Table of Contents

Software Linearization of a Thermocouple


Before thermocouple linearization algorithms can be used to convert the thermocouple junction voltage into temperature values, the physical parameters must be captured and converted into data the computer can process.

Rex Klopfenstein, Jr., King Industries, Inc.

Thermocouple data acquisition requires signal conditioning hardware to convert the thermocouple junction's millivolt values into signals compatible with the input channels of the data acquisition (DA) hardware. If the thermocouple is remote from the DA hardware, a transmitter/receiver pair must be used to prevent loss of information or introduction of noise. The most common operating mode for such pairs is a 4-20 mA current loop. Transmitter/receivers have the ability to scale and offset the relationship between the transmitter input (thermocouple voltage levels) and the receiver output voltage (0-5, 1-5, and 0-10 V). These adjustments permit the thermocouple's operating range to be scaled to use the full dynamic range of the A/D converter (ADC) in the DA system.

A second input channel is needed to monitor the reference junction temperature. If a monolithic linear temperature sensor is used for this purpose, a voltage input channel is also required. These sensors need a 4-20 VDC power supply and several external passive components (resistors and capacitors). After the ADC units have been converted by software routines into output voltage values, the following algorithms can be used to generate temperature readings.

Reference Junction Compensation
Before converting the thermoelectric voltages into equivalent temperature values, it is necessary to compensate for voltages generated at the point where the thermocouple material joins the copper wires of the signal conditioning circuitry (J2 in Figure 1).

Figure 1. The thermocouple circuit consists of sections of thermocouple wire joined to form the temperature-sensing junction. The thermocouple wires are then connected to copper wires, forming the reference junction. Data from a temperature sensor incorporated into the reference junction are used to compensate for voltages generated at the reference junction.
The conversion tables and algorithms provided by the National Institute of Standards and Technology (NIST) are based on the reference junction's being maintained at 0ºC [1], but in most applications this is impractical.
Photo 1. The LM35 IC temperature sensor has a linear, 10 mV/ºC temperature-to-voltage relationship, making it useful in applications such as cold-junction compensation circuits. It requires no external calibration or trimming to provide typical accuracies of ±1/4ºC at room temperature and ±3/4ºC over a 55ºC to 150ºC temperature range. The sensor is available in TO-46, TO-92, and TO-220 as well as the SO-8 shown here. (Photo courtesy of National Semiconductor.)

Several techniques can be used to compensate for reference junction temperatures that deviate from 0ºC. If the reference junction temperature is maintained in the 0ºC-50ºC range, a monolithic linear temperature sensor such as National Semiconductor's LM35 or LM335 (see Photo 1), or the AD590 from Analog Devices can be used.

Most of these temperature sensors have a linear temperature-to-voltage relationship of 10.0 mV/ºC. In some cases, sensor accuracy can be increased by adding an external trim potentiometer that is adjusted or calibrated such that the sensor outputs a specific voltage at a specific temperature. This linear relationship permits sensor calibration using a single temperature point.

The thermocouple reference junction compensation is based on the relationship:

(1)

where:

For this compensation relationship to be valid, both terminals of the reference junction must be maintained at the same temperature. Temperature equalization is accomplished with an isothermal terminal block that permits the temperature of both terminals to equalize while maintaining electrical isolation.

After the reference junction temperature is measured, it must be converted into the equivalent thermoelectric voltage that would be generated when the junction is heated to the measured temperature. There are two ways to perform the temperature-to-voltage conversion. One technique uses a power series polynomial. The thermoelectric voltage is calculated:

E = a0 + a1T + A2T2 + a3T3+ . . . +anTn (2)

where:

E = thermoelectric voltage (microvolts)
an = type-dependent polynomial coefficients
T = temperature (ºC)
n = order of polynomial

NIST publishes tables of polynomial coefficients for each type of thermocouple [1]. In these tables are lists of coefficients, order (the number of terms in the polynomial), valid temperature ranges for each list of coefficients, and error range. Some types of thermocouples require more than one table of coefficients to cover the entire temperature operating range. Tables for the power series polynomial are listed in the main text.


