PIDMA – PID controller with moment autotuner
Block SymbolLicensing group: AUTOTUNING
Function Description
The PIDU block serves as a foundational component for constructing a complete PID controller
(P, I, PI, PD, PID, PI+D). In its simplest form, it can operate independently as a
standard PID controller with two degrees of freedom, accommodating both automatic
() and manual
modes ().
In automatic mode (), the PIDMA block executes the PID control law with two degrees of freedom as follows:
where is Laplace transform of the manipulated variable mv, is Laplace transform of the setpoint variable sp, is Laplace transform of the process variable pv, is Laplace transform of the feedforward control variable dv and , , , , and are the parameters of the controller. The sign of the right hand side depends on the parameter RACT. The range of the manipulated variable mv (position controller output) is limited by parameters hilim, lolim. The parameter dz determines the dead zone in the integral part of the controller. The integral part of the control law can be switched off and fixed on the current value by the integrator hold input IH (). For the proper function of the controller, it is necessary to connect the output mv of the controller to the controller input tv and properly set the tracking time constant tt.
The recommended default value for the PID controller is , and for the PI controller, it is . This ensures a bumpless transfer during switching between manual and automatic modes and correct anti-windup functionality when the output mv saturates. Adjusting the parameter tt allows for precise behaviour adjustment during saturation (e.g., bouncing off the limits due to noise) and when switching between multiple controllers (the size of the jump when switching, if there is a deviation error). A value of 0 sets recommended default values for PI and PID controllers. For controllers withou an integral part, it means disabling the tracking. To enable tracking for P or PD controllers (e.g., for control around a setpoint), set a positive value for tt higher than the sampling period. Disabling tracking for controllers with an integral part is not possible due to the risk of windup.
For the gain setting, a value of disables the controller. Negative values are not allowed (use the RACT parameter for negative effect instead). Setting the integral time constant to disables the integral component of the controller (same effect as disabling it with the irtype parameter). For , the derivative component of the controller is disabled. The additional outputs dmv, de, and SAT sequentially provide the controller’s velocity output (difference of mv), the deviation error, and the saturation flag of the controller’s output mv.
The PIDMA block can be prepared for connection with other types of control blocks by using the icotype parameter. The icotype parameter can be set to the following values with the given meanings:
- 1: Analog - standard block mode,
- 2: PWM - mode suitable for connecting the output mv to the input of pulse-width modulated regulation PWM,
- 3: SCU - mode for connection with a step controller with position feedback SCU,
- 4: SCUV - mode for connection with a step controller without positional feedback SCUV.
For the last option, the meanings of the outputs mv, dmv, and SAT are modified in this case: the output mv equals the sum of the P and D components of the controller, while the output dmv provides the difference of its I component, and the output SAT carries information for the SCUV block whether the deviation error de in automatic mode is less than the dead zone dz. Additionally, for connecting the PIDMA and SCUV blocks, it is recommended to set the setpoint weighting factor for the derivative component c to zero.
In the manual mode (), the input hv is copied to the output mv unless saturated. The overall control function of the PIDMA block is quite clear from the following diagram:
The block PIDMA extends the control function of the standard PID controller by the built in autotuning feature. Before start of the autotuner the operator have to reach the steady state of the process at a suitable working point (in manual or automatic mode) and specify the required type of the controller ittype (PI or PID) and other tuning parameters (iainf, DGC, tdg, tn, amp, dy and ispeed). The identification experiment is started by the rising edge offon on the input TUNE (input TBRK finishes the experiment). In this mode (), first of all the noise and possible drift gradient () are estimated during the user specified time () and then the rectangle pulse is applied to the input of the process and the first three process moments are identified from the pulse response. The amplitude of the pulse is set by the parameter amp. The pulse is finished when the process variable pv deviates from the steady value more than the dy threshold defines. The threshold is an absolute difference, therefore it is always a positive value. The duration of the tuning experiment depends on the dynamic behavior of the process. The remaining time to the end of the tuning is provided by the output trem.
If the experiment ends successfully (), then depending on the input ips appears on the outputs:
- 0: Designed parameters pk, pti, ptd, pnd, pb, pc.
- 1: process moments: static gain (pk), resident time constant (pti), measure of the system response length (ptd).
- 2: Three-parameter first-order plus dead-time model: static gain (pk), dead-time (pti), time constant (ptd). See the FOPDT block.
- 3: Three-parameter second-order plus dead-time model with double time constant: static gain (pk), dead-time (pti), time constant (ptd). See the SOPDT block.
- 4: Estimated boundaries for manual fine-tuning of the PID controller () gain k: upper boundary (pk), lower boundary (pti).
Other values of the ips input are reserved for custom specific purposes. For () the output ite specifies the experiment error more closely. The function of the autotuner is illustrated in the following picture.
During the experiment, the output ite indicates the autotuner phases. In the phase of estimation of the response decay rate () the tuning experiment may be finished manually before its regular end. In this case the controller parameters are designed but the potential warning is indicated by setting the output ite=100.
Remark: The rising edge offon at TUNE input during the phases -2, -3 and -4 causes the finishing of the current phase and transition to the next one (or finishing the experiment in the phase -4).
At the end of the experiment (TBSY onoff), the function of the controller depends on the current controller mode. If the the designed controller parameters are immediately accepted.
This block propagates the signal quality. More information can be found in the 1.4 section.
Input
dv | Feedforward control variable | Double (F64) |
sp | Setpoint variable | Double (F64) |
pv | Process variable | Double (F64) |
tv | Tracking variable | Double (F64) |
hv | Manual value | Double (F64) |
MAN | Manual or automatic mode | Bool |
|
|
|
IH | Integrator hold | Bool |
|
|
|
TUNE | Start the tuning experiment | Bool |
TBRK | Stop the tuning experiment | Bool |
TAFF | Tuning affirmation | Bool |
|
|
|
ips | Meaning of the output signals | Long (I32) |
|
|
|
Parameter
irtype | Controller type (control law) 6 | Long (I32) |
|
|
|
RACT | Reverse action flag | Bool |
|
|
|
k | Controller gain 0.0 1.0 | Double (F64) |
ti | Integral time constant 0.0 4.0 | Double (F64) |
td | Derivative time constant 0.0 1.0 | Double (F64) |
nd | Derivative filtering parameter 0.0 10.0 | Double (F64) |
b | Setpoint weighting - proportional part 0.0 2.0 1.0 | Double (F64) |
c | Setpoint weighting - derivative part 0.0 2.0 | Double (F64) |
tt | Tracking time constant 0.0 1.0 | Double (F64) |
hilim | Upper limit of the controller output 1.0 | Double (F64) |
lolim | Lower limit of the controller output -1.0 | Double (F64) |
dz | Dead zone | Double (F64) |
icotype | Controller output type 1 | Long (I32) |
|
|
|
ittype | Controller type to be designed 6 | Long (I32) |
|
|
|
iainf | Type of apriori information 1 | Long (I32) |
|
|
|
DGC | Drift gradient compensation on | Bool |
|
|
|
tdg | Drift gradient estimation time [s] 60.0 | Double (F64) |
tn | Length of noise estimation period [s] 5.0 | Double (F64) |
amp | Tuning pulse amplitude 0.5 | Double (F64) |
dy | Tuning pulse get down threshold 0.0 0.1 | Double (F64) |
ispeed | Desired closed loop speed 2 | Long (I32) |
|
|
|
ipid | PID controller form 1 | Long (I32) |
|
|
|
Output
mv | Manipulated variable (controller output) | Double (F64) |
dmv | Controller velocity output (difference) | Double (F64) |
de | Deviation error | Double (F64) |
SAT | Saturation flag | Bool |
|
|
|
TBSY | Tuner busy flag | Bool |
TE | Tuning error | Bool |
|
|
|
ite | Error code | Long (I32) |
|
|
|
trem | Estimated time to finish the tuning experiment [s] | Double (F64) |
pk | Proposed controller gain | Double (F64) |
pti | Proposed integral time constant | Double (F64) |
ptd | Proposed derivative time constant | Double (F64) |
pnd | Proposed derivative component filtering | Double (F64) |
pb | Proposed weighting factor - proportional component | Double (F64) |
pc | Proposed weighting factor - derivative component | Double (F64) |
[Previous] [Back to top] [Up] [Next]
2024 © REX Controls s.r.o., www.rexygen.com