Programming ThermoElectric Coolers with LabWindows/CVI

  Print Print

"The graphical user interface for the CVI environment has several distinct advantages, including having no need to write any source code line to produce the user interface, and direct compatibility with ANSI C, and compatibility to C++ using an external compiler like visual C. "

- Eli Flaxer, AFEKA - The Tel-Aviv Academic College of Engineering

The Challenge:
Optimizing ThermoElectric Coolers (TEC) are solid-state heat pumps that operate according to the Peltier effect - a heating or cooling effect when an electric current passes through two conductors.

The Solution:
Using National Instruments LabWindows/CVI to write the program and taking advantage of its graphical user interface.

Author(s):
Eli Flaxer - AFEKA - The Tel-Aviv Academic College of Engineering

Temperature control is needed for a wide range of applications. For some, a precision of ±1°C is satisfactory, but critical applications require precision of 0.1°C and sometimes even 0.01°C.

For example, the performance of optoelectronics devices (diodes lasers, photodiodes, electro-optic modulators etc.) depend strongly on temperature; hence, these devices require high precision temperature control. Moreover, in several systems it is not enough to regulate the temperature to a constant value, but instead, an optimization procedure is required. In systems like these, feedback control mechanism (or user) varies the target temperature to maximize the output signal from the device under control.

ThermoElectric Coolers (TEC) are solid-state heat pumps that operate according to the Peltier effect - a heating or cooling effect when an electric current passes through two conductors.

Design Considerations

The controller presented here was developed to operate with a 1A/5V TEC, at room temperature, and connect to a PC via the standard parallel port - to set the target temperature (and monitor some other signals). We show that by integrating a digital control, and regulating the TEC by pulse width modulation (PWM) with a dedicated smart-driver with proper protection mechanisms, one can implement a compact, reliable, accurate and safe system at relatively low costs. Our controller has a temperature control range of 0-50 °C, a precision of 0.1°C and a time constant of few seconds, using a small PCB of 2.5" x 4.0" in size.

Our initial consideration in the design was to choose the regulation method (PWM or linear). To achieve a compact design without cooling elements, we choose to use a high frequency PWM technique with a small coil filter. High frequency PWM technique combines the advantages of high efficiency energy transfer (the switching element does not waste any energy) and a very low ripple at the output. As mentioned above, the TEC heat pump capacity is proportional to the current flow through the device, that means that by inverting the current direction, one converts the cooler to a heater and vice versa. To improve the controller performance, we drive the TEC with a bi-directional current, switched by full-bridge solid-state devices.

Electronic Circuit

The electronics circuit is composed of three blocks: a digital control, a smart analog PID controller for the PWM bridge, and eight channels 12 bits data acquisition unit. The TEC is connected to the power-switching bridge while the temperature sensor is thermistor. The smart driver, ADN8830 is the heart of the system - it controls all the required parameters for the TEC, and it also provides the necessary protection. This device relies on a Negative Temperature Coefficient (NTC) thermistor or on a solid-state temperature sensing device to sense the temperature of the object attached to the TEC. The target temperature is set with an analog input voltage supply by a 12-bit DAC - AD5341, which enables a resolution better than 0.05°C.

Two analog voltage outputs are provided to monitor the TEC condition: TEMPOUT - the temperature of the object, and VTEC - the voltage across the TEC. A data acquisition unit measures these analog signals, as we explain later. In addition, two digital signals indicate the status of the system: LOCK - indicates when the thermistor temperature is within ±0.1°C of target temperature as set by the reference voltage, FAULT - indicates an open or a short circuit condition of the thermistor. These signals are monitored by the digital unit and sampled by the computer.

The data acquisition unit is made of a single analog to digital converter (DAC), that operate with an internal reference and clock. The MAX197 is a multi range, 12 bit data acquisition system, which requires only a single +5V supply for operation. This converter provides 8 analog input channels that are independently software programmable for a variety of ranges: ±10V, ±5V, 0V to +10V, or 0V to +5V, while the input is protected against an over voltage of ±16.5V. This converter support a 100 ksps sampling rate, an 8 + 4 bits parallel interface to microprocessor, and an internal reference of 4.096V. Two channels of this unit are connected permanently to TEMPOUT and VTEC to monitor the TEC condition, while the others six channels are kept free for any other user purpose.

 Drivers and Software

From the programmer’s point of view, one needs three low-level functions (drivers): setAddress, writeData, and readData to establish communications between the PC and the chipset that work in SPP or EPP mode. Above this low-level layer, the user needs a data acquisition library to translate the digital data to a real data (voltage, temperature, etc.). These functions can be written in assembly, C or any other high level language. We used C language to write both the low-level drivers and the data acquisition library.

We used  National Instruments LabWindows/CVI to write the program and the GUI for the CVI environment has several distinct advantages: 1) A complete transparency to the programmer who programs in C, as there is no need to write any source code line to produce this GUI. 2) Full compatibility with ANSI C, and compatibility to C++ using an external compiler like visual C. 3) A wide support range in addressing many hardware devices and instruments. 4) Low-level support drivers for I/O port addressing. 5) A wide rang of libraries (Advance analysis, PID, TCP, Internet, GPIB, VISA, RS-232, VXI, and much more).

To control the system by the personal computer, we built a graphical user interface (GUI) under windows XP using a CVI, as shown in figure 1: In this panel one sees, a numeric slide that sets the target temperature, six analog meters to monitor six analog channels that indicate several parameters in our system, and two LEDs for the status bits - LOCK and FAULT.

In order to optimize external parameter in the system it is not enough to regulate the temperature to a constant value, but instead, an optimization procedure is required. In that case, a feedback control mechanism varies the target temperature to maximize the output signal from the device under control. As opposed to the temperature control that achieve by hardware PID, the optimization control performed by the software on personal computer using National Instrument PID library. Since the characteristic time constants of the two loops are in a different scale they can work simultaneously.

Author Information:
Eli Flaxer
AFEKA - The Tel-Aviv Academic College of Engineering
Bney Efrayim 218
Tel-Aviv 69107
Israel
eli@flaxer.net

Bookmark and Share


Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community


Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI