pidtune
PID tuning algorithm for linear plant model
Syntax
C = pidtune(sys,type)
C = pidtune(sys,C0)
C = pidtune(sys,type,wc)
C = pidtune(sys,C0,wc)
C = pidtune(sys,...,opts)
[C,info] = pidtune(...)
Description
designs a PID controller of typeC
= pidtune(sys
,type
)type
for the plantsys
. Iftype
specifies a one-degree-of-freedom (1-DOF) PID controller, then the controller is designed for the unit feedback loop as illustrated:
Iftype
specifies a two-degree-of-freedom (2-DOF) PID controller, thenpidtune
designs a 2-DOF controller as in the feedback loop of this illustration:
pidtune
tunes the parameters of the PID controllerC
to balance performance (response time) and robustness (stability margins).
designs a controller of the same type and form as the controllerC
= pidtune(sys
,C0
)C0
. Ifsys
andC0
are discrete-time models,C
has the same discrete integrator formulas asC0
.
andC
= pidtune(sys
,type
,wc
)
specify a target valueC
= pidtune(sys
,C0
,wc
)wc
for the first 0 dB gain crossover frequency of the open-loop response.
uses additional tuning options, such as the target phase margin. UseC
= pidtune(sys
,...,opts
)pidtuneOptions
to specify the option setopts
.
[
returns the data structureC
,info
] = pidtune(...)info
, which contains information about closed-loop stability, the selected open-loop gain crossover frequency, and the actual phase margin.
Input Arguments
|
Single-input, single-outputdynamic system modelof the plant for controller design.
If the plant has unstable poles, and
you must use |
|
Controller type of the controller to design, specified as a character vector. The termcontroller typerefers to which terms are present in the controller action. For example, a PI controller has only a proportional and an integral term, while a PIDF controller contains proportional, integrator, and filtered derivative terms. 1-DOF Controllers
2-DOF Controllers
For more information about 2-DOF PID controllers generally, seeTwo-Degree-of-Freedom PID Controllers. 2-DOF Controllers with Fixed Setpoint Weights
For more detailed information about fixed-setpoint-weight 2-DOF PID controllers, seePID Controller Types for Tuning. Controller FormWhen you use the If For more information about PID controller forms and formulas, see: |
|
PID controller setting properties of the designed controller, specified as a
|
|
Target value for the 0 dB gain crossover frequency of the tuned open-loop response. Specify Increase |
|
Option set specifying additional tuning options for the |
Output Arguments
|
Controller designed for Controller form: Controller type:
In either case, however, where the algorithm can achieve adequate performance and robustness using a lower-order controller than specified with Time domain:
If you specify |
|
Data structure containing information about performance and robustness of the tuned PID loop. The fields of
If |
Examples
Tips
By default,
pidtune
with thetype
input returns apid
controller in parallel form. To design a controller in standard form, use apidstd
controller as input argumentC0
. For more information about parallel and standard controller forms, see thepid
andpidstd
reference pages.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.
Algorithms
For information about the MathWorks®PID tuning algorithm, seePID Tuning Algorithm.
Alternatives
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. For an example, seePID Controller Design in the Live Editor
For interactive PID tuning in a standalone app, usePID Tuner. SeePID Controller Design for Fast Reference Trackingfor an example of designing a controller using the app.
References
Åström, K. J. and Hägglund, T.Advanced PID Control, Research Triangle Park, NC: Instrumentation, Systems, and Automation Society, 2006.
Version History
Introduced in R2010b