PIDU – PID controller unit

Block SymbolLicensing group: STANDARD
Qt SVG Document Exported by REXYGEN Studio dv sp pv tv hv MAN IH mv dmv de SAT PIDU

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 (MAN = off) and manual modes (MAN = on).

In automatic mode (MAN = off), the PIDU block executes the PID control law with two degrees of freedom as follows:

U(s) = ±K bW(s) Y (s) + 1 Tis W(s) Y (s) + Tds Td N s + 1 cW(s) Y (s) + Z(s)

where U(s) is Laplace transform of the manipulated variable mv, W(s) is Laplace transform of the setpoint variable sp, Y (s) is Laplace transform of the process variable pv, Z(s) is Laplace transform of the feedforward control variable dv and K, Ti , Td, N, b and c 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 (IH = on). 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 tt Ti Td, and for the PI controller, it is tt Ti2. 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 K = 0 disables the controller. Negative values are not allowed (use the RACT parameter for negative effect instead). Setting the integral time constant to Ti = 0 disables the integral component of the controller (same effect as disabling it with the irtype parameter). For Td = 0, 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 PIDU 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:

  • Analog - standard block mode,
  • PWM - mode suitable for connecting the output mv to the input of pulse-width modulated regulation PWM,
  • SCU - mode for connection with a step controller with position feedback SCU,
  • 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 PIDU and SCUV blocks, it is recommended to set the setpoint weighting factor for the derivative component c to zero.

In the manual mode (MAN = on), the input hv is copied to the output mv unless saturated. The overall control function of the PIDU block is quite clear from the following diagram:

image/svg+xmlRACT RACT RACT AUT MAN dv sp pv tv hv MAN mv de SAT dmv IH 0 0 icotype=SCUV 0 1 1 0 1 0 0 1 0 1 4 3 2 1 1Tt 1s KTi KTd.sTd/N.s+1 NOT AND OR diff +−1 +−1 c K +−1 b 7 6 5 4 3 2 1

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

off ..

Automatic mode

on ...

Manual mode

IH

Integrator hold

Bool

off ..

Integration enabled

on ...

Integration disabled

Parameter

irtype

Controller type (control law)  6

Long (I32)

1 ....

D

2 ....

I

3 ....

ID

4 ....

P

5 ....

PD

6 ....

PI

7 ....

PID

RACT

Reverse action flag

Bool

off ..

Higher mv -> higher pv

on ...

Higher mv -> lower pv

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)

1 ....

Analog

2 ....

PWM

3 ....

SCU

4 ....

SCUV

Output

mv

Manipulated variable (controller output)

Double (F64)

dmv

Controller velocity output (difference)

Double (F64)

de

Deviation error

Double (F64)

SAT

Saturation flag

Bool

off ..

The controller implements a linear control law

on ...

The controller output is saturated

2024 © REX Controls s.r.o., www.rexygen.com