Fan Logic

Discussion in 'C-Bus Automation Controllers' started by magic8, Jan 11, 2020.

  1. magic8

    magic8

    Joined:
    Jan 6, 2009
    Messages:
    73
    Likes Received:
    1
    Have a cbus network where the 3 speeds of a fan are connected to 3 relay channels.
    Is there a fairly easy way to ensure that only one of these is selected at the same time.
    Have played around with Lua and not really got it working ok.Have also tried making 3 scenes but still need to ensure only one is selected
    Thanks
     
    magic8, Jan 11, 2020
    #1
    1. Advertisements

  2. magic8

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    41
    Likes Received:
    5
    Location:
    New Zealand
    are they all on the same relay? you can do interlock with relay logic
     
    Pie Boy, Jan 11, 2020
    #2
    1. Advertisements

  3. magic8

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    126
    Likes Received:
    14
    Location:
    Perth
    Why not get a sweep fan controller? They “just work” and are designed for the task including software based startup power to spin up the fan before settling in to the selected speed. Last I looked they were cheaper than 3 channels on a relay unit.
     
    chromus, Jan 14, 2020
    #3
  4. magic8

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    999
    Likes Received:
    75
    Location:
    Adelaide, Australia
    You need to put them on channels 1,2 and 3 of the relay. Then on the Turn ON tab, use the Interlock drop down and set 3. Then only the highest of set channels 1-3 will be on.

    But chromus is right. Just go buy a fan controller.
     
    Ashley, Jan 14, 2020
    #4
  5. magic8

    magic8

    Joined:
    Jan 6, 2009
    Messages:
    73
    Likes Received:
    1
    Thanks for replies
    I have just installed a SHAC at an existing installation where the CTC has failed.
    There are 5 fans in total and one 12 channel relay has 4 fans each wired using 3 channels.
    I managed to get the old program out of the screen and the fans had logic to enable you to step through the speeds on a DLT.
    That logic seems easy but with LUA I am struggling.
    Don't think they would want to buy 5 fan controllers and the relay logic would not work the way the relays are wired.
    Also from memory that method does interlock the channels but on the SHAC for example it would still show all the channels on if they were selected even though only one would be on.
    Thanks again for info and any other suggestions welcomed.
     
    magic8, Jan 15, 2020
    #5
  6. magic8

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    999
    Likes Received:
    75
    Location:
    Adelaide, Australia
    If you post the existing logic we can help you convert it to lua.
     
    Ashley, Jan 16, 2020
    #6
  7. magic8

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    41
    Likes Received:
    5
    Location:
    New Zealand
    This might get you started, i use this code for something else but i made a few small modifications, it may suit what you need, this code runs in an event script which happens every time the trigger GA group address changes value.

    Code:
    --EDLT fan controller sets the Triger_Ga to 33%, 67%, 100%, 0% in a circular function (low, med, high, off)
    
    Trigger_Ga = CBusLevelToPct(event.getvalue)
    
    output_speed_1_GA = 1  -- change Ga numbers to match
    output_speed_2_GA = 2
    output_speed_3_GA = 3
    
    function chk_grps()
    speed_1_pct = CBusLevelToPct(GetLightingLevel(output_speed_1_GA))
    speed_2_pct =  CBusLevelToPct(GetLightingLevel(output_speed_2_GA))
    speed_3_pct =  CBusLevelToPct(GetLightingLevel(output_speed_3_GA))
    end
    
    chk_grps()
    
    -- get current speed that is currently on
    if speed_1_pct == 100 then
      current_speed = output_speed_1_GA
    else if
        speed_2_pct == 100 then
        current_speed = output_speed_2_GA
      else if
          speed_3_pct == 100 then
        current_speed = output_speed_2_GA
        end
      end
    end
     
         
    if Trigger_Ga ==  33 then --low
      log('Fan Speed Low')
      -- set current running speed off
         SetLightingLevel(current_speed, 0, 0)
      -- get new values as we just switched one off
      chk_grps()
      -- set new speed if the other two GA are off
      if speed_2_pct == 0 and speed_3_pct == 0 then
         SetLightingLevel(output_speed_1_GA, 255 , 0)  -- speed 1
      end
    end
    
    if Trigger_Ga ==  67 then -- med
      log('Fan Speed Medium')
      -- set current running speed off
         SetLightingLevel(current_speed, 0, 0)
       -- get new values as we just switched one off
      chk_grps()
      -- set new speed if the other two GA are off
      if speed_1_pct == 0 and speed_3_pct == 0 then
         SetLightingLevel(output_speed_2_GA, 255 , 0)  -- speed 2
      end
    end
    
    if Trigger_Ga ==  100 then -- high
      log('Fan Speed High')
      -- set current running speed off
         SetLightingLevel(current_speed, 0, 0)
       -- get new values as we just switched one off
      chk_grps()
      -- set new speed if the other two GA are off
      if speed_1_pct == 0 and speed_2_pct == 0 then
         SetLightingLevel(output_speed_3_GA, 255 , 0)  -- speed 3
      end
    end
    
    if Trigger_Ga ==  0 then -- off
      log('Fan Speed Off')
      -- set current running speed off
         SetLightingLevel(current_speed, 0, 0)
    end
     
     
    Pie Boy, Jan 16, 2020
    #7
  8. magic8

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    41
    Likes Received:
    5
    Location:
    New Zealand
    oops there is one typo... swap out this part, i missed the output_speed_3_GA for speed_3_pct .
    Code:
    -- get current speed that is currently on
    if speed_1_pct == 100 then
      current_speed = output_speed_1_GA
    else if
        speed_2_pct == 100 then
        current_speed = output_speed_2_GA
      else if
          speed_3_pct == 100 then
        current_speed = output_speed_3_GA
        end
      end
    end
     
    Pie Boy, Jan 16, 2020
    #8
  9. magic8

    magic8

    Joined:
    Jan 6, 2009
    Messages:
    73
    Likes Received:
    1
    Thanks for info
    Away for a few weeks will report back as soon as I get home
     
    magic8, Jan 18, 2020 at 12:01 AM
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.