Log in

View Full Version : How to tune a PID loop?


steve d
11-02-2007, 15:51
What would be some typical gains? I'm playing with a bench setup here, motors aren't really loaded or is follow-up pot connected, tough doing it open-loop. I have a gain of 1 for P term, 10/100 for I and D. Seems pretty good, If I up the I gain to 25/100, the error builds up fast and I suspect the real thing will overshoot.
We're using it to "slave" the arm position to the joystick position.

kaszeta
11-02-2007, 15:58
What would be some typical gains? I'm playing with a bench setup here, motors aren't really loaded or is follow-up pot connected, tough doing it open-loop. I have a gain of 1 for P term, 10/100 for I and D. Seems pretty good, If I up the I gain to 25/100, the error builds up fast and I suspect the real thing will overshoot.
We're using it to "slave" the arm position to the joystick position.

Gain depends strongly on what your inputs are, how they are loaded and what your outputs are.

The simple approach is

1. Start with a small P, no I or D.
2. Adjust until the response is about what you want.
3. Add just enough I to eliminate undershoot.
4. Add just enough D to eliminate overshoot.

(This is a gross oversimplification. Read the whitepaper on PID without a PhD here on CD).

Salik Syed
11-02-2007, 17:22
It is not going to be very useful testing the a PID loop on without some kind of realistic feedback. The way errors build up is very reliant upon the type of feedback, gains that may be proper for one application could very well be totally wrong on another. It all depends on your system.

If you are using PID control for positional purposes (i.e an arm) I would follow the above.
We found that if you are doing velocity control PD usually works fairly well

steve d
11-02-2007, 20:49
Thanks. I rigged up the follow-up pot to the shaft of a window motor and tried out the loop. COOL! Playing with I gain can really cause overshoot and wild oscillations! Can't wait to try tuning it on the robot with it's dynamics. BTW, i'm using a bourns follow-up pot that has continous rotation, no stops. Nice pots.