PID Question on deceleration
T Chap
Posts: 4,223
On a motor with an encoder and a PID loop controlling the motor driver based on the error, there is a problem with the deceleration in conditions of the motor/encoder overshooting the destination position during decel. With a motor that is loaded, this is usually not a problem. But there is a fine line ( narrow gap ) between having not enough torque to run the motor well ( Integral wind up max ), and too much torque causing jerky motions. When the integral max is perfect, all things work well, nice accel, decel, no overshooting. The problem of overshooting on decel is when the motor driver ( Prop pin ) toggles the direction back and forth rapidly, so the motor sounds like it is pulsing or knocking until it stabilizes. I have spent a lot of time experimenting trying to find a solution. Any attempts to reset the integral max on an undesirable direction change causes the motor to then revert to several short motions during the decel, since the windup is starting over from A. scratch, or B. starting over from some reduced windup factor. In either case, the drop in output is always noticeable and not acceptable. Then, attempts to disallow direction pin flops during decel are problematic, since what if the pin flop was intention by the main program wanting a reverse during the decel. I think some intervention of the PID loop from the main program may be able to tell the PID loop what is a genuine reverse, and override any measures the loop is taking to prevent pin flip flops on decel.
This is the essence of the direction control:
I do not think the reversing is required to assist the system in deceleration, nor does it help in hitting the encoder line (destination position) since there is enough inherent friction.
The goal is to decel with no direction output changes UNTIL arriving at the destination(ie within 125 encoder counts). But the reverse must be available for intentional cases.
Any ideas?
This is the essence of the direction control:
If position - encoderposition > 0 ' 0 is not allowed position is the destination from the master outa[26]~ 'direction pin else of position - encoderposition < 0 ' 0 is not allowed outa[26] := 1 'direction pin
I do not think the reversing is required to assist the system in deceleration, nor does it help in hitting the encoder line (destination position) since there is enough inherent friction.
The goal is to decel with no direction output changes UNTIL arriving at the destination(ie within 125 encoder counts). But the reverse must be available for intentional cases.
Any ideas?
Comments
Mickster