|
Periodic Task (vi) - Thoughts?
Hi, I was wondering what peoples thoughts were with what code should be put in periodic task. I believe with the old IFI control system you couldn't read driver station values in periodic task (it was just meant for on board sensors, internal calcs, etc). Everything that dealt with driver station input was in teleop.
With the new Crio though since the teleop while loop cycle doesn't finish until the last thing executes, it leads me to think that we should either move the slowest items in teleop to periodic task or the fastest items (so the slow items don't slow down the faster items).
As an example, our lift uses pid and a bunch of other limit checks to keep the driver from killing the lift. However, this is probably the slowest thing in teleop (we used the elapse vi and usually things are under 100ms however there are times when it goes over).
So, what we did was move our minibot deployment code (just a switch from the driver station controlling solenoids) to periodic task since it leads me to believe that if telop does run over 100ms that minibot deployment can be delayed by up to 90ms or so. We also plan to move a bunch of other things that can run faster into periodic task from teleop. Does this seem right? Putting teleop code in periodic tasks seems a little weird to me. Where do you differentiate what should go where?
Any comments would be good. If you could give your own examples of what you put in teleop vs periodic task that would be good. THanks!
|