Shop OBEX P1 Docs P2 Docs Learn Events
How do I regulate a heater? — Parallax Forums

How do I regulate a heater?

PADTPADT Posts: 8
edited 2008-03-12 17:05 in BASIC Stamp
Hi all,
I have a BS2px24 plus the Parallax 28022 Thermocouple kit. I am trying to regulate the temperature of a tank of water by controlling when the blanket heater shuts off and on.· The basic stamp is simply turning on the SSR to warm up the water and turning off the SSR when the bath is at temperature. The problem, of course, is that it overshoots by about 4 degrees C.· How do I get the heater to ramp up to the required setpoint (70C) and stay there? Either no or +/-1C bandwidth is preferred.
Thank you,
Anna

·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-10 21:30
    What do you think? The blanket heater gets hot and the heat percolates into this big tank of water which can hold a lot of heat. I don't know where you're measuring the temperature of the tank, but it's probably not directly under the blanket (because you'd ask a different question if it were). Most heaters don't cool off instantly, so it will continue to pour heat into the tank for a while after you turn off the power to it. Similarly, it will take a while for the blanket heater to warm up once you turn on the power, then the heat has to soak into the tank and actually warm the water. Do you have any graphs of the tank temperature in relationship to time through several cycles of heating and cooling? What's the slope of the curve(s). Again, what do you think you should do?
  • FranklinFranklin Posts: 4,747
    edited 2008-03-10 23:19
    Take a look at this manual for some ideas www.parallax.com/Store/Education/KitsandBoards/tabid/182/ProductID/318/List/1/Default.aspx?SortField=ProductName,ProductName

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • JomsJoms Posts: 279
    edited 2008-03-10 23:55
    You need to take into account what Mike has said. Possibly adding an second detector to test outside air temp also. It is going to take a fair amount of work to keep it in that close of range, much more then any common t-stat can do. More then likely you will need to 'pulse' the heater, say one minute on, thirty seconds off, etc. This is going to be ALOT harder if the outside air temp varies like it does in South Dakota. The circuit will be a lot easier if you control the heater just on/off, but will probably work better if you use a digital to analog convertor then build a circuit that allows the heater to one in 1-10 steps... Just my $.02..
  • PADTPADT Posts: 8
    edited 2008-03-11 00:15
    Thank you for your replies. The tank is inside a building so the room temperature is not expected to fluctuate much. I am measuring the temperature with a thermocouple placed over the side near the center of the 1 foot x 1 foot x 1.5 feet small tank.

    You ask what do I think I should do? Well, after perusing the industrial control manual, I think I should use PID control. I am stuck on what values to use for the proportional, integral and derivative gains, i.e., Kp, Ki and Kd???

    From my research, I am thinking Kp=10, Ki=0.1 and Kd=50. However, it's rather time-consuming to test these estimates, so I was hoping someone who is familiar with something along the lines of this setup would provide a suggestion.

    Also, I wonder if I really need differential control since it's water, and, like you said, it holds heat (cools down ~2x slower than heats up)???

    Thanks again!
  • FranklinFranklin Posts: 4,747
    edited 2008-03-11 02:05
    Your values will depend on mass, heater power/efficiency and insulation. Start with the numbers you think are close and test. There are no hard and fast answers because there are too many undefined variables.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • MSDTechMSDTech Posts: 342
    edited 2008-03-11 02:47
    What you are experiencing is the lack of lead-lag compensation. I haven't worked with this in a loooong time (everything I built was analog and during the 60's), but you can find the theory and some means to implement it if you just google lead-lag.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-03-11 16:59
    Guru Bob Pease of National Semiconductor wrote a series of very approachable articles in Electronics Design magazine. It was part of his crusade comparing Fuzzy Logic with PID. Here is a link to one...
    What's All This P-I-D Stuff, Anyway?
    Use the search to find other of Bob's articles on the subject.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • KatyBriKatyBri Posts: 171
    edited 2008-03-11 23:41
    One method, commonly used in commercial temperature controllers, is a "pulse-width" algorithm.
    ·
    When the actual temperature is far away from the set temperature, the heater is turned on and left on for a given length of time, then turned off for a given length of time. Both are not necessarily equal.
    ·
    As the actual temperature starts approaching the set temperature, the heater is turned on for shorter lengths of time. Basically, the heater is pulsed on faster and shorter, the closer it gets to the set-point. This prevents or minimize any overshoot (like you are currently observing).
    ·
    Some controllers have a “learn” mode where, through several tries, it determines the appropriate lengths and on-off times. This ends up being an algorithm (curve displaying pulse rate as a function of difference in set-point and actual temperature).
    ·
    You could do something similar in software with your STAMP, and even try to develop a learn mode which shouldn’t be to difficult. Sounds like a fun project. Just build the software one small piece at-a-time.
    ·
    Good luck.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-03-12 01:27
    PADT
    There was an story about this in Nuts and Volts in 2005 it was in three parts i send you a PM about it


    Jan Feb March of 2005

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 3/12/2008 2:06:27 AM GMT
  • FranklinFranklin Posts: 4,747
    edited 2008-03-12 01:32
    Sam, why not post it here so we all can take advantage of the info? Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-03-12 01:55
    Franklin

    You have get the magazine and this is also copy right now if you want to email you the story i will send to you

    It also very long story there is no link to give because at the time they did not have these online like they do now

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 3/12/2008 2:00:38 AM GMT
  • JonathanJonathan Posts: 1,023
    edited 2008-03-12 15:34
    A couple of points: PWM control is great, but you need to know what the heating element is made of. Assuming it is tungsten, zero crossing PWM is the way to go. I'm guessing your SSR's are zero crossing types. With some other types, zero crossing PWM causes damaging inrush currents, and you need to use phase shift control to PWM. There are some other things, like maintaining thermal inertia. If you spend too much time off, the heater cools off too much, and you waste power bringing it back up. I have been working on a radiant floor heating system, and much of what we are discussing relates.

    Trying to maintain temps within a single degree is tough. Is single degree precision really needed? Most application have a degree or two of hysterisis.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Mike CookMike Cook Posts: 829
    edited 2008-03-12 16:27
    Franklin said...
    Sam, why not post it here so we all can take advantage of the info? Thanks

    Not to SCAM Nuts & Volts articles but I just discovered you can do the following:

    Copy this into your browser address bar:

    http://nutsvolts.texterity.com/nutsvolts/200501/?pg=65

    This will take you to the online version of January 2005 page 65 (PID Article Part 1)

    Won't let you browse (many pages) using the arrow keys but you can adjust the URL in the address bar for the page your looking for.

    Note: Most of the time the table of contents is on page 4

    http://nutsvolts.texterity.com/nutsvolts/200501/?pg=4

    Maybe we should notify them that their magazine can be read with out a subscription! Found a URL link via Google and started monkeying with the variables!

    If this is offensive to anyone then I'll remove this post.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-03-12 17:00
    Mike Cook

    As you can see you can only read the first two pages and this happen all the time with on line verson if you have not pay for it

    They only ·let you·read part of the story

    Because i pay for the online verson I can·read them but there are no links this far Back

    Nuts and Volts Start there on line verson in 2006 from then on·I can email you the link for the maganize not just the one story they have a thing where you
    Let friends have a look

    If any one want to read the hole story just PM me and i will send it to you

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 3/12/2008 5:10:21 PM GMT
  • Mike CookMike Cook Posts: 829
    edited 2008-03-12 17:05
    Well from my testing if you adjust the page number in the:

    http://nutsvolts.texterity.com/nutsvolts/200501/?pg=65

    http://nutsvolts.texterity.com/nutsvolts/200501/?pg=67

    http://nutsvolts.texterity.com/nutsvolts/200501/?pg=69

    http://nutsvolts.texterity.com/nutsvolts/200501/?pg=71

    You can read any page. Like I said in the previous post the arrow keys that appear on the 'Tool Bar' will only allow a page or two.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike

    Post Edited (Mike Cook) : 3/13/2008 9:41:21 AM GMT
Sign In or Register to comment.