Siemens Simatic S7-200 System Manual page 161

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 could 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.
ITD
AIW0, AC0
DTR
AC0, AC0
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
/ Span) + Offset)
Norm
Raw
where:
R
is the normalized, real number value representation of the real world value
Norm
R
is the un-normalized or raw, real number value representation of the real world value
Raw
Offset
is 0.0 for unipolar values
is 0.5 for bipolar values
Span
is the maximum possible value minus the minimum possible value:
= 32,000 for unipolar values (typical)
= 64,000 for bipolar values (typical)
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:
64000.0, AC0
/R
+R
0.5, AC0
MOVR
AC0, VD100
//Convert an input value to a double word
//Convert the 32-bit integer to a real number
//Normalize the value in the accumulator
//Offset the value to the range from 0.0 to 1.0
//Store the normalized value in the loop TABLE
S7-200 Instruction Set
Chapter 6
6
149

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents