PID processing instruction
This implementation allows you to set the parameters of F355_PID directly using arguments:
Input
FALSE: Manual setting of MV possible
TRUE: Automatic PID controlled MV
FALSE: Inverse control (heating)
TRUE: Forward control (cooling)
FALSE: PI-D control
TRUE: I-PD control
Set point value, range 0-10000
Process value, range 0-10000
Proportional gain, range: 1-9999, unit: 0.1
Integral time, range: 1-30000, unit: 0.1s
Derivative time, range: 1-10000, unit: 0.1s
Sampling time, range: 1-6000, unit: 0.01s
MV lower limit, range: 0-10000
MV upper limit, range: 1-10000
Input/output
Manipulated value
Auto-tuning is not possible using PID_FB. For this, use PID_FB_DUT.
The value for MV can be assigned externally either when the program is initialized or when the value of Automatic is FALSE.
In order to achieve maximum resolution and minimum dead time beyond LowerLimit and UpperLimit, their values should, if possible, cover the entire range of 0–10000.
if the parameter settings are outside the permissible range
if the parameter settings are outside the permissible range
In the global variable list you define variables that can be accessed by all POUs in the project.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR_EXTERNAL
Set_Value_SP: INT:=0;
(*A/D CH0*)
Process_Value_PV: INT:=0;
(*A/D CH1*)
Output_Value_MV: INT:=0;
(*D/A*)
END_VAR
VAR
PID_Control: PID_FB;
(*PID Parameters*)
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 15 ;
NETWORK_BODY
B(B_FB,PID_FB!,PID_Control,11,1,19,15,,?BAutomatic?BForward?BI_PD?BSP?BPV?BKp?BTi?BTd?BTs?BLowerLimit?BUpperLimit?BMV?AMV);
B(B_VARIN,,TRUE,9,2,11,4,);
B(B_VARIN,,FALSE,9,3,11,5,);
B(B_VARIN,,FALSE,9,4,11,6,);
B(B_VARIN,,Set_Value_SP,9,5,11,7,);
B(B_VARIN,,Process_Value_PV,9,6,11,8,);
B(B_VARIN,,15,9,7,11,9,);
B(B_VARIN,,200,9,8,11,10,);
B(B_VARIN,,1,9,9,11,11,);
B(B_VARIN,,10,9,10,11,12,);
B(B_VARIN,,0,9,11,11,13,);
B(B_VARIN,,1000,9,12,11,14,);
B(B_VARIN,,Output_Value_MV,9,13,11,15,);
L(1,0,1,15);
END_NETWORK_BODY
END_NET_WORK
END_BODY
PID_Control( Automatic:= TRUE,
Forward:= FALSE,
I_PD:= FALSE,
SP:= Set_Value_SP,
PV:= Process_Value_PV,
Kp:= 15,
Ti:= 200,
Td:= 1,
Ts:= 10,
LowerLimit:= 0,
UpperLimit:= 1000,
MV:= Output_Value_MV);