Open PID Tuner for PID tuning
PID Tuner with a baseline controller
that you can compare performance between the designed controller and
the baseline controller. If
Cbase is a
object, PID Tuner designs a controller of the same form, type, and
discrete integrator formulas as
a parallel-form PI controller.
pidTuner launches PID Tuner with default
plant of 1 and proportional (P) controller of 1.
Plant model for controller design.
If the plant has unstable poles, and
then you must specify the number of unstable poles in the plant. To do this, after opening PID
Tuner, in the Plant menu, select
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
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.
When you use the
A dynamic system representing a baseline controller, permitting
comparison of the performance of the designed controller to the performance
Interactive PID Tuning of Parallel-Form Controller
Launch PID Tuner to design a parallel-form PIDF controller for a discrete-time plant:
Gc = zpk(,[-1 -1 -1],1); Gd = c2d(Gc,0.1); % Create discrete-time plant pidTuner(Gd,'pidf') % Launch PID Tuner
Interactive PID Tuning of Standard-Form Controller Using Integrator Discretization Method
Design a standard-form PIDF controller using
Gc = zpk(,[-1 -1 -1],1); Gd = c2d(Gc,0.1); % Create discrete-time plant % Create baseline controller. Cbase = pidstd(1,2,3,4,'Ts',0.1,... 'IFormula','BackwardEuler','DFormula','BackwardEuler') pidTuner(Gd,Cbase) % Launch PID Tuner
PID Tuner designs a controller for
the same form, type, and discrete integrator formulas as
For comparison, you can display the response plots of
the response plots of the designed controller by clicking the Show
baseline checkbox in PID Tuner.
a two-degree-of-freedom (2-DOF) PID controller, then
a 2-DOF controller as in the feedback loop of this illustration:
PID Tuner has a default target phase margin of 60 degrees and automatically tunes the PID gains to balance performance (response time) and robustness (stability margins). Use the Response time or Bandwidth and Phase Margin sliders to tune the controller's performance to your requirements. Increasing performance typically decreases robustness, and vice versa.
Select response plots from the Response menu to analyze the controller's performance.
If you provide
Cbase, check Show
baseline to display the response of the baseline controller.
For more detailed information about using PID Tuner, see Designing PID Controllers with PID Tuner.
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 information about the MathWorks® PID tuning algorithm, see PID Tuning Algorithm.
You can open PID Tuner from the MATLAB desktop, in the Apps tab. When you do so, use the Plant menu in PID Tuner to specify your plant model.
For PID tuning at the command line, use
can design a controller for multiple plants at once.
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.
Åström, K. J. and Hägglund, T. Advanced PID Control, Research Triangle Park, NC: Instrumentation, Systems, and Automation Society, 2006.