View Single Post
  #10   Spotlight this post!  
Unread 05-07-2016, 12:28
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 216
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Why won't this PID loop stop?

Quote:
Originally Posted by virtuald View Post
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.
__________________
#Python4Life
Reply With Quote