Create 2DOF PID controller in standard form, convert to standardform 2DOF PID controller
C2 = pidstd2(Kp,Ti,Td,N,b,c)
C2 = pidstd2(Kp,Ti,Td,N,b,c,Ts)
C2 = pidstd2(sys)
C2 = pid2(___,Name,Value)
pid2
controller objects represent
twodegreeoffreedom (2DOF) PID controllers in parallel form. Use pid2
either
to create a pid2
controller object from known
coefficients or to convert a dynamic system model to a pid2
object.
Twodegreeoffreedom (2DOF) PID controllers include setpoint weighting on the proportional and derivative terms. A 2DOF PID controller is capable of fast disturbance rejection without significant increase of overshoot in setpoint tracking. 2DOF PID controllers are also useful to mitigate the influence of changes in the reference signal on the control signal. The following illustration shows a typical control architecture using a 2DOF PID controller.
creates
a continuoustime 2DOF PID controller with proportional gain C2
= pidstd2(Kp
,Ti
,Td
,N
,b
,c
)Kp
,
integrator and derivative time constants Ti
,
and Td
, and derivative filter divisor N
.
The controller also has setpoint weighting b
on
the proportional term, and setpoint weighting c
on
the derivative term. The relationship between the 2DOF controller’s
output (u) and its two inputs (r and y)
is given by:
$$u={K}_{p}\left[\left(bry\right)+\frac{1}{{T}_{i}s}\left(ry\right)+\frac{{T}_{d}s}{\frac{{T}_{d}}{N}s+1}\left(cry\right)\right].$$
This representation is in standard form.
If all of the coefficients are realvalued, then the resulting C2
is
a pidstd2
controller object. If one or more of
these coefficients is tunable (realp
or genmat
),
then C2
is a tunable generalized statespace
(genss
) model object.
creates
a discretetime 2DOF PID controller with sample time C2
= pidstd2(Kp
,Ti
,Td
,N
,b
,c
,Ts
)Ts
.
The relationship between the controller’s output and inputs
is given by:
$$u={K}_{p}\left[\left(bry\right)+\frac{1}{{T}_{i}}IF\left(z\right)\left(ry\right)+\frac{{T}_{d}}{\frac{{T}_{d}}{N}+DF\left(z\right)}\left(cry\right)\right].$$
IF(z) and DF(z) are the discrete integrator formulas for the integrator and derivative filter. By default,
$$IF\left(z\right)=DF\left(z\right)=\frac{{T}_{s}}{z1}.$$
To choose different discrete integrator formulas, use the IFormula
and DFormula
properties.
(See Properties for more information).
If DFormula
= 'ForwardEuler'
(the
default value) and N
≠ Inf
, then Ts
, Td
,
and N
must satisfy Td/N > Ts/2
. This requirement ensures a stable derivative
filter pole.
converts
the dynamic system C2
= pidstd2(sys
)sys
to a standard form pidstd2
controller
object.
specifies
additional properties as commaseparated pairs of C2
= pid2(___,Name,Value
)Name,Value
arguments.

Proportional gain.
Default: 1 

Integrator time.
When Default: 

Derivative time.
When Default: 0 

Derivative filter divisor.
When Default: 

Setpoint weighting on proportional term.
When Default: 1 

Setpoint weighting on derivative term.
When Default: 1 

Sample time. To create a discretetime
Default: 0 (continuous time) 

SISO dynamic system to convert to standard

Specify optional
commaseparated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
Use Name,Value
syntax to set the numerical
integration formulas IFormula
and DFormula
of
a discretetime pidstd2
controller, or to set
other object properties such as InputName
and OutputName
.
For information about available properties of pidstd2
controller
objects, see Properties.

2DOF PID controller, returned as a


Setpoint weights on the proportional and derivative terms, respectively. 

Proportional gain. The value of 

Integrator time. 

Derivative time. 

Derivative filter divisor. 

Discrete integrator formula IF(z)
for the integrator of the discretetime $$u={K}_{p}\left[\left(bry\right)+\frac{1}{{T}_{i}}IF\left(z\right)\left(ry\right)+\frac{{T}_{d}}{\frac{{T}_{d}}{N}+DF\left(z\right)}\left(cry\right)\right].$$
When Default: 

Discrete integrator formula DF(z)
for the derivative filter of the discretetime $$u={K}_{p}\left[\left(bry\right)+\frac{1}{{T}_{i}}IF\left(z\right)\left(ry\right)+\frac{{T}_{d}}{\frac{{T}_{d}}{N}+DF\left(z\right)}\left(cry\right)\right].$$
When Default: 

Time delay on the system input. 

