Practicum ADSV P1: Poorten en flipflops



Practicum LV4: Temperature control with PC

Goal of experiment

The goal of this experiment is to build a LabVIEW-driven temperature control system, which is supposed to regulate the temperature of a small block of copper. The electronic parts of the system are sketched in the figure below, were the "small block of copper" is incorporated in the heater in the lower right-hand corner. The complete system uses a temperature sensitive NTC resistance as temperature sensor, a simple heating resistor as heater, and a combination of ADC & DAC & PC for the electronic feedback. It is your task to (i) wire up the hardware, (ii) write the appropriate PI control software in LabVIEW 7, (iii) test the complete system, and (iv) optimize the feedback parameters.

The temperature sensor (NTC resistor)

The temperature sensor is a so-called NTC resistor, where NTC stands for Negative Temperature Coefficient and refers to the phenomenon that the resistance of such a device decreases with temperature. This decrease is quite rapid (the resistance decreases typically by as much as 4 % per degree Centigrade), making these sensors ideal for accurate temperature measurements.

It is worthwhile to spend a few lines on the physics of NTC resistors. An NTC resistor is nothing more than a piece of semiconductor material with a bandgap that is small enough to allow for thermal excitation of some of the electron from the valence band to the conduction band, or (equivalently) for the thermal excitation of electron-hole pairs. When the temperature rises, the number of thermally excited electron-hole pairs will increase and the resistance goes down, thus explaining the name NTC. As the thermal excitation is limited by (very small) Boltzman factors of the form [pic], where [pic] is the potential barrier, [pic]J/K is the Boltman constant, and T is the temperature (in Kelvin), respectively, the NTC resistance changes exponentially with temperature via

[pic],

where [pic] is related to the potential barrier [pic]and [pic]is the resistance at some reference temperature [pic]. Our NTC resistors are specified for [pic] and [pic] at

