Closed PID loop for Speed Control

We are currently trying to create a closed PID loop that will essentially be able to control the speed output of our drive wheels as we give input through our joysticks.

Is there anyone out there who is willing to share their developed [and working] closed PID loop so that I can get a better picture of what I need to include in the program? A simple closed PID loop program will be sufficient.

Thank you very much.

LabVIEW includes PID functions already. To find them, open the function palette and search for “PID”.

Since you want to control speed instead of position, you have two basic options. Either use the output of the PID function to add to or subtract from your motor power instead of using it as the motor power directly, or get an equivalent effect by running the PID function using the I term as if it were the proportional constant.

Check out the Velocity PID (2012) located here:

http://www.fightingpi.org/Controls.html

It’s in labview, and is commented fairly well and should be self explanatory if you know basic PID theory. Thanks to Jared from team 341 for giving the derivation in 2009 that we used to create this PID to control our shooter this year.

Just out of curiosity, why use PID for a user controlled drive system? This seems unnecessary. PID is nice for things like shooters, but why use it with the drive?

Autonomous. Computer-assisted bridge balancing. More predictable response to driver commands in the presence of varying battery voltages.

Traction control (2009).

Maintaining a set field position.

We’re not even talking about a swerve drive… :wink:

I see. we’ll keep that in mind.