FX Series Programmable Controllers Points Of Technique 10
10-24
10.15 PID Programming Techniques
10.15.1 Keeping MV within a set range
In the reserved re
isters of the PID data block S
3
+18 and S
3
+19 form a double word device
that contains the previous MV x K100. The followin
pro
ram uses this to keep MV under
control when it exceeds the operatin
limits.
Example Pro
ram to keep MV in the ran
e K100 to K5000
If data re
isters are used to hold the limit values, it is possible to use a MUL instruction instead
of the DMOV. E.
. When D50 is upper limit use: MUL D50 K100 D38 because the result of
MUL is alread
a double word DMUL is not needed.
Resettin
(S
3
+19, S
3
+18) in this wa
prevents runawa
, which occurs if onl
MV is chan
ed.
10.15.2 Manual/Automatic change over
In order to switch from automatic (PID) control to manual control and back to automatic it is
necessar
for the PID process to perform 'Manual Trackin
'. Althou
h the FX PID instruction
does not have a manual trackin
feature there are two methods that can be used to make the
switch from manual back to automatic as trouble free as possible.
To understand the reason for the two methods the followin
should be noted. The PID
instruction sets its initial output value based on the initial value of the output re
ister.
When the PID instruction is switched on it can onl
do P as it has onl
1 data readin
. On the
first readin
the current value of the output re
ister is used as
∆
MV. Thereafter the previous
output value is used (stored in S
3
+18, S
3
+19).
After the next readin
PI can be calculated and from the third readin
full PID is performed.
Please see section 5.98, PID (FNC 88), for the complete equations.
Method 1
It is recommended that if manual to auto switchin
is desired that the PID instruction is
switched off durin
manual operation and the operator controls the value of the MV re
ister
(the Output Value). When returnin
to auto mode, the PID instruction is switched on a
ain and
uses the last MV input b
the operator durin
the first PID calculation. After 3 readin
s full PID
will be operatin
and the process should be under control quickl
. (Assumin
that manual
control did not cause a move too far from the Set Point.)
X10
D18 D19 D20 D46PID
K100 K5000 D46 M20ZCP
M20
K100 D46MOV
K10000 D38DMOV
M22
K5000 D46MOV
K500000 D38DMOV
SV
PV
Data
Block
MV
MV
MV
MV
MV
n-1
x
K100
MV
n-1
x
K100
Below
Lower Limit
Above
Upper Limit
Reset PID data to upper limit
MV > 5000: Fix MV to upper limit
Reset PID data to lower limit
MV < 100: Fix MV to lower limit
Check MV against range