Pid
|
Page in progress. |
The PID controller is in parallel form.
| Library |
|
Description
The function creates a continuous or discrete proportional-integral-differential controller (PID controller) in parallel form:
where
-
— the gain factor of the proportional component;
-
— the gain factor of the integral component;
-
— gain factor of the differential component;
-
— filter time constant;
-
— discrete integrator of the integral part;
-
— discrete integrator of the differential part.
Syntax
Function call
-
c = Pid()creates a continuous PID controller with default parameters. You can change the parameter values using the functionsetproperty!.
Arguments
Input arguments
# kp is the gain factor of the proportional component
+
1.0 (default) | scalar
Details
The gain factor of the proportional component. The value must be a finite number.
| Data types |
|
| Support for complex numbers |
None |
# ki is the gain factor of the integral component
+
0.0 (by default) | scalar
Details
The gain factor of the integral component. The value must be a finite number.
| Data types |
|
| Support for complex numbers |
None |
# kd is the gain factor of the differential component
+
0.0 (by default) | scalar
Details
The gain factor of the differential component. The value must be a finite number.
| The creation of a D-regulator is not provided. |
| Data types |
|
| Support for complex numbers |
None |
# tf is the time constant of the filter
+
0.0 (by default) | scalar
Details
The time constant of the first-order filter of the differential component of the regulator. The value must be a finite number.
The value of this parameter must be equal to 0 when the regulator has no differential component.
|
| Data types |
|
| Support for complex numbers |
None |
# ts is the sampling period
+
nothing (by default) | scalar
Details
The sampling period of the controller. For a continuous regulator, the argument takes the value nothing, and for a discrete controller, the value of the argument can be any positive number.
The value of this parameter must be equal to 0 when the regulator has no differential component.
|
| Data types |
|
| Support for complex numbers |
None |
# iformula is a method for integrating an integral component
+
nothing (default) | :forward_euler | :backward_euler | :trapezoidal
Details
The method of integrating the integral component discrete PID controller
The argument takes the following values:
-
:forward_euler— the direct Euler methodIt is recommended to use this method when the sampling period is short, i.e. if the Nyquist frequency is much higher than the bandwidth of the controller. For large values of the sampling period, using the direct Euler method can make the regulator unstable, even if a similar continuous regulator is stable.
-
:backward_euler— the inverse Euler methodThis method guarantees the stability of a discrete regulator when sampling a stable continuous regulator.
-
:trapezoidal— the trapezoid methodThis method guarantees the stability of a discrete regulator when sampling a stable continuous regulator. The trapezoid method allows to obtain a better correspondence of the frequency characteristics of continuous and discrete regulators in comparison with the Euler method.
For a continuous regulator, this argument takes the value nothing.
|
| Data types |
|
# dformula is a method for integrating the differential component
+
nothing (by default) | :forward_euler | :backward_euler | :trapezoidal
Details
The method of integrating the integral component discrete PID controller
The argument takes the following values:
-
:forward_euler— the direct Euler methodIt is recommended to use this method when the sampling period is short, i.e. if the Nyquist frequency is much higher than the bandwidth of the controller. For large values of the sampling period, using the direct Euler method can make the regulator unstable, even if a similar continuous regulator is stable.
-
:backward_euler— the inverse Euler methodThis method guarantees the stability of a discrete regulator when sampling a stable continuous regulator.
-
:trapezoidal— the trapezoid methodThis method guarantees the stability of a discrete regulator when sampling a stable continuous regulator. The trapezoid method allows to obtain a better correspondence of the frequency characteristics of continuous and discrete regulators in comparison with the Euler method.
For a continuous regulator, this argument takes the value nothing.
|
| Data types |
|
Output arguments
# c — PID controller in parallel form
+
Pid
Details
The PID controller is in parallel form. The structure of the regulator depends on the specified parameters.
| Data types |
|