Temperature Control 1: Simple Control Theory

Temperature Control

The need to control temperature is everywhere, but getting it right is more difficult than one might expect. A domestic furnace controlled by a simple thermostat keeps a house comfortable in winter, but the inside air temperature swings irregularly over a range of a few degrees. That's fine for a house---you can have a New Year's party, with a bunch of people dissipating a hundred watts each, doors to hot ovens and the cold outside opening and closing, no worries whatsoever.  The heating system keeps it comfortable.

Such sloppy control doesn't work everywhere.  In applications such as scientific instruments, industrial process control, tunable diode lasers, bioreactors, and high precision mechanisms, we often need much better. It's far from rare for them to need temperature control down to the millikelvin or even microkelvin range. For that, we need a better control system: tighter error limits, higher speed, and higher precision.  (And usually higher accuracy, but that's a point we'll leave for later.)

Temperature control is a complicated multidimensional problem, because we usually want to minimize temperature transients and gradients in some object, as well as keeping its average temperature constant.  In this installment, we'll develop a few control system ideas on a simpler system: a linear voltage regulator such as the familiar LM317, which has one input and one output.

Control System Example: A Linear Voltage Regulator

Probably the most popular adjustable voltage regulator of all time is the three-terminal LM317, which illustrates all the basic aspects of a control system.;

Figure 1: The Texas Instruments LM317 adjustable regulator (from the datasheet with a few annotations): a functional block diagram, followed by a simple application circuit.

Block diagram of the LM317 regulator        

LM317 application circuit

A key concept in control systems is the plant, which is the thing the control loop controls, and consists of the process and the actuator. In the voltage regulator example, the plant is the combination of the power source and pass transistor (the actuator) with the output reservoir capacitor C2 (the process).  The controller  is what does the actual controlling, as one might expect.  In this case it's the voltage reference, the  error amplifier, and the feedback divider R1/R2.  The feedback network forms

VADJ = VOUT · R2 / (R1 + R2).

The error amplifier takes the difference between VADJ and  VOUT -1.25 V and  applies an amplified version to the base of the Darlington pass transistor, forming an overall feedback loop.  If the loop is stable, the error amplifier's gain is sufficiently high, and the resistors are small enough that we can ignore Iadj (~50 μA), the output will be very close to the setpoint defined by the reference and feedback network, 

VOUT =  (R1 + R2)/R1 ·  1.25 V.

 In this view, the job of the control loop is to make the voltage on C2 follow the setpoint and resist external forcing from changes in supply voltage and load current.  The designer's job is to see that it does it well.  We'll look at how that's done.

Open-Loop Behavior

We can investigate the loop's operation by cutting it open, at least in thought.  This might seem like a weird thing to do, but it turns out to be the key move in understanding how it works.  Say we break the loop by freezing the error amplifier's inputs.  Its output will continue normally, except that there will be no feedback action.  When a (sufficiently small) increase in load current ΔIload comes along, the output will sag by

Vsag = Zout ΔIload

because the pass transistor itself has a nonzero output impedance Zout, and the resulting change in its base current will make the drive voltage droop too. (Even a Darlington can load down one of those tiny on-chip amplifiers.)  It'll simplify our discussion if we notionally attribute Zout to the output stage of the amplifier, and take the cut point to be right before that.  

This will change the voltage at the adjust pin by

ΔVadj = Zout ΔIload  ·  R1/(R1 + R2), 

and if the amplifier were doing its thing, it would multiply this by its gain AVamp,

ΔVamp = ΔVadj ·  AVamp.

The total gain from the frozen amplifier output back to the output of its driver is the loop gain 

AVL = AVamp · R1/(R1+R2), 

which turns out to dominate the behavior of the feedback system near equilibrium.  (Huge transients such as turn-on can cause nonlinear problems such as windup, which we'll get to in a bit.)

Once the feedback loop is closed again, the error amplifier is free to work, so it fights the voltage sag. It's not hard to show that load disturbances are reduced by a factor of 1/(1+AVL).  If the loop gain is 10, feedback will reduce the effect of forcing by about 10 times compared with the open-loop value; if it is 1000, by 1000 times. (AVamp has some nonzero phase angle, so the factor probably isn't 1/11 or 1/1001.)  So in general, having more loop gain is better.

How much we can actually use depends on the gain and bandwidth of the error amplifier and on how fast the pass transistor can charge up the output reservoir capacitor.  

Due to the limitations of available components, the bandwidth of the feedback loop is finite, and different parts of it have different speed limitations; for instance, it is easier to make a fast amplifier than a fast, high-current pass transistor with low voltage drop.

FIXME: STOPPED HERE

For stability reasons, the loop gain tends to drop as the reciprocal of the frequency, so that getting more loop gain at lower frequency generally requires increasing the loop bandwidth f0. With a constant input voltage, a fast amplifier, a fast pass transistor of resistance R, and a reservoir capacitance C, if the overall DC voltage gain is A, the open-loop transfer function of the plant is

The high-frequency loop gain is thus

$$A_{VL} = \frac{\displaystyle -j f_0}{\displaystyle f}, \label{eq:integrator}$$

where the unity-gain frequency f0 = A/(2πRC). The 1/f dependence means that |AVL| = 100 at 0.01 f0, 10 at 0.1 f0, and crosses unity gain at f0. Thus the loop rejects external forcing fairly well at low frequency (-40 dB at 0.01f0), but does little above f0. Improving the rejection requires speeding up the loop, which can be done by adding gain, if the rest of the plant is fast enough.

With pure RC circuitry, the phase of the loop gain has a simple dependence on the rate of rolloff. A single RC lowpass falls off asymptotically as 1/f with a constant phase of −90∘. A cascade of N lowpasses goes asymptotically as 1/fN with a phase of −90N∘. Of course, since the RC rolloff is smooth, at lower frequency both the slope and phase are frequency-dependent.

It is well known in feedback theory that the phase of the loop gain must be less negative than −180∘ at the unity-gain frequency, or the loop will be unstable. Usually one wants a phase margin of 45∘ to 60∘ in a high-performance loop (i.e. loop phase of −135∘ to −120∘), depending on the desired tradeoff of speed and overshoot.

It is possible to apply lead-lag compensation, where the loop gain at frequencies well below f0 initially falls off as 1/f2, then gradually goes to to something more like 1/f near unity gain, with a corresponding improvement in phase margin. This preserves stability while allowing more low-frequency loop gain, at least in cases where the DC gain does not vary much. If it does, e.g. if the overall DC gain drops by a factor of 10 (20 dB) for any reason, the phase margin will drop and the loop will likely oscillate.

It is also common for the setpoint to change, as when the user of a power supply turns the voltage knob. The response to a setpoint change is also governed by the loop gain, but its functional form is generally more complicated than that of the forcing rejection. Besides the response bandwidth, we care about the slew rate, i.e. the maximum speed at which the controller can make its output move. This depends on the loop gain, but also on the maximum available charging and discharging currents. These currents will be different in general, leading to asymmetrical slew rates. These ideas apply analogously to temperature control.