Time delay on the system Output. 

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

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 name, specified as a character vector or a 2by1
cell array of character vectors. Use this property to name the input
channels of the controller model. For example, assign the names C.InputName = {'setpoint';'measurement'}; Alternatively, use automatic vector expansion to assign both input names. For example: C.InputName = 'Cinput'; The input names automatically expand to You can use the shorthand notation Input channel names have several uses, including:
Default: 

Input channel units, specified as a 2by1 cell array of character
vectors. Use this property to track input signal units. For example,
assign the units C.InputUnit = {'Volts';'mol/m^3'};
Default: 

Input channel groups. This property is not needed for PID controller models. Default: 

Output channel name, specified as a character vector. Use this
property to name the output channel of the controller model. For example,
assign the name C.OutputName = 'control'; You can use the shorthand notation Input channel names have several uses, including:
Default: Empty character vector, 

Output channel units, specified as a character vector. Use this
property to track output signal units. For example, assign the unit C.OutputUnit = 'Volts';
Default: Empty character vector, 

Output channel groups. This property is not needed for PID controller models. Default: 

System name, specified as a character vector. For example, Default: 

Any text that you want to associate with the system, stored as a string or a cell array of
character vectors. The property stores whichever data type you
provide. For instance, if sys1.Notes = "sys1 has a string."; sys2.Notes = 'sys2 has a character vector.'; sys1.Notes sys2.Notes ans = "sys1 has a string." ans = 'sys2 has a character vector.' Default: 

Any type of data you want to associate with system, specified as any MATLAB^{®} data type. Default: 

Sampling grid for model arrays, specified as a data structure. For model arrays that are derived by sampling one or more independent variables, this property tracks the variable values associated with each model in the array. This information appears when you display or plot the model array. Use this information to trace results back to the independent variables. Set the field names of the data structure to the names of the sampling variables. Set the field values to the sampled variable values associated with each model in the array. All sampling variables should be numeric and scalar valued, and all arrays of sampled values should match the dimensions of the model array. For example, suppose you create a 11by1
array of linear models, sysarr.SamplingGrid = struct('time',0:10) Similarly, suppose you create a 6by9
model array, [zeta,w] = ndgrid(<6 values of zeta>,<9 values of w>) M.SamplingGrid = struct('zeta',zeta,'w',w) When you display M M(:,:,1,1) [zeta=0.3, w=5] = 25  s^2 + 3 s + 25 M(:,:,2,1) [zeta=0.35, w=5] = 25  s^2 + 3.5 s + 25 ... For model arrays generated by linearizing a Simulink^{®} model
at multiple parameter values or operating points, the software populates Default: 
To design a PID controller for a particular plant,
use pidtune
or pidTuner
. To create a tunable 2DOF
PID controller as a control design block, use tunablePID2
.
To break a 2DOF controller into two SISO control
components, such as a feedback controller and a feedforward controller,
use getComponents
.
Create arrays of pidstd2
controllers
by:
In an array of pidstd2
controllers, each
controller must have the same sample time Ts
and
discrete integrator formulas IFormula
and DFormula
.
To create or convert to a parallelform controller,
use pid2
. Parallel form expresses
the controller actions in terms of proportional, integral, and derivative
gains K_{p}, K_{i} and K_{d},
and a filter time constant T_{f}.
For example, the relationship between the inputs and output of a continuoustime
parallelform 2DOF PID controller is given by:
$$u={K}_{p}\left(bry\right)+\frac{{K}_{i}}{s}\left(ry\right)+\frac{{K}_{d}s}{{T}_{f}s+1}\left(cry\right).$$
There are two ways to discretize a continuoustime pidstd2
controller:
Use the c2d
command. c2d
computes
new parameter values for the discretized controller. The discrete
integrator formulas of the discretized controller depend upon the c2d
discretization
method you use, as shown in the following table.
c2d Discretization
Method  IFormula  DFormula 

'zoh'  ForwardEuler  ForwardEuler 
'foh'  Trapezoidal  Trapezoidal 
'tustin'  Trapezoidal  Trapezoidal 
'impulse'  ForwardEuler  ForwardEuler 
'matched'  ForwardEuler  ForwardEuler 
For more information about c2d
discretization
methods, See the c2d
reference
page. For more information about IFormula
and DFormula
,
see Properties .
If you require different discrete integrator formulas,
you can discretize the controller by directly setting Ts
, IFormula
,
and DFormula
to the desired values. (See Discretize a StandardForm 2DOF PID Controller.)
However, this method does not compute new gain and filterconstant
values for the discretized controller. Therefore, this method might
yield a poorer match between the continuous and discretetime pidstd2
controllers
than using c2d
.
pid2
 pidstddata2
 pidtune
 pidTuner
 getComponents