scene ramping times

Discussion in 'General Discussion' started by stargaze, Dec 6, 2009.

  1. stargaze

    stargaze

    Joined:
    Jan 28, 2005
    Messages:
    17
    Likes Received:
    0
    i need to extend the ramping times i a scene to more than 17mins to about 20mins whats the best way to do this :confused:
     
    stargaze, Dec 6, 2009
    #1
  2. stargaze

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    17mins is pretty close to 20mins. I'd start off by trying to negotiate on the requirement and save yourself the trouble!

    There is no native bus command for running ramps longer than 17 minutes so you'll have to do it manually. The easiest way is probably to run a timer that increases/decreases the level of the groups by 1% every 12 seconds.
     
    Newman, Dec 6, 2009
    #2
  3. stargaze

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    That is probably the most profound thing you will read on the forum this week.

    Customers frequently dream up bizarre requirements (often on a whim) which require the installers to go to extraordinary lengths the implement them. It is often a good idea to try to understand what the customer's problem really is, and how important it is, and then to sort out a solution which will give them as much as practical of what they need.

    Doing this results in a system which is cheaper for the customer, quicker and easier to install and maintain, and often more reliable. The more complexity required (integrating third-party systems and so on), the more problems will be encountered. A complex system can often result in a less happy customer.
     
    Darren, Dec 6, 2009
    #3
  4. stargaze

    agent75

    Joined:
    Dec 15, 2008
    Messages:
    7
    Likes Received:
    0
    hi there. i found this thread and am having a similar problem only the lady wants to dim the lights over around 2 hours. is the best way still to make a timer that dims the lights by x percent every x seconds? I have a logic engine and there will be more than one circuit in this set up. is that a logic timer you were talking about?
     
    agent75, Sep 20, 2011
    #4
  5. stargaze

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Yes and yes.

    Out of interest, what's the application requiring dimming over a 2 hour period?
     
    Newman, Sep 21, 2011
    #5
  6. stargaze

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You could have some logic do a ramp to 100% over 2 hours when triggered like this:

    Code:
    { This code generates a slow 2 hour ramp on lighting group 32 when
      triggered from trigger group 1.
      The ramp consists of 256 steps each 28 seconds apart. }
    
    { start slow ramp when needed }
    once GetCBusState("Local", "Trigger Control", "Trigger Group 1") then
    begin
      SetCBusState("Local", "Trigger Control", "Trigger Group 1", OFF);
      TimerStart(1);
    end;
    
    { if ramping then check timer and update group if required }
    if TimerRunning(1) then
    begin
      if TimerTime(1) = 28 then
      begin
        TimerStart(1);
        CurrentLevel := GetLightingLevel(32);
        CurrentLevel := CurrentLevel + 1;
        SetLightingLevel(32, CurrentLevel, "0s");
        if CurrentLevel = 255 then
          TimerStop(1);
      end;
    end;
    There are two problems with the above:
    1. If you start with the controlled group off, you don't see anything happen for 28 seconds (it is still off)
    2. If something else changes the controlled group, the ramp keeps going

    These are fixed with this logic:
    Code:
    { This code generates a slow 2 hour ramp on lighting group 32 when
      triggered from trigger group 1.
      The ramp consists of 256 steps each 28 seconds apart. }
    
    { start slow ramp when needed }
    once GetCBusState("Local", "Trigger Control", "Trigger Group 1") then
    begin
      SetCBusState("Local", "Trigger Control", "Trigger Group 1", OFF);
      if GetLightingLevel(32) = 0 then
        SetLightingLevel(32, 1, 0);
      PreviousLevel := GetLightingLevel(32);
      TimerStart(1);
    end;
    
    { if ramping then check timer and update group if required }
    if TimerRunning(1) then
    begin
      if TimerTime(1) = 28 then
      begin
        TimerStart(1);
        CurrentLevel := GetLightingLevel(32);
        { check to make sure that the group has not been changed }
        if CurrentLevel <> PreviousLevel then
        begin
          TimerStop(1);
          LogMessage('Stop timer');
        end
        else
        begin
          CurrentLevel := CurrentLevel + 1;
          SetLightingLevel(32, CurrentLevel, 0);
          if CurrentLevel = 255 then
          begin
            TimerStop(1);
            LogMessage('Ramp Complete');
          end;
          PreviousLevel := CurrentLevel;
        end;
      end;
    end;
    This still has a problem that it only ramps in one direction and to one level (100%). A more general solution would be to have one group track another but with the 2 hour ramp, That way you can set the first group to any level and the second group will ramp towards the level of the first one. You could do that with this logic:

    Code:
    { This code generates a slow 2 hour ramp on lighting group 32 by
      following group 33.
      The ramp consists of 256 steps each 28 seconds apart. }
    
    { start slow ramp when needed }
    once GetCBusTargetLevel("Local", "Lighting", 33) <> GetLightingLevel(32) then
    begin
      if GetLightingLevel(32) = 0 then
        SetLightingLevel(32, 1, 0);
      PreviousLevel := GetLightingLevel(32);
      TimerStart(1);
    end;
    
    { if ramping then check timer and update group if required }
    if TimerRunning(1) then
    begin
      if TimerTime(1) = 28 then
      begin
        TimerStart(1);
        CurrentLevel := GetLightingLevel(32);
        TargetLevel  := GetCBusTargetLevel("Local", "Lighting", 33);
        { check to make sure that the group has not been changed }
        if CurrentLevel <> PreviousLevel then
        begin
          TimerStop(1);
          SetLightingLevel(33, CurrentLevel, 0);
          LogMessage('Stop timer');
        end
        else
        begin
          if TargetLevel > CurrentLevel then
            CurrentLevel := CurrentLevel + 1
          else if TargetLevel < CurrentLevel then
            CurrentLevel := CurrentLevel - 1;
          SetLightingLevel(32, CurrentLevel, 0);
          if CurrentLevel = TargetLevel then
          begin
            TimerStop(1);
            LogMessage('Ramp Complete');
          end;
          PreviousLevel := CurrentLevel;
        end;
      end;
    end;
    As you can see, it is not trivial and you would not want to do this for too many groups.
     
    Darren, Sep 21, 2011
    #6
  7. stargaze

    agent75

    Joined:
    Dec 15, 2008
    Messages:
    7
    Likes Received:
    0
    phew!! i'll give it a go!

    She want the lights to start out on full or thereabouts and slowly ramp up throughut the evening to create a mood. I definitely would like to go with the "talk her in to something else" method but if she sticks to her guns then ....... :(

    she said she had c bus in another house and it was programmed to do that. she may be mistaken on the automation system but i don't know.

    Shane
     
    agent75, Sep 21, 2011
    #7
  8. stargaze

    agent75

    Joined:
    Dec 15, 2008
    Messages:
    7
    Likes Received:
    0
    hi there.

    i have tried to impliment the above logic (the simple first one at this stage)

    when i run the logic for the first time it comes back with "error c104 identifier not declared " everywhere it says 'CurrentLevel'

    i can't work out what i should chnge this to to fix this.

    any ideas

    regards

    Shane
     
    agent75, Jan 25, 2012
    #8
  9. stargaze

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You need to declare an integer variable called CurrentLevel in the Global Variables section.
     
    Darren, Jan 25, 2012
    #9
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.