TipJar #14 - Speeding Up Slow Tele-Op Code and How Parallel Loops Can Communicate.


Updated 2010 FRC Videos Now Online:


This Blog entry is the 10th in a series intended primarily for FIRST Robotics Competition (FRC) teams and their mentors.

In this blog entry, I discuss how to speed up time-critical code by pulling it out of the Tele-Op.vi, while maintaining the ability to share data.

I discuss:
The fact that there is a lot of stuff going on in TeleOp, and the main loop: can take up to 200ms to run, potentially causing robot damage if limit switches are missed
How to move the state machine created in TipJar #13 into its own deterministic, accurate, fast loop
How moving the state machine out of TeleOp causes the debugging dashboard to fail because the state data is no longer available
How to create a global variable to share the state machine data with the main loop for debugging
Race conditions: why you should never write to global variables from more than one VI
How to send info from TeleOp to the parallel loops in an easy, scalable way using a "Command Signal" global
How using a single command signal can help ensure your important code runs perfectly in TeleOp AND autonomous modes

Sample code is listed below.

Please! If you like (or hate) what you saw, please leave a comment by clicking here.

Also, don't forget to check out the rest of the series by clicking on the left side of the page.

Ben Zimmer
-- LV Mastery Team

Trouble viewing these videos? Please click here to install the latest version of flash.

Testimonials

Want to See More?

Already Registered?

Links:
FIRST Robotics Competition Website.

Subscribe:
Follow this link to be notified whenever something new is added to the "Tip Jar".