Searching \ for '[EE] Tank Temp Control Redux' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=tank+temp+control
Search entire site for: 'Tank Temp Control Redux'.

Exact match. Not showing close matches.
PICList Thread
'[EE] Tank Temp Control Redux'
2005\08\24@094106 by Mike Hord

picon face
I got some good ideas last time, and I'd like
to run my ideas past the assemblage.

RECAP:  I need to run a tank of water (10 US
Gal, or ~38L) from very close to 0C to 50C, in
a predictable, controllable manner over a span
of some days.

I am buying a 300GPH aquarium filter which
has a provision for fitting a 100W heater in the
flow of water.  Power supply is separate for
each; on-off switching of the heater will allow
me to control the amount of energy transferred
into the tank.

So, that leaves me wondering how to prevent
oscillatory behavior in the system, and how to
calculate how much energy to pour into it.  If
I turn on the heater, it won't release its full
100W until it "warms up", right?

If I were to take a tank of room temp water,
stick it in the fridge, and watch its temp fall
with an accurate thermometer, that'd give me
a good idea of the rate of heat transfer from
the tank.  That rate will slow as the temp of
the tank approaches that of the surrounding
air, correct?  That is, it takes longer to go
from 2C to 1C than from 25C to 24C.  I can
then figure out the rate at which I need to
switch my heater to replace the energy lost
to the environment.

Does this sound good?  Real-time feedback
driven control is not something I've ever done
before, and I know it can be tricky.  I think
this is a good project to cut my teeth on,
since the changes will occur VERY slowly.

Mike H.

2005\08\24@101951 by John J. McDonough

flavicon
face
Mike

Real time feedback control is relatively simple, in principle.  Using an
on-off sort of control does muddy the waters a bit, and temperature control
is the most difficult because of the lag times involved.

The sort of default algorithm is called PID for
proportional-integral-derivative.

Proportional basically increases the input in proportion to the error.
Thus, if you are 10 degrees cold, you add ten times as much heat as you
would if you were one degree cold.  The problem is, proportional control
NEVER actually reaches the setpoint.

To counter this, integral control is added.  This adds additional output in
proportion to the integral of the error over time.

For something fast, like flow, PI control works great.  However, when
heating a vessel, it takes a long time for the vessel to respond anyway, and
even longer for the integral to build up.  As a result, for temperature
control of a vessel, PI control is extremely sluggish.

To counter this,  derivative control is added.  Basically, you include a
term that is proportional to the rate of change of temperature, so that you
recognize when you have started to make progress and back off so you don't
overshoot.

Now I have written hundreds, maybe thousands of controllers, but I have
never tried to use a fish tank controller.  But what I would do is the
following.

I would call my "output" a duty cycle for the heater.  So the bottom of my
controller would essentially be a duty-cycle controller.  I don't know if a
PWM output can be made slow enough for a fish tank controller, but that
would be the idea.  You have an algorithm that accepts a duty cycle as
setpoint, and turns the heater on and off at that duty cycle.

Now, the setpoint for the duty cycle controller would be calculated as

 K1 * error   +   K2 * integral of error over time + K3 * derivative of
error over time

