In this lab, you will construct a temperature control circuit, which will keep an aluminum block at a nearly fixed voltage by controlling a cooling device.
Figure 1 shows a block diagram of a simplified version of a temperature control circuit taken from [1]. The original circuit was designed to allow the user to maintain the temperature of a diode laser at a stable value, either above or below the ambient temperature.
[1] K. B. MacAdam, A. Steinbach, and C. Wieman , “A narrow‐band tunable diode laser system with grating feedback, and a saturated absorption spectrometer for Cs and Rb”, American Journal of Physics 60, 1098-1111 (1992) https://doi.org/10.1119/1.16955
The 5 key parts of the circuit can be broken down as follows:
This lab will involve quite a few op-amp circuits, which is why you'll be using a TL074CN chip, which contains four op-amps in a single part.
Note that the power is connected along the middle pins instead of opposite corners here.
A thermistor (temperature-dependent resistor) has been embedded in the aluminum block to allow its temperature to be monitored. This particular thermistor has a nominal resistance of 150k$\Omega$ at 25°C (or 298.15 K). A first order approximation of the relationship between thermistor resistance and temperature is called the $\beta$ equation, given by Eq. 1
| $R = R_0 e^{\beta\left(\frac{1}{T} - \frac{1}{T_0} \right)}$ | (1) |
Here T is temperature in Kelvin and R is resistance in kΩ. $R_0$ is the 150 k$\Omega$ value, $T_0$ = 298.15 K, and $\beta$ is 3892K for this model.
This can be solved for the temperature T to get Eq. 2:
| $T =\dfrac{\beta}{ln(R/R_\infty)} $ | (2) |
where $R_\infty = R_0 e^{-\beta / T_0} \approx 0.32 \Omega $
Higher order accuracy can be gained with appropriate calibration measurements and the use of the Steinhart-Hart Equation or its higher-order cousins for mK level precision.
Design a voltage divider circuit using the thermistor and a fixed resistor that produces an output that increases with temperature. You can use eq. 2 to estimate what the thermistor's resistance will be at various temperatures. For this experiment, we have the constraint that one of the power supply's variable voltages will be set to $+10 V$ for the op-amps.
What would you expect $V_{out,sen}$ to be when the thermistor is at room temperature ($20^\circ$)?
What would you expect $V_{out,sen}$ to be when the thermistor is cooled to $15^\circ$?
Build the temperature sensing circuit. Record what the actual value of $V_{out,sen}$ is at room temperature. You may also want to verify that the resistance of the thermistor decreases as temperature increases by heating the sensor slightly (e.g., by holding the aluminum block).
Keep this circuit (and all subsequent circuits) built! You'll be using it again later.
Now that you have an idea of what sensor voltage corresponds to room temperature, you can create a circuit that will generate a target (setpoint) voltage.
Design a voltage divider that will let you produce a range of setpoint voltages, using a potentiometer.
For the circuit you choose, what range of $V_{out,set}$ values do you expect to be able to achieve?
Construct your circuit, and record what range of values of $V_{out,set}$ can be generated.
Before you continue, you should build a pair of op-amp follower circuits for the setpoint and sensor circuits and connect them for later use. From here on out, $V_{out,sen}$ and $V_{out,set}$ will refer to the output of the op-amp circuits.
The temperature control circuit will be used to control the current flowing through a Thermo Electric Cooler (TEC) so as to maintain the temperature of an Al block at about 15°C. The TEC uses the Peltier effect to transfer heat from the cold side to the hot side. The rate of heat transfer is governed by the magnitude of the current passing through the TEC. The TEC is a semiconductor device (distantly related to diodes), so polarity of the current flow through the device is important. Reversing the current switches which side is cooled or heated.
As shown below, the hot side of the TEC is attached with thermal paste to a heat sink while the cold side is attached to the Al block we wish to cool.
To start, we'll connect just the TEC and a resistor to the power supply. In this instance the resistor is used to limit the maximum current to the TEC, as otherwise it will happily try to draw more than 3A from the power supply.
Construct the circuit, and verify that the TEC gets hotter on one side and cooler on the other. If the side with the heat sink is getting cold, reverse the connections. Note that you'll probably have to turn up the current limit on your power supply here, and that the resistor will become quite hot.
To control the current through the TEC, we will be using a Field Effect Transistor (FET), depicted below. We haven't used FETs yet in this course, but essentially the resistance between the Source (S) and Drain (D) may vary between infinite and a few ohms, depending on the Gate (G) voltage. They're fundamentally controlled by voltages, rather than a BJT's current control.
To use the FET as a switch, we'll just pop it into our circuit as follows:
Modify your circuit with the addition of the FET. Test that, at the very least, the TEC cools when $V_{in}$ is +10 V and that it doesn't when $V_{in}$ is 0V.
The FET, its heatsink, and the power resistor will get hot while you are doing this lab. Take care to not touch other wires to them or brush against either when working. If you aren't sure if the part is cool, you can hold your hand near it or very gingerly touch it with the back side of your finger.
Also, the FET's heat sink is connected to the drain pin. If you touch it with other wires, you may find some very odd behavior popping up.
To test your circuit, you should try a variety of input voltages $V_{in}$ between 0V and 10V. This can be done a variety of ways; you can use a DC signal from your function generator, the other side of your power supply, or you might be able to use your setpoint circuit depending on the design.
Test the behavior of your cooling circuit, making a note of your choice of inputs voltages and the current through the device for each value.
At what input voltage does the FET (S)ource voltage begin to change?
What is the maximum current through the positive power supply as you test different inputs? You don't need to be precise, you can just read off the value from the LCD screen. Don't worry if you see 100s of mA; we'll need substantial power to make significant temperature changes.
It may be that you observe both your setpoint and sensor voltages drop whenever the TEC starts drawing much current. Some of this behavior can be explained by the fact that, when we start moving over an amp of current through our wires, their small resistances may still result in measurable voltage changes. Consider that if a wire has even $0.01\Omega$ resistance, we'd get a 10mV drop across it when passing an amp of current through it. A more sophisticated circuit would take care to stabilize the voltage divider circuits, using a diode clamp or a voltage regulator.
To begin with, consider a control circuit without any negative feedback at all, shown below.
What do you predict $V_{out,fb}$ will be when $V_{in,1} > V_{in,2}$? What about when $V_{in,1} < V_{in,2}$?
What would happen if you switched the setpoint and sensor connections?
Build the comparator circuit shown below and test your predictions. In this instance it may be useful to use a function generator as a dc voltage for $V_{in,1}$ and then use ground $V_{in,2}$.
Now that you know how to control the cooler and you have the sensors and a basic feedback circuit constructed, it's time to put things together.
You should probably be able to tell if the cooler is actively working or not somehow other than by touching it. To start, you might use the output of your feedback circuit to light up an LED when the cooler is on.
Add an LED indicator to your circuit, however you wish. It can be as simple as one LED and a resistor, or you can use a transistor driver if you need things to be brighter. If you really wanted to be fancy you could pass the temperature sensor's output to a chain of resistors in series, then use comparators to light up more LEDs the higher the temperature of the block.
In order to log voltages from your circuit as a function of time, you'll have to do a little bit of setup first.
run all button shaped like two arrows in the menu bar ⏩ )
This will connect to the oscilloscope using Python, set it to make measurements of the mean values of channel 1 and channel 2, and then save values once per second. The default runtime is 240 seconds, but you can change the value after the runtime variable to however long you want.
To keep a copy of a plot after it runs, click the power icon in the top right corner of the plot and then right-click the image to save.
If you get an error message about parameter conflicts, hit the default setup button on your scope, turn on channel 2 again, and then re-run the software.
Start the software and turn on your power supply.
Save a copy of the error signal voltage vs. time. Note any relevant information such as the starting and ending voltages and times.
It should be noted that this is not a very precise way of doing this; the scope is not a great tool for measuring small, instantaneous dc voltages. You may see some quantization of values occur that will distort your readings. A better option would be to use a dedicated benchtop voltmeter, but for instructional purposes we decided to keep the same instruments you've been using.
We are still doing some apparatus construction to make the purpose of the advanced feedback controls more apparent. Stop here if this is your first day.
Now that you've got a functioning circuit, it is time to alter the way in which it controls the temperature; this can be done by modifying the control circuitry. Right now, with the op-amp acting as a comparator, the cooler is either fully off or fully on. This works reasonably well for our setup, which has a small aluminum block with the thermistor close to our very powerful cooling unit. However, in many systems the feedback is more delayed and thus this method would oscillate above / below the setpoint temperature by a wider margin.
There are two options at this point.
Your choice of option will not affect your grade for the lab.
Consider the circuit below, which is a modified inverting amplifier:
What do you predict $V_{feedback}$ will be in terms of $V_{sensor}$, $V_{setpoint}$, $R_1$, and $R_2$?
Why is this called proportional control? What is the thing that is proportional to what?
Modify your control circuit as shown in the figure above. We suggest starting with a 100:1 ratio of $R_2$ to $R_1$.
You may want to disconnect the sensor, setpoint, and feedback connections in order to test this circuit with a known signal; otherwise it may be difficult to tell if the modified circuit is behaving as intended. After you are satisfied that your control circuit is functioning, re-connect it to the other sub-circuits. Once again, prepare to record both $V_{sensor}$ and $V_{setpoint}$ with the computer.
After turning off your circuit for a bit and letting the Al block come to equilibrium, start the data collection on the computer and then turn on the power supply.
Observe how the temperature of the block approaches the setpoint temperature.
Does the Al block reach the set point temperature?
What is the characteristic time with which the block reaches equilibrium?
Repeat the measurement for different values of the proportional gain.
How does the characteristic response time of the TEC change as a function of gain?
This section is experimental! It has yet to be thoroughly tested by students; on the flip side what you do can inform future offerings of this course. We also do not know how long it will take, so don't be worried if you run out of time. If for some reason you want to play with the circuit past this week, then a few folks leaving their circuits built on breadboards won't cause any issues.
What we'll do from here out is take the difference between our sensor and setpoint voltages, also called an error signal, and manipulate it in various ways.
To start, we'll construct an op-amp circuit called a difference amplifier. As the name suggests, it has an output that is proportional to the difference between the inputs. We'll start with the simple version, which has direct proportionality.
Consider the circuit below:
Will this circuit be able to directly control your heater? Why or why not?
Replace your existing feedback stage with the difference amplifier shown above.
You may want to use your function generator in place of the sensor and setpoint voltages when testing; otherwise it may be difficult to tell if the modified circuit is behaving as intended.
After you are satisfied that your control circuit is functioning, re-connect it to the other sub-circuits. You can hook it up to your cooler if you want, but unless the lab is on fire it probably won't do anything.
Everything we're doing today is going to be in service of expanding out the feedback portion of our circuit. So, let's start filling it in with our new circuits. The difference amplifier will be the first thing to process inputs, but we won't use it directly as an output.
Now let's do something with this error signal to actually control our heater! We'll start with the most straightforward approach, which is to make the signal driving our FET proportional to (but larger than) our error signal.
Using the fourth op-amp in your chip, make the proportional amplifier shown above. Test that the output works as expected, but don't connect it to the peltier controller just yet.
You may have noticed an issue here: the sign of our feedback is backwards! This was intentional, for reasons that will become clearer later on. For now we need a means of flipping the sign, and we'll accomplish this with yet another op-amp circuit: an inverting amplifier with a gain of 1!
Wire up another TL074 op-amp chip, and build the proportional amplifier shown above using the difference amplifier as the input.
We're ready to try controlling temperature again! Hook up the peltier again and collect some data.
Observe how the temperature of the block approaches the setpoint temperature, and what happens after reaching the setpoint.
Does the Al block reach the set point temperature?
This is the end of what's been reasonably well tested in the past. You can stop here, or you can continue to experiment with using integral and differential feedback. Stopping here will not impact your grade.
A problem with just having proportional feedback is that it will naturally slow down as your sensor and setpoint voltages get closer together. To address that, we can add some 'momentum' to our feedback in the form of the integral of our error voltage over time. This means that the longer the error signal persists, the stronger the feedback drive signal becomes. On its own this would overshoot the setpoint every time and result in oscillations for a while, but combined with proportional feedback it can speed up how quickly a system comes to equilibrium.
Consider the control circuit shown below:
The integrator made with an op-amp is essentially a better version of the kind made with only a resistor and capacitor. A voltage at the input is translated to a current through $R_{I1}$, which charges up the capacitor $C_{I1}$. For a constant input voltage, the output will grow at a constant rate. The one caveat is that the sign of the integral is flipped; a positive voltage at the input will result in an increasingly negative output.
It also turns out that we lied when we stated the second Golden Rule of op-amps (that the voltage at the inverting and non-inverting teminals of an op-amp will be the same when there's negative feedback). There will be a slight difference, on the order of microvolts or less, but that would add up over time with a perfect integrator. Thus, we add in $R_{I2}$ to keep that effect from building up.
Assuming you want your integrator to act over the course of a second or so, what values of $R_{I1}$ and $C_{I1}$ might be appropriate? Note that the largest capacitor you have access to that isn't polarized is about 3.3 $\mu$F.
Construct the circuit shown above, but do not connect it to the rest of the feedback network yet.
Try testing the integrator's behavior with a known signal from the function generator before you continue on.
To add the integral feedback to your network, we need only connect it to our inverting amplifier with the same resistor value as the proportional feedback circuit, shown below.
Try testing the temperature controller again, with the proportional feedback included.
In contrast to integral feedback, differential feedback acts as a damping force on our system. If there's ever a sudden change in the error signal it acts to mitigate its output by opposing the proportional feedback. Our temperature controller isn't a system where this is likely to be extremely relevant, but if we for instance had a much more capable cooler, we might not want it to suddenly turn on full blast if there's a glitch in the sensor. A much more relevant situation would be in controlling motors, where sudden changes in drive can come with unwanted side effects (e.g. sudden torques on your motor's mountings).
Consider the circuit below:
In the circuit above, if $V_{err}$ is constant, the capacitor will eventually charge up and thus there will be no current through any components, resulting in the output $V_D = 0$. If the input is changing, then the current through $R_{D1}$ and $C_{D1}$ will also be shared by $R_{2D2}$, resulting in an output signal. The time constant for this only depends on $R_{D1}$ and $C_{D1}$ as the virtual ground at $V_-$ keeps the feedback resistor from affecting the capacitor's charging/discharging.
Construct the circuit shown above, but do not connect it to the rest of the feedback network yet.
Try testing the differentiator's behavior with a known signal from the function generator before you continue on.
We're ready to complete our feedback network now by adding the differential component the same way we did the integral component, shown below:
|
| Our completed PID network. Tuning the behavior of such networks for a given task is a science in and of itself, and usually falls into the purview of engineers. For a brief overview, see the following website. |
Try testing the temperature controller one more time, with the derivative feedback included. Depending on your parameters, it may or may not make much difference in how well the output settles.
There're no new instructions here, feel free to skip.
There are a few possible directions modifying this circuit could take. One would be to add derivative-based feedback, which could increase the feedback voltage (and thus current in the cooler) if it isn't changing quickly/ or reduce it if the signal is changing too much to prevent overshooting. This makes sense if you're working with a more open, unknown system than a particular block of aluminum. The other would be to add integral-based feedback, which can help drive the system closer to the desired setpoint if it has a tendency to be consistently high or low.
A circuit utilizing all three types of feedback is know as a PID controller, which you could spend an entire quarter or two learning the theory of operation. Thankfully, it is possible to construct a control circuit that works well enough by observing the effect of altering the strengths of the different feedback signals.
While we chose to cool a block with a peltier, this technique is ubiquitous and used for things like: