Thermocouple Solution Sensor Linearization

App Note AN314 (980 kB, 1 pdf file):   Thermocouple and Sensor Linearization

Introduction
This application note describes how to design and build an AnadigmDesigner®2 (AD2) circuit, suitable for most commonly available thermocouples. The circuit has been designed to provide large gains and correction for a thermocouple’s nonlinear transfer function.

The reader is taken through each stage of the design process with example AD2 circuits, gradually building up a complete thermocouple solution. The thermocouple AD2 circuit along with a spreadsheet to define the linearization data can be obtained from the Okika Devices website.

This application note assumes that the reader is familiar with Okika Devices FPAAs, evaluation boards and the associated AnadigmDesigner®2 software.

Thermocouple Theory
This section of the application note describes the principles behind thermocouples.    Readers who are already familiar may wish to skip forward and start at the following section entitled “AN231E04 implementation”.

If a temperature difference is generated along a single wire, a thermoelectric voltage is produced across the wire. If it were possible to measure this, it could be used as a temperature indicator. In reality, the voltage developed across the wire cannot be measured easily because the wires on the measuring equipment would be present in the same thermal gradient, either causing the measurement to be nulled, or errors to be generated.

To overcome this, two wires of dissimilar metals are joined together at one end to form a thermocouple. When placed in a thermal gradient, the wires generate different thermo-electric voltages, the difference in voltage being a measure of the difference in temperature between the two ends.

Referring to Figure 1, VX(T1, T2) is the thermo-electric voltage generated across metal X with one end at temperature T1 and the other at temperature T2. Joining the wires X and Y together at one end generates a net voltage VXY(T1, T2) at the other. Knowing the voltage VXY and T2 allows T1 to be calculated.

The loose ends of the thermocouple (those at T2) are usually soldered or screwed into a terminal block to make a measurement. It is important that the terminal block is isolated from sources of heat which may create a thermal gradient across it, i.e. kept isothermal. It should therefore not reside on the same circuit board as the electronics used to measure the thermocouple voltage.
In order to calculate T1, the temperature T2 (sometimes known as the cold junction) has to be known.

There are several solutions to this. The easiest is to leave it at ambient temperature, assuming it varies little from this. This is not very accurate but may suffice for some applications.

An improved method uses a separate sensor such as a thermistor or semiconductor temperature sensor to establish the temperature of the terminal block.

The problem of measuring the temperature of the cold junction can be eliminated by forcing it to a known temperature such as that of melting ice. It may be possible to mount the terminal block on a reference temperature source, but this is often problematic. A neater solution can be achieved by introducing an additional thermocouple to create a separate reference junction.

Figure 2 shows a thermocouple made from metals X and Y, along with an additional junction which is kept at a known reference temperature (T2).

By adding the thermo-electric voltages generated across each of the sections of wire in Figure 2, it can be shown that the net voltage across the wires at T3 is given by VX(T1, T2) - VY(T1,T2) = VXY(T1,T2), the same as for the simple thermocouple shown in Figure 1. The introduction of an additional thermocouple junction has had no effect on the result. This is true even though the terminal block is at T3. The necessity to keep the terminal block isothermal (at T3) is just as important as it was for the method shown in Figure 1.

Thermocouples do not have a good linear response over their whole temperature range, as shown in Figure 3 for the “Type K” thermocouple.

This means that the output voltage is not directly proportional to the temperature being sensed. This necessitates using a thermocouple table to convert the measured voltage into a temperature.

Thermocouple tables are published for the case where one junction, known as the reference junction, is at 0 °C. This is the junction at T2 in Figures 1 and two above. Some of the methods discussed previously, do not keep this junction at 0 °C, but at some other known reference temperature. In these cases, the measured voltage requires compensating before using the thermocouple table.

The compensation is carried out by looking up T2 in the inverse thermocouple table. This compensation voltage is then added (or subtracted) from the measured value before using the thermocouple table to find T1.

Finally, IC’s are available which can perform the compensation necessary in order to allow the cold junction to vary with time. These IC’s measure the temperature of the cold reference junction and produce the correct compensation voltage to allow a thermocouple table to be used directly. The IC should be mounted on the terminal block to sense T2, and the compensation voltage it generates put in series with the thermocouple.

