Update later figs to use 10V

Double check resistor supplies - Make sure there are enough 6.2 Ohm ones

Double check if 15 C is doable when using 5V power supply for Peltier.

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.

A block diagram of the full temperature controller circuit.

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

Circuit Functionality

The 5 key parts of the circuit can be broken down as follows:

  • Temperature Sensor: Allows user to monitor the output of a voltage divider that includes a thermistor, which in turn is proportional to the temperature of the aluminum block.
    • The sensors use buffers (op-amp followers) to prevent any possible loading that would alter their outputs. Remember back in lab 4 (Transistors 1) when your sensor couldn't directly power an LED? That was a loading issue.
  • Temperature Setpoint:  Allows user to control the the temperature that they'd like to coolthe block to by setting a voltage via potentiometer.
    • The difference between the Sensor and Setpoint Monitor voltages is called the Error Signal.
  • Feedback Control: The circuit essentially compares the voltage drop across the thermistor (Temperature Sensor) to the voltage drop across the set point resistance (Temperature Setpoint) and generates an output voltage proportional to the difference between the two. This output voltage is used to control the behavior of the next stage of the circuit by switching a cooling element on or off via transistor.  How this output voltage scales with the changing difference between the Sensor and Set Point voltages is determined by the circuit's gain.
  • Peltier Control: This circuit controls the current passing through the TEC(Thermo Electric Cooler) using a Field Effect Transistor(FET), based on the signal from the feedback control portion. Note that the TEC is a peltier device, and can be used for both heating or cooling depending on configuration.
  • Lighting Indicator: This part of the circuit gives the user visual information about what the circuit is doing. This could be as simple as turning an LED on whenever the heater is on, and if you were building this to be an independent circuit you'd probably want an 'on' indicator when it's powered. This can be quite helpful when using such a circuit in a research environment, where you don't want to have to pull out a thermometer or oscilloscope to tell if the heater is working or not.

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.

A pin-out diagram for the TL074CN. Notice that the half-moon shape indicates the top of the chip; the circle seems to be an artifact of manufacturing.

Note that the power is connected along the middle pins instead of opposite corners here.

Temperature Sensing

thermistor (temperature-dependent resistor) has been embedded in the aluminum block to allow its temperature to be monitored. This particular thermistor has a resistance of ~100kΩ at 20°C and approximately 150kΩ at 15°C. Eq. 1 shows the relationship between the thermistor resistance and temperature from 20°C to 0°C.

$T = 51.9160 − 0.4376R +1.8229 X 10^{−3} R^{2} − 4.3102 X 10^{−6}R^3 + 4.1807 X 10^{−9}R^4$  (1)

Here T is temperature in °C and R is resistance in kΩ. This was determined empirically by testing one thermistor, so while the same trends are likely for your component the coefficients might differ.

Python Temperature Conversion

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.

The circuit symbol for a thermistor. Note that it includes labeling for what the expected resistance is around room temperature. The connections among components in our heating & cooling element. You'll use the TEC connections later.

Design a voltage divider circuit using the thermistor and a fixed resistor that produces an output that increases with temperature. For this experiment, we have the constraint that the power supply's variable voltages will be set to $+15 V$ and $-15 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).

Temperature Setpoint

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.

An example temperature setpoint circuit template. Note that by adjusting the resistors X and Y you can narrow the output range to allow for finer control. For instance, if X = 0 and Y = 0, one turn of the pot would sweep from 0 to 15 V.
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.

A template for buffered temperature measurement/setpoint circuits. You can use any of the four op-amps in your chip to construct the buffer circuits, it shouldn't make a significant difference in anything.

Thermo Electric Cooler Control

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.

The thermo electric cooler, shown in place with aluminum block and heat skink.

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.

A circuit for testing the TEC

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.

Controlling the TEC

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.

Our Field Effect Transistor (FET). Note that the Source is named for being the “source” of electrons into the FET and the “drain” is the terminal electrons exit the FET from. Thus, conventional current will be from the drain to the source. The circuit symbol for a FET. Specifically, an N-type JFET. There are many, many types of FETS with differing useful behaviors to learn about if you need to.

