Tunable PID controller
blk = ltiblock.pid(name,type)
blk = ltiblock.pid(name,type,Ts)
blk = ltiblock.pid(name,sys)
Model object for creating tunable onedegreeoffreedom PID
controllers. ltiblock.pid
lets you parametrize
a tunable SISO PID controller for parameter studies or for automatic
tuning with requires Robust Control Toolbox™ tuning commands such
as systune
, looptune
, or hinfstruct
.
ltiblock.pid2
is part of the family of
parametric Control Design Blocks. Other
parametric Control Design Blocks include ltiblock.gain
, ltiblock.ss
, and ltiblock.tf
.
creates
the onedegreeoffreedom continuoustime PID controller:blk
= ltiblock.pid(name
,type
)
$$blk={K}_{p}+\frac{{K}_{i}}{s}+\frac{{K}_{d}s}{1+{T}_{f}s},$$
with tunable parameters Kp
, Ki
, Kd
,
and Tf
. The string type
sets
the controller type by fixing some of these values to zero (see Input Arguments).
creates
a discretetime PID controller with sample time blk
= ltiblock.pid(name
,type
,Ts
)Ts
:
$$blk={K}_{p}+{K}_{i}IF\left(z\right)+\frac{{K}_{d}}{{T}_{f}+DF\left(z\right)},$$
where IF(z) and DF(z)
are the discrete integrator formulas for the integral and derivative
terms, respectively. The values of the IFormula
and DFormula
properties
set the discrete integrator formulas (see Properties).
uses
the dynamic system model, blk
= ltiblock.pid(name
,sys
)sys
, to set the sample
time, Ts
, and the initial values of the parameters Kp
, Ki
, Kd
,
and Tf
.

PID controller  

String specifying controller type. Specifying a controller type
fixes up to three of the PID controller parameters.
 

Sample time, specified as a scalar.  

Dynamic system model representing a PID controller. 

Parametrization of the PID gains The following fields of
 

Strings setting the discrete integrator formulas IF(z)
and DF(z) for the integral and
derivative terms, respectively.
Default:  

Sample time. For continuoustime models, Changing this property does not discretize or resample the model.
Use Default:  

String representing the unit of the time variable. This property
specifies the units for the time variable, the sample time
Changing this property has no effect on other properties, and
therefore changes the overall system behavior. Use Default:  

Input channel names. Set Alternatively, use automatic vector expansion to assign input
names for multiinput models. For example, if sys.InputName = 'controls'; The input names automatically expand to You can use the shorthand notation Input channel names have several uses, including:
Default: Empty string  

Input channel units. Use Default: Empty string  

Input channel groups. The sys.InputGroup.controls = [1 2]; sys.InputGroup.noise = [3 5]; creates input groups named sys(:,'controls') Default: Struct with no fields  

Output channel names. Set Alternatively, use automatic vector expansion to assign output
names for multioutput models. For example, if sys.OutputName = 'measurements'; The output names automatically expand to You can use the shorthand notation Output channel names have several uses, including:
Default: Empty string  

Output channel units. Use Default: Empty string  

Output channel groups. The sys.OutputGroup.temperature = [1]; sys.InputGroup.measurement = [3 5]; creates output groups named sys('measurement',:) Default: Struct with no fields  

System name. Set Default:  

Any text that you want to associate with the system. Set Default:  

Any type of data you wish to associate with system. Set Default: 
Tunable Controller with a Fixed Parameter
Create a tunable PD controller. Then, initialize the parameter values, and fix the filter time constant.
blk = ltiblock.pid('pdblock','PD'); blk.Kp.Value = 4; % initialize Kp to 4 blk.Kd.Value = 0.7; % initialize Kd to 0.7 blk.Tf.Value = 0.01; % set parameter Tf to 0.01 blk.Tf.Free = false; % fix parameter Tf to this value blk
blk = Parametric continuoustime PID controller "pdblock" with formula: s Kp + Kd *  Tf*s+1 and tunable parameters Kp, Kd. Type "pid(blk)" to see the current value and "get(blk)" to see all properties.
Controller Initialized by Dynamic System Model
Create a tunable discretetime PI controller. Use a pid
object to initialize the parameters
and other properties.
C = pid(5,2.2,'Ts',0.1,'IFormula','BackwardEuler'); blk = ltiblock.pid('piblock',C)
blk = Parametric discretetime PID controller "piblock" with formula: Ts*z Kp + Ki *  z1 and tunable parameters Kp, Ki. Type "pid(blk)" to see the current value and "get(blk)" to see all properties.
blk
takes the value of properties, such as Ts
and IFormula
,
from C
.
Controller with Named Input and Output
Create a tunable PID controller, and assign names to the input and output.
blk = ltiblock.pid('pidblock','pid') blk.InputName = {'error'} % assign input name blk.OutputName = {'control'} % assign output name
getValue
 hinfstruct
 looptune
 ltiblock.pid2
 ltiblock.ss
 ltiblock.tf
 systune