Light Harvesting

Discussion in 'General Discussion' started by remedy, Nov 22, 2008.

  1. remedy

    remedy

    Joined:
    Nov 22, 2008
    Messages:
    16
    Likes Received:
    0
    We have a commercial job which has been specced up by someone else which contains an 8 channel dsi dimmer 3 light level sensors and a pac. what we want to achieve is a constant 800 lux light level and what we want to achieve is use the 3 light levels to harvest what actual level is, take an average of those 3 readings and adjust the dimmer accordingly to achieve the 800 lux.

    At present we seem to be encountering a problem polling the light levels from the sensors using the pac and are not sure hopw to write the average command for the light levels can anyone help!!!!!
     
    remedy, Nov 22, 2008
    #1
  2. remedy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Firstly, this would be easier if you were using Multisensors. They have the ability to perform closed-loop light level regulation on their own (Light Level Maintenance). They also have the ability to broadcast the light level at regular intervals (Light Level Broadcasting).

    Nevertheless, let's work with what you've got.

    The things you'll need to do can be broken down into the following areas:
    1. Data Collection
    2. Data Averaging
    3. Decision Making

    1. Data Collection
    To collect the data from the Light Level Sensors you'll need to use the Monitor component in PICED. This will periodically get the current Light Level out of the Light Level Sensors. You need to collect the light level often enough to get meaningful values and sufficient response time but infrequent enough that you don't generate a lot of needless bandwidth-wasting network traffic.

    2. Data Averaging
    Once you've got your 3 readings you'll need to average them. Whether you average just the 3 current readings or you use older readings as well, and whether you place equal or less significance in older readings, is up to you and how much code you want to write.

    3. Decision Making (the really fun part)
    Now that you've got the current light level, averaged over your 3 sensors, you can compare it to your target of 800 lux. You then need to decide what to do. You can do one of 4 things

    • Leave the current dimmer setting alone
    • Dim up
    • Dim down
    • Stop a ramp that you've previously sent to the dimmer.
    Firstly, you'll need some dead-band around the 800 lux setting. There's no point in dimming the lights up if your target is 800 and the current reading is 790. This is the equivalent of the 'Margin' parameter on the SENLL and SENPILL products.
    Secondly you need to consider the rate at which you dim up or down.
    - You don't want it to be too obvious to the office occupants that the light level of the dimmer is changing.
    - You also need to dim the lights up or down at a sufficiently slow rate that your light level polling and processing can stop it at 800 lux when it gets there. Remember that you can't just tell the dimmer to go to 800 lux because the brightness setting of the dimmer that yields 800 lux is a moving target.
    - The rate also needs to be sufficiently slow to prevent your system oscillating up and down around the target of 800 lux.
    Thirdly, you'll need to stop the dimmer at the desired level. That means that you'll need to internally track the current level of the dimmer, so that you can send a Set Level command on C-Bus when the light level is right.

    As a starting point, I'd probably poll all your sensors every 10 seconds and use a ramp rate on the dimmer of 300 seconds. You can then lengthen your polls or speed up your ramps if you need faster response, but watch out for oscillations.

    The technically correct way to do all this is with a software PID controller however that requires a bit more software than what you're probably hoping to get away with.

    Doing this sort of thing by hand, i.e. writing all the code yourself, is a little tricky, but not beyond possible. Just be prepared to have to re-visit it a few times to get it working acceptably.
     
    Newman, Nov 23, 2008
    #2
  3. remedy

    remedy

    Joined:
    Nov 22, 2008
    Messages:
    16
    Likes Received:
    0
    where we are falling down at the moment is the logic code statemnent to average out the 3 sensors. Can you help????
     
    remedy, Nov 24, 2008
    #3
  4. remedy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Hi Remedy

    Do you mean that you need help writing the logic code for:
    Average Reading = (Sensor1 + Sensor2 + Sensor3) / 3

    Or are you having trouble getting the light level out of the sensors??
     
    Last edited by a moderator: Nov 24, 2008
    Newman, Nov 24, 2008
    #4
  5. remedy

    Duncan

    Joined:
    Jul 23, 2004
    Messages:
    925
    Likes Received:
    0
    Location:
    Salinas de Garci Mendoza, Bolivia
    Well.. "Remedy" seems unwilling to do so.. So I will..

    Your first answer in this thread was an awesome post.. Full of wisdom, knowledge and experience, nicely formatted, well written, clear... Thanks for taking the time to post it.. I enjoyed reading it and I'm not even working with C-Bus these days!
     
    Duncan, Nov 24, 2008
    #5
  6. remedy

    remedy

    Joined:
    Nov 22, 2008
    Messages:
    16
    Likes Received:
    0
    Hi Newman

    The average code
     
    remedy, Nov 25, 2008
    #6
  7. remedy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You will need to assign the readings from your 3 Light Level sensors to 3 System IO Monitor variables. You'll also need to create a Global Variable to store the averaged value. After that, you'll then need to create the code to average them out and store the result.

    Something like:

    Once (LLReading1 > 0) AND (LLReading2 > 0) AND (LLReading3 > 0) then
    begin
    AverageLL := (LLReading1 + LLReading2 + LLReading3) / 3;
    end;
     
    Newman, Nov 25, 2008
    #7
  8. remedy

    agent75

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

    I noticed that you said it would be easier to do if you had multi sensors. I am currently doing a project in which there are a number of multisensors which will control one group of lights. the client has asked that the lowest level be taken. I was told by the cbus help line that only one sensor can control a group of lights which i find difficult to believe as there is the light level broadcast function on the sensor (i gather this can be used in conjunction with logic to source the lowest reading). in short... how do i do this.
    regards

    Shane
     
    agent75, Dec 15, 2008
    #8
  9. remedy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    If you wish to take the lowest of the three levels then you'll need to write some Logic to make that decision. Turn on Light Level Broadcasting in the Multisensors, monitor the levels of the three groups in your logic and then make a decision about what to do.

    The on-line help is referring to the capabilities of the sensors when they are used on their own, i.e. not in conjunction with any logic code.

    The difference between the Light Level Sensors and the Multisensor is that the Multisensor can broadcast it's current light level on a Group Address. The Light Level Sensor can't do that, it only works by using the PICED Monitor component which periodically interrogates the Light Level sensor to extract the current level.

    For performing closed loop regulation of the light level using the Light Level Maintenance feature of the Multisensors (without any logic), this can only be done by one sensor per group address. If all 3 sensors tried to do it, they would fight each other.
     
    Newman, Dec 15, 2008
    #9
  10. remedy

    agent75

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

    Actually, it was the phone help people that told me that. i suspected throughout the call that they really didn't know anything about multi sensors but didn't want to say that.

    Thankyou for your prompt answer. I see from earlier in this thread an example of code for averaging the light levels. that seems pretty straight forward. can i send that averaged light level back to one of the sensors to do it's light level maintenance function somehow or do i have to write code for the light group itself? If so are there any on line code samples of this. i must admit i'm struggling a little with this part of it (i'm tempted in some of the smaller areas with 2 (pointless?) sensors to just disable one of them and use only one!)

    Thankyou

    Shane
     
    agent75, Jan 4, 2009
    #10
  11. remedy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You'll need to set the level of the group address yourself, based on the average. The Multisensor can only perform light level maintenance for it's local light level.
     
    Newman, Jan 21, 2009
    #11
  12. remedy

    Memphix

    Joined:
    Aug 31, 2006
    Messages:
    248
    Likes Received:
    1
    Location:
    Australia
    Could someone advise of the best way to ramp the lights to hold a lux level (like that of the original post).

    I am using multi-sensors and a PACA. Would expect to use the Light Level Broadcasting with logic.

    Somehow in the logic I'll need the inverse of the Broadcast Light Level group. ie: if the lux level desired is 80 lux and the Broadcast Light Level is at 40 (400 lux), then ramp Light Group up to 210. Or if Broadcast Light Level is 100 (1000 lux), then ramp Light Group down to 50.

    Or an equation similar. Seems like the opposite to track group (mixed with an algorithm). Any help appreciated, even if its totally different to where I'm at. Previously I have only switched lights off when lighting is adequate.

    To reference lux to group level conversion... from one of Newmans posts:
     
    Last edited by a moderator: Apr 5, 2013
    Memphix, Apr 5, 2013
    #12
  13. remedy

    Memphix

    Joined:
    Aug 31, 2006
    Messages:
    248
    Likes Received:
    1
    Location:
    Australia
    With a test bench setup, I have confirmed that the light level broadcast is as stated, light level broadcast group address set to level 10 is a reading of 100lux, level 25 is 250lux and so on.

    Need a formula to ramp the light group address to meet the desired target light level. Any suggestions?
     
    Memphix, Apr 7, 2013
    #13
  14. remedy

    Memphix

    Joined:
    Aug 31, 2006
    Messages:
    248
    Likes Received:
    1
    Location:
    Australia
    I was able to use Light Level Maintenance - its the feature that does exactly what I was trying to achieve (with a little logic where sections over lap).

    Talking to myself on forums :rolleyes:
     
    Memphix, Oct 7, 2013
    #14
  15. remedy

    Colin Smith

    Joined:
    Aug 3, 2004
    Messages:
    102
    Likes Received:
    0
    Location:
    Auckland, New Zealand
    No - you were just talking to me in the future.
     
    Colin Smith, Jun 27, 2019
    #15
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.