Tuning a PID in LabVIEW

Is there a way to tune PID coefficients without have to build and deploy on the robot continuously? I know that you could test it outside of the robot in a simulator but the coefficients are pretty specific to the system/robot and it would be convenient to update them until we get them right, then hard code the values in and only have to build and deploy once.

This is most of the benefit of labview. A temporary deploy (run arrow) with numeric controls wired to the pid gain inputs will allow you to adjust the gains real time.

1 Like

We prefer to tune the PID values theoretically before having to fine tune them. You can find our process here: FRC 6377 The howdy bots just released our first whitepaper! "Dont break your bot a guide for testing large and delicate mechanisms

Once we have the values, we use a configuration file that we load into the robot and we take from there the constants. Thus, when we need to change the constants we just edit said file in the RIO. You can find our 2019 code here: 2019 Howdy Bots 6377 Code Release

Can you elaborate a little bit more on the temporary deploy. I generally have always tested code by doing a full build and deploy. I understand that the numeric controls will allow me to input values on the front panel that can be read by the PID VI. If I understand correctly, you are saying I can connect to the robot (lets assume via USB) and use the labview run arrow to temporarily deploy the code. Then all I have to do is enable from the driver station like normal? I apologize for the silly question if this is the answer.

We use three “Pots” method for hard things to tune… Here is a post I did a few years back describing what I mean.

When you click the Run arrow in a VI that is under a target on the project explorer, LabVIEW will deploy and run it if it’s able to connect to the target (i.e. the roboRIO is is connected).

Usually when working with the FRC Framework, you will run Robot Main.vi to debug the code. This will give you all the functionality of the robot framework, plus the debugging tools (probes, highlight execution, single stepping, etc) without having to permanently deploy in the target and run without UI. Yes, it will allow you to change the values in front panel controls, as Tom suggests :slight_smile:

If you’re still curious, can learn the details about this process here: Deploying and Running VIs on an RT Target (Real-Time Module)

super helpful! Thank you so much!

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