IPID
Process regulator that uses the feedback concept to regulate the
process variable according to the difference between its current value and the value of the
set point. PID achieves calculation by a method of sampling.

Parameter values for IPID function block:
Parameter | Data Type | Description | ||
---|---|---|---|---|
PV | REAL | Process variable. This value must be a REAL value.
Infinity or Not a Number (NaN) values are not supported by this input. | ||
SP | REAL | Set point. This value must be a REAL value.
Infinity or Not a Number (NaN) values are not supported by this input. | ||
Auto | BOOL | Determines whether IPID operates in AUTO or MANUAL mode.
| ||
XO | REAL | Adjustment value. This value must be a REAL value. Infinity or Not a Number (NaN)
values are not supported by this input. In MANUAL mode, Xout = XO | ||
Kp | REAL | Proportionality constant. This value must be a
REAL value. Infinity or Not a Number (NaN) values are not supported by this
input. | ||
Ti | TIME | Integral time constant. Possible values range from 0ms to 23hr59m59s999ms. | ||
Td | TIME | Derivative time constant. Possible values range from 0ms to 23hr59m59s999ms. | ||
Ts | TIME | Minimum sample period. If Ts is less than the application scan time, uses the application scan time as
the effective sample interval. The maximum effective sample period is Ts plus the application scan time. Possible values range from 0ms to 23hr59m59s999ms. | ||
Tdf | TIME | Derivative time constant. Possible values range from 0ms to 23hr59m59s999ms. | ||
Xmax | REAL | Maximum value of Xout. This value must be a REAL
value. Infinity or Not a Number (NaN) values are not supported by this
input. | ||
Xmin | REAL | Minimum value of Xout. This value must be a REAL
value. Infinity or Not a Number (NaN) values are not supported by this
input. | ||
INCstop | BOOL | Increment stop. | ||
DECstop | BOOL | Decrement stop. | ||
Derr | BOOL | Derivative action switch. TRUE = error FALSE = PV | ||
Fwd | BOOL | Gain action. TRUE = forward acting | ||
Xout | REAL | IPID function block output. Action required on the system to keep the regulation. Xout recalculates when
taking each sample. | ||
LIMIThi | BOOL | TRUE if Xout clamps at the maximum value of
Xmax. | ||
LIMITlo | BOOL | TRUE if Xout clamps at the minimum value of
Xmin. | ||
DQP | REAL | Delta output due to proportional action | ||
DQI | REAL | Delta output due to integral action | ||
DQD | REAL | Delta output due to derivative action | ||
DXout | REAL | Total delta output |
TIP:
Loss of precision and underflow may
occur.
When Xmax < Xmin, the function assumes that the values are reversed and
swaps the values. The Reversed error counter increments each time the function has to swap
the parameters.
When overflow occurs during execution, the stored error and delta
terms set to zero.
In AUTO mode:
- Xout sets to zero
- LIMIThi sets to FALSE
- LIMITlo sets to FALSE
In MANUAL mode:
- Xout sets to XO clamped to the range Xmin to Xmax
- LIMIThi sets to XO > Xmax
- LIMITlo sets to XO < Xmin
AUTO Mode Operation
When a new sample is made and Auto
= TRUE, calculates the output Xout:
Xout = Xout + Kp
* ( dE[t] + I[t]/Ti + fddD[t] * Td /
T)
where
E[t] = SP - PV (error) dE[t] = E[t] - E(t-1) (delta error) I[t] = ( E[t] * T ) (integral term) fddD[t] = ddD[t] filtered, first order lag, time constant Tdf ddD[t] = dE[t] - dE[t-1] if Derr = true (delta delta error) ddD[t] = dPV[t-1] - dPV[t] if Derr = false (delta delta PV) dPV[t] = PV[t] - PV[t-1] (delta PV)
E[t-1] is the stored error value. This is
the value during the last sample.
PV[t-1] is the stored process variable. This is the
value during the last sample.
T is the elapsed time in milliseconds since the last
sample.
The results of calculation are given as
outputs:
DQP = Kp * dE[t] (delta proportional term) DQI = Kp * I[t]/Ti (delta integral term) DQD = KP * fddD[t] * Td / T (delta derivative term) DXout = DQP + DQI + DQD (delta total output)
When Ti <10ms, the
integral term sets to zero to avoid excessive action.
Using the Fwd input, swap the
action between reverse and direct acting. When Fwd = False, a positive Kp gives a rising
output on falling PV (reverse action). When Fwd = True, a positive Kp gives a falling output
on falling PV (direct action). Setting a negative value to Kp also inverts the
action.
After calculating Xout, applies the increment stop (INCstop), decrement stop
(DECstop) and the clamp (Xmax and Xmin). When INCstop = TRUE and Xout has increased since
the last sample or if DECstop = TRUE and Xout has decreased since the last sample, Xout sets
to its previous value. When Xout > Xmax or Xout < Xmin:
- Xout clamps to the range Xmin to Xmax
- LIMIThi sets to Xout > Xmax
- LIMITlo sets to Xout < Xmin
When INCstop, DECstop or the clamp are active, the output Xout stays at its last
value. The results of calculation (DQP, DQI, DQD, DXout) continue updating. On
initialization, INCstop and DECstop have no effect.
MANUAL
Mode Operation
For new samples where Auto = FALSE, the output Xout immediately follows
the adjustment value (XO) clamped to the range Xmin to Xmax. LIMIThi sets to XO > Xmax
and LIMITlo sets to XO < Xmin. The stored error term sets to (SP - PV) and the stored
delta terms set to zero. The increment and decrement stop (INCstop and DECstop) have no
effect.
Function Block Diagram Example
(*FBD example
with IPID function block*)

Structured Text
Example
IPID(Process1, 25.5, Mode, Adjust, Proportion, IntegralT, DerivativeT, T#20ms, ConstantT, 101.2, 91.8, Increment, Decrement, ActionSwitch, GainAction); Result:= PID_II.Xout; High := PID_II.LIMIThi; Low := PID_II.LIMITlo; DeltaP := IPID.DQP; DeltaI := IPID.DQI; DeltaD := IPID.DQD; DeltaTotal := IPID.DXout;
Provide Feedback