Manually Tuning a System from Scratch

NI Motion Measurement & Automation Explorer

Manually Tuning a System from Scratch

As Kp increases, you approach the commanded position faster, and thus overshoot by a greater amount. The opposite is also true. Kd reduces the oscillations over a period of time after the initial rise. When Kp decreases, Kd becomes dominant; and when decreasing Kd, Kp becomes dominant.

When tuning your system, it is necessary to find a comfortable balance between Kp and Kd such that there is adequate response time, which is primarily controlled by Kp; and minimal overshoot, which is primarily controlled by Kd; without having to increase or decrease the gains too much. Increasing or decreasing the gains too much can create an unstable system, and possibly damage the motor. Ki is used to correct for steady-state position error, and is typically the last step.

Complete the following steps to achieve a critically damped system from scratch:

  1. Launch MAX.
  2. Expand Devices and Interfaces.
  3. Expand NI–Motion Devices, and then expand the item for the appropriate motion device.
  4. Expand Calibration in the configuration tree, and select Servo Tune.
  5. Select the Control Loop tab.
  6. Set the integral gain (Ki) to 0. Set the proportional gain (Kp) to a reasonable starting value, such as 25.
  7. Set the derivative gain (Kd) to a reasonable starting value, such as Kp * 2, or 50.
  8. Click the Step Response tab to examine the Step Response plot. The Step Response plot shows a significant overshoot. If the plot does not show a significant overshoot, increase the proportional gain by factors of 1.5 to 2 until the Step Response plot yields an overshoot.
  9. After achieving overshoot, attempt to damp the system to reduce maximum overshoot and settling time, while still trying to maintain a low rise time.
    1. Click the Control Loop tab and begin with a typical value for the derivative gain of Kp * 2.
    2. Increase the derivative gain by factors of 1.5 to 2 until the oscillations diminish or the system begins buzzing.
    3. When you hear buzzing from the motor, reduce Kd and proceed to the next step.
      Tip  If at any time the system is buzzing, the gains are too high. Reduce the gains and continue.
  10. If the system is slow to respond to commands, increase the proportional gain and derivative gain by factors of 1.5 to 2 until you are satisfied with the step response. High rise time, peak time, and settling time are indicative of a sluggish machine. You can tweak your step response by adjusting the proportional gain or derivative gain.
  11. If your system continues buzzing and you are unable to achieve a favorable step response after adjusting Kp and Kd, adjust the derivative sampling period (Td). Increase Td by 2, and adjust Kp and Kd accordingly. Depending on the step response graph you get out of the new settings, you may need start over at step 5.
  12. After achieving a satisfactory step response, you can alleviate any steady state error using the integral gain (Ki). Not all systems need integral gain. Use the Step Response plot to determine the steady-state following error. If the final position at steady state is not the same as the commanded position, the solution may be to use integral gain. Adjust Ki, starting at 1, and increase incrementally by 1 or 2 until the steady state error on the step response is eliminated.
    Tip  Remember that if you increase Ki too much, your system may become unstable.