Modifying an old thermostatic chamber, can't get precise temperature control.
CuriousOne
Posts: 931
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!
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!
Comments
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.
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.
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.
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".
http://learn.parallax.com/pid-control
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.
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.
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.
A very nice one is on lakeshore's manuals. Look for a temperature controller and download the manual.
Massimo
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,
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.
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.
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.
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.
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
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.
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..
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.
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.
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/