Template for publishing FAQs in the Internet April 2005
The S7-1200 has a one of the most complete PID controller of the SIMATIC world. Your tuning tool, for
example, makes your use very practical.
Some applications, however, are very simple, and don’t need all of the potential of the intern S7-1200
PID controller. For this very simple application, the follow “lean” version of PID controller could be a
choice.
He has a clean list of parameter that makes your use for simple application, that doesn’t needs of
tuning tools. He has an auto detection of its call time, so he could be place in any cycle or time OB
without any special adjusts. Your open source could also easily adapt for special uses.
[[Link]]
Parameter description
The parameter of the PID lean follow the S7-300/S7-400 (in a simplified way) description as decrypted
follow:
Parameter Data Range of Default Description
Type Values
SP REAL -100.0...100. 0.0 SETPOINT
0 (%)
or phys. value
at same unit as
PV
PV REAL -100.0...100. 0.0 PROCESS
0 (%) VARIABLE
or phys. value
at same unit as
SP
Gain REAL 2.0 PROPORTIONAL
GAIN
Specifies the
Template for publishing FAQs in the Internet April 2005
controller gain.
Ti TIME >= CYCLE T#20s INTEGRATION
TIME
Determines the
time response of
the integrator
If Ti = 0s, the PID
integration is
deactivated
TD TIME >= CYCLE T#10s DERIVATIVE
TIME
The “derivative
time” input
determines the
time response of
the derivative unit.
If Ti = 0s, the PID
integration is
deactivated
Tm_lag TIME >= CYCLE T#2s TIME LAG OF
THE
DERIVATIVE
ACTION
The algorithm of
the D action
includes a time
lag that can be
assigned at the
“time lag of the
derivative action”
input.
Man_ON BOOL TRUE MANUAL VALUE
ON
If the input
“manual value on”
is set, the control
loop is
interrupted. A
manual value
(MAN) is set as
the manipulated
value (LMN).
MAN REAL -100.0...100. 0.0 MANUAL VALUE
0 (%) MAN value is
or phys. value passed to LMN
at same unit as when Man_ON is
LMN true.
LMN_HI REAL -100.0...100. 0.0 MANIPULATED
0 (%) VALUE HIGH
or phys. value LIMIT
at same unit as The manipulated
LMN value is always
limited by an
upper and lower
limit. The
“manipulated
value high limit”
input specifies the
upper limit.
LMN_LO REAL -100.0...100. 0.0 MANIPULATED
Template for publishing FAQs in the Internet April 2005
0 (%) VALUE LOW
or phys. value LIMIT
at same unit as The manipulated
LMN value is always
limited by an
upper and lower
limit. The
“manipulated
value low limit”
input specifies the
lower limit.
Reset BOOL TRUE COMPLETE
RESTART
The block has a
complete restart
routine that is
processed when
the input
“complete restart”
is set.
LMN REAL 0.0 MANIPULATED
VALUE
The effective
manipulated value
is output in
floating point
format at the
“manipulated
value” output.
Algorithmic
In manual mode (Man_ON = TRUE) the MAN value is passed to LMN (limited to LMN_HI, LMN_LOW).
In automatic mode (Man_ON = TRUE) the LMN is calculated as follow:
ER = SP – PV
Delta Time = time interval between the actual call and the last call of the FB.
Delta ER = ER – ER of the previous cycle
LMN = LMN_P + LMN_I + LMN_D
LMN_P (proportional part of the PID) = ER *Gain
LMN_I (proportional part of the PID) = ER *Gain * Delta Time / Ti
Notes:
If Ti = 0, then LMN_I = 0
If LMN > LMN_HI or LMN < LMN_LO or Man_On = True then LMN_I = LMN – LMN_P – LMN_I
LMN_D (derivative part of the PID) = Tm_lag * Delta ER / (Delta Time * Tm_lag / Td + 1 ) + LMN_D * (
1 + Delta Time * Tm_lag / Td)
Notes:
If Td = 0, then LMN_D = 0
Template for publishing FAQs in the Internet April 2005
Important:
The sample program is freeware. Any user can use copy and forward this program FREE OF
CHARGE. The authors and owners of this program take no responsibility whatsoever for the
functionality and compatibility of this software. Use of the software is entirely at the user's own risk.
Since this software is free of charge, there is no warranty, nor claim for error correction and hotline
support.