Hot tub temp control


Closed Thread
Results 1 to 14 of 14
  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219

    Default Hot tub temp control

    I am considering building a hot tub with a standard 220v hot water heater element. I would use a 40 amp solid state relay to control power. I have never used a SSR before but think it would control with PWM. What do I need to know about the SSR to use PWM. I’m not worried about temperature measurement or the PID. What other consideration should I think about?

    Wayne

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Hi,
    Have you seen Scampys recent thread on pretty much the same topic?
    In my experience using "normal" PWM (normal as in hundred to thousands of Hz since that what the PIC usually generates using HPWM etc) doesn't work with SSR for controlling AC and I try to explain why in the other thread. However a hot tub is a relatively slow system (if you don't have a heater in the megawatt range) and you can easily do a software PWM with a period of something like 10 seconds (or even longer). Do a timer interrupt at 100Hz, keep track of 1000 interrupts and you have your PWM signal with almost 10bits of resolution.

    What other consideration should I think about?
    Safety safety and of course safety!

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Thanks,
    Dave - Now that looks like a great way to enjoy your last Sunday afternoon
    Yea, I saw the post but I wasn’t sure exactly how it would relate to the hot tub control. Now I see that Henrik's illustration makes it clear, great illustration by the way. Hot tub would be much simpler due to the long time frame to move temperature. After reviewing the post I think a standard 1k pulse stream driven by PID on-off time would do the trick. I shouldn’t have to worry about zero-crossing, phase angles, half cycles, or any of that stuff taken into consideration when speed is a concern. Does that sound logical?

    Wayne

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Not sure what you mean by standard 1k pulse stream but again, as long as your PWM period is MUCH MUCH longer than a half cycle you shold be fine. With SSD I'd go for 10 seconds or something, with a mechincal relay 1 minute but it obviously depends on how much the heater is able to "move" the temperature in that timeframe (which isn't much I'd guess) - as you say.

  6. #6
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Not sure what you mean, MUCH MUCH longer than a half cycle. You mean the period being the time for the full on and off portion of a single cycle? Why is it important for the pulse to be longer than a half cycle? Does it have to do with the time needed to turn on the SSR? Looking at your illustration it would seem that any positive going pulse would turn on the SSR for the completion of that cycle? Or, am I making this more complicated than it is? So why would you switch on the SSD for only 10 seconds? Why not much longer? Water temp is not going to move very fast at 220V&18.5Amps Lets say 250 gallon tank . I’m sure I’ve missed the point. Please explain.

    Wayne

  7. #7
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    I don't think you need PID or PWM, just a thermometer and a relay should do fine I would think.

    If it takes one minute to heat the tub one degree, and it cools at the same rate, then you may keep the temperature of the water between... say, 77 and 78 degrees (any two arbitrary points, really) by turning the element on for one minute every other minute. I suppose you might want it to take two minutes to heat the water or you might want to keep the water within a half a degree of optimum, but it will be rare to find a thermostat accurate and consistent enough that a 10 second or so cycle won't keep the water very close to optimum temperature - and this only if it takes only 1 minute to heat or cool the tank a degree. If it requires 10 minutes, or 30, then turning on and off the element in 10 or 30 second cycles should keep very close temperature control.

    My guess is that you will need far more watts to get anywhere near a rate of increase that requires PID or PWM and, if I'm wrong and the water does heat too quickly, you could use a lower wattage element.

    I don't often take baths, but even in that small tank I am comfortable for at least tens of minutes with no auxiliary heating, but then... perhaps lavender scented bubbles retain heat?!

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Not sure what you mean, MUCH MUCH longer than a half cycle.
    I mean MUCH MUCH longer than a half cylce of the AC. As I tried to explain and illustrate in the other thread, if you run a 1kHz PWM signal with a 50% dutycycle into an SSR it will basically be conducting 100% of the time - not 50% as the PWM signal dictates. If, however, the PWM period would be, say 1000 times longer than the period of the AC half cycle it doesn't matter much WHERE in the AC half cycle that falling edge of the PWM signal occurs (remember that the SSR will keep conducting untill the AC zero crossing), the error will be very small.

    Why is it important for the pulse to be longer than a half cycle?
    Not the pulse, the period of the PWM signal.

    Looking at your illustration it would seem that any positive going pulse would turn on the SSR for the completion of that cycle?
    First of all, there are different types of SSR, the illustration asumes a random firing one. Yes, a pulse will turn ON the SSR which will then conduct "on it's own" until the next zero crossing.

    So why would you switch on the SSD for only 10 seconds? Why not much longer?
    I didn't say that. I said that the period of the PWM signal could be 10 seconds. The output of the PID routine then tells the PWM generator how much of that period the heater will be powered. If the PID determines it needs 100% power then the SSR will be on continously. If the PID determines it needs 25% power the heater will be on for 2.5seconds and off for 7.5seconds. Now, even if the falling edge of the PWM signal occurs right after the AC zero crossing the SSR will only conduct for the remaining of the half cycle (8.333ms at 60Hz mains) which is a very small proportion of the desired 2.5 seconds. But you can easily use a longer period as well if you want.

    Or, as Amoque says, use a simple on/off thermostat.

    /Henrik.

  9. #9
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    There is NO NEED to use PWM for such a slow cycle time. I use 5 seconds for the cycle time in my Sous Vide controller and it yields .05 degree control. I only use the timer and have 299.999 bits resolution for the seudo pwm which is 16.666 milliseconds.
    Dave Purola,
    N8NTA
    EN82fn

  10. #10
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    But it's STILL a PWM signal, right? It's just that the frequency (ie the PWM period) is a lot longer than what you normally can generate with the CCP module of the PIC.

  11. #11
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Thanks guys for all the input. I think Amoque has a point which is supported by Dave. I’m not worried about controlling power for any AC cycle but controlling the on-off function of the SSR for say an on cycle of 5 seconds or 5 minutes so I use a pulse stream like Henrik displays in his illustration for 5 sec. or 5 minutes. After which I monitor the temp change. I’m sure a relay would do the job just fine except I don’t want to have to replace a relay every other year. I’m sure it will take some experimenting to get the on-off times worked out depending on the volume of the water. A PID is most likely overkill. I see now there are many ways to control this function. Thanks again, you guys are awesome.
    Wayne

  12. #12
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Quote Originally Posted by HenrikOlsson View Post
    But it's STILL a PWM signal, right? It's just that the frequency (ie the PWM period) is a lot longer than what you normally can generate with the CCP module of the PIC.
    I suppose it is... But, I would more typically describe PWM as a means of limiting apparent output to a percentage of fully on. As an example, with an LED: If the modulation is fast enough that the LED appears less than 100% bright it would be (in my mind) PWM; if the modulation was slow enough that the LED appeared full output, I would call that "blinking". I'm sure that there are a dozen issues with my definition/ description, but its what first comes to mind as how I'd differentiate.

  13. #13
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    As we all know the term PWM means Pulse Width Modulation. There's nothing in it saying how long the period containing the "pulse" is, all it means is that the ratio between high/low is what carries the information. As with FM, AM etc, you can frequency modulate a 1mHz signal as you can with a 1THz signal etc and so on.

    The LED in your example is either on or off (except during the transisitions) it's just that our eyes isn't fast enough to see it. The inertia in the "system" (the switch, the LED, our eyes and brain) "filters" the "high frequency" components out and we see it as 50% (or whatever) brightness.

    Same thing with the low(ish) power heating element in a large volume of water. The "system" (the switch (SSD), heating element, water and even the sensor or our body if it's a hot tub) is so slow that you can have a PWM period of 60 seconds. If the element is on 30 seconds and off 30 seconds during that 60 seconds period you're effectively limiting the total power to 50%, just like you are with the LED.

    Of course, if you reduce the the period too much (say a day or week or month, all depending on the system) you're going to get "blinking" with the heater/water as well. The effect of selecting a too long PWM period is obvious but it's still a PWM signal.

    /Henrik.

  14. #14
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Hot tub temp control

    Henrik,
    Thank you once again for your eloquent technical explanations. I always enjoy reading your posts as I’m sure everyone else does as well. Now my only decision is how much time I want to spend on this code. Thanks.
    Wayne

Similar Threads

  1. max232epe gets hot , real hot
    By richard in forum Serial
    Replies: 13
    Last Post: - 11th November 2014, 10:47
  2. Very hot rectifier
    By The Master in forum Off Topic
    Replies: 11
    Last Post: - 1st July 2014, 22:27
  3. Hot Servos
    By The Master in forum Off Topic
    Replies: 37
    Last Post: - 6th August 2010, 19:32
  4. Hot Tub Temperature Probe
    By DavidK in forum Off Topic
    Replies: 14
    Last Post: - 22nd November 2008, 11:45
  5. hot water flow sensor
    By jessey in forum Off Topic
    Replies: 16
    Last Post: - 24th January 2007, 05:05

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts