fan control

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Richc, Jul 30, 2008.

  1. Richc

    Richc

    Joined:
    Jul 3, 2008
    Messages:
    16
    Likes Received:
    0
    Location:
    dural
    i am running into some red lights with a one button control of
    a sweep fan .

    messrs lucky 555 and froop have some concise logic code....

    once GetLightingState("Fan 1 Button")=ON then
    begin
    CounterFan1:=CounterFan + 1
    SetLightingState ("Fan 1 Button") , OFF;
    case CounterFan1 of
    0: ;
    1 :SetScene ("Fan 1 hi");
    2 :SetScene ("Fan 1 med")

    etc


    questions...
    1) there are 4 scenes, how are they triggered ?, trigger control
    with action selector per fan button in scene editor in piced ?
    2)what is Fan 1 Button? a group in lighting on the key? with on/off as function or scene as a function??
    3) are we using controlled item and scene group in Component properties?
    4) we have 11 fans (i work for a fan company) so does that
    mean i need 11 modules with similar code or all code in 1 module,
    will there be enough memory?





    carpe diem
     
    Last edited by a moderator: Jul 30, 2008
    Richc, Jul 30, 2008
    #1
  2. Richc

    froop

    Joined:
    Dec 23, 2007
    Messages:
    124
    Likes Received:
    0
    Location:
    Melbourne, Australia
    1. Yes, scenes are triggered through trigger control
    2. Yes, Fan 1 Button is a group in lighting with on/off as a function.
    3. No
    4. First off, "Ouch". That's 3 relay channels per fan, so 33 relay channels. That's expensive fan control! But you could do all the code in 1 module. Should be plenty of memory and processing cycles to do it.

    What you could also do to save relay channels is just use two per fan. Either two speeds, or if you wire up the "slow", and "medium", turning them both on together should be close to what the "fast" speed is. But if you work for a fan company, you should be better qualified to say whether that's a good idea :)
     
    froop, Jul 30, 2008
    #2
  3. Richc

    Richc

    Joined:
    Jul 3, 2008
    Messages:
    16
    Likes Received:
    0
    Location:
    dural
    2 or 3 channel

    thanks froop, worked a treat except for the extra button press
    to reset the counter...doesnt matter

    with 2 channel and 2 caps the top speed is about 85% of max which is acceptable.
    (2 caps in parallel doubles their value ), the higher the capacitance the higher the rpm. its probably ok to do this as it would have to be a very hot day indeed to warrant full speed anyway. the only issue is startup at a lower
    voltage (3rd speed 2 caps) which draws more current and can over many years wear out the windings insulation

    we have a few spare relays so it was ok for the client to use the
    full 3 channels and 3 speeds.
     
    Richc, Aug 2, 2008
    #3
  4. Richc

    goggan

    Joined:
    Jul 2, 2008
    Messages:
    5
    Likes Received:
    0
    Long press off?

    Hi,

    I've followed these threads with interest, and successfully set up a single button high/med/low/off cycle.

    However, it's slightly non intuitive for the user for a couple of reasons:
    - LED status on SC key 4/Saturn and DLT switches is always 'off' due to the logic design
    - Fans are obviously slow to react, so there's no quick way to tell if you've turned them off

    I can live without indication of whether the fan is high/med/low, but I was wondering about using the 'long press' function on the same button (currently idle) to trigger the low & medium relays to 'off'. I can't see an obvious way to set the long press to trigger a separate event, so we're back to the PAC.

    One thought I had is to set the long press to ramp the level to 50% (for example) and have the logic engine check levels rather than on/off; so a short press would set the level to 100% which the existing logic would use to cycle through levels, but a long press would set it to 50%, and the logic on detecting that would turn the loads off.

    Would this be the best approach? And if so how would this be best programmed? Would I use GetLightingLevel and cases for 0/128/255? I'm a bit of a n00b when it comes to PAC programming!

    Thanks in advance,
    Glyn.

    Current code:
    once(GetLightingState("B3 Fan") = ON) then
    begin
    CounterFanB3 := CounterFanB3 +1;
    SetLightingState("B3 Fan", OFF);
    case CounterFanB3 of
    1 : SetScene("B3 Fan High") ;
    2 : SetScene("B3 Fan Medium");
    3 : SetScene("B3 Fan Low");
    4 : SetScene("B3 Fan Off");
    5 : CounterFanB3 :=0;
    end;
    end;
    if CounterFanB3 >= 4 then
    begin
    CounterFanB3 := 0;
    end;
     
    goggan, Sep 23, 2008
    #4
  5. Richc

    goggan

    Joined:
    Jul 2, 2008
    Messages:
    5
    Likes Received:
    0
    Ok, well I tried my idea and it worked - I'd still appreciate comments on whether it's the 'best' solution!

    On the switch
    --
    Set to "B3 Fan" toggle
    Recall 1 set to 50% (in blocks)
    Long press set to recall 1

    On the PAC (indentation lost by the forum, not me ;)

    if(GetLightingLevel("B3 Fan") = 127) then
    begin
    SetLightingState("B3 Fan", off);
    CounterFanB3 := 0;
    SetScene("B3 Fan Off");
    end;

    if(GetLightingLevel("B3 Fan") = 255) then
    begin
    CounterFanB3 := CounterFanB3 +1;
    SetLightingState("B3 Fan", OFF);
    case CounterFanB3 of
    1 : SetScene("B3 Fan High");
    2 : SetScene("B3 Fan Medium");
    3 : SetScene("B3 Fan Low");
    4 : SetScene("B3 Fan Off");
    5 : CounterFanB3 :=0;
    end;
    end;

    if CounterFanB3 >= 4 then
    begin
    CounterFanB3 := 0;
    end;

    The scenes are set as discussed elsewhere to trigger the correct loads. The extra if loop at the end cleans up if the Counter has gone wonky, and avoids the need for an extra cycle to reset the loop.

    Cheers,
    Glyn.
     
    goggan, Sep 23, 2008
    #5
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.