Siemens Simatic S7-200 System Manual page 247

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

Advertisement

Converting and Normalizing the Loop Inputs
A loop has two input variables, the setpoint and the process variable. The setpoint is
generally a fixed value such as the speed setting on the cruise control in your automobile.
The process variable is a value that is related to loop output and therefore measures the
effect that the loop output has on the controlled system. In the example of the cruise control,
the process variable would be a tachometer input that measures the rotational speed of the
tires.
Both the setpoint and the process variable are real world values whose magnitude, range,
and engineering units may be different. Before these real world values can be operated upon
by the PID instruction, the values must be converted to normalized, floating-point
representations.
The first step is to convert the real world value from a 16-bit integer value to a floating-point
or real number value. The following instruction sequence is provided to show how to convert
from an integer value to a real number.
XORD
MOVW
LDW>=
JMP
NOT
ORD
LBL
DTR
The next step is to convert the real number value representation of the real world value to a
normalized value between 0.0 and 1.0. The following equation is used to normalize either the
setpoint or process variable value:
R
= (R
Norm
where:
R
Norm
R
Raw
Offset
Span
The following instruction sequence shows how to normalize the bipolar value in AC0 (whose
span is 64,000) as a continuation of the previous instruction sequence:
/R
+R
MOVR
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02
AC0, AC0
// Clear the accumulator.
AIW0, AC0
// Save the analog value in the accumulator.
AC0, 0
// If the analog value is positive,
0
// then convert to a real number.
// Else,
16#FFFF0000, AC0
// sign extend the value in AC0.
0
AC0, AC0
// Convert the 32-bit integer to a real number.
/ Span) + Offset)
Raw
is the normalized, real number value representation of the real world value
is the un-normalized or raw, real number value representation of the real world
value
is 0.0 for unipolar values
is 0.5 for bipolar values
is the maximum possible value minus the minimum possible value
= 32,000 for unipolar values (typical)
= 64,000 for bipolar values (typical)
64000.0, AC0
// Normalize the value in the accumulator
0.5, AC0
// Offset the value to the range from 0.0 to 1.0
AC0, VD100
// Store the normalized value in the loop TABLE
Instruction Set
10-59

Advertisement

Table of Contents
loading

Table of Contents