One of the key functions of a motion controller is to create the trajectories the motor follows in order to reach the target position (or velocity or torque). As the motor turns, the controller processes feedback from the encoder and compares the actual position of the motor with the desired position. If there are any deviations between the actual position and the desired position, the controller issues commands to correct the error.
Deviations can be caused by inaccuracies in the mechanical components (backlash in screws, compliance in connecting elements, or errors in mounting surfaces) or by unknown disturbances — often in the form of unexpected forces on the system that cause the position, velocity, or torque to rise or fall sharply and unpredictably.
The motor’s ability to follow the given trajectory and achieve the desired position is tracked and managed by the controller through a function known as command tracking or reference tracking. (When the controller is monitoring a process variable, such as temperature or fluid level, rather than the position, speed, or torque of a motion control system, this function is referred to as setpoint tracking.)
Each gain in the PI (proportional-integral) or PID (proportional-integral-derivative) control loop affects the system’s reference tracking. In addition, feedforward control, a proactive control method that predicts the system’s error and injects commands into the control loop to minimize the error, is often used to improve reference tracking and further minimize the deviation between the commanded position and the actual position of the motor.
To address unexpected forces that cause the motor to move away from the target value, the controller uses a function known as disturbance rejection, which processes the disturbance and provides commands that correct for these unknown forces or conditions.
In control tuning, the proportional gain (kp) determines the amount of disturbance rejection. This makes sense because the proportional gain issues an error correction signal that is directly proportional to the error. So when a disturbance occurs, causing the motor to deviate from the desired state, the proportional gain outputs a correction signal to bring the motor back toward the desired state. In theory, the higher the proportional gain, the better the disturbance rejection. But in real-world applications, the maximum value of proportional gain that can be used without causing instability is limited by the system bandwidth and phase margin.
Motion controllers often use both functions — reference tracking and disturbance rejection — to provide accurate, steady-state performance and to reduce sensitivity to changing or unexpected loads. However, there are tradeoffs when both functions are used: the lower the overshoot and settling time for reference tracking, the more sluggish the disturbance rejection will be, and vice-versa. Tuning the controller involves finding the appropriate balance between the overshoot and settling time of the reference tracking function and the response time of the disturbance rejection function.