Description
Original instructions
Function description
The function block produces a PID controller.
Initialization Requirements
This function block performs an internal initialization in the first program cycle after a warm start or cold start (e.g. 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 PID_Instance (SP:=ReferenceVariable, 
    PV:=ControlledVariable, MODE:=OperatingModes, 
    PARA:=Parameter, FEED_FWD:=Disturbance, 
    YMAN:=ManualManipulatedValue, Y:=ManipulatedVariable, 
    ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y)
Representation in ST
Representation:
PID_Instance (SP:=ReferenceVariable, 
    PV:=ControlledVariable, MODE:=OperatingModes, 
    PARA:=Parameter, FEED_FWD:=Disturbance, 
    YMAN:=ManualManipulatedValue, Y:=ManipulatedVariable, 
    ERR=>SystemDeviation, STATUS=>StatusOfOutput_Y) ;
PID parameter description
Description of input parameters:
Parameter
Data type
Description
SP
Reference variable
PV
REAL
Controlled variable
MODE
Operating mode
PARA
Parameter
FEED_FWD
REAL
Disturbance variable
YMAN
REAL
Manually manipulated value
Description of input / output parameters:
Parameter
Data type
Description
Y
REAL
Manipulated variable
Description of output parameters:
Parameter
Data type
Description
ERR
REAL
System deviation
STATUS
Y output status
Parameter description Mode_PID
Data structure description
Element
Data type
Description
man
"1": Manual mode
halt
BOOL
"1": Halt mode
en_p
BOOL
"1": P component on
en_i1
BOOL
"1": I component on
en_d
BOOL
"1": D component on
d_on_pv
BOOL
"1": D component in relation to the controlled variable
"0": D component in relation to the system deviation
1Refer to Initialization Requirements.
Parameter description Para_PID
Data structure description
Element
Data type
Description
gain
Proportional action coefficient (gain)
ti
Integral time
td
TIME
Derivative time
td_lag
TIME
Delay of the D component
ymax
REAL
Upper limit
ymin
REAL
Lower limit
Parameter description Stat_MAXMIN
Data structure description
Element
Data type
Description
qmax
"1" = Y has reached the upper control limit
qmin
BOOL
"1" = Y has reached the lower control limit
Error message
An error message is returned if
NOTE: For a list of all block error codes and values, see Tables of Error Codes for the Obsolete Library.