View Single Post
  #3   Spotlight this post!  
Unread 04-07-2016, 13:40
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 Oblarg View Post
Caveat: I am only familiar with the java version of WPILib and am assuming that the functionality is the same.

The loop does not automatically stop when you're within tolerance of the setpoint. Rather, the tolerance setting is used by the onTarget() function to determine whether or not you have reached your setpoint. If you wish to stop the loop once you've reached your setpoint, you'll have to write code to disable the PID controller once onTarget() returns true.
I did actually write code so that if it was onTarget(), it would be disabled but it never worked because I found out that if you call onTarget too often, it never returns true.
__________________
#Python4Life
Reply With Quote