Tunable twodegreeoffreedom PID controller
blk = ltiblock.pid2(name,type)
blk = ltiblock.pid2(name,type,Ts)
blk = ltiblock.pid2(name,sys)
Model object for creating tunable twodegreeoffreedom PID
controllers. ltiblock.pid2
lets you parametrize
a tunable SISO twodegreeoffreedom PID controller. You can use this
parametrized controller for parameter studies or for automatic tuning
with 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 twodegreeoffreedom continuoustime PID controller described
by the equation:blk
= ltiblock.pid2(name
,type
)
$$u={K}_{p}\left(bry\right)+\frac{{K}_{i}}{s}\left(ry\right)+\frac{{K}_{d}s}{1+{T}_{f}s}\left(cry\right).$$
r is the setpoint command, y is the measured response to that setpoint, and u is the control signal, as shown in the following illustration.
The tunable parameters of the block are:
Scalar gains Kp
, Ki
,
and Kd
Filter time constant Tf
Scalar weights b
and c
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.pid2(name
,type
,Ts
)Ts
.
The equation describing this controller is:
$$u={K}_{p}\left(bry\right)+{K}_{i}IF\left(z\right)\left(ry\right)+\frac{{K}_{d}}{{T}_{f}+DF\left(z\right)}\left(cry\right).$$
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.pid2(name
,sys
)sys
, to set the sample
time, Ts
, and the initial values of all the tunable
parameters. The model sys
must be compatible
with the equation of a twodegreeoffreedom PID controller.

PID controller  

Controller type, specified as a string. Specifying a controller
type fixes up to three of the PID controller parameters.
 

Sample time, specified as a scalar.  

Dynamic system model representing a twodegreeoffreedom 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 TwoDegreeofFreedom Controller with a Fixed Parameter
Create a tunable twodegreeoffreedom PD controller. Then, initialize the parameter values, and fix the filter time constant.
blk = ltiblock.pid2('pdblock','PD'); blk.b.Value = 1; blk.c.Value = 0.5; blk.Tf.Value = 0.01; blk.Tf.Free = false; blk
blk = Parametric continuoustime 2DOF PID controller "pdblock" with equation: s u = Kp (b*ry) + Kd  (c*ry) Tf*s+1 where r,y are the controller inputs and Kp, Kd, b, c are tunable gains. Type "showBlockValue(blk)" to see the current value and "get(blk)" to see all properties.
Controller Initialized by Dynamic System Model
Create a tunable twodegreeoffreedom PI controller. Use a
twoinput, oneoutput tf
model
to initialize the parameters and other properties.
s = tf('s'); Kp = 10; Ki = 0.1; b = 0.7; sys = [(b*Kp + Ki/s), (Kp  Ki/s)]; blk = ltiblock.pid2('PI2dof',sys)
blk = Parametric continuoustime 2DOF PID controller "PI2dof" with equation: 1 u = Kp (b*ry) + Ki  (ry) s where r,y are the controller inputs and Kp, Ki, b are tunable gains. Type "showBlockValue(blk)" to see the current value and "get(blk)" to see all properties.
blk
takes initial parameter values from sys
.
If sys
is a discretetime system, blk
takes
the value of properties, such as Ts
and IFormula
,
from sys
.
Controller with Named Inputs and Output
Create a tunable PID controller, and assign names to the inputs and output.
blk = ltiblock.pid2('pidblock','pid'); blk.InputName = {'reference','measurement'}; blk.OutputName = {'control'};
blk.InputName
is a cell array containing
two strings, because a twodegreeoffreedom PID controller has two
inputs.
getValue
 hinfstruct
 looptune
 ltiblock.pid
 ltiblock.ss
 ltiblock.tf
 systune