Quote:
Originally Posted by Elliot Swart
Our team has been having trouble with excessive CPU utilization of the basic FIRST supplied VI's. Even the basic code with vision turned off when deployed (not in debug mode), uses up 60% of the processor. Reading analog values and setting PWM outputs on the FPGA seems to be nearly as demanding as image processing. Given that I/O was handled easily on the old PIC, I assume there must be something wrong, either with the FRC libraries or with my teams specific version of them. I was wondering if anyone has an idea on how to fix this, and if this is a problem for other teams.
Also, when the CPU load is high, we get intermittent "no code" displays on the driver station
|
The symptoms you describe are those of unrestricted while-loops. In labview, the processor loves while loops. It will run them as often as it can. sometimes nothing else gets a chance to run, because the while loop is busy.
You should examine each while-loop in your code to make sure that it contains a timed element. An example is the one waiting for a camera. one waits for the drivers station message.
You can simply insert a wait-timer into a loop so that the processor will pause to catch its breath. While paused, the rest of your parallel code gets a chance to run.
Don't pause too long, or your sequence of code steps will now take too long. for the robot, you may find that a 1 ms pause is enough to let the processor breathe.
Not all loops need to pause, since some are very quick to finish. but continuous parallel loops are the ones to check.
Jerry
team-79 beta tester