Labview Day 2: Temperature Control - Inside Mines

31
Labview Day 2: Temperature Control Objectives: Use the Analog Out and Analog In features of our Data Acquisition Systems to control temperature. Understand the physical basis of temperature measurements and control. Understand that measurements and excitation involve electronic conversion of analog and digital signals.

Transcript of Labview Day 2: Temperature Control - Inside Mines

Page 1: Labview Day 2: Temperature Control - Inside Mines

Labview Day 2: Temperature Control

Objectives:

Use the Analog Out and Analog In features of our Data Acquisition Systems to control temperature.

Understand the physical basis of temperature measurements and control.

Understand that measurements and excitation involve electronic conversion of analog and digital signals.

Page 2: Labview Day 2: Temperature Control - Inside Mines

Labview Day 2: Outline

Outline:

Analog In and Out

How does the DAC and ADC work?

Temperature measurements and Control: Open Loop system

Temperature Control: Closed Loop

Page 3: Labview Day 2: Temperature Control - Inside Mines

Data Acquisition in the Labview Environment

Uses DAQ cards or controls instruments via a standard bus, such as the RS-232 ports, USB, parallel ports or GPIB.

Virtual instrumentation - combined hardware and software to develop flexible used defined computer based instruments. The computer behaves similar to a standard instrument in having controls (Front Panel) and display and storage of data.

Page 4: Labview Day 2: Temperature Control - Inside Mines

Parts of Data Acquisition with a virtual instrument

Typical computer based data acquisition system (from Application Note AN007, National Instruments)

Page 5: Labview Day 2: Temperature Control - Inside Mines

Signal ConditioningThis is the treatment of analog signals prior to digitization. For sensors of different types there are many forms, that is true of the output signals as well since a voltage may need to be converted to a current for instance.Amplification - for low level signals amplification near the source is preferable.Linearization - transducers such as thermistors can be corrected in hardware or software. Many are built into Labview.Excitation - an external voltage or current is often required for a transducer such as a strain gauge or a phototransistor.Isolation - separation of voltage spikes and isolation to reduce noise are common.Filtering - anti-aliasing is common, in addition the use of a 60 Hz filter is required in some cases because the ADC is not an averaging type.

Page 6: Labview Day 2: Temperature Control - Inside Mines

Virtual InstrumentsIn order to make this seamless between different hardware, the software consists of two parts: MAX (Measurement and Automation Explorer) and LabView.

Measurement & Automation Explorer (MAX) provides access to all your National Instruments DAQ, GPIB, and VISA devices. With Measurement & Automation Explorer, you can

• Configure your National Instruments hardware and software

• Add new channels, interfaces, and virtual instruments

• Execute system diagnostics

• View devices and instruments connected to your system

The use of MAX is not needed with the new express VIs.

Page 7: Labview Day 2: Temperature Control - Inside Mines

DACs and ADCs

Analog In

Digital Out

ADC

Analog Out

Digital In

DAC

Summing DAC

R-2R ladder application

Enabled counter

Successive approximation converter SAC

Page 8: Labview Day 2: Temperature Control - Inside Mines

R-2R DAC ladder

VoR

2R Rf

The output for this circuit is a voltage. DACs are typically very fast, limited only be the switch speeds and the slew rate of theop amp (max. rate of change of the output in response to a change of the input).

Page 9: Labview Day 2: Temperature Control - Inside Mines

DAC800 Diagram

V0

RREF

R

2R

This circuit has a current output which makes it faster. It has a very clever arrangement of resistors that contribute amounts of current that are summed. The small range of resistance values and the duplicated circuits make this very precise.

Page 10: Labview Day 2: Temperature Control - Inside Mines

Successive approximation (SA) ADC

Binary search, with timing and comparison. A decision has to be made for each bit, so the time doesn’t depend on the value. Can be very fast.

Reset SA Register

Switch largest untested bit on, DAC outputs value

Is DAC greater than Vin?

Leave bit set, try next one

Reset bit, try next one

Page 11: Labview Day 2: Temperature Control - Inside Mines

Dual Slope converter

++

OSC.

Counter

D FFs

12.54 V

