Shop OBEX P1 Docs P2 Docs Learn Events
Modifying an old thermostatic chamber, can't get precise temperature control. — Parallax Forums

Modifying an old thermostatic chamber, can't get precise temperature control.

CuriousOneCuriousOne Posts: 931
edited 2014-02-08 05:36 in General Discussion
Hello.

Recently I've aquired laboratory grade thermostatic chamber, which can support any temperature from 30C to 60C, with 0.5C precision inside it. The chamber is made around 1958, and uses (used, guts are already junked), some thermoactive wire wein bridge and vacuum tubes! I thought for myself, that upgrading this to have digital display and temperature control and so on will be fun and easy with basic stamp, but seems like I was totally wrong.

I've already did display part, thermometer part and control part (BS2+DS1820+MAX7219+MOC3052 driving BTA140). Everything works just like it should worked, except the fact that I have temperature runout. Say, I've set target temp to be 40C (temperature sensor is suspended in center of chamber). Heater is on, and as temperature reaches 40C, heater is switched off, but temperature continues to rise, and about in 5 minutes, reaches around 44C.

As I understand, this is caused by poor heat transfer ratio of air. How should I fix that? Install a fan that will rotate air inside the chamber? But actual chamber was working just fine without any fans!
«1

Comments

  • PublisonPublison Posts: 12,366
    edited 2014-02-01 04:25
    I would download a copy of Process Control text from the Parallax site:

    http://www.parallax.com/product/122-28176

    There is a wealth of information on temp control, both open loop and closed loop. Also good information on using PID to prevent overshoot.
  • Heater.Heater. Posts: 21,230
    edited 2014-02-01 04:27
    You gutted it and threw away the tubes! You destroyed a historical artefact.

    Please tell me it was not you.

    Do you have a picture of this thing? Before it was gutted.

    Temperature control is not so easy. When using a "bang bang" controller by the time you decide to turn it off you may already have pumped enough energy into the heating element to keep things warming up for a long time. Unlike controlling a motor you can't command the heater into reverse to slow down the rise in temperature or cool it to correct the overshoot error.

    No doubt a fan would help to get the heat from the heater to everything else thus reducing that stored energy effect a bit.

    They knew how to do it in 1958.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-02-01 06:01
    Obviously you cannot just go full on and then shut off at the target temperature. The heat element is way above the target and continues to contribute heat.

    So you have to begin to feed less and less heat in as you get closer and closer. And only when you get no over-shoot can you switch to maintaining the heat.

    Sounds like in might have been done with tubes as an op amp in analog. Could be done that way again with tiny solid-state op amps and might be easier to set up the feedback loop to be adjustable than it would to do an all digital solution.

    Of course, you can do PID instead in an all digital solution.

    Elliot Sound Products in Australia has nice easy to use (and inexpensive) op amp boards, and power supply boards for the same.

    Of course, the temperature can still be measured via digital for a read out.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-01 06:23
    The unit was already gutted when I bought it. It was sold as junk metal from local research lab. It had only rectifier lamp and filament transformer in place, other parts were missing. The overal look can be seen here: http://images.dmir.ru/dmir/images/laboratornyy-sushilnyy-shkaf-7049353.jpg
    It has concentric heater, wound around internal aluminum chamber (checked image with thermal camera, can post if someone interested).

    Technically, I can "PWM" the heater, to allow smoother temperature increase, but I still need to develop some kind of lookup table like? "If outside temp is 25C and we need 35C inside, then heat at full untill 30C and then slowly go to 35C".
  • PublisonPublison Posts: 12,366
    edited 2014-02-01 08:25
    Andy just posted a new page on the Learn site about PID control with the BS2:

    http://learn.parallax.com/pid-control
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-02-01 08:27
    35 decrees C is not very hot. What is the temperature range you desire. Is 60 degrees C the real limit? And at what precision? You might be able to do better than 0.5 degrees.

    Less than 100 degrees C is pretty much a warmer for things like hot dog buns and an after shave towel.

    Or I guess if your incubating bacteria or growing crystals, it might have its uses. Or a hot house for mushrooms.

    It might make a great plate and mug warmer or incubate chicken eggs.

    The overall watt consumption at peak use will give you an idea of the peak rate that you have to reduce for precise control. There is some heat loss that requires replacement that is dependent on the outside temperature (assume 20 degrees C or 'room temperature') and how much good insulation the unit included. And the unit has startup cost in a 'thermal mass' that has to be heated to the target temp from a startup at room temp.

    So estimating [a] peak watt consumption, amount of heat loss at target temp compared to room temp (this you might have to run tests a various targets and read the current consumption, and [c] the start up thermal mass to target (by tiiming how long it takes to reach target temp at full on) may all provide some useful info to design your PID in this case.

    Actual room temperature and AC current readings might be required for PID. Just watching the temperature gauge is likely to continue to know too little, too late.

    It is an interesting project. I have a friend that has a hobby of microbiology and this the kind of thing that she would find useful to put petri dishes in with samples of rabbit dung and such.

    Not exactly my cup of tea, but when you have a microscope .. you go looking at things that others would never think of.

    If 60 degrees C is your extreme, I'd start with estimating how to get to the sustainable extreme and work backwards from there.
  • pmrobertpmrobert Posts: 675
    edited 2014-02-01 10:38
    Thermal equipment of that vintage is quite likely to have asbestos insulation. It's not a problem unless it becomes airborne. Be careful, asbestosis and mesothelioma are really bad ways to exit this world and are slow, painful ways to die.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-01 11:32
    I've read that PID page, but I can't understand, how it will work in my case, when temperature runs up?

    I've checked internals, the wire is insulated from main chamber with silk ribbon, soaked in gypsum, same layer of gypsumed ribbon goes around the wire, and then additionally insulated by layers of cardboard.

    The 30C and 60C comes from readings on the front panel. I personally plan to use this for glue/epoxy caking/hardening, which does not requires so precise temperature control, but I want to do it, since hey, in 1958 they did it with tubes, I can't do it with ICs? :)
  • kwinnkwinn Posts: 8,697
    edited 2014-02-01 12:43
    CuriousOne wrote: »
    I've read that PID page, but I can't understand, how it will work in my case, when temperature runs up?

    I've checked internals, the wire is insulated from main chamber with silk ribbon, soaked in gypsum, same layer of gypsumed ribbon goes around the wire, and then additionally insulated by layers of cardboard.

    The 30C and 60C comes from readings on the front panel. I personally plan to use this for glue/epoxy caking/hardening, which does not requires so precise temperature control, but I want to do it, since hey, in 1958 they did it with tubes, I can't do it with ICs? :)

    Even a PID control loop will have some overshoot and oscillation around the set point before the temperature stabilizes. The only way I have seen of having the temperature rise and stabilize at the set point with almost no overshoot and oscillation is a modified PID algorithm. IIRC that modification adjusted the PID parameter once the temperature got close to the set point. The amount of adjustment was based on the difference in temperature between the ovens ambient and set point.
  • kwinnkwinn Posts: 8,697
    edited 2014-02-01 12:49
    BTW, how is the heating coil powered, AC or DC, and what voltage?
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-01 12:52
    AC, 220V, power is about 350W.

    Yes, I also come to conlcusion, that I should have two termometers, inside and outside, and also huge lookup table, for specific start-stop conditions, according to temperature.
  • propMakerpropMaker Posts: 65
    edited 2014-02-01 13:00
    CuriousOne wrote: »
    AC, 220V, power is about 350W.

    Yes, I also come to conlcusion, that I should have two termometers, inside and outside, and also huge lookup table, for specific start-stop conditions, according to temperature.

    Generating a lookup table for lots of conditions is probably as much or more work than implementing PID control.
  • max72max72 Posts: 1,155
    edited 2014-02-01 14:31
    For PID tuning there are many sources.
    A very nice one is on lakeshore's manuals. Look for a temperature controller and download the manual.
    Massimo
  • Mark_TMark_T Posts: 1,981
    edited 2014-02-01 16:35
    An important thing to note that you will get much better control if the heater is not a
    binary device - drive it with PWM (probably a very low frequency like 0.1Hz) so that
    as you approach the target it is starting to reduce the average heating power. Far from the
    target you'll probably saturate so the heater is fully on, but don't keep that up all
    the way to the target temperature or overshoot is guaranteed.

    Now you know that overshoot is about 5 degrees, you know that if the target is
    40 C, you should start to ease back the heater power by 35 C,
  • localrogerlocalroger Posts: 3,451
    edited 2014-02-01 16:54
    You can actually drive a heater like that with a *really* low frequency like pulses of 1 to 5 seconds duration. Achieving about 0.5C stability should not be too hard with hand PID tuning.
  • kwinnkwinn Posts: 8,697
    edited 2014-02-01 17:40
    Have to agree with what Mark_T says in post 15 “Now you know that overshoot is about 5 degrees, you know that if the target is 40 C, you should start to ease back the heater power by 35 C”.

    A simple method to control any 120/240VAC powered device is cycle control. That is to modulate the power by switching the device on for x out of n cycles of the AC line. Simple software and hardware requirement with virtually no electrical noise since the power is switched at the AC zero crossing point.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-01 21:43
    As I understand, PID can't work without overshoot, so tables is a must.
  • ercoerco Posts: 20,256
    edited 2014-02-01 22:06
    Heat transfer occurs by conduction, convection, and radiation. All three are taking place, very complicated. Many variables like blackbody radiation, color, sensor's proximity to and view of the heater element. Moving/shielding your temp sensor wrt heater will absolutely change the system transient & steady state responses, for better or worse. And adding objects to be heated may also change the responses if they change the sensor/heater view.

    I'd play around with the sensor location a while to optimize that before getting into a PID routine, which should require storing a recent temperature history for integration, but not a table.
  • potatoheadpotatohead Posts: 10,261
    edited 2014-02-01 22:11
    Your tolerance range is what? That .5C?

    So then, your allowable overshoot is .2C, leaving some small amount of margin for measurement error. You can decide what this is empirically, if nothing else.

    There are always tolerances. The basic problem you are facing is matching the process to the tolerances. Take some small amount of overshoot into account and work from there.

    So then, if you require *no* overshoot at your target range, that .5C precision must be centered below your target range; otherwise, the .5C precision will be centered on your target range and some small overshoot is acceptable.

    Frankly, it's easier to think about it with the precision centered on the temp range, but it doesn't have to be that way. Up to you. What you need to realize is again there are always tolerances. The only value you can't get is the target value. Your device will deliver close to that value and how close is a matter of process control. Doesn't matter what you use to get this done in this respect.

    Tolerances simply exist because things simply aren't perfect.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-02-02 03:09
    I came across this by Googling "pid thermal control". It may help, more so than just tossing a PID object at you.

    http://newton.ex.ac.uk/teaching/cdhw/Feedback/Setup-PID.html

    Frankly, I would just have a rough and ready ramp up to near optimal temperature and then switch over to PID mode.

    This approach may eliminate exhaustive lookup tables. Something like 100% power until 75% of temp 75% power until 90% of temp, 50% power until 95% of time, and then jump to PID.

    At some point, designing good application code is BOTH about being creative, and a bit lazy.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-02 21:57
    There's huge thermal inertia, which depends on a lot of factors...
  • potatoheadpotatohead Posts: 10,261
    edited 2014-02-02 23:15
    You need a feedback loop that scales with the temp difference.

    Sample, compute, output, sample, compute, output....

    Do you know what the original temp settle time was? With that huge inertia, it's probably a long time. Given they used tubes, etc... a table shouldn't be necessary. For one, it seems to me that would only work given a fairly stable ambient temp start range. The trade-off might be time to arrival at target temp is shorter but down time would need to be longer.

    With the feedback loop approach, that would be more balanced.

    Over a designated range, run it full throttle. Sample, recalculate range, run it at a percentage. Continue until it's operating on what is basically a sustaining pulse once the temp delta is inside your desired precision range.

    http://educypedia.karadimov.info/library/PIDcontrol.pdf
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-02-03 01:53
    I suspect that the 'huge thermal inertia' operates as the thermal equivalent of a huge capacitor that removes AC ripples from a rectifier for a DC supply.

    The main thing is that the heat up phase needs to be tapered off during start up to avoid a big overshoot in that mode which will require a long cooling down period.

    Once this device is at the target temperature, it is going to pretty much remain there with small inputs to make up for heat loss to the ambient room temperature.

    SO code for two modes -- Cold start, and sustained operating temperature. The feedback should be pretty simple, just a temperature sensor or an array of them if you desire to average out readings.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-03 05:02
    Yes, currently doing that way, but also added 12cm fan, which helped really much - temperature runout decreased to 2C from 5C.
  • max72max72 Posts: 1,155
    edited 2014-02-03 05:09
    CuriousOne wrote: »
    As I understand, PID can't work without overshoot, so tables is a must.
    This is not correct.
    It is a question of tradeoff. You have to balance speed, set point accuracy and overshoot. And you have to correctly tune the parameters to get the results you expect.
    Some controllers have different parameters depending on the set point too..
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-03 05:39
    Currently, I'm building so called "derating" curve. For example, when target is 30C and I switch off heater at 28.5C, temperature peaks to 30.6C
    But, when target is 40C and I switch off at 38.5C, temperature goes to 39.4C only. So, there's certain coefficient to be calculated.
  • Heater.Heater. Posts: 21,230
    edited 2014-02-03 06:04
    CuriosOne,
    As I understand, PID can't work without overshoot, so tables is a must.
    Not so.

    When you build a feed back control system you are essentially building a oscillator. A good example of an oscillator is a pendulum.

    When you move a pendulum away from it's resting position and let go gravity tries to pull it back towards the vertical position again. As it does so the pendulum starts to move faster and faster. It gains kinetic energy. By the time it reaches it's lowest position it has gained enough energy to carry it past that position and way on up the other side to nearly as high as when you let go. A pendulum is continuously swapping potential energy, due to its height with kinetic energy due to it's velocity. In the absence of friction it will do this forever. It's an oscillator.

    What if we immerse the pendulum in water? Then the movement is slowed by the viscous friction of the water. It gets to it's vertical position more slowly and swings by to a lesser height on the other side. The amplitude of the oscillations gets less and less until it is stopped hanging vertically. We have a damped oscillator.

    What if we repeat this experiment in molasses? Then we might find that the viscous friction is so great that the pendulum advances very slowly until it gets to the rest position. It never overshoots up the other side. This is a critically or over damped oscillator.

    And so it goes with a PID heating controller. If the PID is applying two much energy input the temperature will reach the set point quickly but by the time it gets there there is so much heat in the system that temperature continues to rise past the set point. If the PID is applying to little energy temperature will rise inordinately slowly and may never reach the set point due to heat losses. By changing the PID parameters you are changing the amount of "damping" in the system just like moving that pendulum from air to water to molasses.

    The trade off is that if you want a fast response, get up to temperature quickly, you might have to accept a bit of overshoot. For less overshoot your response time will be slower. This somewhat depends on how accurately you want the set point to be maintained.

    If you think about it, to have tables do what a PID algorithm does you would need them to be three dimensional. It might be harder work to create those tables correctly than to tune the PID.

    As an aside. Someone around here has a fuzzy logic control system for the Propeller. Perhaps that is a thing to look at.
  • PublisonPublison Posts: 12,366
    edited 2014-02-03 06:20
    Heater. wrote: »
    CuriosOne,



    As an aside. Someone around here has a fuzzy logic control system for the Propeller. Perhaps that is a thing to look at.

    I know Hanno has a Fuzzy Logic engine in Veiwport:

    http://onerobot.org/products/viewport/

    http://onerobot.org/landing-on-the-moon-with-fuzzy-logic/
  • Heater.Heater. Posts: 21,230
    edited 2014-02-03 06:21
    That's the one.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-03 06:21
    I talked with a guy who used devices like this when they were working. He said, they had about 2C overshoot, and stabilizing at desired temperature in about 25-30 minutes after startup.
Sign In or Register to comment.