Proportional fan control. I suck at math!


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    EDIT:
    just re-read your post, you want the fan to run at 50% at 90 degrees, if so then wouldn't that be a simple case of a statement like
    If temp >90 and <120 then PW=127
    If temp > 120 then PW=255
    Hope this helps
    I think I have settled on the 12F683. It has an 8mhz internal osc, A/D converter and hardware PWM so it doesn't have to be constantly strobed.
    Also the 2k words program memory is a nice touch. I can be as sloppy with my code as I want and still have room to spare.

    Getting closer..Anything below 90deg fan is off so:
    If Temp<90 then HPWM=0
    Then at 90 deg fan comes on at 50%:
    If Temp=90 then HPWM=127 (50% of 255 leaving 127 remainder). 'Minimum fan speed

    Here is the part I don't understand. From 91 to 120 the fan speed needs to vary according to temperature so:
    From 91 to 120 each degree needs to widen the HPWM by 4.23 (remaining 127 / 30 deg) speeding up the fan incrementally by temp.

    Finally
    IF Temp>= 120 then HPWM=255 'Full fan speed at or above 120 deg

    The actual PBP command is: HPWM Channel,Dutycycle,Frequency
    so at 90 deg on channel 1, 50% duty cycle and 1khz rate the command
    would be HPWM 1,127,1000. I can replace the 127 with a variable.

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


    Did you find this post helpful? Yes | No

    Default

    I can replace the 127 with a variable.
    I f you are asking then yes. You can use a variable.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Ahh, that's right, the minimum on speed is 50%... (duty = 128)

    So then you've got to increase duty by about 4.2 for every degree between 90 and 120 ...

    How about something along these lines:

    If temp < 90 then duty = 0

    If temp > 120 then duty = 255

    If temp > 89 AND temp < 120 then duty = 128 + ((temp - 90) * 42 / 10)

    steve

  4. #4
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Perfect!
    I knew you guys were brainie.
    I'll buy you a virtual beer.. Cheers!

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Nice one Steve !

    Good teamwork

  6. #6
    Join Date
    Nov 2009
    Location
    Wagoner, USA
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    And thanks to alec also. Somehow I missed his post earlier but he did a lot of the work for me and between Steve and Alec I think we've got it..
    I have a solar hot air furnace which I'm building this control for. It is just a relay controlled fan right now which, early in the morning, kicks on at 110 degrees then cools the collector down too much and shuts off at 90 deg then cycles again. It also outputs data to a serial LCD module such as ambient temp, collector temp, fan relay on/off and vent servo position.
    With the proportional control I can have it to come on at 90 degrees and only move the amount of air that it can heat without shutting off and cycling increasing the heating time.
    As the sun rises and it gets hotter in the collector the fan can move ever increasing amounts of air until it gets to full speed. Full collector temperature ranges from 90 at cut in to around 140-170 deg at noon depending on outside temperature.
    Last edited by polymer52; - 3rd January 2010 at 23:23.

Similar Threads

  1. How do I give a radio control car autonomous control
    By Kenjones1935 in forum General
    Replies: 190
    Last Post: - 17th January 2010, 15:40
  2. Transistor selection, PWM fan control
    By 124C41 in forum Schematics
    Replies: 5
    Last Post: - 22nd December 2008, 15:33
  3. Control RC servo via Parallax Servo Control
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th September 2005, 08:18
  4. Replies: 9
    Last Post: - 30th August 2005, 06:33

Members who have read this thread : 0

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