Appendix A: Linearization
Manual Number: 00650-014-4
Page A-1
Appendix A:
Linearization
A common requirement encountered in data acquisition is to linearize the output of non-linear
transducers such as thermocouples, RTDs, etc. The starting point for any linearizing algorithm is
knowledge of the calibration curve (input/output behavior) of the sensor. This may be derived
experimentally, or may be available in manufacturers data, or in standard tables.
There are several approaches to linearization. The two most common are (a) piecewise lineariza-
tion using look-up tables and (b) use of a mathematical function to approximate the non-linearity.
Amongst the mathematical methods, polynomial expansion is one of the easiest to implement.
The utility program, POLY.EXE, allows you to generate up to a 10th order polynomial approxima-
tion. For most practical applications, a fifth-order polynomial approximation is usually adequate.
Before you start the program have the input/output data or calibration data handy. This will be in
the form of x and f(x) values where x is the input to your system and f(x) is the resulting output. To
run the program, type
POLY
and
ENTER
at the command line. The program will then prompt you
for the desired order of the polynomial, then the number of pairs that you wish to use to generate
the polynomial. You then enter the data pairs and the polynomial is computed and displayed.
For example, given the following data points, lets generate a 5th order polynomial to approximate
this function:
[
I;
The order of the polynomial that you desire will be 5 and the number of data points that you enter
will be 11. After the data points are entered, the program gives the following output:
For the polynomial f(x) = C(0) + C(1)x
1
+ C(2)x
2
+ C(3)x
3
+ C(4)x
4
+ C(5)x
5
, the coefficients will
be:
COEFFICIENT (5) :
-0.003151
COEFFICIENT (4) :
0.081942
COEFFICIENT (3) :
-0.740668
COEFFICIENT (2) :
2.635998
COEFFICIENT (1) :
-2.816607
COEFFICIENT (0) :
2.956044
QUALITY OF SOLUTION (sum of the errors squared): 2.797989
The goal is to make the quality as close to 0 as possible. The program checks the resulting polyno-
mial with the data pairs that you entered. It computes the f(x) values for each x value entered using
the polynomial, subtracts the result from the supplied value of f(x), and then squares the result.
The squared results are then summed to compute the QUALITY. If the computed f(x) values were
exact, this value would be 0. But, since this is an approximation, this value will usually be some-
thing greater than 0.