PID Motor Control - Integral problem

Discussion in 'Embedded Systems and Microcontrollers' started by n6xb, Feb 18, 2011.

  1. n6xb

    Thread Starter New Member

    Dec 29, 2010
    3
    0
    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!:)
     
  2. be80be

    Senior Member

    Jul 5, 2008
    431
    57
    Have a good look over here pid

    Stephen Zahra did great job at telling how to get pid to work.
     
  3. n6xb

    Thread Starter New Member

    Dec 29, 2010
    3
    0
    Thank you... very good video!
     
Loading...