5 — VEHICLE CONTROL LANGUAGE (VCL)
Curtis Model 1351 – December 2018
Return to TOC
pg. 84
MAP_TWO_POINTS()
is function interpolates values between two points, Y1 and Y2; based upon an
X input parameter.
Interpolating based on X1 and X2.
Typical Usage:
1. Calculate a value framed between two X-axis points projected across two Y
points, where the functions’ output is the value of the Y-axis intersection.
2. Extend the 7 pair limitation of the Setup_Map function by the use of multiple
If, If Else statements on segments of an XY array.
Map_Two_Points(X,X1,X2,Y1,Y2)
:
X Input.
X1 Input point X1.
X2 Input point X2.
Y1 Output point Y1.
Y2 Output point Y2.
:
n Mapped value.
:
None
Code Example: Convert a controller value, such as Steer_Angle, to a voltage.
e input (X) is the Steer_Angle variable, where X1-X2 is an angle between 0
and 90 Degrees. e output is the interpolated value across Y-axis points in Volts.
Enable the expansion of the Setup_Map(16) function beyond the seven (7) point-
pair by the use of multiple If, If Else statements on segments of a two point XY
array. For Example:
If(X < 1)
{
Y = Map_2_Points(X, X1, X2, Y1, Y2)
}
Else If(0<= X <= 1)
{
Y = Map_two_Points(X, X1, X2, Y1, Y2)
}
Else If(1< X <= 2)
{
Y = Map_Two_Points(X, X1, X2, Y1, Y2)
}
Else If(2< X <= 3)
{
Y = Map_Two_Points(X, X1, X2, Y1, Y2)
}
Etc.