Manually Tuning Motors
Use the Control Loop tab to view and edit the PID parameters. Auto Tune provides a tuned system, but for an optimally tuned system, it is necessary to fine-tune the final PID parameters. It may also be necessary to alter the PID parameters, depending on your specific circumstances.
Complete the following steps to manually tune a motor:
Note This exercise assumes that Axis 1 is configured as a servo axis. |
- Launch MAX.
- Expand Devices and Interfaces.
- Expand NI–Motion Devices, and then expand the item for the appropriate motion device.
- Expand Calibration in the configuration tree, and select Servo Tune.
- Auto tune the motor first.
- Click the Control Loop tab and note the values on the Kp, Kd, Ki, and Td controls. Write these values down for future reference.
- In the Control Loop tab, increase the proportional gain (Kp) by a factor 2, and click Save in the MAX toolbar. Increasing by a factor of 2 works for most systems, but if your system becomes unstable, reduce this factor appropriately.
- Click the Step Response tab to examine the Step Response plot. As you increase the proportional gain, the rise, peak, and settling times decrease, producing a stiffer, faster response. The maximum overshoot increases as well. Increasing by a factor of 2 typically results in a noticeably higher overshoot. If this is not true for your particular system, try increasing your gain again.
- Decrease the proportional gain (Kp) by a factor of 2 from its original value or a factor of 4 from its current value. Decreasing by a factor of 2 works for most systems, but if your system becomes too sluggish, reduce this factor appropriately.
- Click the Step Response tab to examine the Step Response plot. As you decrease the proportional gain, the rise, peak, and settling times increase, producing a smoother, slower response. As you decrease Kp, the maximum overshoot decreases as well. Decreasing by a factor of 2 typically results in a noticeably more damped system. If this is not true for your particular system, try decreasing the gain again.
- Reset the Proportional Gain (Kp) to the original value you noted in step 6.
- Increase the Derivative Gain (Kd) by a factor of 1.5. Increasing by a factor of 1.5 works for most systems, but if your system becomes too sluggish, reduce this factor appropriately.
- Click the Step Response tab to examine the Step Response plot. As you increase the derivative gain, the maximum overshoot decreases and the settling time increases. The number of visible oscillations decreases as well. Increasing by a factor of 2 typically results in a noticeably more damped system. If this is not true for your particular system, try increasing your gain again.
- Decrease the Derivative Gain (Kd) by a factor of 1.5 from the original value, or a factor of 2.25 from the current value. Decreasing by a factor of 1.5 works for most systems, but if your system becomes unstable, decrease this factor appropriately.
- Click the Step Response tab to examine the Step Response plot. As you decrease the derivative gain, the maximum overshoot increases while the settling time decreases. The number of visible oscillations increases as well. Decreasing by a factor of 1.5 typically results in a noticeably higher overshoot. If this is not true for your particular system, try decreasing your gain again.
- Reset the Derivative Gain (Kd) to the original value you noted in step 6.
Note There are subtle differences between the Kp and Kd values on your system. Increasing Kp increases the slope of the initial rise to the commanded position. As you increase Kp, you approach the commanded position faster, and thus overshoot by a greater amount. Kd reduces the oscillations over a period of time after the initial rise. When Kp decreases, Kd becomes dominant, and when Kd decreases, Kp becomes dominant. When tuning your system, the goal is to find a comfortable balance between Kp and Kd such that there is adequate response time, which is controlled primarily by Kp, and minimal overshoot, which is controlled primarily by Kd, without having to significantly increase or decrease the gains. Increasing or decreasing the gains too much can create an unstable system and possibly damage the motor. - Decrease the Integral Gain (Ki) to 0.
- Click the Step Response tab to examine the Step Response plot. You may notice a steady state error position delta on the Step Response plot. This is the steady-state position error.
- Increase the Integral Gain (Ki), by increments of 1, beyond its original value. Be careful not to increase Ki too much.
- Click the Step Response tab to examine the Step Response plot. Increasing the Integral Gain beyond what is necessary to correct for a steady state position error can result in an unstable system.
Tip As you become familiar with the effects of Ki on your system, you will notice that it corrects steady-state position error. Some simple systems may not require Ki. - Reset the Integral Gain (Ki) to the original value you noted in step 6.