Log in

View Full Version : Sequence Structure Using Limit Switch


JakeE
05-03-2014, 21:47
I want a sequence structure go to the next sequence in autonomous as soon as a limit switch returns true, but I don't know how to do this. I can't figure this out even after days of thinking and trial and error, and I would really appreciate any help. :confused:

mgerber
05-03-2014, 22:47
I'm going to assume that by sequence structure you mean either a flat sequence or stacked sequence. The code our team uses is loosely based off of Team 358's Variations on Autonomous (http://team358.org/files/programming/ControlSystem2009-/LabVIEW/Auto-2012.png), except using While loops inside the frames instead of timing. Attach the output of the limit switch to the loop condition and the program will pause at that point until the limit is pressed. I don't have Labview on this computer but I'll see if I can whip up a picture as an example.

JakeE
05-03-2014, 22:49
Thank you so much! I'll give that a try! :)

mgerber
05-03-2014, 23:08
Here's a quick mock-up with a turret motor and a limit switch.
http://i.imgur.com/YUKe8lj.png
You can do similar simple things with ultrasonics, pots, gyros, etc. Drive forward till you reach a certain distance, then turn motor off. Rotate until you reach a certain measurement. You get the idea. Much easier (and simpler) than a PID loop in many cases.