PID Controller Tuning
Automatic and interactive tuning of PID gains
Control System Toolbox™ software offers several tools and commands for tuning PID controllers. To select the best tool for your application, see Choosing a PID Controller Design Tool.
For information about tuning PID controllers in Simulink® models, see Model-Based PID Controller Tuning (Simulink Control Design).
Apps
PID Tuner | Tune PID controllers |
Live Editor Tasks
Tune PID Controller | Tune PID Controller for LTI plant in the Live Editor |
Functions
pidtune | PID tuning algorithm for linear plant model |
pidtuneOptions | Define options for pidtune function |
getPIDLoopResponse | Closed-loop and open-loop responses of systems with PID controllers |
pidTuner | Open PID Tuner for PID tuning |
Topics
PID Tuning Basics
- Choosing a PID Controller Design Tool
Control System Toolbox software provides several tools for designing PID controllers. - Designing PID Controllers with PID Tuner
PID Tuner lets you perform automatic, interactive tuning of PID controllers. - PID Controller Types for Tuning
Control System Toolbox PID tuning tools can generate and tune many PID and 2-DOF PID controller types.
Interactive PID Tuning
- PID Controller Design for Fast Reference Tracking
Tune a PID Controller to meet rise-time and settling-time requirements. - Tune PID Controller to Favor Reference Tracking or Disturbance Rejection (PID Tuner)
PID tuning is a tradeoff between reference-tracking and disturbance-rejection performance. This example shows how to tune to favor one or the other when using PID Tuner. - PID Controller Design in the Live Editor
Use the Tune PID Controller task to generate code in the Live Editor for designing a PID controller for a linear plant model. - Analyze Design in PID Tuner
PID Tuner provides system response plots and other tools for tuning PID controllers.
Command-Line PID Tuning
- PID Controller Design at the Command Line
Programmatically tune a PID controller using thepidtune
command. - Tune PID Controller to Favor Reference Tracking or Disturbance Rejection (Command Line)
Use the tuning options of thepidtune
command to favor reference tracking or disturbance rejection at the command line. - Designing Cascade Control System with PI Controllers
Design two PI controllers for a cascade control system using thepidtune
command.
PID Controller Design from Measured Response Data
- Interactively Estimate Plant Parameters from Response Data
If you have System Identification Toolbox™ software, you can use PID Tuner to estimate a linear plant model based on response data measured from your system. PID Tuner then tunes a PID controller for the resulting model. - Tune PID Controller from Measured Plant Data in Live Editor
Use Live Editor Tasks to generate code for tuning a PID controller based on measured plant response. - System Identification for PID Control
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.
Two-Degree-of-Freedom PID Controllers
- Tune 2-DOF PID Controller (PID Tuner)
Design a two-degree-of-freedom (2-DOF) PID controller, and compare the controller performance with that of a 1-DOF PID controller. - Tune 2-DOF PID Controller (Command Line)
Design a two-degree-of-freedom (2-DOF) PID controller, and compare the controller performance with that of a 1-DOF PID controller.
Tuning in Simulink
- PID Controller Tuning in Simulink
You can tune the gains of PID Controller blocks to achieve a robust design with the desired response time using PID Tuner. - Design PID Controller Using Simulated I/O Data
This example shows how to tune a PID controller for plants that cannot be linearized. - Design PID Controller Using Estimated Frequency Response
When your plant cannot be linearized, you can estimate a plant model using frequency response estimation and import the plant model into PID Tuner.
PID Algorithm
- PID Tuning Algorithm
MathWorks® algorithm for tuning PID controllers tunes the PID gains to achieve a good balance between performance and robustness.