(some of the K's will probably be negative)

There are theoretical bases for setting K1, K2 and K3, but they never work.
Best plan is probably to do a DOE to determine the best settings.  You might
do a couple of quick, ad-hoc, experiments to set the range for your DOE.
Too low a value for any of the gains and you won't get to setpoint very
soon.  Too high and you will overshoot or even oscillate.  Generally, if you
want to heat the vessel fairly quickly you accept a little overshoot, but
this depends on the sensitivity of your application.

Hope this helps

--McD


{Original Message removed}

2005\08\24@111055 by olin piclist

face picon face
Mike Hord wrote:
> I need to run a tank of water (10 US
> Gal, or ~38L) from very close to 0C to 50C, in
> a predictable, controllable manner over a span
> of some days.
>
> I am buying a 300GPH aquarium filter which
> has a provision for fitting a 100W heater in the
> flow of water.

100W sounds like way too little for this.

There are important answers you left out.  How accurate do you need the
temperature control to be?  How fast must it respond?  How fast must you be
able to heat the water?

I once built a darkroom waterbath with a really dumb controller, but
it worked very well.  This bath was probably about a gallon
in one of those platics tubs you can get lots of places for washing dishes
or whatever.  I also used an aquarium pump to keep the water circulating.
That guaranteed that temperature differences at different points would be
minimal and that there was always circulation past the thermistor sensors.
The control algorithm was just to turn a relay on or off every 64 power line
cycles based on whether the temperature was above or below the set point.
It worked very well.  Once the setpoint was reached, you could barely see
movement on the photographic thermometer.  It probably kept the temperature
to about 1/4 degree F.  For a heater I used a commercial immersion
heater intended to warm your coffee right in the cup.  They were cheap and
available back in 1980, and all the safety issues had already been dealt
with.

That heater was probably 50-100W, which is why 100W sounds like way to
little in your case.

Of course instead of guessing, you should have done the math. [rant] Why is
it people seem allergic to doing this.  This stuff is straight out of high
school physics. [/rant]  Anyway, you have 10 gallons, which is about 80
pounds of water, which therfore requires 80 BTU to heat one degF, or 144 BTU
to heat 1 degC.  144 BTU is about 152Kj.  That means it will take over 25
minutes for 100W to raise the temperature 1C with no loss to the outside.
This sounds woefully inadequate.

Raising the temperature 1C in 1 minute is probably a reasonable goal,
assuming you don't need it faster (you never said).  You can immediately see
that requires around 2.5KW plus whatever is lost to the outside.  Also note
that this is very slow compared to how you can control the power input.  You
can easily decide to turn the heater on or not for 10 seconds at a time and
still get very good regulation.

To measure the power loss to the outside, fill the tank with maximum
temperature water by whatever means, turn on the circulation pump, and close
it up.  Record temperature over time.  It should be an exponential decay
approaching ambient, and will probably take a few days to get within
measurement error of ambient.  However, you only need to record the first
few hours.  You are interested in the maximum power loss, which occurs at
maximum temperature.  The rate of change at maximum temperature will tell
you the power loss your heater needs to deal with.

For example, let's say the temperature drops 2C/hour at 50C.  2C/hour is
3.6F/hour.  You have 80 pounds of water, so that's 288 BTU/hour = 304Kj/hour
= 84.4j/S = about 85 watts.  If that's the case, a 2.5KW heater should still
be fine.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\08\24@115957 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Olin Lathrop" <spam_OUTolin_piclistTakeThisOuTspamembedinc.com>
Subject: Re: [EE] Tank Temp Control Redux


> For example, let's say the temperature drops 2C/hour at 50C.  2C/hour is
> 3.6F/hour.  You have 80 pounds of water, so that's 288 BTU/hour =
> 304Kj/hour
> = 84.4j/S = about 85 watts.  If that's the case, a 2.5KW heater should
> still
> be fine.

If Mike is the patient type, and the loss does turn out to be around 85
watts, then the 100W heater ought to work pretty well.  Just turn it off for
a little while each day.  Of course, Mike may grow a rather long beard
getting it up to temperature in the first place.....

It surprises me that I didn't jump on the "do the math" thing in the first
place.  I'll be in Germany next week teaching model building.  While we talk
about designing experiments to uncover the model, the first rule is that if
you have a first principles model, you use it.  It is incredible how many
people will do an amazing amount of work to avoid cracking open a textbook.

--McD

2005\08\24@123751 by Mike Hord

picon face
> Of course instead of guessing, you should have done the math. [rant] Why is
> it people seem allergic to doing this.  This stuff is straight out of high
> school physics. [/rant]  Anyway, you have 10 gallons, which is about 80
> pounds of water, which therfore requires 80 BTU to heat one degF, or 144 BTU
> to heat 1 degC.  144 BTU is about 152Kj.  That means it will take over 25
> minutes for 100W to raise the temperature 1C with no loss to the outside.
> This sounds woefully inadequate.

Apologies for not including that info in the original message, but
25 minutes per deg C is just fine.  We're primarily concerned with
the amount of O2 dissolved in the water, and that changes fairly
slowly, so a slow rise to a given temp and then loitering at that
temp +/-, say, .1 deg C, would be just peachy.

Incidentally, my "guess" was not unfounded.  I know that a 100W heater
keeps my 54 gallon aquarium at 80 degrees even when the temp in the
house is at 60 degrees.

> To measure the power loss to the outside, fill the tank with maximum
> temperature water by whatever means, turn on the circulation pump, and close
> it up.  Record temperature over time.  It should be an exponential decay
> approaching ambient, and will probably take a few days to get within
> measurement error of ambient.  However, you only need to record the first
> few hours.  You are interested in the maximum power loss, which occurs at
> maximum temperature.  The rate of change at maximum temperature will tell
> you the power loss your heater needs to deal with.

Which is exactly what I suggested doing in the
fifth section of my initial message.  A simple
"sure, that method will work fine" would have
sufficed.

> For example, let's say the temperature drops 2C/hour at 50C.  2C/hour is
> 3.6F/hour.  You have 80 pounds of water, so that's 288 BTU/hour = 304Kj/hour
> = 84.4j/S = about 85 watts.  If that's the case, a 2.5KW heater should still
> be fine.

As should a 100W heater.  My error for not specifying
the rise time I needed.  Since this is a device testing
and calibration setup, it's quite acceptable for the test
run to take two or three days to run through its cycle.

There is a 200W model available.  The extra wattage
certainly won't hurt to have available.

Mike H.

2005\08\24@124425 by Mike Hord

picon face
> If Mike is the patient type, and the loss does turn out to be around 85
> watts, then the 100W heater ought to work pretty well.  Just turn it off for
> a little while each day.  Of course, Mike may grow a rather long beard
> getting it up to temperature in the first place.....

See my response to Olin's message.  The whole affair is automated,
and slowness is quite desirable.

> It surprises me that I didn't jump on the "do the math" thing in the first
> place.  I'll be in Germany next week teaching model building.  While we talk
> about designing experiments to uncover the model, the first rule is that if
> you have a first principles model, you use it.  It is incredible how many
> people will do an amazing amount of work to avoid cracking open a textbook.

I'm a "do-the-math" type, too, but I wanted to make certain I had
my principles in order before tackling energy transfer rates and
such.  As Olin pointed out, I do really need to do some checking
to determine the maximum heat transfer rate, before I can decide
on the rest.

Mike H.

2005\08\24@132002 by olin piclist

face picon face
John J. McDonough wrote:
> If Mike is the patient type, and the loss does turn out to be around 85
> watts, then the 100W heater ought to work pretty well.  Just turn it
> off for a little while each day.  Of course, Mike may grow a rather
> long beard getting it up to temperature in the first place.....

Yeah, really long.  I just picked 2C/hour out of the air as an example,
although my guess is the power loss would significantly larger than 85W with
reasonable insulation.

> It surprises me that I didn't jump on the "do the math" thing in the
> first place.  I'll be in Germany next week teaching model building. While
> we talk about designing experiments to uncover the model, the
> first rule is that if you have a first principles model, you use it. It is
> incredible how many people will do an amazing amount of work to
> avoid cracking open a textbook.

Right.  So do the math instead of guessing at the heat loss.

He's got 10 gallons, which is about 38 liters.  A liter of water takes up
1000 cubic centimeters, or .001 cubic meter.  The tank volume therefore
needs to be at least .038 cubic meters.  If it were a cube, it would be .038
** 1/3 = 336mm on a side.  The surface area of each side would be .336m x
336m = .113 square meters.  All 6 sides is .113 m**2 x 6 = .678 square
meters = 7.3 square feet total surface area.

His maximum temperature is 50C, and let's say it has to work with ambient
20C (68F) for a total temperature difference of 30C = 54F.  Let's say it's
insulated with R 10 insulation.  At 54F temp difference, that would lose 5.4
BTU/hour per square foot.  Times 7.3 square feet, the water would lose 39.4
BTU/hour = 41.6Kj/hour = 11.6W.

That's a lot less than I thought.  It just goes to show how there is no
substitute for doing the math.  R10 insulation is achievable with deliberate
insulation applied to the tank, and you could probably get R 15 or maybe R
20 with some care.  Of course the tank will be a little bigger than the
absolute minimum of 10 gallons, and probably not a perfect cube, and we made
a few other simplifying assumptions.  Still 20-30 watts now sounds
believable at maximum temperature.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\08\24@134343 by Spehro Pefhany

picon face
At 01:20 PM 8/24/2005 -0400, you wrote:


>That's a lot less than I thought.  It just goes to show how there is no
>substitute for doing the math.  R10 insulation is achievable with deliberate
>insulation applied to the tank, and you could probably get R 15 or maybe R
>20 with some care.  Of course the tank will be a little bigger than the
>absolute minimum of 10 gallons, and probably not a perfect cube, and we made
>a few other simplifying assumptions.  Still 20-30 watts now sounds
>believable at maximum temperature.

If there's evaporative cooling taking place, it will blow those estimates
right out of the water (so to speak). Especially at 50°C.

>Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff

2005\08\24@140439 by Harold Hallikainen

face picon face
I haven't been following this thread, but if anyone's interested in
temperature control techniques of about 50 years ago, see
http://kauko.hallikainen.org/hi/brochures/ .

Harold

--
FCC Rules Updated Daily at http://www.hallikainen.com

2005\08\24@143534 by Mike Hord

picon face
> If there's evaporative cooling taking place, it will blow those estimates
> right out of the water (so to speak). Especially at 50°C.

Some, but not much.  The tank has a cover placed on it, and the only holes in the cover are filled by insertion of the devices under test.

Mike H.

2005\08\24@162713 by rosoftwarecontrol

flavicon
face
go to here, an example how temperature being controled.
done by me. It is rather simple and lots of ready products
on market.



http://ca.geocities.com/microsoftwarecontrol/tmpr/tmpr.htm

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

2005\08\24@165314 by Mike Hord

picon face
Looks good!  Thanks!

Mike H.

> go to here, an example how temperature being controled.
> done by me. It is rather simple and lots of ready products
> on market.
>
> http://ca.geocities.com/microsoftwarecontrol/tmpr/tmpr.htm

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...