Figure 2. Two techniques can be used to convert the Type J thermocouple reference junction temperatures into millivolts. As can be seen from the graph, the power series method is much more accurate (but slower) than linear approximation. The power series has a relatively small error (<2 mV), whereas the linear approximation method generates a relatively large error (almost 16 mV at 25ºC).
Figure 2 and Figure 3 include coefficient tables that convert temperature values to the appropriate thermoelectric voltages using lower order polynomials. These reduced-order tables permit faster temperature-to-voltage conversions but with the penalty of reduced accuracy.

Figure 3. Both the linear approximation and the power series technique generate rather large errors in the Type K thermocouple. The power series, however, introduces much less error into the conversion process. The errors produced by this method can be reduced by increasing the number of terms (or order). These higher order tables can be found in a NIST publication [1].
Figures 2 and 3 also list conversion coefficients that cover the 0ºC-50ºC temperature range with a minimum error magnitude for the Types J and K thermocouples.

A second method of conversion uses an equation that represents a linear approximation of the temperature vs. thermoelectric voltage function over a limited temperature range (0ºC-50ºC):

y = mx + b (3)

The linear approximation consists of a constant, m, which represents the slope of the temperature vs. thermoelectric voltage line (Seebeck coefficient) and an offset voltage, b. All thermocouple types listed by NIST have an offset voltage equal to zero, so the b term is dropped. The temperature range
TABLE 1
Seebeck Coefficients
Type m (µV/°C)
S
R
B
E
J
K
T
6.02
5.93
0.05
60.93
51.71
40.46
40.69
selected for the linear approximation must represent the operating extremes of the reference junction. The accuracy of the voltage approximation is increased by physically limiting the reference junction temperature range by housing it in a temperature-controlled chamber (zone box). Appendix A includes a set of graphs that exhibit the error magnitude between the NIST tables and the linear approximation (y = mx) for each type of thermocouple.

The Seebeck coefficients listed in Table 1 are based on linear interpolation of thermocouple table values over a 0ºC-50ºC temperature range.

Voltage-to-Temperature Conversion
The first operation in converting the measured thermoelectric voltage (V) to an equivalent temperature value is the algebraic addition of the voltage measured at the reference junction terminals and the calculated reference junction voltage. The sum represents an approximation of the thermoelectric voltage generated at the temperature-sensing junction (J1 in Figure 1).

The calculated thermoelectric voltage generated at J1 is converted into an equivalent temperature value using a power series polynomial along with type-dependent coefficient tables. The power series polynomial takes the form:

T = a0 + a1E + a3E3+ . . . +anEn (4)

where:

E = thermoelectric voltage (microvolts)
an = type-dependent polynomial coefficients
T = temperature (ºC)
n = order of polynomial

NIST publishes three tables for each thermocouple type containing coefficients representing quadratic (second order), cubic (third order), or quartic (fourth order). Voltage-to-temperature conversion accuracy can be increased by using higher order coefficient tables, but at the cost of longer processing time to perform the calculations. Accuracy can be further enhanced by selecting tables representing the narrowest temperature range for the specific measurement application. Appendix B of the NIST document contains a listing of power series coefficients for each type of thermocouple (see Table 2 and Table 3).

TABLE 2
Thermoelectric-to-Temperature
Conversion, Type J*
a0 = 0.0
a1 = 1.8843850x10-2
a2 = 1.2029733x10-6
a3 = -2.5278593x10-10
a4 = -2.5849263x10-14
(-200°C to 0°C with error range -0.4°C to 0.5°C)
a0 = 0.0
a1 = 1.9323799x10-2
a2 = -1.0306020x10-7
a3 = 3.7084018x10-12
a4 = -5.1031937x10-17
(0°C to 760°C with error range -0.9°C to 0.7°C)
*NIST Monograph 125, Table A6.2.3
TABLE 3
Thermoelectric-to-Temperature
Conversion, Type K*
a0 = 0.0
a1 = 1.2329875x10-2
a2 = -1.4434305x10-5
a3 = -4.2824995x10-9
a4 = -4.2028679x10-13
(-270°C to 0°C with error range -11°C to 8°C)
a0 = 0.0
a1 = 2.5132785x10-2
a2 = -6.0883423x10-8
a3 = 5.5358209x10-13
a4 = 9.3720918x10-18
(0°C to 1370°C with error range -2.4°C to 1.2°C)
*NIST Monograph 125, Table A6.2.3

