If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.
Special Thanks To:
Aaron Holmes
Aaron Wheeler
Adam Horden
Alan Scrimgeour
Andre
Andrew Haynes
Anonymous000
asabase
Austin Weil
barney
Barry
Bert Hickman
Bill Kukowski
Blitzorn
Brandon Paradelas
Bruce Bowling
BubeeMike
Byong Park
Cesiumsponge
Chris F.
Chris Hooper
Corey Worthington
Derek Woodroffe
Dalus
Dan Strother
Daniel Davis
Daniel Uhrenholt
datasheetarchive
Dave Billington
Dave Marshall
David F.
Dennis Rogers
drelectrix
Dr. John Gudenas
Dr. Spark
E.TexasTesla
eastvoltresearch
Eirik Taylor
Erik Dyakov
Erlend^SE
Finn Hammer
Firebug24k
GalliumMan
Gary Peterson
George Slade
GhostNull
Gordon Mcknight
Graham Armitage
Grant
GreySoul
Henry H
IamSmooth
In memory of Leo Powning
Jacob Cash
James Howells
James Pawson
Jeff Greenfield
Jeff Thomas
Jesse Frost
Jim Mitchell
jlr134
Joe Mastroianni
John Forcina
John Oberg
John Willcutt
Jon Newcomb
klugesmith
Leslie Wright
Lutz Hoffman
Mads Barnkob
Martin King
Mats Karlsson
Matt Gibson
Matthew Guidry
mbd
Michael D'Angelo
Mikkel
mileswaldron
mister_rf
Neil Foster
Nick de Smith
Nick Soroka
nicklenorp
Nik
Norman Stanley
Patrick Coleman
Paul Brodie
Paul Jordan
Paul Montgomery
Ped
Peter Krogen
Peter Terren
PhilGood
Richard Feldman
Robert Bush
Royce Bailey
Scott Fusare
Scott Newman
smiffy
Stella
Steven Busic
Steve Conner
Steve Jones
Steve Ward
Sulaiman
Thomas Coyle
Thomas A. Wallace
Thomas W
Timo
Torch
Ulf Jonsson
vasil
Vaxian
vladi mazzilli
wastehl
Weston
William Kim
William N.
William Stehl
Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Registered Member #505
Joined: Sun Nov 19 2006, 06:42PM
Location: Yorkshire!
Posts: 329
Judging by this thread (pan and tilt) there are a number of people here who know stuff about control loops, PID and the like. As a follow on from this thread (thermistor questions) I want to ask for advice regarding a solution for a project I'm working on.
I'm designing a homebrew temperature controller for my brother who does lots of homebrewing (beer, mead, etc.) to help him keep his yeast at the right temperature. I'm using an Arduino to PWM control 5 individual heaters with feedback via thermistors (or possibly LM35s) being sensed by the analog inputs. There's also a multiplexed LED display for showing the temperature and some buttons to set temperature.
Set up of heater and fluid is like this
My question regards the method of controlling the heater power to achieve a stable temperature. I can only heat and not cool and I don't want any overshoot as too high a temperature will start to kill off the yeast. Whilst I'm going to put a "safety feature" in that cuts the heater power if the temperature rises too much I don't think this would be suitable for controlling within a degree of the set point.
My options are (I think):
> on/off controller with hysterisis > PID controller > Custom
On/off control Normal thermostat style, turn heater on max power until temperature reached. This is my favoured method due to it's simplicity + very simple to implement - risk of overshoot - how to deal with thermal capacitiy of heating element (is this an issue)? turn off before set point?
PID PID functions for the Arduino do exist ( + but these use floats and probably take a while to compute. On the other hand, my temperature is changing so slowly that shouldn't be a problem! As long as I multiplex my LED display from an timer interrupt it could take as long as it needs to compute temperature. + Once tuned should work well with no overshoot - Difficult to implement and tune
Custom Since the parameters of the system are reasonably well defined (specific heat capacity of the fluid, heater power) I could come up with a control scheme based on these parameters. + could be made fairly simple - using system in non-ideal conditions wouldn't work properly
Your advice and experience is welcomed Thanks James
Registered Member #53
Joined: Thu Feb 09 2006, 04:31AM
Location: Ontario, Canada
Posts: 638
With a bit of work you could adapt a regular digital house thermostat to do this. Just extend its own temperature sensor into the jug and use the heating-enable signal to close a relay that turns on your heater. You can adjust the "lag/delay" in most units and if you do a trial run with just water you can determine if you need to set the thermostat down by a degree or 2. It will be 10x faster then building your own unit and fairly easy to operate.
Parts: Fancy digital/programmable thermostat 24v XFMR 24v coil 120v contact relay 2 wires to move the thermistor/temp sensor from inside the thermostat to inside the jug. Box to put it in so its not a mess
Registered Member #2123
Joined: Sat May 16 2009, 03:10AM
Location: Bend, Oregon
Posts: 312
PID is actually a very good method for heating a liquid. There are many thermocouple type digital PID controllers out there, Omron is one mfg that comes to mind, who has a very large selection of economical temp controller types. These usually control to within 1 deg. C. Many PID temp controllers can be 'trained' to their load to minimize temperature overshoot.
If you do not need tight tolerances, then more relaxed designs can be used, a mechanical thermostat (large hysterisis) or a thermistor/comparitor IC-driven relay, where hysterisis can be determined.
If it is practical, put a teflon-encapsulated stir-bar magnet in the vessel and use an external magnetic stirrer to constantly stir the liquid. You can minimize temperature overshoot and thermal stratification of the liquid that way.
Registered Member #311
Joined: Sun Mar 12 2006, 08:28PM
Location:
Posts: 253
There is no need for floats for PID as the values will not span a huge range. Integer maths with binary fractions stored in longs (e.g. 8:24 bits) will easily give enough resolution.
Registered Member #1497
Joined: Thu May 22 2008, 05:24AM
Location: Toronto, Ontario, Canada
Posts: 801
Adding the stirrer will even distribution of heating into the vessel, and prevent the heater (if at maximum power) from overheating a localized area and killing the yeast.
Registered Member #30
Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
mikeselectricstuff wrote ...
There is no need for floats for PID as the values will not span a huge range. Integer maths with binary fractions stored in longs (e.g. 8:24 bits) will easily give enough resolution.
This is true, I've done a PID controller on a PIC using just 8x8 multiplies and 16-bit state variables. The only problem is that you need to think harder when designing it, than if you just mindlessly used floats everywhere.
Computing power is now so cheap that it often makes economic sense to waste power in this way, because it gets the development done quicker and makes the code more maintainable.
Registered Member #505
Joined: Sun Nov 19 2006, 06:42PM
Location: Yorkshire!
Posts: 329
Hey guys, thanks for all the replies.
First off, I already have all the hardware built, I just need the software writing to drive it. Thanks for all the alternate ideas though. I'm not going to leave my Arduino board in there, rather I'm going to replace it with an ATmega168 (or maybe an 88) in an IC socket. Should save a few bob! Plus most of the parts I used were junk box or free issue so it didn't cost that much really.
Shortly after posting the start to this thread, I knocked up a simple on/off controller with the heater in free air on my desk and a 0.25 degC hysterisis. It overshot by 6 degC on the first warmup from room temperature but wasn't too bad after that; I need to put it into water to see what it does then.
If it doesn't work, I'm going to code my own PID functions rather than use a library as this will be the best way to learn!
Also, we have some thermal simulation software at work, so I might press that into action to see if it can be made to model a heater suspended in fluid. It would be interesting to see the temperature differential present in the water, how much convection there was and if a magnetic stirrer would be worth it.
Also I don't know if the brewing my brother does creates sediment (I suspect the answer would be yes) so that would be a definite no vote for a stirrer.
Registered Member #1837
Joined: Tue Dec 02 2008, 02:20PM
Location: NYC
Posts: 65
Maybe you should put a regular thermostat in series with your high tech solution as a back up. That way you have best of both worlds. Redundancy is next to Godliness.
Registered Member #505
Joined: Sun Nov 19 2006, 06:42PM
Location: Yorkshire!
Posts: 329
Dennis Rogers wrote ...
Maybe you should put a regular thermostat in series with your high tech solution as a back up. That way you have best of both worlds. Redundancy is next to Godliness.
Hi Dennis,
There's going to be a safety feature in the software (is that an oxymoron?) that cuts the heater power if the control loop allows it to overshoot
Registered Member #1956
Joined: Wed Feb 04 2009, 01:22PM
Location: Jersey City
Posts: 172
James
You have a nice project coming up!
My advice: You should use PID. Get four pots on arduino ADs and name them "SetPoint", "Kp", "Kd" and "Ki". Then write a simple code using the AD's values plus the temperature sensing of the LM35 to calculate the PWM.
If you are woried about not getting enough amplitude of the LM35 (1V) you can put a opamp between the that IC and the controling for a 5x gain or so...
Then google "Ziegler–Nichols" and use that method to tune your system. It's a fun thing to do!! I did it before for a heating device too but I used a "opamp only" design. Yes, I used a lot of opamps! haha Good luck out there!
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.