Program instructions
7.9 PID
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
317
7.9.3
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 //Convert an input value to a double word
DTR AC0, AC0
//Convert the 32-bit integer to a real number
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
Norm
= ((R
Raw
/ Span) + Offset)
where:
R
Norm
is the normalized, real number value representation of the real world value
R
Raw
is the un-normalized or raw, real number value representation of the real world
value
Offset
is 0.0 for unipolar values
is 0.5 for bipolar values
Span
is the maximum possible value minus the minimum possible value:
= 27,648 for unipolar values (typical)
= 55,296 for bipolar values (typical)
The following instruction sequence shows how to normalize the bipolar value in AC0 (whose
span is 55,296) as a continuation of the previous instruction sequence:
/R
55296.0, AC0 //Normalize the value in the accumulator
+R
0.5, AC0
//Offset the value to the range from 0.0 to 1.0
MOVR AC0, VD100 //Store the normalized value in the loop TABLE
Содержание SIMATIC S7-200
Страница 30: ...Product overview 1 7 Programming software S7 200 SMART 30 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 267: ...Program instructions 7 6 Counters S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 267 HSC modes 3 and 4 ...
Страница 394: ...Program instructions 7 18 Subroutine S7 200 SMART 394 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 425: ...Communication 8 5 PROFIBUS S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 425 ...
Страница 786: ...Technical specifications A 11 S7 200 SMART cables S7 200 SMART 786 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 798: ...Error codes C 4 PLC fatal error codes S7 200 SMART 798 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 848: ...Ordering information F 6 Human Machine Interface devices S7 200 SMART 848 System Manual V2 3 07 2017 A5E03822230 AF ...