对于例程中的舵机pid.py有疑问,是只有P在控制吗?
-
由以下三部分代码来看,PID中根本没有I和D控制是吗,有大佬解答下吗?
pan_pid = PID(p=0.10, i=0, imax=90)#在线调试使用这个PID
if abs(self._ki) > 0 and dt > 0: self._integrator += (error * self._ki) * scaler * delta_time if self._integrator < -self._imax: self._integrator = -self._imax elif self._integrator > self._imax: self._integrator = self._imax output += self._integrator
self._last_derivative = float('nan') if isnan(self._last_derivative): derivative = 0 self._last_derivative = 0
-
对,这个代码里没用到i