Vin

-Vref CTRL

Vc t

Measure this part, it is proportional to Vin.

Page 12: Labview Day 2: Temperature Control - Inside Mines

Basic Operation of a Dual Slope ADCRelies on CTRL circuit that allows the capacitor C to charge with rate given be Vin/RC for a fixed time T0 (this is typically a fixed number of clock cycles N0). Then the capacitor discharges for a time T1 at a fixed rate Vref/RC (or for N1 clock cycles) until it reaches zero.

If T1 is measured (T0 is known), then Vin = (T1/T0)Vref = (N1/N0)Vref.

VcAdvantages - doesn’t require precise components so inexpensive. It also can be designed to average out noise (particularly line noise).

t

Disadvantage - slow, if the output is 10 bits (typical display on DMM) it requires 210 clock cycles. Conversion time usually few ms.

Page 13: Labview Day 2: Temperature Control - Inside Mines

Pinout of 68 pin Connector for PCI-6035E

In addition to the 25 pins associated with analog in, 4 with analog out, and 20 associated with the 8 DIO lines there are a number of other lines as well, some inputs, some outputs, some both. More on these next semester in PHGN317

Page 14: Labview Day 2: Temperature Control - Inside Mines

Analog InputsA DAQ card can have analog inputs with different characteristics added. The input is almost always a voltage. Our system has a single successive approximation converter with 16 bits.

Characteristics

