Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 104
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
All today's birthdays', congrats!
Download (31)
ScottH (37)


Next birthdays
11/02 Download (31)
11/02 ScottH (37)
11/03 Electroguy (94)
Contact
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.
Forums
4hv.org :: Forums :: General Science and Electronics
« Previous topic | Next topic »   

Heater Control Advice

1 2 
Move Thread LAN_403
thedatastream
Fri Jul 24 2009, 11:54AM Print
thedatastream Registered Member #505 Joined: Sun Nov 19 2006, 06:42PM
Location: Yorkshire!
Posts: 329
Judging by this thread (pan and tilt) Link2 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) Link2 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 Link2 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 (Link2 + Link2 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

Back to top
Nik
Fri Jul 24 2009, 07:04PM
Nik 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
Back to top
MinorityCarrier
Fri Jul 24 2009, 09:22PM
MinorityCarrier 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.
Back to top
mikeselectricstuff
Fri Jul 24 2009, 10:21PM
mikeselectricstuff 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.
Back to top
aonomus
Fri Jul 24 2009, 10:33PM
aonomus 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.
Back to top
Steve Conner
Sat Jul 25 2009, 08:07AM
Steve Conner 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.
Back to top
thedatastream
Sat Jul 25 2009, 09:21PM
thedatastream 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.

Happy weekend
James
Back to top
Dennis Rogers
Sun Jul 26 2009, 02:30AM
Dennis Rogers 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.
Back to top
thedatastream
Sun Jul 26 2009, 07:47AM
thedatastream 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

Thanks
JAmes
Back to top
tobias
Mon Jul 27 2009, 01:02AM
tobias 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!
Back to top
1 2 

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
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.