

Therefore, even 1 degree overshoot cause the error value is -359 (set point - now position) and the motor rotate again to reach the desired position. Motor rotation is slowing down as its "now" position approaching 0 degree, but the system is not overshoot free.

I know the problem is due to a little position overshoot cause the encoder to read a very large error.įor instance, if the setpoint is 0 degree, the motor rotate to reach it. Using either Quick Drop or the function palette, add the PID.vi from the LabVIEW PID and Fuzzy Logic toolkit. But when it is not, the motor never stop rotating. Once we determine the middle position, we can finally implement the PID controller. When the set point is a value between 10 - 350 the sytem worked well.

FOR READING ENCODER POSITION, GIVING 0-359 OUTPUT CORRESPOND TO THE ENCODER POSITION PID myPID(&input, &output, &setpoint, kp, ki, kd, DIRECT) ĪnalogWrite(RPWM, out) //Sets speed variable via PWMĪnalogWrite(LPWM, abs(out)) //Sets speed variable via PWM The used code: #include īyte input_pin = ĭouble input = 0, output = 0, setpoint = 0 The motor cannot stop at set point value near 0 degree (350 - 359, 0 - 10 degree). The system contain a dc motor, absolute encoder, and a motor driver.Įverything work as expected, but one thing. I'm doing a control engineering project, implementing a PID motor position control for automatic antenna tracking system.
