Main Content

Tune PID Controller to Favor Reference Tracking or Disturbance Rejection

This example shows how to tune a PID controller to reduce overshoot in reference tracking or to improve rejection of a disturbance at the plant input. Using thePID Tunerapp, the example illustrates the tradeoff between reference tracking and disturbance-rejection performance in PI and PID control systems.

Design Initial PI Controller

Load a Simulink®model that contains a PID controller block.

open_system('singlePILoop')

The plant in this example is:

Plant = 0.3 s 2 + 0.1 s .

The model also includes a reference signal and a step disturbance at the plant input. Reference tracking is the response atyto the reference signal,r. Disturbance rejection is a measure of the suppression atyof the injected disturbance,d. When you usePID Tunerto tune the controller, you can adjust the design to favor reference tracking or disturbance rejection as your application requires.

Design an initial controller for the plant. To do so, double-click the PID controller block to open the Block Parameters dialog box, and clickTune.PID Tuneropens and automatically computes an initial controller design.

The controller in the Simulink model is configured as a PI-type controller. Therefore, the initial controller designed byPID Tuneris also of PI-type.

Add a step response plot of the input disturbance rejection. SelectAdd Plot>Input Disturbance Rejection.

PID Tunertiles the disturbance-rejection plot in a new tab.

Tip

Click and drag the tab to position the plots.

By default, for a given bandwidth and phase margin,PID Tunertunes the controller to achieve a balance between reference tracking and disturbance rejection. In this case, the controller yields some overshoot in the reference-tracking response. The controller also suppresses the input disturbance with a longer settling time than the reference tracking, after an initial peak.

Clickto update the Simulink model with this initial controller design. Doing so also updates the Block Response plots inPID Tuner, so that as you change the controller design, you can compare the results with the initial design.

Adjust Transient Behavior

Depending on your application, you might want to alter the balance between reference tracking and disturbance rejection to favor one or the other. For a PI controller, you can alter this balance using theTransient Behaviorslider. Move theTransient behaviorslider to the left to improve the disturbance rejection. The responses with the initial controller design are now displayed as theBlock response(dotted line).

降低transient-behavior coefficient to 0.45 speeds up disturbance rejection, but also increases overshoot in the reference-tracking response.

Tip

Right-click the reference-tracking plot and selectCharacteristics>Peak Responseto obtain a numerical value for the overshoot.

Move theTransient behaviorto the right until the overshoot in the reference-tracking response is minimized.

Increasing the transient-behavior coefficient to 0.70 nearly eliminates the overshoot, but results in sluggish disturbance rejection. You can try moving theTransient behavior滑块,直到你找到一个合适的平衡eference tracking and disturbance rejection for your application. How much the slider affects the balance depends on the plant model. For some plant models, the effect is not as large as shown in this example.

Change PID Tuning Design Focus

So far, the response time of the control system has remained fixed while you have changed the transient-behavior coefficient. These operations are equivalent to fixing the bandwidth and varying the target minimum phase margin of the system. If you want to fix both the bandwidth and target phase margin, you can still change the balance between reference tracking and disturbance rejection. To tune a controller that favors either disturbance rejection or reference tracking, you change thedesign focusof the PID tuning algorithm.

Changing thePID Tunerdesign focus is more effective the more tunable parameters there are in the control system. Therefore, it does not have much effect when used with a PI controller. To see its effect, change the controller type to PID. In the Simulink model, double-click the PID controller block. In the block parameters dialog box, in theControllerdrop-down menu, selectPID.

ClickApply. Then, clickTune. This action updatesPID Tunerwith a new controller design, this time for a PID controller. Clickto the Simulink model with this initial PID controller design, so that you can compare the results when you change design focus.

As in the PI case, the initial PID design balances reference tracking and disturbance rejection. In this case as well, the controller yields some overshoot in the reference-tracking response, and suppresses the input disturbance with a longer settling time.

Change thePID Tunerdesign focus to favor reference tracking without changing the response time or the transient-behavior coefficient. To do so, clickOptions, and in theFocusmenu, selectReference tracking.

PID Tunerautomatically retunes the controller coefficients with a focus on reference-tracking performance.

The responses with the balanced controller are now displayed as theBlock response, and the controller tuned with a focus reference-tracking is theTuned response. The plots show that the resulting controller tracks the reference input with considerably less overshoot and a faster settling time than the balanced controller design. However, the design yields much poorer disturbance rejection.

Finally, change the design focus to favor disturbance rejection. In theOptionsdialog box, in theFocusmenu, selectInput disturbance rejection.

This controller design yields improved disturbance rejection, but results in some increased overshoot in the reference-tracking response.

When you use design focus option, you can still adjust theTransient Behaviorslider for further fine-tuning of the balance between these two measures of performance. Use the design focus and the sliders together to achieve the performance balance that best meets your design requirements. The effect of this fine-tuning on system performance depends strongly on the properties of your plant. For some plants, moving theTransient Behaviorslider or changing theFocusoption has little or no effect.

To obtain independent control over reference tracking and disturbance rejection, you can use a two-degree-of-freedom controller,PID控制器(2自由度), instead of a single degree-of-freedom controller.

Related Topics