You can represent PID controllers using the specialized model objects
pid
and pidstd
. This topic describes the
representation of PID controllers in MATLAB^{®}. For information about automatic PID controller tuning, see PID Controller Tuning.
You can represent continuoustime ProportionalIntegralDerivative (PID) controllers in either parallel or standard form. The two forms differ in the parameters used to express the proportional, integral, and derivative actions and the filter on the derivative term, as shown in the following table.
Form  Formula 

Parallel (pid object) 
$$C={K}_{p}+\frac{{K}_{i}}{s}+\frac{{K}_{d}s}{{T}_{f}s+1},$$ where:

Standard (pidstd object) 
$$C={K}_{p}\left(1+\frac{1}{{T}_{i}s}+\frac{{T}_{d}s}{\frac{{T}_{d}}{N}s+1}\right),$$ where:

Use a controller form that is convenient for your application. For example, if you want to express the integrator and derivative actions in terms of time constants, use standard form.
For information on representing PID Controllers in discrete time, see DiscreteTime ProportionalIntegralDerivative (PID) Controllers
This example shows how to create a continuoustime
ProportionalIntegralDerivative (PID) controller in parallel form using pid
.
Create the following parallelform PID controller: $$C=29.5+\frac{26.2}{s}\frac{4.3s}{0.06s+1}.$$
Kp = 29.5; Ki = 26.2; Kd = 4.3; Tf = 0.06; C = pid(Kp,Ki,Kd,Tf)
C is a pid
model object, which is a data container for
representing parallelform PID controllers. For more examples of how to create PID
controllers, see the pid
reference page.
This example shows how to create a continuoustime
ProportionalIntegralDerivative (PID) controller in standard form using pidstd
.
Create the following standardform PID controller: $$C=29.5\left(1+\frac{1}{1.13s}+\frac{0.15s}{\frac{0.15}{2.3}s+1}\right).$$
Kp = 29.5; Ti = 1.13; Td = 0.15; N = 2.3; C = pidstd(Kp,Ti,Td,N)
C is a pidstd
model object, which is a data container for
representing standardform PID controllers. For more examples of how to create
standardform PID controllers, see the pidstd
reference page.
pid
 pidstd
 pidtune
 pidTuner