John Kuehn Shirley Hong Peter Tam Controlling a Temperature Controlling Device Abstract: This experiment enabled us to perform a digital-to-analog (D/A) operation using the National Instruments DAQ board within our computer. Ultimately, we constructed a feedback based system that controlled the temperature of an aluminum block with great precision. Upon many trials, we obtained coefficients with the values A=5.0, B=0.0008, and C=3.0 which provided the best temperature control and temperature measurements. These coefficients enabled us to record temperatures with utmost precision of 0.2 degrees Celsius for set temperatures within the range of 15º to 40º degrees Celsius. Introduction: The motivation for creating a PID controller was to create a system that could automatically monitor and control a device or system of devices. This controller can be used to replace a human operator that would otherwise have to constantly monitor and adjust the system manually. The PID controller allows us to automatically adjust some set measurement, and the controller takes care of keeping that device in range of the specified measurement. We created a PID controller that controls the temperature of an Aluminum Block. The PID stands for Proportional, Integral, Derivative. ‘P’ is the proportional gain parameter. This is the first parameter of the PID control algorithm and has a coefficient ‘A’ attached to it. This output value is proportional to the difference between the set value and the current value (The Error). In this case the error was the difference in Set temperature v. Current temperature. ‘I’ is the integral parameter. This output is proportional to the time integrated with the error signals. This parameter is helpful because it tends to stabilize right above or below the set point, and provides additional output to counteract energy losses to the system. This is the second parameter of the PID control algorithm and has a coefficient ‘B’ attached to it. In this case, the integral parameter provided a voltage to counteract heat dissipation or absorption from the air in the room. Lastly, ‘D’ is the derivative function or the rate which the problem overshoots or undershoots the range of the set point. This is the third parameter of the PID control algorithm and has a coefficient ‘C’ attached to it. By taking a derivative in the change error (temperature) small fluctuations are eliminated In this case, the derivative parameter provided for a more stabile temperature. By manipulating the variables, the PID controller will change in response to any change in the measurement or the set point. In our case, it will either raise the temperature of the aluminum plate or lower the temperature of the plate. The theoretical concept behind the PID temperature controller is that when the temperature is measured, this temperature value is used to control the error signal that is determined by this simple algorithm. Vin = AE + B t (m=0 to n) Em + C/t * [ En – En-1 ] Vin is the voltage applied, A is the gain, En = temperature set point, En-1 is the previous set point; delta t is the integration time. Thus, this algorithm takes an input temperature and finds the correct output voltage necessary to heat the aluminum block and maintain it at the set temperature. The Thermo Electric device used to cool and heat the block in the PID temperature controller is also known as the Peltier Thermo-Electric device. We shall refer to this as a TE Device from now on. The TE Device has an array of thermocouple junctions and are arranged in such a way as to provide a heating side and a cooling side. Therefore, heat can be dissipated through this thermoelectric module or it can be absorbed depending on the direction of current flow through the thermocouplers, which then can be measured by watts/cm which is I = V^2 /R. Experimental Setup & Procedure: 1. Build a Vi that instructs your DAQ board to perform a D/A operation named Simple Write-Easy I/O. 2. Attach a voltmeter between your DAQ board’s Digital-to-Analog Channel 0 Output (DAC0OUT) and Analog Output Ground(AOGND), then verify that you can use Simple Write-Easy I/O to output voltages. 3. Build a digital temperature controller that can control the temperature of an aluminum block to within less than 0.05º degrees Celsius of a given set-point temperature. A. The algorithm for the controller includes: i. Reading from the block’s temperature Tsample using a thermistor as the temperature sensor. ii. Comparing Tsample with the desired set-point temperature Tset-point iii. Decide what value of Vin will command the TE device to provide the heating or cooling needed to bring Tsample closer to Tset-point iv. Applying this voltage at the Vin input of the voltage-controlled current driver circuit. v. Repeating this process continuously to obtain the desired temperature control of the aluminum block. First, sample readings of temperature were taken. To average out random fluctuations when reading the thermistor voltage we determined the mean of the data. Then, Ohm’s Law and Steinhart-Hart Equation was used to convert the voltage to the temperature Tsample. The Discrete Sampling PID Control algorithm was then implemented n in software: Vin AE Bt Em m 0 C En En 1. The error E was determined every t t seconds and the summation in the right hand side term is over all the error-values determined since the program started running. (Since our set-up is similar to the one described in Appendix I of Essick, we originally used constants with the values A=7, B=1, C=0.5. However, the measurements taken were not at its optimum. Consequently, we ran many trials of different constants until the optimum values were acquired.) The Simple Write-Easy I/O was used as a subVI in the block diagram to output of the PID value for Vin to the input of the TE device’s voltage-controlled current driver circuit. In order to construct the digital temperature-control system, the thermistor-based digital thermometer from Chapter 10 is rebuilt. The thermistor is now used to monitor Tsample. An 1F capacitor is added to shunt high-frequency noise signals to ground. The unity-gain buffer is not included in the circuit due to unstable and inconsistent results. Vout and GND is connected to the inputs of the A/D channel of our LabVIEW system. (The software was wired as shown in the attached pages.) Results: Many tests were run on the PID temperature controller. The controller was tested for range, stability, speed, and accuracy. Before any of these tests could be run, it was first necessary to find the proper coefficients for the control algorithm. Starting with the book’s suggestion: A=7.0, B=1.0, C=0.5 and testing various other configurations, trial and experimentation led us to believe the coefficients A=5.0, B=0.0008, and C=3.0 were best suited for our setup. Starting at room temperature (around 23º Celsius) and climbing to a set temperature of 32º Celsius was the standard for testing coefficients. One can see by the graph on the following page why we chose the coefficients that we did. Since only one Thermo- Electric device was available for use in this experiment, and there were no secondary devices or backups, much care had to be taken to prevent damage to the unit. TE Device specifications were somewhat of a mystery since its data sheet was in a different language, therefore operating values of 2.0 ± 0.1 amps where used instead of the alleged 8.0 amps the specifications seemed to suggest. When positive voltage was applied to the circuit, positive amperage flowed though the TE device causing heating of the aluminum block, and when negative voltage was applied, the current flowed the opposite direction and caused for cooling of the block. To find the range of the temperature controller we simply ran it at the maximum input and output voltage for extended periods until the temperature of the aluminum block reached its maximums and minimums respectively. We found that the block could reach temperatures as low as 5.2º Celsius and temperatures as high as 75.4º Celsius. The testing of the controller’s stability went hand in hand with finding the best coefficients for the PID algorithm. We chose the values A, B, and C based on which looked the most stable. We noted that stability increased with an increase in the C term which correlates to the damping factor in the PID algorithm. This makes sense, but this term was also responsible for the situations in which aluminum block temperatures would not quite reach the desired set temperatures, especially when the set temperatures were below room temperature. The speed of this temperature control unit depended on many factors. Some limiting factors include: The power supply driving the TE Device, the Room Temperature, and the heat transfer properties of the aluminum block. These factors were assumed to be constant for all tests. The one factor we did control (as stated earlier) was the voltage supplied to the controlling circuit and thus controlling how much current was applied to the TE device. Granted, we limited the current source to 2.0 amps, the PID control algorithm could be modified to reduce the rate of temperature change of the aluminum block. The ‘A’ coefficient was in charge of the proportional part of the PID control algorithm. When testing for the best coefficients to use, A was changed slightly in the range from 5.0-7.0. The results of changing these constants were small, but the results imply that smaller values of ‘A’ caused for faster divergence to the desired set temperature. This goes against our assumptions that higher values of ‘A’ increase the proportional rate of change. The accuracy of our digital temperature controller was highly dependent on a rather inaccurate temperature reader. Reasons for the inaccurate temperature reader will be discussed later, but it is important to verify that the PID controller is accurate. To test this, we actually did not read a “real” temperature. Instead we faked temperatures by providing the “temperature read” input of the PID algorithm with an array of input temperatures. With this being the case we could watch a non-fluctuating output voltage supplied to the control circuit. We believe that this voltage would regulate the control circuit to maintain a very accurate and stable temperature. Discussion and Conclusion: The book wanted a digital temperature controller that could adjust the temperature of an aluminum block to within .05º Celsius of a given set temperature. We were able to maintain the aluminum block at a temperature accurate to 0.2º Celsius in the range between 15º and 40º Celsius. It is not possible to get any better accuracy without having a stable temperature reader. The temperature reader ranged ± 0.3º C in very short time spans, and therefore caused the output voltage to fluctuate similarly. We were able to achieve accuracy of 0.2º C by reading in an average of multiple temperatures, and increasing the ‘C’ term (differential term) in the PID control algorithm to help stabilize fluctuations. Aside from the temperature-reading problem, all other aspects of the PID control algorithm coincided with PID control theory. The automatic temperature controller was fast, efficient, stable, and simple to operate. To keep a cup of tea warm, or keep a can of beer cool, this would be an overly accurate and involved method, but one could not be unhappy with the results. References: Essick, John, Advanced LabView Labs. Upper Saddle River, NJ: Prentice Hall, 1999. Pellet, Professor David E., Room 337, UC Davis Physics Department. 2002 Mouer, William. PID Basics. 1999. PID Controller Basics. 1999, Stanford University. http://bigben.stanford.edu/Labsuite/pid_basics.htm * Special Note * Some aspects of this report may be somewhat repetitive, and this is the result of multiple people working on different parts. The outline for the Physics 122 Lab write-up is somewhat redundant already, so we apologize if we are the same. * Other Note * Have a Good Summer, and if you publish this in a world renown Physics Journal let us know. –JAK, Pete, Shirley