PID Motor Control - Integral problem

Thread Starter

n6xb

Joined Dec 29, 2010
3
I am working on a microcontroller PID motor controller. P and D work very good, but I am having some problem with the Integral-I control.

Please see the attached plot that shows the

current motor shaft position error - GREEN
Integral error - BLUE
PWM output - RED
Zero Error - Brown Center Line

P and D are disabled for this plot, and the motor shaft position is within a few degrees of no error.

At point A the position error is negative (-2deg) so the I error is building up to move the motor.

At point B, the I error is large enough to push the motor shaft back to zero error.

At point C, the motor shaft error is 0.

And here is the problem... After point C the Integral still has enough power to continue to push the motor shaft into a positive error condition(+2deg).

At point D, the I error is small enough not to continue to push the motor any further. However, now the I error is building up to the positive side to push the motor shaft back to 0.

It seems that the Integral never zeros out and the motor continues to oscillate. How is it possible to zero out the error so that the Integral will not continue to build up in this fashion? The I error windup is way below saturation in this plot.

Thank you!:)
 

Attachments

Top