Name: PID_Timed

Type: Function block

Language type: ST

Description:

PID procedure. Integral part is calculated with Tustin method. Td is lower limited to 6*Tsample Dead zone: udz, ldz: error is 0 for measure between [setpoint-ldz;setpoint+udz] and increases linearly outside this interval. With bumpless I part is updated in order to match P+offset part (limited [0,1000])+I with manual out. Bumpless AutoManual Reset Out Note F F F ManualOut P,I,D runs F F T ManualOut P,I,D = 0 F T F P+I+D+OffsetOut Eventually limited by MaxVar F T T OffsetOut P,I,D = 0 T F F ManualOut P,D runs; I=ManualOut-P-OffsetOut T F T ManualOut P,I,D = 0 T T F P+I+D+OffsetOut Eventually limited by MaxVar T T T OffsetOut P,I,D = 0 ARW input: Anti Reset Windup Time If ARW = 0 function is disabled If ARW <>0 its absolute value must be greater than Tsample ARW acts desaturating linearly I part when output is 100% or 0% I part is desaturated, when output is 100%, up to -OffsetOut I part is desaturated, when output is 0% and I part lower than -OffsetOut, up to -OffsetOut Suggested values: ARW=-Ti/10 for PI ARW=-SQRT(TixTd) for PID NOTE: It must be used in Timed Task and a defined instance can be executed only once per cycle. Warning: each PLC cycle the refresh is mandatory

Input:

Name Type Description
measure INT Measure to be controlled
setpoint INT Setpoint, same unit measure of measure
OffsetOut INT Fixed offset when pid works [0...1000]
reverse BOOL false=(p_pid increase with input) true= (p_pid decrease with input)
lowdeadzone UINT dead zone error, same unit measure of measure
updeadzone UINT dead zone error, same unit measure of measure
Tsample USINT Pid Output Update Period [sec/10] (default=1)
Pb UINT Proportional Band, same unit measure of in_pid
Ti UINT Integral Time: 0 disabled, 1...xxx [sec/10] >2xTsample
Td UINT Derivative Time 0 disabled 1...xxx [sec/10]
ARW INT Anti reset windup Time: 0 disabled [sec/10] See also block description
MaxSpeed USINT Maximum out variation per second (0 disabled 1-100%/sec)
Bumpless BOOL I part updated in order to match manual out (Ti must be >0)
AutoManual BOOL if False Manual Control the output reaches manualOut
reset BOOL if TRUE the output reaches OffsetOut
ManualOut INT Pid Output with manual control [0...1000]

Output:

Name Type Description
outH INT Output saturated at 1000 in case of probe error and pid working
outP INT Output paused in case of probe error
outL INT Output forced to 0 in case of probe error and pid working
Prop INT Prop part Output [0...1000] Always running if bumpless is True
Integ INT Integral part Output [0...1000] Always running if bumpless is True
Deriv INT Derivative part Output [0...1000] Always running if bumpless is True
Error INT (measure-setpoint) minus dead zone control