Application Example
The conversion techniques discussed above can be illustrated with a Type J thermocouple designed to operate in a 20ºC-700ºC temperature range. To perform temperature measurements, the computer uses the DA and signal conditioning system to record the reference junction temperature (ºC) and the microvolt output of the thermocouple circuit. Next, the circuit output voltage is compensated for any deviation from 0ºC in the reference junction by multiplying the measured reference junction temperature by the appropriate Seebeck coefficient. For the Type J thermocouple, the value is 51.71µV/ºC. If a more accurate conversion is required, the reference junction temperature can be converted into an equivalent thermoelectric voltage using a power series polynomial.

The following is an example of a procedure (written in C/C++) that will process a power series polynomial of any size. Three parameters are required. The first, -n-, represents the order of the polynomial to be calculated. The second, -input-, contains the input parameter to the power series polynomial. In this example, this value represents the temperature measured at the reference junction. The final parameter, -coef[]-, is an array of appropriate polynomial coefficients that is -n- cells long.

 double power_series(int n, double input, double coef[])
 {
      double sum=0.0;
      int i;
      sum=coef[0];
      for(i=1;i<=(n-1);i++)
           sum=sum+(pow(input, (double)i)*coef[i]);
      return(sum);
 }

 (pow(input,i) is a standard C function that
    raises -input- to -i-)

The calculated value of the reference junction voltage is then algebraically added to the thermocouple circuit output voltage measured at the reference junction. The new value represents an approximation of the thermoelectric voltage generated by the temperature-sensing junction of the thermocouple.

The calculated voltage must now be converted into an equivalent temperature value. Conversion is accomplished using a power series polynomial (Equation 4). To apply the polynomial it is necessary to select a set of coefficients from the NIST table for a Type J thermocouple. Table selection is based on whether calculation speed or conversion accuracy is important. The most accurate set of coefficients is the 4th order (error range -0ºC to 0.7ºC for Type J), followed by the 3rd order (error range -1.7ºC to 2.3ºC for Type J), and then the 2nd order (error range ±3ºC for Type J). The fastest calculation can be accomplished using the 2nd order polynomial; the 4th order polynomial requires the longest processing time.

Each coefficient table, based on the order of the conversion polynomial, is also subdivided into temperature ranges. The design specification for this example calls for an operating range of 20ºC to 700ºC. With this information and the desired polynomial order, a set of polynomial coefficients can be selected. For this example the 4th order (quartic) table will be used. The same power series algorithm given for the temperature-to-voltage conversion procedure can be used to convert voltage to temperature. Here, the -input- parameter would be microvolts and the value returned would be the equivalent sensing junction temperature (ºC).

If it is necessary to convert the entire range of the Type J thermocouple (-200ºC to 760ºC), a conversion algorithm can be developed that divides the temperature range into two, -200ºC to 0ºCand 0ºC to 760ºC. Whenever a temperature conversion is requested, the algorithm first determines which polynomial table to use by checking the corrected voltage of the thermoelectric sensing junction. A thermoelectric voltage $0 would use the 0ºC -760ºC table of coefficients; a thermoelectric voltage <0 would use the -200ºC to 0ºC table of coefficients.

Reference
1. R. Powell et al. 1974. Thermocouple Reference Tables Based On The IPTS-68, NBS Monograph 125, U.S. Department of Commerce, National Bureau of Standards, Washington, DC. This document contains data for the Types S, R, B, E, J, K, and T thermocouples, and is available from Omega Press, Stanford, CA.


Rex Klopfenstein, Jr., is Vice President, King Industries, Inc., 500 Lehman Ave., Bowling Green, OH 43402; 419-353-5311 or 419-353-2774, fax 419-352-1583.

Questex Media
Home | Contact Us | Advertise
© 2009 Questex Media Group, Inc.. All rights reserved.
Reproduction in whole or in part is prohibited.
Please send any technical comments or questions to our webmaster.