Use automatic PID tuning to tune single-loop control systems
PID Controller or
2DOF Simulink blocks. To decide whether automatic PID
tuning is right for your application, see Choosing a Control Design Approach.
|PID Tuner||Tune PID controllers|
You can tune the gains of PID Controller blocks to achieve a robust design with the desired response time using PID Tuner.
Open the PID Tuner app to tune PID Controller or PID Controller (2DOF) blocks.
To determine whether your PID controller meets your requirements, you can analyze the system response using the PID Tuner response plots.
After tuning a PID Controller using a linear model of your plant, verify that the tuned controller meets your design requirements when applied to your nonlinear Simulink model.
Tune a PID controller to reduce overshoot in reference tracking or to improve rejection of a disturbance at the plant input.
When you open PID Tuner from a controller block in a model that is referenced in one or more open models, you must specify which open model is the top-level model for linearization and tuning.
By default, PID Tuner linearizes your plant and designs a controller at the operating point specified by the initial conditions in your Simulink model. In some cases, this operating point can differ from the operating point for which you want to design a controller.
If you have System Identification Toolbox™ software, you can import measured time-domain response data into PID Tuner. You can then estimate a plant model for this response data.
If you have System Identification Toolbox software, estimate the parameters of a linear plant model based on time-domain response data using PID Tuner. You can then tune a PID controller for the resulting estimated model.
This example shows how to tune a PID controller for plants that cannot be linearized.
When your plant cannot be linearized, you can estimate a plant model using frequency response estimation and import the plant model into PID Tuner.
If your nonlinear Simulink model operates over a wide range of operating conditions, you can design an array of PID controllers for multiple model operating points.
To implement gain-scheduled control using a family of PID controllers, create a lookup table that associates each plant operating point with the corresponding PID gains.
Tune PID Controller (2DOF) blocks to achieve both good setpoint tracking and good disturbance rejection.
PI-D and I-PD controllers are used to mitigate the influence of changes in the reference signal on the control signal. These controllers are variants of the 2DOF PID controller.
Simulink Control Design™ provides several approaches to tuning Simulink blocks, such as Transfer Fcn and PID Controller blocks.
You can use PID Tuner to tune PID gains automatically in a Simulink model containing a PID Controller or PID Controller (2DOF) block.
PID Tuner considers as the plant all blocks in the loop between the PID Controller block output and input.
MathWorks® algorithm for tuning PID controllers tunes the PID gains to achieve a good balance between performance and robustness.
System identification is the process of estimating a dynamic representation of the system you want to control, based on the system response to a known excitation.
Identification of a plant model for PID tuning requires a single-input, single-output data set.
In PID Tuner you can represent identified plant dynamics as either process models or state-space models.
Perform preprocessing operations such as removing offsets and filtering the data before you use it.
Some Simulink blocks, such as those with sharp discontinuities, can produce poor linearization results. For example, when your model operates in a region away from the point of discontinuity, the linearization of the block is zero.
If you cannot find a good design using PID Tuner, try a different PID controller type. If no PID controller is satisfactory, consider designing a more complex controller.
When you run your Simulink model using the PID gains computed by PID Tuner, the simulation output can differ from the PID Tuner response plot.
When you run your Simulink model using the PID gains computed by PID Tuner, the simulation output may not meet your design requirements.
If controller performance deteriorates when you discretize a tuned continuous-time PID controller, consider tuning a discrete-time controller directly.
When you use PID Tuner to design a controller, the resulting derivative gain can have a different sign from the integral gain. PID Tuner always returns a stable controller, even if one or more gains are negative.