Siemens SIMATIC S7-200 System Manual page 164

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

S7-200 Programmable Controller System Manual
The following instruction sequence shows how to scale the loop output:
MOVR
VD108, AC0
- -R
0.5, AC0
*R
64000.0, AC0
Next, the scaled, real number value representing the loop output must be converted to a 16-bit
integer. The following instruction sequence shows how to do this conversion:
ROUND AC0, AC0
DTI
AC0, LW0
MOVW
LW0, AQW0
Forward- or Reverse-Acting Loops
The loop is forward-acting if the gain is positive and reverse-acting if the gain is negative. (For I or
ID control, where the gain value is 0.0, specifying positive values for integral and derivative time
will result in a forward-acting loop, and specifying negative values will result in a reverse-acting
loop.)
Variables and Ranges
The process variable and setpoint are inputs to the PID calculation. Therefore the loop table fields
for these variables are read but not altered by the PID instruction.
The output value is generated by the PID calculation, so the output value field in the loop table is
updated at the completion of each PID calculation. The output value is clamped between 0.0 and
1.0. The output value field can be used as an input by the user to specify an initial output value
when making the transition from manual control to PID instruction (auto) control of the output. (See
the discussion in the "Modes" section below).
If integral control is being used, then the bias value is updated by the PID calculation and the
updated value is used as an input in the next PID calculation. When the calculated output value
goes out of range (output would be less than 0.0 or greater than 1.0), the bias is adjusted
according to the following formulas:
MX
=
or
MX
=
where:
MX
MP
n
MD
n
M
n
By adjusting the bias as described, an improvement in system responsiveness is achieved once
the calculated output comes back into the proper range. The calculated bias is also clamped
between 0.0 and 1.0 and then is written to the bias field of the loop table at the completion of each
PID calculation. The value stored in the loop table is used in the next PID calculation.
The bias value in the loop table can be modified by the user prior to execution of the PID
instruction in order to address bias value problems in certain application situations. Care must be
taken when manually adjusting the bias, and any bias value written into the loop table must be a
real number between 0.0 and 1.0.
A comparison value of the process variable is maintained in the loop table for use in the derivative
action part of the PID calculation. You should not modify this value.
150
//Moves the loop output to the accumulator
//Include this statement only if the value is bipolar
//Scales the value in the accumulator
//Converts the real number to a 32-bit integer
//Converts the value to a 16-bit integer
//Writes the value to the analog output
1.0
- -
(MP
+ MD
n
- - (MP
+ MD
)
n
n
is the value of the adjusted bias
is the value of the proportional term of the loop output at sample time n
is the value of the differential term of the loop output at sample time n
is the value of the loop output at sample time n
)
when the calculated output M
n
when the calculated output M
> 1.0
n
< 0.0
n

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents