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 TunerTune PID controllers

Functions

pidTunerOpen PID Tuner for PID tuning
pidtunePID tuning algorithm for linear plant model
pidtuneOptionsDefine options for pidtune command
getPIDLoopResponseClosed-loop and open-loop responses of systems with PID controllers

Examples and How To

Tools Workflow

PID Controller Design for Fast Reference Tracking

Tune a PID Controller to meet rise-time and settling-time requirements.

Analyze Design in PID Tuner

PID Tuner provides system response plots and other tools for tuning PID controllers.

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.

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.

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.

Programmatic Workflow

PID Controller Design at the Command Line

Programmatically tune a PID controller using the pidtune command.

Tune PID Controller to Favor Reference Tracking or Disturbance Rejection (Command Line)

Use the tuning options of the pidtune command to favor reference tracking or disturbance rejection at the command line.

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.

Designing PID for Disturbance Rejection with PID Tuner

This example shows how to design a PI controller with good disturbance rejection performance using the PID Tuner tool.

Designing Cascade Control System with PI Controllers

Design two PI controllers for a cascade control system using the pidtune command.

Temperature Control in a Heat Exchanger

This example shows how to design feedback and feedforward compensators to regulate the temperature of a chemical reactor through a heat exchanger.

Control of Processes with Long Dead Time: The Smith Predictor

This example shows the limitations of PI control for processes with long dead time and illustrates the benefits of a control strategy called "Smith Predictor."

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.

Concepts

PID Design Tools

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

Using the PID Tuner app and the pidtune command, you can tune many PID and 2-DOF PID controller types.

PID Tuning Algorithm

MathWorks® algorithm for tuning PID controllers tunes the PID gains to achieve a good balance between performance and robustness.

Identifying Plant Models

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.

Input/Output Data for Identification

Identification of a plant model for PID tuning requires a single-input, single-output data set.

Choosing Identified Plant Structure

In PID Tuner you can represent identified plant dynamics as either process models or state-space models.

Preprocess Data

Perform preprocessing operations such as removing offsets and filtering the data before you use it.