Tech Report-temp Controller

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Tech Report-temp Controller as PDF for free.

More details

  • Words: 2,268
  • Pages: 5
The Thermistor Used in a Temperature Controller for the Alexandrite Laser Rod Jane Thipphavong A&EP Lasers, Inc. March 10, 2003 ABSTRACT An inexpensive procedure to keep the alexandrite laser rod at a specified temperature is to use a thermistor in a temperature controller. The resistance was measured for a range of temperatures in order to calibrate the thermistor. After completing the calibration and assessment of errors, the thermistor was used as a digital thermometer in conjunction with a computer program to control a heater. By analyzing this system, it is found that the thermistor is capable in maintaining the temperature of the alexandrite laser rod with an accuracy of ±3˚C. INTRODUCTION The goal of the project is to implement a temperature controller to hold the alexandrite laser rod at some specified temperature between 30˚C and 100˚C. The proposed solution is to use a thermistor in combination with a computer to achieve this. Moreover, thermistors are quite common and inexpensive, making it practical for the budget as well as achieving the project goal. Thermistors have the property that its resistance changes exponentially with temperature. Using this fact, a computer can measure the resistance from the thermistor to calculate the current temperature. The computer uses this calculated temperature to signal a heater to control the temperature, depending on how great the current temperature deviates from the desired one. A thermistor was calibrated and used in a temperature-controlling unit to determine whether it was acceptable for use. Results indicate that using the thermistor in the temperature controller does maintain the specified temperature. The rest of the report explains the theory; the apparatus and method; and the results and conclusions in greater detail. The appendices… THEORY The thermistor resistance is related to the inverse of the temperature exponentially: R = R0exp(T0/T)

(1)

where R is the thermistor resistance (in Ohms) and T is the temperature (in degrees Kelvin). R0 and T0 are parameters specific to the thermistor. Hence, as the temperature T increases, the resistance R decreases to at most R0. Conversely, as T decreases towards 0 Kelvin, R increases. Using (1), measurements of the resistance R from the thermistor can now be used to calculate the temperature T. Moreover, rearranging (1) yields: ln(R) = ln(R0) + T0/T

(2)

which describes a linear relationship between ln(R) and T. Hence, a linear least squares fit of ln(R) and 1/T from the measurements, results in ln(R0) being the ln(R)-intercept and T0 as the slope of the fitted line. Since R and T are measured quantities, error analysis must be done to determine the uncertainties in the calculated values. The uncertainty of each value, (denoted by a preceding Δ,) is calculated using the following formulas:

Δln(R) = [Σi(δi)2/N]½

(3)

½

ΔT0 = Δln(R) (N/D)

2

where

(4) ½

Δln(R0) = ΔT0[Σ(xi) /N]

(5)

δi = ln(Ri) – ln(Rt)

(6)

2

2

D = NΣ(xi) – (Σxi)

(7)

xi = 1/Ti

(8)

