View Single Post
  #1   Spotlight this post!  
Unread 20-03-2016, 10:15
btcshields6 btcshields6 is offline
Registered User
FRC #4206
 
Join Date: Aug 2014
Location: Texas
Posts: 107
btcshields6 is an unknown quantity at this point
Setting Mechanism Position with Button

Hey guys, I've got a question about triggering some PID loops.

So I built a small VI with a PID control in it that reads the value of a potentiometer and attempts to change it by actuating a motor (the reference voltages for various positions are inputted). I want to trigger moving to a different position using a button.

My plan is to put the VI in periodic tasks inside a case structure, and control it using a boolean that is tied to a joystick button. But I don't want to hold it down continuously while the loop executes. How could I program it to execute on the button press and continue executing (as true, so the code stays active in the loop) until it achieves the desired position (or a position very close to it; when it's in range). I want it to run until its close and then stop.

Thanks!
Reply With Quote