To use the FET as a switch, we'll just pop it into our circuit as follows:

A heater control circuit, which will cause the TEC to cool down when $V_{in}$ is sufficiently high. If you place your FET in the board such that the metal heatsink faces towards your right, then the top pin (1) is the Gate, the middle (2) the Drain, and the bottom (3) is the Source.

Modify your circuit with the addition of the FET. Test that, at the very least, the TEC cools when $V_{in}$ is +15 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.

Testing the controller

To test your circuit, you should try a variety of input voltages $V_{in}$ between 0V and 15V. This can be done a variety of ways; you can use a DC signal from your function generator 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.
Hey, my setpoint & sensor voltage are changing when the cooler kicks on. What gives?

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.

Basic Feedback Control

To begin with, consider a control circuit without any negative feedback at all, shown below.

A control circuit with no feedback whatsoever.
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}$.

Initial Testing

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.

  • Turn off your power supply to make sure you aren't affecting your block's temperature to start with.
  • Connect your various circuits together, as shown in the first block diagram.
    • For the feedback stage, $V_{out,set}$ should connect to Vin2$V_{in,1}$. If you swap the connections, the device will do nothing to a warm block and cool a cold block indefinitely.
  • Briefly power on your circuit to confirm that it will begin to cool at room temperature.

Adding Lighting Indicators

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.

Temperature Logging

In order to log voltages from your circuit as a function of time, you'll have to do a little bit of setup first.

  • Make sure that channel 1 is connected to the temperature sensor output $V_{out,sen}$
  • Make sure that channel 2 is connected to the temperature setpoint output $V_{out,set}$
  • Set the horizontal scale to a short enough time that the scope is continuously updating (i.e. you aren't watching a line crawl across the screen)
  • Start up Jupyter notebook using the icon on the desktop, or through the start menu
  • Download a new copy of the temperature logging notebook here:temperature_logger.ipynb
  • In Jupyter, navigate to the directory the notebook is in and open it
  • Run the two notebook cells (there's a 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 ⏻ icon in the 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.

This portion of the lab is being revised this year due to there being a mismatch between the affordances of our cooling apparatus and the properties needed for more sophisticated feedback. As such, the remaining instructions do not make much sense to do with the setup you've been using. The portions on proportional / integral feedback are thus considered optional, and if you've done everything up until this point you are finished with the graded portion of the lab. Be sure to include a final diagram of your circuit in your report.

If you want to experiment more with control systems, we have a handful of modified units that feature a much larger block of aluminum and a thermistor that is further away, shown below. Early in the day on Wednesday you may need to team up with another student or wait to experiment with a modified unit.

Modified temperature control block. Note that the thermistor is around 150k at room temperature instead of 100k.

If you want to find the temperature / resistance relationship for this thermistor, it is given below:

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.

Advanced Feedback Control

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 wide margin.

Consider the circuit below, which is a modified inverting amplifier:

A control circuit with only proportional feedback, which will output a voltage $V_{feedback}$ that depends on differences in the setpoint and sensor voltages.
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 Fig 6.  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?

Find the gain at which the temperature oscillates about the equilibrium value, and keep $R_1$ and $R_2$  constant when moving on the the next part.

Integral Feedback

Finally, consider the control circuit shown below

A control circuit with both proportional and integral feedback, which will output a voltage $V_{feedback}$ that depends on differences in the setpoint and sensor voltages.
What do you predict $V_{feedback}$ will be in terms of $V_{sensor}$, $V_{setpoint}$, $R_1$, $R_2$, and $C_1$ ?  (Note: your prediction should reduce to your previous circuit as $C_1 \rightarrow \infty$ )

Modify your control circuit as shown in Fig 7.  Choose a capacitor which, when combined with $R_1$, produces an RC time constant about a factor of 3 shorter than the response time you measured using only proportional feedback.

Use the computer to record $V_{sensor}$ and $V_{setpoint}$ again, using the same procedure as before.

 How does the addition of the capacitor change the network's behavior? 

Future Possibilities

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: