Description
Original instructions
Function description
The function block produces a PID controller.
A system deviation ERR is formed because of the reference variable SP and the controlled variable PV. This deviation ERR causes the manipulated variable Y to change.
Initialization requirements
This function block performs an internal initialization in the first program cycle after a warm start or cold start (for examle application download or power cycle) of the PLC program.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EN and ENO can be configured as additional parameters.
For the proportional part of the controller to behave properly, the integral action must be reset (the input coefficient EN_I set to zero) for at least one scan time after a warm start or cold start.
If the integral action coefficient EN_I is set to a non-zero value at initialization, the function block behaves like an I or ID controller with no proportional part.
Properties
The function block has the following properties:
Transfer function
The transfer function is:
Explanation of the variables:
Variable
Description
YD
D component (only when EN_D = 1)
YI
I component (only when EN_I = 1)
YP
P component (only when EN_P = 1)
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL PID1_Instance (MAN:=ManualMode, HALT:=HaltMode, 
    SP:=SetpointValueInput, PV:=ProcessVariable,
    BIAS:=DisturbanceInput, EN_P:=P_Portion_On, 
    EN_I:=I_Portion_On, EN_D:=D_Portion_On, 
    D_ON_X:=D_PortionValueFlag, GAIN:=ProportionalRate, 
    TI:=ResetTime, TD:=DerivativeActionTime, 
    TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
    YMIN:=LowerControlLimit, YMAN:=ManualValue,
    Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
    QMAX=>Y_Reached_YMAX, QMIN=>Y_Reached_YMIN)
Representation in ST
Representation:
PID1_Instance (MAN:=ManualMode, HALT:=HaltMode, 
    SP:=SetpointValueInput, PV:=ProcessVariable,
    BIAS:=DisturbanceInput, EN_P:=P_Portion_On, 
    EN_I:=I_Portion_On, EN_D:=D_Portion_On, 
    D_ON_X:=D_PortionValueFlag, GAIN:=ProportionalRate, 
    TI:=ResetTime, TD:=DerivativeActionTime, 
    TD_LAG:=LagTimeD_Portion, YMAX:=UpperControlLimit,
    YMIN:=LowerControlLimit, YMAN:=ManualValue,
    Y=>ManipulatedVariable, ERR=>OutputSystemDeviation,
    QMAX=>Y_Reached_YMAX, QMIN=>Y_Reached_YMIN) ;
Parameter description
Description of input parameters:
Parameter
Data type
Description
MAN
"1": Manual mode
HALT
BOOL
"1": Halt mode
SP
Setpoint input
PV
REAL
Controlled variable (process variable)
BIAS
REAL
Disturbance input
EN_P
BOOL
"1": P component on
EN_I1
BOOL
"1": I component on
EN_D
BOOL
"1": D component on
D_ON_X
BOOL
"1": D component on controlled variable
"0": D component on system deviation
GAIN
REAL
Proportional action coefficient (gain)
TI
Integral time
TD
TIME
Derivative time
TD_LAG
TIME
Delay, D component
YMAX
REAL
Upper limit
YMIN
REAL
Lower limit
YMAN
REAL
Manually manipulated value
1Refer to Initialization Requirements.
Description of output parameters:
Parameter
Data type
Description
ERR
REAL
Output system deviation
Y
REAL
Manipulated variable
QMAX
BOOL
"1" = Output Y has reached upper limit
QMIN
BOOL
"1" = Output Y has reached lower limit
Runtime error
If YMAX < YMIN an error messages appears.
NOTE: For a list of all block error codes and values, see Tables of Error Codes for the Obsolete Library.