增量pid算法 Kp = 0.4f; Ki = 0.53f; Kd = 0.1f; SetSpeed = a; err = SetSpeed - ActualSpeed; float incrementSpeed; incrementSpeed = Kp * (err - err_next + Ki * err + Kd * (err - 2 * err_next + err_last));//这是增量pid的计算公式; ActualSp eed += incrementSpeed; err_last = err_next; err_next = err; return ActualSpeed; eed += incrementSpeed; err_last = err_next; err_next = err; return ActualSpeed;