I don't understand thermostats

Started by July 14, 2015
```On Wednesday, July 15, 2015 at 2:39:26 AM UTC+2, John Larkin wrote:
> On Tue, 14 Jul 2015 14:13:36 -0700 (PDT), whit3rd <whit3rd@gmail.com>
> wrote:
> >On Tuesday, July 14, 2015 at 1:29:26 PM UTC-7, John Larkin wrote:
> >> Imagine a mass that we want to heat ...Thermal systems are
> >> diffusive, which we represent as a bunch of RC lags.
> >
> >> ... there is no thermal
> >> equivalent to an inductor.
> >
> >It'd be nice if that were the case, but you CAN get thermal overshoot,
> >just like an inductor, when your components achieve ignition temperature.
>
> But systems composed of heat sources and masses and thermal conductors
> don't ring or overshoot, whereas mechanical systems do ring and
> overshoot and oscillate. You have to add some non-thermal element,
> like electronics or some mechanical gidget, or gain somehow, to make a
> thermal system ring.

Actually, if your system contains a convecting element, you can get interesting behaviour. Convection doesn't happen if the Rayleigh number is less than 500, and if it's less 100,000 the convection will be laminar. Convection involves mass transfer, so it has a well-defined time lag, that decreases as the temperature gradient rises.

You may need to add a little imagination - or at least physical insight - to your armoury to appreciate thi.

> Maybe that makes thermostat systems so docile.
>
> It does look like, for a nontrivial system, the p-p temperature
> excursion and frequency will be limited by the process, all the way
> down to zero hysteresis, which is equivalent to an ideal comparator.
> So it's kinda hard to get wrong.

From your rather restricted perspective that may well be true, at least until you start demonstrating something to as customer, which is when the interesting effects traditionally chose to manifest themselves.

--
Bill Sloman, Sydney

```
```On 07/15/2015 03:10 PM, John Larkin wrote:
> On 15 Jul 2015 18:27:31 GMT, Glen Walpert <nospam@null.void> wrote:
>
>> On Wed, 15 Jul 2015 09:20:47 -0700, John Larkin wrote:
>>
>> <clip>
>>> It could be that my heater (actually a bunch of surfmount
>>> resistors surrounding the optical widgets) will have more
>>> thermal mass than the gadgets being heated. I'm trying to get a
>>> mockup to test. Even when I have one, figuring out the equivalent
>>> circuit will be a chore. Electronics is so easy to drive and
>>> probe; mechanical and thermal systems aren't. Imagine designing a
>>> racing car engine, and wondering what the temperatures and flows
>>> are like inside; we sure have it easy.
>>>
>>> It is tempting to control the temperature of the heater, and not
>>> the object to be heated. Much better dynamics, almost first
>>> order.
>>
>> Or you could control both; an inner loop controlling heater
>> temperature and an outer loop controlling the heated object
>> temperature (the output of which is the setpoint for the inner
>> heater temperature controller). This should give you the better
>> dynamics without any loss of accuracy.
>>
>> Not really pertinent to your control system, actually responding to
>> another comment about optimal control with PID, but I do not think
>> PID can ever achieve optimal transient response in a temperature
>> controller (or pretty much any other controller, possibly excepting
>> some which need to be too fast for digital control).  PID can be
>> tuned for the best response possible from a system with a PID
>> controller; fastest response with specified (possibly zero)
>> overshoot.  But some sort of model reference control system can
>> always do better, at the cost of additional complexity.
>
> PID isn't optimum, but "optimum" is hard to quantify anyhow. In my
> current situation, I don't care much about overshoot or transient
> response.

In a system with a significant thermal diffusion contribution, PID will
spoil your whole day.  In diffusion, the phase shift continues to grow
without bound as the signal rolls off, so dialling up the D term will
make a nice oscillator.  It can help some in cases where the thermal
mass approximation works accurately.

>> For a temperature controller you would create a math model of the
>> thermal system which will accurately model the temperature at the
>> sensor as a function of heat load or ambient temperature, heater
>> power input, possibly other variables influencing the system, and
>> time.  If the system has significant nonlinearities they should be
>> included in the model.
>
> Mechanical/thermal systems are essentially linear. A resistive heater
> is a square-law device, like the problem George posted about. PWM or
> bang-bang eliminate that nonlinearity.

Most of my thermal control loops are designed using a plant model
consisting of an integrator and a time delay in cascade.  You trigger a
scope when the heater turns on, and you can read both the delay and the
slope right off the trace.  Generally in small TEC-based loops, it won't
even need tweaking IME.

>> The model parameters can be determined from measured response to a
>> step or other stimulus.  Then when you have a transient to respond
>> to the controller calculates how many watt-seconds of energy are
>> needed to reach the set point and turns the heater on or off fully
>> for the calculated time, then backs off to the calculated steady
>> state power.
>
> Yeah, the nuisance is to quantify the physics, ideally at the design
>  level. A thermal breadboard might be pragmatic; I could probably do
>  that in a fraction of the time I could learn and run thermal
> modeling software.
>
> The error
>> signal is not the difference between set point and measured
>> temperature, it is the difference between measured temperature and
>> model predicted measured temperature, and this error signal can be
>> used to adjust heater on/off time or power level and also to adjust
>> the model for more accurate response on the next transient, which I
>> have seen referred to as adaptive model reference control.
>>
>> While not too many heaters need this level of optimization, there
>> are situations where the improvement is worth the effort, and it
>> can be a lot more fun than boring old PID <yawn> or bang-bang
>> <double-yawn>.
>
> A little boredom is fine if I can get it done quick. It's pretty much
> a charity job. I prefer systems that respond in picoseconds to those
> that settle in minutes.

Ditto, except femtoseconds. ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net
```
```On 7/14/2015 4:29 PM, John Larkin wrote:
>
>
> Imagine a mass that we want to heat with some closed-loop controller.
> It's C2 below. Voltage represents temperature. Thermal systems are
> diffusive, which we represent as a bunch of RC lags. Assume the
> voltage at C4 is the temperature sensor.
>
> If I were to design a PID controller, I'd have to really think about
> it, or fiddle some, to keep it stable. But if I do a dumb on/off
> thermostat, it seems to always work. I can tweak the hysteresis and
> vary the p-p temperature excursions and the switching frequency, but
> it's always stable. Or maybe it's always unstable. But it works.
>
> As Vh gets smaller, the oscillation frequency converges to some
> limiting value, which is I guess the ultimate performance of a
> thermostat for this physics. To get any less temperature excursion, I
> guess I'd have to do a real PID loop. Curious.
>
> This may have something to do with the fact that there is no thermal
> equivalent to an inductor.

Inductance and capacitance work by storing energy in an electric field
or a magnetic field with contrasting mathematics.  Heat can not be
converted to other forms of energy efficiently.  Your equations only
represent one form of energy storage, heat.  Use an engine to
efficiently convert the heat to some other form of energy storage and
you can use more complex math which may allow for oscillations.

--

Rick
```
```On Wednesday, July 15, 2015 at 11:25:56 AM UTC-7, bloggs.fred...@gmail.com wrote:
> On Wednesday, July 15, 2015 at 12:20:52 PM UTC-4, John Larkin wrote:

> > It could be that my heater (actually a bunch of surfmount resistors
> > surrounding the optical widgets) will have more thermal mass than the
> > gadgets being heated. I'm trying to get a mockup to test. Even when I
> > have one, figuring out the equivalent circuit will be a chore.

> One thing for certain is that no one uses SPICE for this.

I'd not be so certain of that.   A biochemist once remarked to me that he was
using SPICE to model enzymes and glandular secretions.   It's like a big
spreadsheet, really: there's LOTS of uses.
```
```On 07/15/2015 03:57 PM, whit3rd wrote:
> On Wednesday, July 15, 2015 at 11:25:56 AM UTC-7, bloggs.fred...@gmail.com wrote:
>> On Wednesday, July 15, 2015 at 12:20:52 PM UTC-4, John Larkin wrote:
>
>>> It could be that my heater (actually a bunch of surfmount resistors
>>> surrounding the optical widgets) will have more thermal mass than the
>>> gadgets being heated. I'm trying to get a mockup to test. Even when I
>>> have one, figuring out the equivalent circuit will be a chore.
>
>> One thing for certain is that no one uses SPICE for this.
>
> I'd not be so certain of that.   A biochemist once remarked to me that he was
> using SPICE to model enzymes and glandular secretions.   It's like a big
> spreadsheet, really: there's LOTS of uses.But

But way, way easier to debug than a big spreadsheet.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net
```
```On 15/07/2015 20:31, John Larkin wrote:
> The conductivities are actually diffusive, so
> an RC is only an approximation.
>
> Incidentally, this is pretty close for simulation:
>
> 1 farad  == 1 gram aluminum
>
> 1 amp    == 1 watt of heat
>
> 1 volt   == 1 deg C
>
> 1 ohm    == 1 degC/watt
>
> 1 second == 1 second

John,

You mention in your very first post that C2 is the mass to heat with
R2(&#2013266096;C/W) the thermal resistance i.e. some Y Watt dissipated with respect
to X &#2013266096;C temp rise. quite homogeneous in math point of view.

Nevertheless in your global model, the variable "watt of heat" should be
*only* unidirectional, is it so ? I think not ...

Modeling the heat transfer phenomenon by equivalent electrical
components is quite difficult AFAIK.

Habib.

PS : this is a very smart idea, however.
```
```On Wed, 15 Jul 2015 15:40:49 -0400, Phil Hobbs
<pcdhSpamMeSenseless@electrooptical.net> wrote:

>On 07/15/2015 03:10 PM, John Larkin wrote:
>> On 15 Jul 2015 18:27:31 GMT, Glen Walpert <nospam@null.void> wrote:
>>
>>> On Wed, 15 Jul 2015 09:20:47 -0700, John Larkin wrote:
>>>
>>> <clip>
>>>> It could be that my heater (actually a bunch of surfmount
>>>> resistors surrounding the optical widgets) will have more
>>>> thermal mass than the gadgets being heated. I'm trying to get a
>>>> mockup to test. Even when I have one, figuring out the equivalent
>>>> circuit will be a chore. Electronics is so easy to drive and
>>>> probe; mechanical and thermal systems aren't. Imagine designing a
>>>> racing car engine, and wondering what the temperatures and flows
>>>> are like inside; we sure have it easy.
>>>>
>>>> It is tempting to control the temperature of the heater, and not
>>>> the object to be heated. Much better dynamics, almost first
>>>> order.
>>>
>>> Or you could control both; an inner loop controlling heater
>>> temperature and an outer loop controlling the heated object
>>> temperature (the output of which is the setpoint for the inner
>>> heater temperature controller). This should give you the better
>>> dynamics without any loss of accuracy.
>>>
>>> Not really pertinent to your control system, actually responding to
>>> another comment about optimal control with PID, but I do not think
>>> PID can ever achieve optimal transient response in a temperature
>>> controller (or pretty much any other controller, possibly excepting
>>> some which need to be too fast for digital control).  PID can be
>>> tuned for the best response possible from a system with a PID
>>> controller; fastest response with specified (possibly zero)
>>> overshoot.  But some sort of model reference control system can
>>> always do better, at the cost of additional complexity.
>>
>> PID isn't optimum, but "optimum" is hard to quantify anyhow. In my
>> current situation, I don't care much about overshoot or transient
>> response.
>
>In a system with a significant thermal diffusion contribution, PID will
>spoil your whole day.  In diffusion, the phase shift continues to grow
>without bound as the signal rolls off, so dialling up the D term will
>make a nice oscillator.  It can help some in cases where the thermal
>mass approximation works accurately.
>
>>> For a temperature controller you would create a math model of the
>>> thermal system which will accurately model the temperature at the
>>> sensor as a function of heat load or ambient temperature, heater
>>> power input, possibly other variables influencing the system, and
>>> time.  If the system has significant nonlinearities they should be
>>> included in the model.
>>
>> Mechanical/thermal systems are essentially linear. A resistive heater
>> is a square-law device, like the problem George posted about. PWM or
>> bang-bang eliminate that nonlinearity.
>
>Most of my thermal control loops are designed using a plant model
>consisting of an integrator and a time delay in cascade.  You trigger a
>scope when the heater turns on, and you can read both the delay and the
>slope right off the trace.  Generally in small TEC-based loops, it won't
>even need tweaking IME.

That's very cool. When I get a mockup to test, I'll see how well that
model fits the measurements.

--

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

```
```Den tirsdag den 14. juli 2015 kl. 22.29.26 UTC+2 skrev John Larkin:
> Imagine a mass that we want to heat with some closed-loop controller.
> It's C2 below. Voltage represents temperature. Thermal systems are
> diffusive, which we represent as a bunch of RC lags. Assume the
> voltage at C4 is the temperature sensor.
>
snip

here with what is rougly a 1st order deltasigma

Version 4
SHEET 1 2332 932
WIRE 0 0 -288 0
WIRE 352 0 80 0
WIRE 944 0 352 0
WIRE 352 32 352 0
WIRE -288 160 -288 0
WIRE -224 160 -288 160
WIRE -96 160 -144 160
WIRE -16 160 -96 160
WIRE 96 160 64 160
WIRE 192 160 96 160
WIRE 304 160 272 160
WIRE 352 160 352 112
WIRE 352 160 304 160
WIRE 656 160 352 160
WIRE 656 208 592 208
WIRE 944 208 944 0
WIRE 944 208 832 208
WIRE -288 224 -288 160
WIRE -96 224 -96 160
WIRE 96 224 96 160
WIRE 304 224 304 160
WIRE 592 288 592 208
WIRE -288 336 -288 288
WIRE -96 336 -96 288
WIRE 96 336 96 288
WIRE 304 336 304 288
WIRE 592 432 592 368
WIRE 0 512 -288 512
WIRE 544 512 80 512
WIRE -288 672 -288 512
WIRE -224 672 -288 672
WIRE -96 672 -144 672
WIRE -16 672 -96 672
WIRE 96 672 64 672
WIRE 192 672 96 672
WIRE 304 672 272 672
WIRE 400 672 304 672
WIRE 480 672 400 672
WIRE 544 672 544 512
WIRE -288 736 -288 672
WIRE -96 736 -96 672
WIRE 96 736 96 672
WIRE 304 736 304 672
WIRE -288 848 -288 800
WIRE -96 848 -96 800
WIRE 96 848 96 800
WIRE 304 848 304 800
FLAG -288 336 0
FLAG -96 336 0
FLAG 96 336 0
FLAG 304 336 0
FLAG -288 848 0
FLAG -96 848 0
FLAG 96 848 0
FLAG 304 848 0
FLAG 400 672 t
FLAG 656 256 0
FLAG 592 432 0
SYMBOL cap 80 224 R0
WINDOW 0 67 13 Left 2
WINDOW 3 64 44 Left 2
SYMATTR InstName C1
SYMATTR Value 1m
SYMBOL cap -112 224 R0
WINDOW 0 63 18 Left 2
WINDOW 3 64 53 Left 2
SYMATTR InstName C2
SYMATTR Value 5m
SYMBOL cap -304 224 R0
WINDOW 0 60 22 Left 2
WINDOW 3 66 53 Left 2
SYMATTR InstName C3
SYMATTR Value 1m
SYMBOL res -128 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 1K
SYMBOL res 80 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 1K
SYMBOL res 96 -16 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R3
SYMATTR Value 1K
SYMBOL cap 288 224 R0
WINDOW 0 67 13 Left 2
WINDOW 3 64 44 Left 2
SYMATTR InstName C4
SYMATTR Value 1m
SYMBOL res 288 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R4
SYMATTR Value 1K
SYMBOL cap 80 736 R0
WINDOW 0 67 13 Left 2
WINDOW 3 64 44 Left 2
SYMATTR InstName C5
SYMATTR Value 1m
SYMBOL cap -112 736 R0
WINDOW 0 63 18 Left 2
WINDOW 3 64 53 Left 2
SYMATTR InstName C6
SYMATTR Value 5m
SYMBOL cap -304 736 R0
WINDOW 0 60 22 Left 2
WINDOW 3 66 53 Left 2
SYMATTR InstName C7
SYMATTR Value 1m
SYMBOL res -128 656 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R5
SYMATTR Value 1K
SYMBOL res 80 656 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R6
SYMATTR Value 1K
SYMBOL res 96 496 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R7
SYMATTR Value 1K
SYMBOL cap 288 736 R0
WINDOW 0 67 13 Left 2
WINDOW 3 64 44 Left 2
SYMATTR InstName C8
SYMATTR Value 1m
SYMBOL res 288 656 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R8
SYMATTR Value 1K
SYMBOL res 368 128 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R9
SYMATTR Value 1K
SYMBOL Digital\\dflop 736 112 R0
SYMATTR InstName A2
SYMBOL voltage 592 272 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PULSE(0 1 0 10u 10u 1m 2m)
SYMBOL Digital\\inv 480 608 R0
WINDOW 3 -103 8 Left 2
SYMATTR InstName A1
SYMATTR Value vh=0.002
TEXT -208 -56 Left 2 !.tran 100 uic
TEXT -280 448 Left 2 ;THERMOSTAT
TEXT -280 480 Left 2 ;JL  July 14, 2015
TEXT -72 80 Left 2 ;===== thermal lags =====
TEXT -72 592 Left 2 ;===== thermal lags ====
```
```On Wed, 15 Jul 2015 22:32:20 +0200, Habib Bouaziz-Viallet
<habib@nowhere.com> wrote:

>On 15/07/2015 20:31, John Larkin wrote:
>> The conductivities are actually diffusive, so
>> an RC is only an approximation.
>>
>> Incidentally, this is pretty close for simulation:
>>
>> 1 farad  == 1 gram aluminum
>>
>> 1 amp    == 1 watt of heat
>>
>> 1 volt   == 1 deg C
>>
>> 1 ohm    == 1 degC/watt
>>
>> 1 second == 1 second
>
>John,
>
>You mention in your very first post that C2 is the mass to heat with
>R2(&#2013266096;C/W) the thermal resistance i.e. some Y Watt dissipated with respect
>to X &#2013266096;C temp rise. quite homogeneous in math point of view.
>
>Nevertheless in your global model, the variable "watt of heat" should be
>*only* unidirectional, is it so ? I think not ...

If you had a Peltier or some other heater/cooler, it would be
bidirectional. You could add diodes to the model if you want to force
heating only.

>
>Modeling the heat transfer phenomenon by equivalent electrical
>components is quite difficult AFAIK.

Not so bad, if you can measure the process and get the numbers.

You could even use the lossy transmission line model to approximate
diffusive conduction.

--

John Larkin         Highland Technology, Inc
picosecond timing   precision measurement

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

```
```On Wed, 15 Jul 2015 12:03:17 -0700, John Larkin
<jlarkin@highlandtechnology.com> wrote:

>On Wed, 15 Jul 2015 11:25:51 -0700 (PDT),
>bloggs.fredbloggs.fred@gmail.com wrote:
>
>>
>>One thing for certain is that no one uses SPICE for this.
>
>I do. It works fine, once I get the numbers, the thermal masses and
>losses and conductivities.

The thermal analysis work for mainframes was done on electronics

> Maybe you can get a free eval copy of something like this:
>>http://www.mentor.com/products/mechanical/flotherm/flotherm-xt/
>
>Will that simultaneously simulate my electronics? Something has to do
>both.
>
>>
>>They /should/ enable a time varying control input, if not at least a steady state, but like I've said in the past, if engineers have any say in the architecture, it will be lacking.
>
>Try living in a world without engineers.

She does.

```