I'm making a controller for my heated seats in my car, and still havn't made
a decision whether it should be a closed or open loop temp control. It will
have 4 settings. In openloop that would simply be 25,50,75 and 100% output
(simply low freq PWM, period 1 second or so) or in closed loop for example
35,40,45,50 deg C.
I once made a version that would go one setting down each 3 minutes until it
reaches setting 1 at which it will remain then (until you choose another
one). You could also stop that by pressing the button a little longer.
I think a simple on/off controller would do, no fancy PID stuff.
Jeroen
For simplicity and sanity, keep it open loop.
If you go for closed loop then be prepared to implement (and tune) a 3
term PID control sytem.
The heater has a significant time lag to setpoint and this creates all
the
control problems. Do you really need +/- .5degC control ;-).
Not accounting for the fact that he'll have to "carefully" place the sensor.
Fred.
> For simplicity and sanity, keep it open loop.
> If you go for closed loop then be prepared to implement (and tune) a 3
> term PID control sytem.
Why??? A simple thermostat is closed loop.
> The heater has a significant time lag to setpoint and this creates all
True.
> the control problems.
False.
> Do you really need +/- .5degC control ;-).
Trying for that level of control is what creates control problems.
A simple closed loop which maintains temperature at a setpoint +/-
several degrees is not complex.
sdb
--
| Sylvan Butler | Not speaking for Hewlett-Packard | sbutler-boi.hp.com |
| Watch out for my e-mail address. Thank UCE. >>>> change ^ to @ <<<< |
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. --Benjamin Franklin, 1759
Stop Senator Fritz Hollings-S2048, Palladium, and TCPA, NOW!
http://www.freedom-to-tinker.com/archives/cat_fritzs_hit_list.html
Or else like Fritz, fight piracy -- regulate potty chairs!
Agreed. A T/S is an excellent closed loop conrol system. I wish people
would use them more often in the simple applications that many times
I've seen implemented in horrendously complicated uP/DAC/ADC PID
setups.
Jeroen though is after 4 fixed settings. This would imply some kind of
4 position, presettable 'click stop' T/S (electrical or mechanical)
with a probe placed somewhere in/on the car seat. Hopefully, not where
Fred suggests. Dependant on the local thermal time constant the unit
would then temperature cycle between its own (unpredictable)
upper/lower limits.
>
> > The heater has a significant time lag to setpoint and this creates all
>
> True.
>
> > the control problems.
>
> False.
>
> > Do you really need +/- .5degC control ;-).
>
> Trying for that level of control is what creates control problems.
> A simple closed loop which maintains temperature at a setpoint +/-
> several degrees is not complex.
That's right but ... Essentially, what I'm suggesting, is that
sticking a probe somewhere in the seat and allowing the setup to cycle
within an undefined temperature window without PID control is
actually still more complicated (even less comfortable!)than having a
completely open loop setup.
>
> sdb
regards
john
Why is there an undefined temperature window? I will use a uC with a
tempsensor. When the temp is lower than the setpoint-1 cdeg the heater is
turned on and when the temp reaches setpoint+1cdeg it is turned off again.
The ripple in temp. will be defined by the amount of hysteresis I define
(which can actually be quite small, nothing wears out by rapid cycling). And
I will check the temp and act only once a second, any faster is not
necessary.
Jeroen
With 'real world' closed loop control systems, the physical properties
of the non electronic variables, gum up the electronic works and act
as a grade #1 bitch!. It can't be half answered so this here is a bit
l..o..n..g.
Yes ... In an ideal situation, what you say is absolutely correct.
From the electronics POV, they will switch power on when then sensor
says I'm too cold and switch power off when the sensor says I'm too
hot, and would be happy to control the seat temperature with even
+/- 0.01degC heating/cooling limits. Simple power On, power OFF,
couple of resistors to set the hi/lo limit trips, a comparitor +Fet,
et voila, no problem!.
It's easy to do, so build a unit up and try it!. You will actually
find the seat temperature cycling at much,much greater limits than
what it was designed for. (the seat temp' would, more likely run
rampantly out of control).
There is a very real, very practical, problem lurking in the depths of
this closed loop system you have just created and concerns **how
quickly** that seat temperature sensor can notice any temperature
changes. Get a mental model or 'handle' on why this 'speed of
response' can be a problem and you will know the very foundation stone
that ALL electronic/electrical/mechanical, control sytem and feedback
theory, sits on. (The 'delay' in mechanical systems is usually called
response time, in purely electronic systems it can be called 'phase
shift').
Take a worst case example. Say the temp sensor is one of the LM???,
T05, linear two wire types and you insert it in the seat fabric at the
body point where the most comfort is wanted. Assume that in this
position the sensor is say 10mm away from the surface of the nearest
embedded heater wire. The PIC (say) will digitise the sensor's
voltage, compare it against the hi/lo limits and switch power on and
off as needed.
Ok, let's go ...
[1] Turn ignition ON and power up the seat heater control system.
[2] Sensor says too cold so PIC switches power to the heater.
[3] Seat warms up
[4] Sensor at some time later will say "I'm too hot".
[5] Power switched off and seat cools
[6] Sensor at some time later will say "I'm too cold".
[7] Power switched on and seat heats again
[8] Blindly repeat [4] to [7].
The killer, is in lines [4] and [6]. The "some time later" could be 3
seconds or even a few minutes. It all depends on how fast the heat can
get through the local path from the heater wire to the sensor body, or
(on cooling how fast the heat can dissipate from the sensor itself and
region around the sensor.
[nb, If you think about it you'll also notice that these two 'time
constants' can also be widely different just like a refrigerator motor
cycles only occasionally.]
So ... The heater's just been switched on. The heat manages to
percolate through to the sensor in say 10 seconds and the heater is
then switched off as the sensor has now reached the upper limit. The
problem now, is that the sensor has happily said that it's temp' is at
the upper limit but in actual fact most of the surrounding seat area
material and fabric is at a much higher temperature as it has had 10
seconds worth of heating and is still conveying these higher
temperatures through to the sensor **even though the power has been
switched off**.
This leads to massive temperature 'overshoots' which can only be
reduced (not eliminated!) by making the thermal paths, 'time
constants' shorter. E.g using a very low mass sensor attached directly
to the resistance wire in the heater cabling. If this is done, then
when the sensor says "I'm at the higher limit" then it is probably
more nearer to the truth. Although in this case it may have very
little relationship to the actual general seat temperature.
If you think this heat/distance problem through you maybe can see why
a situation can develop where the heater is asked to switch on even
when the seat temp' is already way too high. This is then a system in
oscillation.
To (realistically) get control of this heat lag/lead problem you need
as a first step, to ignore the upper/lower limit action and move to
continuous on line on/off duty cycle control. This is easily done via
the PIC say. Regularly monitor (eg once per second) how much the seat
temperature has changed (+/-) over the last second. Compare with the
setpoint and find how far it is from the required temp' and make
adjustment to the on/off duty cycle such that the heating/cooling
effects slow down as the setpoint is reached.
This method is the (D)erivative or 'rate of change' part of a full
PI(D) control setup.
Getting this kind of control system up and running can be a black art
and there is NO guaranteed method of finding a solution beforehand.
Numerous ways and means can be used to get a 'fix' and it is down to
the designer to dream up something suitable.
Ignore the books and software that tell you they will provide
solutions to these problems(they cost money and are mostly bollocks)
as they require a full mathematical description (transfer function) of
the the seat/body heatflow dynamics before they can calculate an
optimum control setup. In your case you would need the convective and
conductive heat xfer data for the laminar seat materials and a
clothed human body and then the application of a finite element 3D
solution using the Fourier heat transfer equation.
Setup these one off systems as you find them!. As long as you are
aware of the pitfalls (the basics) beforehand they can be quite fun
from a progging POV.
regards
john
Rumpantly?
--
Regards, John Woodgate, OOO - Own Opinions Only. http://www.jmwa.demon.co.uk
Interested in professional sound reinforcement and distribution? Then go to
http://www.isce.org.uk
PLEASE do NOT copy news posts to me by E-MAIL!
<snip> Thanx for the time taken for the explanation
I indeed forgot about the overshoot problem.
> This method is the (D)erivative or 'rate of change' part of a full
> PI(D) control setup.
I'm familiar with it, and yes, I know it can be damn tough to tune them
properly. I once made one that had to stabilize the light intensity in a box
(exactly 38 lux and 512 lux, switchable) for light sensor calibrations.
Well... that took *much* **much** longer to tune than I ever imagined... :(
The reason I choosed for the control loop was to compensate for lamp wear,
mains fluctuations etc.
Back to the seats:
From I what I can make up, the problem is that when you turn of the heater,
heating still continues for a while, so this need to be accounted for (as
someone once told me that this happens in house heating). And overshoot is
always a problem. The problem also with the heater is, the characterics
change depending on who sits on it (or nobody at all). I'll include a timer
that heats the seat some time before I'm going to use the car, so that I can
sit myself down on a nice warm seat :)
But do I need a fullblown PID?? Isn't the I-term just enough? E.g. constant
switching on/off, period 1 second, and increase/decrease PW by a fraction of
the error? The P term is not needed, because you can't say 'when continously
turned on the temp will be so and so much C deg', it also depends on the
ambient temp.
Maybe I can make it an autotuning control loop? Digital home thermostats
seem to do this (not every house is the same). I've E2PROM in the AVR
anyway. Hmmm, very interesting stuff...
Are there any other control algorithms?
Jeroen
Nice one! ;-)
After typing it, I looked and looked and looked at those words. They
just would NOT gel. In the end I said bugger it!.
Apologies for the 'chapter and verse', I just got carried away ... ;-)
No you should'nt really need the full PID. Just using the 'I' seems
like it would work OK. The commercial oven controllers use exactly
that ON/OFF variable duty cycle system. Ideal for your seat, would be
the 45UKP hand sized controller (complete with probe!), I bought last
year to make a small PCB test oven based on an external 500W
floodlight.
Yes, with the AVR, autotuning is a perfectly good option. Lot of
progging though as you need to make a number of tentative control
sensitivety 'tests' before selecting an optimum control strategy.
The old analogue bi-mettalic and the newer digital home T/C's use a
'pre-act' mechanism for switching. In that they are sensitive to rates
of change of the room temperature change. I.e they will act to switch
off earlier than setpoint if the room temp' is rising fast. (The D
method I was on about).
Loads of algorithms or methods !. Most are the type that come from a
'what if I do this' thinking session. None that are especially clever
and most are just mix and match of the basic PID parts.
As you've got EPROM in there I'd be inclined to store a fixed set of
duty-cycles that give (say 4 or more) approx' aiming temps. Then
using the sensor just tweek the Duty cycle from that point. Would
greatly minimise ability of the setup to get out of control. (just
dreamt this one up!, I'll add it to my own list ;-).
regards
john