|
Re: PID Tuning Help
Here's what I've done for PID that seems to work very well for us.
We've used it for:
Velocity PID on flywheel shooter
Position PID on window motor for bridge stinger
Position PID on window motor for turret
Position PID on climber
Position PID on elevator
To avoid breaking things, I start with p = .00001, so nothing happens. I increase p by one order of magnitude until the thing starts moving. At this point, we make sure that the mechanism is heading in the right direction. Finally, we increase P until the steady state error is 3 to 5 times larger than our largest acceptable error. This value usually ends up being near half the P value that causes uncontrollable acceleration. At this point, we slowly increase I (start with .00001, increase by orders of magnitude until something happens, then by increasingly smaller amounts) until the mechanism reaches the setpoint, even if it oscillates on reaching the setpoint. Then, we increase D very slowly (start at .00001, increase by order of magnitudes).
If D ends up too large and causes oscillations, use more low pass filter on your sensor data (or use a moving average with more samples).
|