Resolution - given by number of bits or minimum step size [16 bits, smallest resolution

Speed - maximum rate data can be read [200 kS/s]

Number and Type of Inputs- single ended, differential [16 SE or 8 DI]

Range - can be bipolar or unipolar, range is software selectable [±50 mV to ±10 V]

Input impedance - [100 GΩ in parallel with 100 pF]

Differential measurements are normally used if the signal is small, or the lines are long and may be noisy and to avoid potential ground loops.

Page 15: Labview Day 2: Temperature Control - Inside Mines

Sc-2075 ANALOG IN

We have the E-series cards, they have 8 differential inputs (or 16 single ended).

Page 16: Labview Day 2: Temperature Control - Inside Mines

Analog OutputsThe output is normally a voltage but can be configured to be a current in some cards.

Characteristics

Resolution - given by number of bits or minimum step size [12 bits, smallest resolution

Speed - maximum rate data can be written. The data output is dependenton the size or existence of a buffer [10 kS/s with DMA, unbuffered]

Number and Type of Inputs- single ended, differential [2 SE]

Range - can be bipolar or unipolar, range is software selectable [ ±10 V]

Output impedance - [0.1 Ω, can drive or source 5 mA max.]

Page 17: Labview Day 2: Temperature Control - Inside Mines

Sc-2075 ANALOG OUT

The important thing to note here is that the output is only 10 volts, positive or negative!

Page 18: Labview Day 2: Temperature Control - Inside Mines

Seebeck Effect: ThermocouplesIntrinsic to material – doesn’t correspond to surface effect like work function.

Imagine conducting material with ends at different temperatures –what happens to the number of carriers?

If no current flows builds up an electric field that balances the diffusion current.

Electric Field TSE ∇⋅=

S is called the thermopower. If have two different materials the measured voltage is related to the difference in Seebeck coefficients for the material pair – a thermocouple.

Page 19: Labview Day 2: Temperature Control - Inside Mines

Thermocouples

Important “laws” – law of intermediate metals (solder OK), law of successive metals VAC=VAB+VBC (can use reference metals to use any combination); law of successive temperatures if Va developed between T1 and T2 and Vbdeveloped between T2 and T3 then Vc= Va+ Vb developed between T1 and T3.

The latter is important because it means that need only tabular values for one reference temperature. All others can be determined. It also points out that you need a reference temperature.

Page 20: Labview Day 2: Temperature Control - Inside Mines

Peltier Effect: Thermoelectric CoolersThere are two other related thermoelectric effects: the Peltier effect (1834) and the Thomson effect (1854), both involve passing current through a junction or a homogeneous material respectively. (don’t forget good old Joule)

Peltier – changing the direction of current flow can result in either heating or cooling at a junction, with the work performed by the current source.

Thompson – if there exists a thermal gradient across a material then passing a current can result in heating or cooling.

( )dTdSTSST

TJHeatJHeatA

tABAAB

tAsonTABPeltier

=−=

∆−==

σπ

σπ hom

Page 21: Labview Day 2: Temperature Control - Inside Mines

Peltier Effect: Simple diodeTo demonstrate basic idea imagine that you have two metal platesseparated by vacuum, both at the same temperature initially. Each has a distribution of electrons that is identical.

Now heat one slightly – it has more electrons so initially there is a net flow of electrons away until equilibrium is reached again.

Now return to same temperature and apply a potential resulting in a current. The one that has current leaving is cooled!

Page 22: Labview Day 2: Temperature Control - Inside Mines

IC Temperature SensorsNote that the circuit is simple – with the addition of a resistor at the + terminal this looks at VCE, even though we treat is like a diode with a temperature dependent voltage.

Page 23: Labview Day 2: Temperature Control - Inside Mines

IC Temperature Sensors

Based on dependence of diode equation on the absolute temperature of the junction.

Page 24: Labview Day 2: Temperature Control - Inside Mines

bidirectional current driver

• You have already designed and tested a circuit that can control a Peltier device.

• Designed to provide large bi-directional current flow necessary to power both the heating and cooling of the thermoelectric device.

• You will build the circuit, and ultimately, useLabView to provide control input and feedback.

Page 25: Labview Day 2: Temperature Control - Inside Mines

System Schematic

+8 V

-8 V

TE

Vin

+

-

470 Ohm

GND

GND GND

TIP 120

TIP 125Data sheets for componentsare in binders

7411 µF

1 µF

Page 26: Labview Day 2: Temperature Control - Inside Mines

Controlling and measuring

As the first stage of this test, connect the Peltier device and measure the current and temperature as a function of applied voltage using the Agilent supplies. Make a table and plot this in your notebooks.Then using the Analog output capabilities drive the input stage of your push-pull to control the output. You should place a limit on the voltage to protect the device.Construct your VI to measure and control the system. Try to incorporate sub-VIs.

Page 27: Labview Day 2: Temperature Control - Inside Mines

Open vs.Closed Loop Control

As with Op Amp circuits these mean exactly the same – no feedback is open, with feedback is closed.More complex control theory expresses the response function in terms of Laplace transforms, we will focus on a time-domain only view.

i(t) Tc(t)System F(x1,x2,…)

Page 28: Labview Day 2: Temperature Control - Inside Mines

Closed Loop Control

i(t) Tc(t)System F(x1,x2,…)

KP e(t)+e(t)Tset

i(t)Tc(t)System

F(x1,x2,…)+

( )∫ dtteKi

+KP e(t)+

e(t)Tset

Page 29: Labview Day 2: Temperature Control - Inside Mines

Closed Loop Control

The use of correction terms that are P, I, and D allows for a stable control of Temperature

System F(x1,x2,…)

i(t)Tc(t)

KP e(t)+e(t)

+++

( )∫ dtteKi

dtdeKD

Tset

Page 30: Labview Day 2: Temperature Control - Inside Mines

Closed Loop Control, selecting the constants

At first just ‘play”.

A more systematic approach is based on the lag time L and the maximum rate of change R. Start by looking at response of system with NO feedback. Change the voltage some amount instantly D, watch how long the lag is, and the maximum rise. Finally look at what temperature the system stabilizes at (the change in controlling parameter is D).

22LK

KL

KK

LRDK p

Dp

ip ===

Since it is not continuous, all of this is in loops, with the time per step about 1/10th of the time constant of the system.

Page 31: Labview Day 2: Temperature Control - Inside Mines

Closed Loop Control, selecting the constants 2

An alternative way to do this with a closed loop system is called the Ziegler-Nichols method. Start by using only P control and find when it oscillates with period Tosc, this gain we will call Kp

crit. Then the gains are:

82

2osc

critP

Dosc

critP

i

critP

pTKK

TKKKK ===

The main problems with this mode is that the system will overshoot, and it may be difficult to get an oscillation (the gain may not be set high enough).