The various methods of establishing the temperature of the cold junction, and then compensating for it, are often referred to as “cold junction compensation.” The method chosen will depend on the cost, practicality and desired accuracy.

 

AN231E04 IMPLEMNATION

Interfacing to the device pins
The problems of interfacing to a thermocouple and providing a linearized response are completely solved using the AN231E04. What follows is a description of the design process using AnadigmDesigner®2 Software, with example circuits gradually building to a complete thermocouple solution.

The voltage generated by a thermocouple is a differential signal. The AN231E04 is a fully differential signal processing device, so interfacing could be achieved by simply connecting the thermocouple wires to the input pins of the device. However, a better method is to use the input amplifier (available in I/Os 1-4) in combination with a few passive components to form a low pass 2nd order Rauch filter, as shown in Figure 4.

The advantage of using a Rauch filter is 3-fold:

  1. It provides a 2nd order low pass filter which is useful for removing noise that is easily picked up from the environment by the thermocouple, particularly if it is far from the interface electronics,
  2. It can provide substantial gain on the input (the input amplifier’s offset is typically 500uV so there is plenty of scope for amplification without introducing significant offsets).
  3. The Rauch filter automatically biases the thermocouple to Voltage Mid Rail (VMR) of the AN231E04 device.

The equations for calculating the component values of a Rauch Filter are quite complex, so it is fortunate that Okika Devices supplies a simple Excel tool that performs these calculations for the user. Just download the tool from the Okika Devices website, open it up and enter the desired values of corner frequency, gain and Q. Also enter a preferred value for R1. The tool will calculate the values of R2, R3, C1, and C2. Now enter the component values, adjusted to suit available preferred values, and the tool will re-calculate the parameters and plot the response.

As an example, suppose we require the following parameters:

  • Fo = 0.1kHz
  • Gain = 100
  • Q = 0.707
  • And we choose R1 = 1kohm

If we enter these values into the Excel tool and then adjust the resulting component values to fit with available components, we get the following:
R1 = 1kohm R2 = 100kohm
R3 = 1kohm C1 = 1000nF C2 = 10nF

And the filter response is shown in figure 5.

Gain requirements
The sensitivity of a thermocouple ranges from a few V/°C to tens of V/°C depending on the thermocouple type. The temperature range it is required to work over, and its sensitivity will define the gain required.

To achieve optimum results, the thermocouple voltage range should be amplified to +/- 3V before further signal processing. This will involve gains from 100 to 10,000 or more. In section 3.1 above it was shown how to amplify by 100 in the input stage using a Rauch Filter.

All analog amplifiers can suffer from input referred offset. This is a condition where a finite input voltage is required to cause zero output voltage. The amplifier’s input referred offset will be multiplied by the gain setting, and so if care is not taken, the amplifier can saturate simply from its own offset voltages. The AN231E04 device uses an auto-nulling process to minimise offsets, including in the I/O amplifier which has a typical offset (after auto nulling) of 500uV (1000uV max). Although this offset is small, it is not recommended to choose a gain in the input stage of much more than x100, so the rest of the gain should come from CAMs inside the device.

In addition to the auto nulling of offsets, certain CAM’s provide output signals which automatically compensate for their own offsets by using a clocking scheme which measures the offset in one phase and then nulls it in the other. One CAM which exploits this technique is called GainHold.

Figure 6 shows a low pass biquad filter CAM with gain = 1, providing additional noise filtering if required. This is followed by 2 GainHold CAMs, each of which can combine high gain (up to x100 each) combined with a very low offset. Thus a high gain circuit suitable for a thermocouple is achieved.

When using the GainHold CAM, remember that the output is offset free on the same phase as the input sampling. Care should, therefore, be taken to ensure that the correct phase is sampled with subsequent CAM’s in the signal path. Phase1 was arbitrarily chosen for the first GainHold CAM, and thus the second GainHold CAM also uses phase1 to preserve the offset performance from the first GainHold.

The circuit shown in Figure 6 provides the gain requirements for a complete thermocouple solution. Where the necessary gain is less than 1000, one of the GainHold CAM’s can be removed. For optimum performance, the maximum gain of the Rauch Filter input stage should be restricted to 100, as previously mentioned.

