|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Autonomus timed tasks
I need to control motors for certain amounts of time. Like drive motors for two seconds, then arm motors for 3, etc. How do I do this in labview?
|
|
#2
|
||||
|
||||
|
Re: Autonomus timed tasks
This can easily be achieved with a state machine. Check out FRCMastery.com for a really helpful tutorial on how to set this up.
|
|
#3
|
||||||
|
||||||
|
Re: Autonomus timed tasks
Quote:
Look at the frcmastery video "Step 5 - Turn on Autonomous Mode". It walks through the default (non game specific) autonomous code, which runs the drive train for certain periods of time. It shouldn't be hard to do something similar to add arm control. |
|
#4
|
|||||
|
|||||
|
Re: Autonomus timed tasks
If you really want to do different things based only on elapsed time, the easiest tool to use is probably the Flat Sequence. It looks like a movie timeline. Each frame in the sequence will run in turn after the previous frame has completed. If you place a simple Wait function in a frame, that frame will complete only after the specified time has elapsed.
The motor safeties will shut down the outputs if you don't keep setting a value continuously, so you need to either find a way to loop inside the frame to keep them happey, or just disable or lengthen the safety timeout. |
|
#5
|
||||
|
||||
|
Re: Autonomus timed tasks
All three of these options are workable solutions to the task at hand.
I'll acknowledge, as Joe pointed out, that a state machine may not be the most convenient way, but depending on how you trigger state changes, it is actually a very useful and effective way to program autonomous. In fact, last year we had four different autonomous modes, each was it's own state machine. It worked great. Joe's suggestion to follow the "Step 5 - Turn on Autonomous Mode" on FRCMastery.com is an excellent and simple way to make autonomous work. Alan's suggestion to use a Flat Sequence is almost exactly the same approach as the timed loops show in Joe's suggestion, just implemented a slightly different way. Learn all three methods and you will be prepared for almost any Autonomous challenge, and many other challenges as well. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|