Piecewise table block operation – Micromod MOD: 1800P - MOD 30ML Identity Module (Version 2) Algorithms, Tables and Sequential Logic Functions User Manual
Page 117
Logic Functions - Book 2
PIECEWISE TABLE BLOCK
9-5
9.2.1
Piecewise Table Block Operation
When a piecewise linearization is specified, the input value to the linearization block is
compared to the X coordinate values of the points in the table. The comparison starts with the
second point and continues sequentially until either the last point is reached or a point is found
for which the X coordinate value is greater than or equal to the input value. The linearized
output value is then calculated as:
(Y2 - Y1)
Output = --------- * (Input - X1) + (Y1)
(X2 - X1)
where X2,Y2 are the coordinates for the first point having an X value greater than or equal to
the input (or the last point in the table) and X1,Y1 are the coordinates for the previous point in
the table.
The points must be ordered in the table with increasing values for X (there can be no duplicate
X values). When the input value is less than the X coordinate value of the first point, the slope
of the line between the first and second points is used to extrapolate the output value.
Likewise, if the input value is greater than the X coordinate value of the last point in the table,
the slope of the line between the last and second last points is used to extrapolate the output
value. If endpoint clamping is desired, flat segments must be specified with the first and last
pair of points. For example, the following table will cause the output to be clamped at 10.0 on
the low end and 1000.0 at the high end:
X
Y
1.
0.0
10.0
2.
10.0
10.0
3.
30.0
100.0
4.
50.0
400.0
5.
75.0
800.0
6.
90.0
1000.0
7.
100.0
1000.0
When an inverse piecewise linearization is specified, the same algorithm is used except that
the Y coordinate values are used in place of the X coordinate values. An example of a
piecewise and inverse piecewise linearization is shown in Figure 9-3.
The configurator performs the following checks on the piecewise table block to determine if
the table can be piecewise or inverse piecewise.
•
At least 2 points must be entered (60 points maximum).
•
For each point, both the X and Y values must be entered.
•
If the X values are in ascending order with no duplicates, the table is marked as usable for
piecewise linearization.
•
If the Y values are in ascending order with no duplicates, the table is marked as usable for
inverse piecewise linearization.