Thermocouple linearization
A typical thermocouple response is depicted in Figure 3. It can be seen from the graph that the output voltage is not ideally proportional to the input temperature. To calculate the temperature given the thermocouple voltage, therefore, requires either a look-up table or analog linearization technique.

AN231E04 has a built-in 256 value look-up table (LUT) employed in the TransferFunction CAM, which can be used to compensate for the non-linearity’s of a sensor.

For advanced users who wish to know more regarding the. transfer function CAM, please refer to the Design Brief entitled “Using the TransferFunction CAM in AN231E04 Devices”.

For a thermocouple, the TransferFunction CAM can be used to generate an analog voltage which varies linearly with the temperature being sensed. The basic method is described in sections 3.3.1 to 3.3.2 and an improvement to this described in section 3.3.3.

TransferFunction CAM
The transfer function CAM uses an internal ADC to digitize the input signal, subsequently using the 8-bit digital word as the address for a “Look Up Table” (LUT – 256 x 8-bit RAM).

The resulting 8-bit data word from the LUT is then converted back to an analog output voltage, as shown in Figure 7. 

The 8-bit ADC on the front- end has a full-scale range of +/-3V i.e. as the input voltage is swept from -3V to +3V the LUT address sweeps from 0 to 255 (decimal).

The content of the LUT (the data) is completely arbitrary and user-defined. The data is converted to an analog output voltage with an 8-bit DAC whose full-scale range is flexible up to +/-3.0V. The range should be greater than +/-1.5V in order to exercise all the 256 quantization levels and achieve the best possible performance.

Defining the Transfer Function
The transfer function is stored in the LUT and consists of 256 floating- point numbers. These numbers may be entered manually, or loaded from a file (“CSV” format – Comma Separated Values) via AnadigmDesigner®2 Software.

Input and Output Quantization
When using the TransferFunction CAM, remember that the LUT input and output signals are quantized to 8 bits and that to achieve the maximum signal-to-noise-and-distortion-ratio (SINAD) necessitates using the full dynamic I/O ranges of the LUT. I.e., scale the input signals so that they have maximum amplitudes of +/-3V, and try to ensure that the output range is symmetrical and between +/-1.5V and +/-3.0V.

Improving the linearization
The transfer function CAM can be used as described to simply take an input value and return a linearized output value. However, the power of the CAM can be significantly increased if the thermocouple signal already has a strong linear component. If this is the case, then a much better resolution and hence more accurate result can be achieved by programming the LUT with the difference from the straight line, rather than the function which would generate the straight line itself.

For the type K thermocouple in Figure 3, the linear component, and thermocouple difference from this, or delta are shown in Figure 8.

The CAM’s required to achieve the linearization using the delta technique are shown in Figure 9. In this circuit, a “straight line” transfer function is provided by the lower input of the “summer” block, and the TransferFunction CAM provides the required perturbations from the “straight line.”
Calculating the LUT data required for a difference-to-the-straight line solution is not always easy, and for that reason, a spreadsheet is provided by Okika Devices that assists this process for a wide range of industry- standard thermocouples.

Maximizing the dynamic range
The gain blocks shown in Figure 6 assume that the input signal is equally spaced around zero volts. If this is not the case, then the full dynamic range of AN231E04 will not be used, and compromised performance will result. The signal from a thermocouple will not usually be symmetric around zero volts, and so a DC shift is necessary.

The Gain circuit shown in Figure 6 has been modified to include a programmable DC shift as shown in Figure10.

Completed circuit

By combining the circuits shown in Figure’s 9 and 10, a complete thermocouple conditioning circuit is realized, as shown in Figure 11.

The TransferFunction CAM compensates for its input referred offset (to achieve this, the hold option has NOT been set on this CAM) and has been programmed to both sample and output using phase1. The second SumDiff CAM samples both its inputs on phase1 (to maintain the offset nulled signal) and outputs its own offset nulled signal on phase2. Finally, as only one phase of the SumDiff CAM is valid and offset-free (the other phase returns to zero), a Hold CAM is used prior to sending the signal off-chip via OutputCell2.

The completed circuit is available from Okika Devices® along with an Excel spreadsheet to assist the programming as described below.

