PID Tuner
Tune PID controllers
Open the PID Tuner App
MATLAB Toolstrip: On theAppstab, underControl System Design and Analysis, click the app icon.
MATLAB command prompt: Enter
pidTuner
.Simulink model: In thePID ControllerorPID Controller (2DOF)block dialog box, clickTune.
Examples
- Tune PID Controller to Favor Reference Tracking or Disturbance Rejection (PID Tuner)
- PID Controller Tuning in Simulink(Simulink Control Design)
- Designing PID Controllers with PID Tuner
- Introduction to Model-Based PID Tuning in Simulink(Simulink Control Design)
Parameters
Plant
— Current plant
LTI model in Data Browser |Import
| ...
ThePlantmenu displays the name of the current plant thatPID Tuneris using for controller design.
Change the current plant using the following menu options:
A list of the LTI models present in thePID TunerData Browser.
Import
— Import a new LTI model from the MATLAB workspace.重新Linearize Closed Loop
— Linearize the plant at a different snapshot time. SeeTune at a Different Operating Point(Simulink Control Design). This option is available only when tuning aPID ControllerorPID Controller (2DOF)在仿真软件模型。金宝appIdentify New Plant
— Use system identification to obtain a plant from measured or simulated system response data (requires System Identification Toolbox software). See:Interactively Estimate Plant Parameters from Response Data, when tuning a PID controller for an LTI model.
Interactively Estimate Plant from Measured or Simulated Response Data(Simulink Control Design), when tuning aPID Controller在仿真软件模型。金宝app
If you are tuning a PID controller for a plant represented by an LTI model, the default plant is:
Plant
= 1, if you openedPID Tunerfrom theAppstab in the MATLAB Toolstrip, or if you used thepidTuner
command without an input argument.The plant you specified as an input argument to
pidTuner
.
If you are tuning aPID ControllerorPID Controller (2DOF)block in a Simulink model, then the default plant is linearized at the operating point specified by the model initial conditions. SeeWhat Plant Does PID Tuner See?(Simulink Control Design)
Type
— Controller type
'PI'
|'PIDF'
|'PID2'
| ...
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 theTypemenu to specify controller type. When you change controller type,PID Tunerautomatically 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, seePID Controller Types for Tuning.
If you are tuning aPID ControllerorPID Controller (2DOF)block in a Simulink model, theTypefield displays the controller type specified in the block dialog box.
Form
— Controller form
'Parallel'
|'Standard'
This field displays the controller form.
If you are tuning a controller for a plant represented by an LTI model, use theFormmenu to specify controller form. For information about parallel and standard forms, see the
pid
andpidstd
reference pages.If you are tuning aPID ControllerorPID Controller (2DOF)block in a Simulink model, theFormfield displays the controller form specified in the block dialog box.
Domain
— Domain for specifying performance targets
'Time'
|'Frequency'
TheDomainmenu enables you to switch the domain in which PID Tuner displays the target performance parameters.
Time
— Sliders set theResponse TimeandTransient Behavior.Frequency
— Sliders set theBandwidthandPhase 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)(tuningPID ControllerorPID Controller (2DOF)block in Simulink model)
Add Plot
— Create analysis plots
Reference Tracking
|Input Disturbance Rejection
|Controller Effort
| ...
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:
Analyze Design in PID Tuner(tuning a controller for an LTI model)
Analyze Design in PID Tuner(Simulink Control Design)(tuningPID ControllerorPID Controller (2DOF)block in Simulink model)
Programmatic Use
Tips
For PID tuning at the command line, use
pidtune
. Thepidtune
command can design a controller for multiple plants at once.For interactive PID tuning in the Live Editor, see theTune PID ControllerLive Editor task. This task lets you interactively design a PID controller and automatically generates MATLAB code for your live script.