Hi,
I usually (well always) do it "by feel"....
Leave I at 0 to begin with it, add P until you're starting to see severe overshoot or it starts to oscillate. When that happens start adding D to dampen it out. Once you dampened it you should be able to add some more P and then follow with even more D. Finally add I to get rid of any steady state error and increase the "stiffness".
On my "developmemnt system" with a smalish (30W) DC-motor, 500 line encoder (2000cpr) and LMD18200 H-bridge I have P:1500, I:100, D:2000, Ti:1
Remember that with very high gains there is a risk of overflowing the internal calculations (there's are no checks for that in PID routines). That would make the loop highly unstable and might cause the servo to run away. I'm not saying that is what is happening in your case, just that it's a possibility. It's also very imortant to set the output clamp to a proper value so you're not overflowing the PWM duty cylcle register.
What's the resolution of your encoder?
/Henrik.
Bookmarks