N represents the total number of measurements; xi are the measured values; and δi are the residuals defined as the deviations of individual measurements of ln(Ri) from theoretical values of ln(Rt) computed from (2). From error propagation analysis, the uncertainty of temperature T, ΔT, is: ΔT = (T/T0) [(ΔT0)2 + (TΔln(R)2 + (TΔln(R0)2]½

(9)

where ΔT0, Δln(R), and Δln(R0) are calculated using the above equations (3)-(5). The ΔT represents the error in the calculated T values from the actual temperature of the thermistor. Because of error propagation, ΔT is highly dependent on the errors: ΔT0, Δln(R), and Δln(R0). A more detailed explanation of the theory behind error analysis and the development of equations (3)-(9) may be found in Appendix I. APPARATUS AND METHOD The temperature controller consists of three main components: (1) the computer (program), (2) the thermistor, and (3) the heater. The computer program reads the thermistor resistance and then calculates the temperature using (1). Depending on how much this calculated temperature deviates from the desired temperature, the program decides whether to the heater is needed. In order to evaluate the thermistor as an adequate temperature controller with an accuracy of ±3˚C, the following equipment will be needed: 

PC Computer



Thermometer



Heater



Lab PC+ I/O Board and Protoboard



HEXFET, Push Button, Resistors and Wires

The project is divided into two stages: 

Stage I: Calibrating the thermistor. o

Measure the Resistance Temperature curve for the thermistor. To do this, the thermistor resistance was measured for a range of temperatures and then graphed to show their relationship. 

Refer to Figure 1 below on how to connect the components. The push button switch allows the heater to be controlled manually.



A C++-program was written to allow for: (1) manually entering a thermometer temperature reading, (2) reading the voltage from the ADC on the Lab PC+ board, and (3) using this voltage to compute the thermistor resistance by the equation: VT/V0 = RT / (R1 + RT)

(10)

Rearranging (10) to give the variable of interest yields: RT = VTR1 / (V0-VT)

(11)

where V0, R1 are measured from the circuit in Figure 1, VT is the voltage reading, and RT is the calculated thermistor resistance.

o





The program was structured to take in a series of measurements and export all data to a text file useable by Matlab (or any other software) analysis. Refer to Appendix II for the actual C-program used.



The C++-program was then used to record a range of temperature measurements at 3 to 5˚C intervals (and the calculation of the associated thermistor resistance) as the thermometer responded to a constant heating. Data was taken until about 90˚C and then the heater was turned off to record temperatures and resistance as the thermometer cooled to below 30˚C.

Find values for R0 and T0, which complete the calibration of the thermistor. This was done by using Matlab to plot equation (2), and then performing a linear least-squares fit to the data points. See Figure 2. From (2), we see that the ln(R)-intercept and slope of the fitted line correspond to ln(R0) and T0 respectively. 

Matlab was used to plot the Ri values of thermistor resistance vs. temperature Ti to verify that it followed the model (1). See Figure 3.



Next, Matlab was used to plot ln(Ri) vs. 1/Ti where the data taken when the block was heating up are plotted as open circles and the cooling data are plotted as x’s as shown in Figure 2. The polyfit() function was then used to obtain a least squares fitting of the data to a straight line and determine the slope and intercept of the best fit line.

Stage II: Operating the temperature controller. o

Set up the digital temperature controller. The power transistor, HEXFET, now replaces the manual push button. 

o

As seen in Figure 4, the Source is connected to ground, Drain to the heater, and the Gate to PA0. When a HI signal is applied to the Gate, HEXFET acts like a closed switch, and vice versa for a LO signal.

Maintain the temperature by controlling a heater using a thermistor in conjunction with a C++ program. The C++ program performs the following: 

Set ports A, B, and C on the Lab PC+ board for output and then initialize PA0 to 0 volts.



Prompt the user to enter the desired temperature, TSET.

Then, the process below is repeated in the program every two seconds until keypressed:

o



Use the ADC channel 2 to read the thermistor voltage in ADC units, convert the ADC units to voltage, and calculate the thermistor resistance and temperature, TEMP.



If TEMP is less than TSET + 1, the Gate of the HEXFET (PA0) is set to LO, in order to signal the heater to turn on. Otherwise, if TEMP is greater than TSET + 1, the Gate is set to HI, to turn the heater off.



Export the elapsed time in seconds and the measured temperature for each reading to a text file useable by Matlab (or any other software) analysis.

Testing the temperature controller. Run the C++ program for a few minutes to test the temperature controller. Then, use Matlab to plot the temperature vs. elapsed time data. Refer to Figure 5.



If the computed temperatures from the thermistor resistance readings do not match up with the actual temperature on the thermometer, then the calibration values of R0 and T0 may be slightly incorrect. In particular, the thermistor used in this experiment needed an adjustment to T0 in order to correct the inconsistency.



As shown in Figure 5, the temperature vs. elapsed time data was plotted with Matlab to indicate that the temperature controller was working properly.

RESULTS Stage I: Calibrating the thermistor. The resistance versus temperature data, shown in FIGURE 3, does match up well to the exponential relationship described in (1). In FIGURE 2, Matlab was used to perform a least squares fit on the ln(R) vs. 1/T data. From FIGURE 2, note that there is some type of systematic error between heating and cooling since the heating data points were a little below the fitted line and the cooling data were above. The error can also be seen in the residuals plot in FIGURE 3, where the heating data points are mostly below 0 and vice versa for cooling data. This “hysteresis” effect is due to the thermometer not being able to display the precise “real time” temperature. In the case of heating, the thermometer is too slow in rising to the actual temperature. Hence, lower-than-actual temperatures are recorded, resulting in data points being below the fitted line in FIGURE 2 and vice versa for cooling. In order to solve this error, only the heating data was fitted, as shown in FIGURE 4. It was from this graph that the constants to calibrate the thermistor were obtained. Moreover, error analysis was done to determine what the uncertainty in the parameters ln(R), R0 and T0 would be. The complete analysis resulted in: ln(R0) = -4 ± 0.1296

(12)

T0 = 3466 ± 42.5890 °Kelvins

(13)

Δln(R) = 0.0383

(14)

These values were then used to calculate the uncertainty for the T values. The average ΔT was found to be 6. Note that ΔT does not represent the error in maintaining TSET, but rather the measured value of TSET by the thermistor itself. Hence, an adjustment of T0 was necessary for the temperature on the thermometer to match the thermistor temperature. See Appendix III for the complete list of ΔT values. Stage II: Operating the temperature controller. There are a couple of points that need to be accounted for: 

As stated before, if the computed temperatures from the thermistor resistance readings do not match up with the actual temperature on the thermometer, then the calibration values of R0 and T0 may be slightly incorrect. The thermistor used in this experiment needed an adjustment to T0. The value of T0 was changed to 3303 °Kelvins in order to correct the inconsistency.



The V0 on the Protoboard actually fluctuates since the +5 volt power supply has a 50 mV 60 Hz ripple superimposed on its output. The variation in V0 also affects VT and RT since these are all related by equation (10). In Figure 6, we can see this effect by noting that the temperature does not appear smooth as it is rising and falling. o

To reduce this error, another ADC was used to measure V0 immediately before reading VT. These values of VT and the corrected V0 are then used to calculate RT by equation (10).

o

Since V0 is much more accurate when found in this manner, it reduces the fluctuations in the temperature. This is apparent in Figure 7, where we see that the temperature rises and falls more smoothly than Figure 6.

From Figure 7, we see that the temperature controller accurately controls the desired temperature within ± 3 °C. The graph shows that temperature overshoots a little more than undershoots. This is because the temperature does not cool fast enough in the two second delay before the heater is turned on again by the computer. CONCLUSIONS 

Figure 7 indicates that the thermistor is acceptable for use in a temperature controller. The desired temperature was successfully maintained within ±3°C.



Moreover, Figure 7 shows that the average temperature of the system is actually higher than TSET because of more overshoot than undershoot. This could be a problem if the system turns out to be more temperature-sensitive when exposed to temperatures greater than TSET over a long period of time. This may be solved by conducting further experiments on how long the delay should be between successive temperature readings in order to allow enough time for the system to cool to a lower temperature before turning on the heater.



Calibration technique may need to be improved to obtain more correct values for R0 and T0. As a result, ΔT will be smaller, which improves the accuracy of the measured temperature values by the thermistor.



The temperature controller was tested one desired temperature setting. However, further testing should be done to ensure the temperature controller works over a range of temperatures. Also, different thermistors should be considered to optimize cost and quality. Ultimately, final testing of the temperature controller should be done with the alexandrite rod to ensure the design meets requirements.

FIGURES Figure 1: Circuit board. Figure 2: Plot of ln R vs. 1/T Figure 3: Plot of R vs. T Figure 4: Temperature Controller Circuit Figure 5: Residuals Figure 6: Jagged V0 Figure 7: Corrected V0

Related Documents

Controller
May 2020 7
Tech
October 2019 67
Micro Controller
May 2020 7
Micro Controller
May 2020 14
Composite Tech&tech
May 2020 27