|
|
Software Linearization of a Thermocouple
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 CompensationBefore 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).
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:
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:
where:
E = thermoelectric voltage (microvolts) 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.
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):
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
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 ConversionThe 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:
where:
E = thermoelectric voltage (microvolts) 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).
Application Example 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. Reference1. 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|