Quote:
Originally Posted by virtuald
Code:
self.last = None
...
if self.last is None or abs(self.last - input) > 0.001:
self.pid_controller.setSetpoint(input)
self.last = input
|
I don't see how that would work if I were to give the input as 90, it would go through and then self.last would become 90 and then it wouldn't do anything because 90-90 is 0. For me, in order to get that to work, self.last would have to be set like this self.last = self.gyro.getYaw(). But I really don't know what I am doing with setting up PID loops so I could(and probably am) dead wrong.