25 (C. Based on these values we can calculate the following reference table for NTC resistance versus temperature, which allows for a quick manual conversion of one into the other:

|T[(C] | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 |

|R[k(] |1.508 |1.224 |1.000 |0.823 |0.681 |0.567 |0.475 |0.400 |0.339 |0.288 |0.246 |0.212 |

In the experiment, the NTC resistance (and the associated temperature) can be determined from the ADC voltage in the circuit shown above, in which the 5 V source from the I/O card is put over a serial circuit of an NTC resistor and a fixed 1 k( resistor (see figure). This 1 k( resistor is mounted in the groundplate of your compact experimental set-up and can be observed by turning the device upside down.

The heater (high-power resistor driven by Darlington circuit)

As heating device we use a simple high-power resistor that is driven by a so-called Darlington circuit, comprising a back-to-back combination of a standard transistor and a high-power transistor (see figure). Such a combination is needed because the current amplification of a single high-power transistor is rather small and because the DAC can’t supply more than 5 mA of output current.

Every circuit should also contain the special box that we labelled “safeguard against short-circuiting” in the figure above. This box should be positioned between the +20V supply that you get “out of the wall” and the Darling amplifier circuit. It safeguards against shortcircuiting by limiting the output current to about 1 A. The way this box works is relatively simple: it contains a semiconductor with the intriguing properties that it’s resistance is very low (about 0.25 () at currents below 1 A, but rises rapidly for currently above 1 A. If the green LED is on the voltage is passed through, if the red LED is on there is a short in your circuit.

There are two more details of the heating circuit that you need to know. First of all, the voltage over the heater is about 1.2 V lower than the DAC voltage, as there is a voltage drop of about 0.6 V over each of the two transistors inside the Darlington circuit. Secondly, the power that you dump into the heater and that takes care of the temperature control is of course proportional to the square of the heater voltage! Combining these two effects we find that the dissipated power is about

[pic]

where [pic] at room temperature. At the maximum DAC output of 10 V about 4.1 W is dissipated.

The special relation between the dissipated power and the regulating voltage has of course also consequences for the regulating feedback loop that we want to construct. We challenge you to figure these out for yourself (and explain them in your report).

Temperature dynamics of a simple system

|The figure on the right presents a very simple model for the | |

|thermal management in our system (= copper block). Energy can be | |

|fed into the system with a heating resistor that generated a | |

|heating power P [W]. Energy leaks out of the system through | |

|thermal contact between the system and the environment = thermal | |

|bath. Two parameters determine the temperature dynamics of this | |

|system: (i) the system's heat capacity C [J/K], which quantifies | |

|the thermal energy increase per Kelvin, and (ii) the thermal | |

|conductivity ( [W/K] between the system and | |

its environment, which quantifies the energy leak between system and bath per Kelvin temperature difference. With these parameters in mind it is relatively easy to write down the time evolution of the system's temperature as

[pic]

where [pic]is the temperature of the environment. Please check the dimensions in this equation and note that these are indeed correct. At constant heating power the solution of this differential equation is easily found as

[pic] and [pic] ,

where [pic] is the equilibrium temperature and [pic] is the thermal time constant (check the dimensions!). The temperature dynamics of this simple system is thus surprisingly straightforward: the equilibrium temperature of the system is [pic]larger than that of the environment and the relaxation of the system to any new equilibrium temperature is predicted to be exponential with a time constant [pic].

Practical system might of course deviate from this simple system in several ways. The temperature might not be completely uniform over the system and there will probably be some time delay between the application of a heating pulse at one end of the system and the temperature rise observed with a sensor at the other end. The thermal contact between the system and its environment might be more complicated then sketched in the model, which assumes that the bath remains at a fixed temperature and must therefore be “infinitely large”. As a practical example of the latter complication we note that the large black block, which contains the copper system, might heat up at some point. In principle, we can model the temperature of this black block in a similar way, introducing a second heat capacity and thermal conductivity (now between black block and larger environment). This type of modelling, however, goes way beyond our present needs.

Theory digital feedback control

The basic idea of any electronic feedback system is very simple. Suppose you want to control a voltage [pic] and keep it at some fixed set-point voltage [pic]. The first thing you will of course do is compare the two voltages and calculate the error signal or error voltage [pic]. As a second step you will need some kind of algorithm, the details of which are given below, that uses this time-dependent error voltage to calculate how much control or feedback[pic] is needed in order to quickly reduce the error voltage to zero. As the third and last step we will apply this feedback under the usual assumption that the system responds linearly to this control via [pic].

The simplest control algorithm uses only proportional feedback, i.e., feedback that is proportional to the error signal at that very moment, via [pic]. As we sample at discrete times [pic], this proportional feedback can also be written as

[pic].

The main advantage of proportional or P-control is of course it’s simplicity. The main disadvantage is that this type of feedback can never reduce the error signal to exactly zero (Why not?). We can of course make the residual error signal smaller by increasing the proportionality constant [pic], but if we increase it too much our control system will become unstable and start to oscillate. The main reason for this behaviour is the presence of unavoidable time delays between the temperature measurement and the heating response at that same position. These time delays correspond to phase shifts in the frequency domain that will give the feedback the wrong sign and make it in-phase (feed forward), instead of out-of-phase (feed back), at sufficiently high frequencies.

An alternative control algorithm uses integrating feedback, where the feedback depends not only on the instantaneous error, but also on the past error values. For this type of control the feedback is given by

[pic] .

The main advantage of integrating feedback is that it has a memory of past perturbations and in principle controls the system back to zero error signal. This memory is at the same time a disadvantage, as it reduces the control speed; the low-frequency fluctuations are much better controlled than the high-frequency ones.

A very popular control algorithm uses the combination of both proportional and integrating feedback in a so-called PI control. In the above notation this type of control has

[pic] .

When we specialize this to our temperature control setup, this becomes

[pic] ,

where [pic] is the measured voltage over the NTC resistor for the nth sampling point, [pic] is the set NTC voltage that we want to reach, [pic]is the heating power that needs to be applied and [pic] en [pic] are the feedback constants. In the actual experiment a complication arises from the fact that the system temperature is controlled via the heating power, which is a quadratic function of the DAC voltage. The vi program should account for this complication.

As a side remark we note that the "strength of the integrating feedback" is not only proportional to[pic], but is also inversely proportional to the sampling time [pic]. More sample points per unit time will obviously lead to an increase in the integrating feedback [pic] in the above discrete representations of the time integral [pic]. Based on this notion, there is another (more physical) parameter to quantify the relative strength of the integrating feedback as compared to the proportional feedback. This parameter is ``effective integration time " [pic], which is the time it takes the integrating control to build up to the same strength as the proportional control (at fixed error signal). In terms of this parameter the PI feedback is

[pic]

There are fancier algorithms than PI control. One of these is the so-called PID control, in which an extra differential term, for which the feedback is proportional to the time-derivative of the error signal, is added to the PI control. The form of this differential term alone is

[pic],

where the right-hand expression is an alternative discrete representation of the time-derivative that is less sensitive to noise. The advantage of PID over PI controls is that they are generally faster, as the differential term increases the feedback strength of high-frequency fluctuations. The disadvantage of PID controls is that they more susceptible to noise, due to the differential action.

The figure on the next page shows typical time traces of three controled systems and summarizes their differences. For P control the equilibrium does not correspond to the set-point. In theory, the evolution towards this equilibrium should be a simple exponential decay. In practice some overshoot can occur due to time delays between sensor read-out and actuator response. PI control is better in the sense that the equilibrium does correspond to the set-point. Theoretically, this equilibrium is reached after a damped (or possibly overdamped) harmonic oscillation. PID controls can potentially be faster, albeit somewhat more noisy.

[pic]

Optimisation of the feedback parameters of a PI control requires some skill. A standard trick to find the limitations of system & control is to search for the ultimate feedback constant [pic] at which the system starts to oscillate under proportional feedback only ([pic]). As a rule of thumb, the optimum parameters for stable PI control are now roughly [pic] for the proportional term and [pic]for the integrating term, where [pic] is the oscillation period of the unstable system.

Experimental challenges

|1. |HARDWARE: |

| |(a) Wire up the temperature sensing circuit, by connecting it to the AI 0 (= Analog Input 0 = ADC 0) and the external|

| |+ 5V of the I/O box . Make sure that you ground both cables! |

| |(b) Wire up the heating circuit, by (i) routing the DAC (AO0) output to the B connector of the Darlington circuit and|

| |the associated ground to the grounding of the heating device, (ii) connecting the E output of the Darlington to the |

| |other side of the heating resistor, and (iii) routing the +20V and ground from the banana plugs out of the wall |

| |through the safety box into the E connector of the Darlington circuit and the heater grounding, respectively. Please |

| |compare your connections very carefully with those depicted in the figure before you make the final connection with |

| |the +20V supply; a short circuit is easily produced. |

|2. |SOFTWARE: |

| |(a) Write a VI that allows you to monitor both the voltage over the NTC (related to the temperature) and the DAC |

| |voltage (that is send to the Darlington circuit and produces the heating power) as a function of time. Add a meter to|

| |show the instantaneous heating voltage and at least four digital controls to set the sampling rate, the require NTC |

| |voltage, and the strength [pic] and [pic] of the proportional and integrating feedback terms. Also add a digital |

| |indicator for the instantaneous NTC voltage. |

| |(b) It is probably wise to separate the PI control from the complications that originate from the quadratic relation |

| |between heating power and drive voltage. We suggest that you first derive the (instantaneous) error voltage [pic], by|

| |subtracting the NTC voltage from the require value, and write the PI control algorithm that calculates the required |

| |heating power from these error voltages, in combination with the feedback parameters [pic] and [pic]. |

| |(c) Have another look at the relation between the DAC voltage and the heating power. Now construct an equation that |

| |converts the required heating power back into a DAC drive voltage and incorporate this equation behind your previous |

| |PI control algorithm. After connection with suitable analog output subVI(s), this completes your PI control. |

| |(d) Save the VI before you run it. Complicated VIs have a tendency to crash on the first run! |

|3. |VI TESTING & THERMAL RESPONSE |

| |(a) Before running and testing the VI we have to set a few input parameters. The first choice we have to make is the |

| |sampling time. Theory tells us that it is in principle sufficient to take a sampling time that is about 1/10-th of |

| |the response time of the system, but how fast is the thermal response of the system? Make a reasonable guess for the |

| |sampling time, set the feedback parameters [pic] and [pic] equal to zero and run the VI. Set the y-axis for |

| |auto-scaling and the lay-out of the waveform chart that records the NTC voltage for points-and-lines plotting (use |

| |symbol in upper right-hand corner for layout changes). If the VI runs properly, you should be able to see the |

| |ultimate limitation of the ADC in the form of "bit noise". |

| |- Check whether the voltage step per bit agrees with the expected value for our 16-bit ADC. Print the figure and clue|

| |it into your Labjournal. |

| |(b) We will now check the thermal time response of the system. For this purpose we want to run the VI over an |

| |extended period of time (say 5-10 minutes) and might need more data points on the waveform chart. If you want to |

| |change the standard number of 1024 data points into something bigger, you can do so via the option chart history |

| |length that shows up after right-clicking on the waveform chart. Check the thermal time response, by performing a |

| |single run under three consecutive conditions: (i) first with heater/feedback off, (ii) then with heater fully on |

| |(just take large feedback constants), (iii) with heater/feedback off again. The 2nd part of this run shows how fast |

| |the system heats up under maximum heating. Please don't to go beyond 50-60 (C, as I am not sure how much heat the |

| |system can stand. The 3rd part of this run shows how fast the system cools down. In a simple model this cooling |

| |corresponds to an exponential decay of the deviation from room temperature. |

| |- Play around with the parameters until you have a neat-looking time trace and print it for your labjournal. Show it |

| |to an assistant as a proof that your wiring is correct. |

| |(c) Does the temperature excursion decay exponentially and if so, what is thermal response time of your system? In |

| |view of this knowledge, did you make a proper choice for the sampling time, or did you over-sample? (answers in |

| |labjournal) |

|4. |TEMPERATURE CONTROL WITH (PI) FEEDBACK |

| |(a) Finally we want to test and optimize the control system, by modifying its feedback parameters [pic] and [pic]. |

| |Start with proportional feedback only ([pic]=0) and try a few feedback parameters. Discuss the results with an |

| |assistant and summarize the conclusions in your labjournal. Add a print of a characteristic time trace. |

| |(b) Repeat these tests for integrating feedback only ([pic]=0) and report the results. |

| |(c) Use a combination of proportional and integrating feedback and draw your conclusions. Explain in jour labjournal |

| |how you determined the optimum feedback and what criteria you used. |

| |(d) (Optional) For fun you could also check how good this feedback scheme controls the temperature and protects it |

| |from external influences like air currents (blowing). |

| |(e) (Optional) If you still have time left, please feel free to dress up the temperature control in any way you find |

| |suited. One extension could be the inclusion of a differential part in the feedback scheme, to make it a PID instead |

| |of a PI control. In principle, this could speed up the control, but also makes it noisier. Another extension could be|

| |the addition of a digital filter, to suppress some noise and incorporate time response effects. The most elegant |

| |extension is to let the algorithm optimise its own feedback constants. Such an "intelligent control" works by probing|

| |the system's dynamics during the heating and cooling trajectories and uses the obtained information to optimise the |

| |feedback parameters[pic] and [pic] (and possibly even [pic]). |

Report

We expect some nice prints in your labjournal and answers to all questions addressed under points 3 and 4 above.

-----------------------

NTC

PC

1k(

ADC

heater

+5 V

DAC

Thermal conductivity ( [W/K]

Safeguard against shortcircuiting

Heating power P [W]

+20 V

Heat capacity C [J/K]

system

Thermal bath (= large environment)

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download