Discrete PID Controller
PID controller.
Description
The PID Controller block implements a PID controller (PID, PI, PD, P only or AND only).
The output of the block is a weighted sum of the input signal, the integral of the input signal and the derivative of the input signal. The summation weights are given by proportional, integral and differential coefficients. The first order pole filters the differential component.
The block supports several controller types and structures. Possible options:
-
Controller type (PID, PI, PD, P only or I only).
-
Controller shape (parallel or ideal).
-
Time domain (continuous or discrete).
-
Initial conditions
When these parameters are changed, the internal structure of the block changes: the corresponding variants of subsystems are activated.
Ports
Input
Port_1 (u) - input signal
scalar
| vector
| matrix
The difference between the setpoint and the output signal of the controlled system as shown in the figure below:
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
.
Output
Port_1 - controller output
scalar
| vector
Controller output, which is a weighted sum of the input signal, integral of the input signal and derivative of the input signal. The summation weights are given by the proportional, integral and differential coefficients. Which summands are involved in the summation depends on the value of the Controller parameter.
The controller output is a vector signal when the input is a vector signal. In this case the unit acts as N independent PID controllers, where N is the number of signals in the input vector.
Data types: Float64
.
Parameters
Controller - controller type
PID (by default)
| PI
| PD
| P
| I
Specifies the controller composition.
PID
-
Proportional, integral and differential parts.
PI
-
Proportional and integral parts only.
PD
-
Only proportional and differential parts.
P
-
Proportional part only.
I
-
Integral part only.
Block parameter |
|
Values |
|
By default |
|
Form - controller structure
Parallel (by default)
| Ideal
Specifies whether the controller structure is parallel or ideal.
Parallel
-
The controller output represents the sum of the proportional, integral and differential parts independently weighted by P, I and D respectively. For example, for a continuous-time parallel PID controller, the transfer function is:
For a parallel form controller with discrete time, the transfer function is of the form:
,
where the parameters Integrator method and Filter method define and respectively.
Ideal
-
Proportional gain P acts on the sum of all parts. For example, for an ideal form PID controller with continuous time, the transfer function is of the form:
For an ideal-form controller with discrete time, the transfer function is of the form:
,
where the parameters Integrator method and Filter method define and respectively.
Block parameter |
|
Values |
|
By default |
|
Time domain - discrete-time or continuous-time controller
Discrete-time (by default)
| Continuous-time
For the Discrete-time
value, it is recommended to explicitly set the calculation step for the block. If Discrete-time
is selected, the Integrator method and Filter method parameters are also enabled.
When the PID Controller block is in a synchronous state control model, you cannot select Continuous-time
.
Block parameter |
|
Values |
|
By default |
|
Derivative (D) - differential coefficient
0 (by default)
| scalar
| vector
The final real value of the differential coefficient.
Dependencies
To use this parameter, set the Controller parameter to PID
or PD
.
Customisable: yes
Block parameter |
|
By default |
|
Filter coefficient (N) - derivative filtering coefficient
100 (by default)
| scalar
| vector
The final real value of the filter gain. The filter gain determines the position of the filter pole in the differential part of the block. The location of the filter pole depends on the Time domain parameter.
When Time domain has the value Continuous-time
, the pole position is s = −N
.
When Time domain has the value Discrete-time
, the pole position depends on the Filter method parameter.
Filter method | The location of the filter column |
---|---|
|
|
|
|
|
|
The block does not support N = Inf
(perfect unfiltered derivative). If the Time domain parameter is set to Discrete-time
, you can uncheck Use filtered derivative to remove the derivative filter.
Dependencies
To use this parameter, set the Controller parameter to PID
or PD
.
Customisable: yes
Block parameter |
|
By default |
|
Integral (I) - integral coefficient.
1.0 (By default)
| scalar
| vector
The final real value of the integral coefficient.
Dependencies
To use this parameter, set the Controller parameter to a type that has an integral action.
Customisable: Yes
Block parameter |
|
By default |
|
Proportional (P) -proportional coefficient.
1.0 (By default)
| scalar
| vector
The final real value of the proproportional coefficient. When the controller form:
Parallel
-
Proportional action is independent of integral and derivative actions. For example, for a parallel PID controller with continuous time, the transfer function is of the form:
For a parallel controller with discrete time, the transfer function has the form:
,
where the parameters Integrator method and Filter method define and respectively.
Ideal
-
The proportional factor P is applied to the sum of all parts. For example, for an ideal form PID controller with continuous time, the transfer function is of the form:
For an ideal-form controller with discrete time, the transfer function is of the form:
,
where the parameters Integrator method and Filter method define and respectively.
Dependencies
To use this parameter, set the Controller parameter to one of the values PID
, PI
, PD
or P
.
Customisable: Yes
Block parameter |
|
By default |
|
Filter initial condition - initial filter value
0 (By default)
Filter initial value.
Integrator initial condition - integrator initial value
`0 (By default)
Integrator initial value.