LabVIEW Lag when running in Debug mode

Debug mode is when we launching code into the RIO by pressing the start icon in the Front Panel/Block Diagram instead of building and deploying. Probably the most handy feature of using LabVIEW vs JAVA or C++.

We have noticed significant lag between the robot reacting and the Front Panel showing data. The robot itself seems fairly responsive. It just seems like data coming from RIO to the PC is about 2 to 3 seconds behind.

We are connecting wirelessly when doing this.

I’m wondering if others have experienced this lag and if there is a remedy for this?

I’m also wondering if this lag affects PID tuning practices. We have noticed before that when we tune a motor in Debug and then hard code those gains, build and deploy, we seem to get more overshoot in the deployed code. Wondering if others have experienced this as well.

I expect some lag to happen when the code is running wireless. Even with tethered connections, the information coming back from the roboRIO can be delayed or not received as often as expected.

As you might assume, this depends on both the connection quality, as well as the code itself (code that takes more CPU time, will allow for less time for other processes - as the one that sends information back to the debugger - to run slower).

LabVIEW Real-Time prioritizes the code that is running in the roboRIO over the information that is sent back to the debugger to ensure reliability in the execution.

My recommendation for tuning PIDs is to have a known steady-state, where the values are “reset”. This can be accomplished by using a case structure and a button (either in the front panel or the joystick) that starts the test from a known idle state. This would look like a state machine with two cases: one that disables the outputs and resets the motor controller or LabVIEW PID, and other that sets the values and lets it run.

Other option is to re-run the code after changing the control value and setting “set as default value”, which should not take long to re-deploy since 99% of the VIs are already transferred and loaded in the roboRIO’s memory.

Regarding PID tuning, I also recommend reading:

Like oscarfonloz said, the debug values are not expected to be super fast. Are you using a camera? It’s possible you’re close the bandwidth limit. Even if you’re not using a camera, you could try turning off the bandwidth limit option when configuring your radio to see if that helps, just remember to test again with it on especially if you do start using a camera.

I would recommend NOT wiring the dt input on the PID VI. That way it will check the time internally. You might post a picture of you’re PID code.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.