An algorithm for controlling temperature and humidity of greenhouse and aviculture


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Iran
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    it's not a modern system.the water pour on the pads and big fans on the other side of the saloon pull the air and flow of the air make an approximately constant temperature and humidity in aviculture. in aviculture humidity is not as important as temperature(the pads not heated) but in greenhouse we use fog makers to control humidity exactly. The fans,heaters,valves and fog makers are controlled with PIC16F877A. i put some sensors in different places of saloon and measure the humidity and temperature and send data to main controller and that controller decide what to do and it will turn on/off fans,heaters,vaves and fog makers.for example for turning on a fan, i will make PORTB.0 high and it turns on the relay(5v 10A relay) then this relay will turn on the contactor( SIEMENS 3PH contactors) and contactor with turn on the fan.i also put a keypad to control each fan and heater automatically or manually that can selected with the operator.

    imagine that we have 8 fans and 2 heaters and a valve for pour water on the pad(work as a cooler in hot weather and increase humidity)
    fans: fan1 fan2 fan3 fan4 fan5 fan6 fan7 fan8
    heaters: heater1 heater2
    valve: valve1
    fan1,fan3 fan5 and fan7 are always on for ventilation in aviculture.
    for controlling i should use fan2,fan4,fan6 and fan8 and also heaters and valve.
    so in my algorithm when i tell fans ,it means fan2,fan4,fan6 and fan8

    in aviculture humidity is not as important as temperature so i exert this margine for temperature and humidity:
    for temperature: (setpoint-1) and (setpoint+1)
    for humidity: (setpoint-4) and (setpoint+4)

    this is my algorithm that executed every 10 mintutes:


    1-if (temp<(setpoint-1)) and (humidity<(setpoint-4)) then

    turn on heaters
    turn off fans

    if the situation is not changed for 20 minutes then turn on valve

    if the situation is not changed for 40 minutes turn on alarm

    2- if (temp<(setpoint-1)) and (humidity>(setpoint+4) then

    turn off valve
    turn on heaters
    turn off fans

    if the situation is not changed for 20 minutes then turn on fans(for reducing humidity)

    if the situation is not changed for 40 minutes then turn on alarm

    3-if (temp>(setpoint+1)) and (humidity>(setpoint+4)) then

    turn off valve
    turn off heater

    if the situation is not changed for 10 minutes then turn on fans

    if the situation is not changed for 20 minutes turn on valve(for reducing temperature)

    if the situation is not changed for 40 minutes turn on on alarm


    4-if (temp>(setpoint+1)) and (humidity<(setpoint-4) then

    turn off heaters

    if the situation is not changed for 10 minutes then turn on fans and valve

    if the situation is not changed for 40 minutes then turn on alarm


    what do you think about this algorithm?
    Last edited by amindzo; - 8th November 2008 at 09:59.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by amindzo View Post
    what do you think about this algorithm?
    Like I said on one of your other threads. Write down every thing you would do if you were controlling the system manually.

    Looks like you have done that.

    Now copy your algorithm into a code editor and comment it out. Start writing the code in between each operation.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2006
    Location
    Iran
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    my problem is a good algorithm.i can convert the algorithm to picbasic easily.

  4. #4
    Join Date
    Dec 2005
    Location
    So Cal and loving it
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    I made a simple temp/rh controller for my wife's crab tank a long time ago. I found better results when I averaged the readings and gave it a plus/minus window. Eg. temp drops below the low setting - heater came on and drove it back to the required setting and shut off. The slight overshoot was well within the upper setting so no need to worry about a complicating the controller for handling the hysteresis etc.
    +-------------------------------------------------------------------+
    | PBP 2.47/2.50 | MCS+ 3.0.0.5 | U2 Prog | Vista x64 | NO SLEEP!!!!!!! |
    +-------------------------------------------------------------------+

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    what do you think about this algorithm?
    Yuck.
    OMG, did I say that.

    If all those fans, heaters, etc. are individually controlled?
    You'd get much better results using a PID loop or two.

    Then it would be able to actively "Maintain" the preset conditions, instead of just overreacting when things get too far out of whack.

    Check out this thread from Henrick.

    PID-filter routine (2nd try).
    http://www.picbasic.co.uk/forum/showthread.php?t=5874

    And this explains how it works.
    It's for the basic stamp, but it's what henrick based his program on.
    Start at page 97

    Industrial Control (pdf)
    http://www.parallax.com/Portals/0/Do...oks/edu/ic.pdf
    <br>
    DT

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