Configuring the example AD2 circuit
An Excel spreadsheet has been developed to accompany the AD2 Thermocouple linearization circuit, in order to facilitate a rapid solution.

By entering the thermocouple type and the temperature range over which it is to be used, the spreadsheet will return all the necessary parameters and TransferFunction CAM LUT data required to configure the example AD2 circuit. Full assistance with this process is given in the spreadsheet.

Calibration
Care has been taken through each stage of the AD2 design process to ensure that offsets are minimized, and that programmed gains are comfortably within the working ranges of the CAM’s chosen.

However, small offsets and gain errors are unavoidable, and a calibration cycle should thus be undergone in order to fully optimize the circuit.

Referring to Figure 11, it is important that the signal presented to the TransferFunction CAM has the correct gain, and is offset free. This ensures that the data in the CAM’s LUT is correcting for non-linearity at the correct thermocouple voltage. The recommended calibration exercise (described in detail in the accompanying spreadsheet) therefore concentrates on node n6.

The calibration consists of several stages. The example AD2 thermocouple circuit as shown in Figure 11 is first programmed using the spreadsheet derived data. To start the calibration, node n6 should be monitored via the Hold CAM (by deleting wire n8 and connecting the Hold CAM to node n6).

The achieved gain to node n6 should then be calculated by, altering the input voltage over several settings (spread over the thermocouple range), and monitoring the voltage at node n6. Any discrepancy between measured and programmed voltage gains should now be corrected for by altering the gains of the two GainHold CAMs.

During the AnadigmDesigner®2 Software circuit design, the voltage range of the thermocouple was shifted to be centered on zero volts. The exact thermocouple voltage which generates zero volts at node n6 is given in the spreadsheet. In order to null the small offsets which may still exist, the input should now be driven with this voltage, and the gain in the lower input branch of SumDiff1 modified by small amounts until the voltage at node n6 is zero.

It may not always be possible to achieve exactly zero, but any residual offset voltage can be compensated for by reprogramming the LUT in the TransferFunction CAM. The spreadsheet is designed to help this process, allowing the LUT to be easily programmed with the (residual) offset corrected data.

The new LUT data may impose small gain changes, as described in the spreadsheet and so the gain to node n6 should then be re-calibrated as described previously.

Finally, the Hold CAM should be disconnected from node n6 and reconnected to node n8.

The circuit is now optimized to give a linear voltage output as a function of the thermocouple temperature being monitored. The sensitivity of the final circuit and its intercept with zero determine the temperature being measured by a simple re-arrangement of the formula,

Vout = Sensitivity x Temperature + Intercept

Finally, to complete the calibration, the sensitivity and intercept are calculated by connecting the thermocouple to the input and measuring the circuit output voltage for several input temperatures.

To assist the user, a full step by step approach to the calibration exercise is given in the accompanying spreadsheet.

The thermocouple interface is now complete and ready to be used in its application.

Performance
The accuracy of the final solution will depend on several factors. The ability to measure the temperature of the reference junction is important, as well as ensuring that external noise sources are well isolated. Some error inevitably comes from the electronics, and these contributory factors are now discussed.

Offsets and gain error coming from the CAM’s can be calibrated out using the procedures described above, with any residual error making a small contribution to the overall total.

Non-linearities in the thermocouple are corrected by the LUT, but some will remain due to the finite number of addresses, as well as the quantization of the correction data. The performance which can be expected from the linearization is reported in the accompanying spreadsheet and depends on both the thermocouple type and temperature range that is it used over.

Random thermal noise is present in all measuring systems. The high gains required in order to interface to a thermocouple may result in noticeable random noise on the output. This can be averaged out by taking several measurements. The uncertainty in the final answer will diminish by the square root of the number of measurements taken.

In summary, the accuracy achieved will depend on all of the above factors with the spreadsheet giving a good indicator as to what is achievable with good averaging.

Summary

This application note has described how a thermocouple functions, and has given alternative methods on how to achieve cold junction compensation. AnadigmDesigner®2 Software circuits have been developed in stages to show how high gain can be achieved without saturation as well as the linearization techniques necessary for a high accuracy thermocouple solution.

The completed AnadigmDesigner®2 Software circuit is available from Okika Devices, along with a spreadsheet to facilitate rapid development.