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 type C
= pidtune(sys
,type
)type
for the plant
sys
. If type
specifies a one-degree-of-freedom
(1-DOF) PID controller, then the controller is designed for the unit feedback loop as
illustrated:
If type
specifies a two-degree-of-freedom (2-DOF) PID controller,
then pidtune
designs a 2-DOF controller as in the feedback loop of this
illustration:
pidtune
tunes the parameters of the PID controller
C
to balance performance (response time) and robustness (stability
margins).
designs a controller of the same type and form as the controller C
= pidtune(sys
,C0
)C0
. If
sys
and C0
are discrete-time models,
C
has the same discrete integrator formulas as
C0
.
and
C
= pidtune(sys
,type
,wc
)
specify a target value C
=
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. Use C
= pidtune(sys
,...,opts
)pidtuneOptions
to specify the option set opts
.
[
returns the data structure C
,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-output dynamic system
model of 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
term controller type refers 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, see Two-Degree-of-Freedom PID Controllers. 2-DOF Controllers with Fixed Setpoint Weights
For more detailed information about fixed-setpoint-weight 2-DOF PID controllers, see PID 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 the Tune PID Controller Live 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, see PID Tuning Algorithm.
Alternatives
For interactive PID tuning in the Live Editor, see the Tune PID Controller Live Editor task. This task lets you interactively design a PID controller and automatically generates MATLAB code for your live script. For an example, see PID Controller Design in the Live Editor
For interactive PID tuning in a standalone app, use PID Tuner. See PID Controller Design for Fast Reference Tracking for 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