PID Tuner

Tune PID controllers

Description

The PID Tuner app automatically tunes the gains of a PID controller for a SISO plant to achieve a balance between performance and robustness. You can specify the controller type, such as PI, PID with derivative filter, or two-degree-of-freedom (2-DOF) PID controllers. Analysis plots let you examine controller performance in time and frequency domains. You can interactively refine the performance of the controller to adjust loop bandwidth and phase margin, or to favor setpoint tracking or disturbance rejection.

You can use PID Tuner with a plant represented by a numeric LTI model such as a transfer function (tf) or state-space (ss) model. If you have Simulink® Control Design™ software, you can use PID Tuner to tune a PID Controller or PID Controller (2DOF) block in a Simulink model. If you have System Identification Toolbox™ software, you can use the app to estimate a plant from measured or simulated data and design a controller for the estimated plant.

Limitations

When using MATLAB® Online™, the redesigned PID Tuner app and system identification features introduced in R2014a are not available. For information on using the previous PID Tuner, see PID Controller Tuning in the R2013b documentation.

Open the PID Tuner App

  • MATLAB Toolstrip: On the Apps tab, under Control System Design and Analysis, click the app icon.

  • MATLAB command prompt: Enter pidTuner.

  • Simulink model: In the PID Controller or PID Controller (2DOF) block dialog box, click Tune.

Parameters

expand all

The Plant menu displays the name of the current plant that PID Tuner is using for controller design.

Change the current plant using the following menu options:

If you are tuning a PID controller for a plant represented by an LTI model, the default plant is:

  • Plant = 1, if you opened PID Tuner from the Apps tab in the MATLAB Toolstrip, or if you used the pidTuner command without an input argument.

  • The plant you specified as an input argument to pidTuner.

If you are tuning a PID Controller or PID Controller (2DOF) block in a Simulink model, then the default plant is linearized at the operating point specified by the model initial conditions. See What Plant Does PID Tuner See? (Simulink Control Design)

The controller type specifies which terms are present in the PID controller. For instance, a PI controller has a proportional and an integral term. A PDF controller has a proportional term and a filtered derivative term.

  • If you are tuning a controller for a plant represented by an LTI model, use the Type menu to specify controller type. When you change controller type, PID Tuner automatically designs a new controller. Available controller types include 2-DOF PID controllers for more flexibility in the trade-off between disturbance rejection and reference tracking. For details on available controller types, see PID Controller Types for Tuning.

  • If you are tuning a PID Controller or PID Controller (2DOF) block in a Simulink model, the Type field displays the controller type specified in the block dialog box.

This field displays the controller form.

  • If you are tuning a controller for a plant represented by an LTI model, use the Form menu to specify controller form. For information about parallel and standard forms, see the pid and pidstd reference pages.

  • If you are tuning a PID Controller or PID Controller (2DOF) block in a Simulink model, the Form field displays the controller form specified in the block dialog box.

The Domain menu enables you to switch the domain in which PID Tuner displays the target performance parameters.

  • Time — Sliders set the Response Time and Transient Behavior.

  • Frequency — Sliders set the Bandwidth and Phase Margin.

To refine the controller design, you adjust the target performance parameters using the sliders or the corresponding numeric values.

For more information, see:

  • Refine the Design (tuning a controller for an LTI model)

  • Refine the Design (Simulink Control Design) (tuning PID Controller or PID Controller (2DOF) block in Simulink model)

Create time-domain and frequency-domain analysis plots to help analyze the performance of the PID controller. For detailed information about the available response plots, see:

Programmatic Use

Introduced in R2010b