Neptune Apex Seasonal Lighting Table for EcoTech XR Series

Discussion in 'Aquarium Controllers' started by samba_dad, Jul 28, 2015.

  1. samba_dad

    samba_dad Well-Known Member R2R Supporter

    Joined:
    Jun 6, 2014
    Messages:
    469
    Likes Received:
    141
    Location:
    Huntsville, Alabama
    In this post, I am trying to describe what I have done to apply seasonal light timing to a complex Radion lighting profile. I had recently switched my tank temperature to use the seasonal table, and was very interested in doing something similar for my Radions which were already using a complex lighting profile. The temperature seasonal table implementation is much much easier than the lighting profile. I am hopeful this post will provide some additional useful information that was not captured in other posts (at least not in a way obvious to me) and help others wanting to setup a complex lighting profile based on seasonal tables. Up to now, I have used the Radion profile shown in the first image below. To implement most of the original Radion lighting profile, I used a total of 11 profiles (see below for more specifics). The profiles are setup in the Apex Web Interface (not Fusion) with 2 additional profiles for clouds and storms (left identical to the first post from RussM in the Neptune forums). Note: I may either remove the storms or dramatically reduce the lightning intensity due to not wanting to freak out my fish and cause them to jump and injure themselves. Below are the steps I followed....

    1) I created an Excel table to translate my existing Radion profile to a format helpful in converting fixed times to "if sun (delta from sunrise)/(delta from sunset)" statements. The Excel table allowed me to more easily list the color temperature using CW, B, RB, G, R, UV settings, starting and ending light intensities, ramp times, and implement a calculation for the delta time parameters in the "if sun" statements. My Excel table is shown below. Note that in my table, the start/end times will have no meaning once I switch to the seasonal table but were used for me to double-check my computations for the delta times. I pulled up the seasonal table with the Apex Web Interface and saw the sunrise time was roughly 06:30 and the sunset time was roughly 19:30 for end of May. Referencing these times provided a sanity check for me in setting up the delta times for the "if sun" statements. Also, I obtained the CW,B,RB,G,R,UV color settings, starting and ending intensities from the original profile using the wizard from the WXM Radion module outlets (see Radion lighting profile image below). Also, I simplified my lighting profile slightly to make programming with the seasonal table a little easier. My previous Radion profile extended past midnight and I was not sure if this would work in the Apex "if sun" statements. Note that at this point, I have not adjusted my seasonal table times to local/preferred times as RussM suggests. I am just adding deltas to the if sun (delta from sunrise)/(delta from sunset) statements to account for these times.

    2) I created a series of lighting profiles using the data from the Excel spreadsheet. This is achieved by using the Apex Web Interface under Configuration->Profile Setup. I simply reconfigured PF1 through PF11 to implement each of the entries on my Excel spreadsheet. See the image below for a graphic from my PreDawn(PF1) profile. Upon inspection, it is easy to see where the information from the Excel spreadsheet is simply entered into the appropriate fields of the profile entry.

    3) Next, I computed a horizontal bar chart like the one that RussM produced previously on the Neptune forum. I needed this to ensure I setup the program properly referencing each of the "if sun" reference times, so I put a time scale on the horizontal axis as a sanity check. Again these times will become meaningless once I use the seasonal table. Note that the order of the if sun statements is very important. You basically want to start with the broadest time window on the pre-midday portion and work your way through all the other pre-midday profiles. Next you start with your broadest times on the post-midday portion for your "if sun" statements and work your way through the other post-midday profiles. In other words, the "if sun" statements are entered from the top to down order of this chart. The last "if sun" entry will by your midday brightest light listing. RussM reminded me that the last if statement that is satisfied in your script "wins" and will control which profile you are using. Below is my horizontal bar chart with my "if sun" delta times listed along with the intensities. It is important to take a moment and look through the chart and understand the critical points. Starting at the top of the chart the Pre-Dawn (PreDawn) profile will only be active from sunrise-120 minutes to sunrise-60 minutes. This will allow the lighting intensity to ramp from 0% to 2% over a 60 minute period. At the end of 60 minutes, then the Early Morning (EarlyMorn) profile will kick in and ramp from 2% to 7% light intensity over 60 minutes from sunrise-060 to sunrise time. Next, the MidMorn profile will become active from sunrise to sunrise+090 minutes where we continue to increase the intensity from 7% to 22% over 90 minutes. This continues all the way through the horizontal bars until we reach midday which runs from sunrise+360 to sunset-240 minutes. Very important: the second delta time (reference to sunset) for the pre-midday portion of the horizontal bar chart is irrelevant and does not matter - it is just conveniently set to somewhere near the middle of the midday profile. Likewise, the first delta time (reference to sunrise) for the post-midday portion of the chart is irrelevant and is just set to somewhere near the middle of the midday profile. See the chart below.

    4) Start writing the code for the Radions using the horizontal bar chart and Excel spreadsheet. Note you have to turn off the wizard for the Radion in order to write the script to control the Radion. Below is my code snippet. So far, it appears to be working just fine.

    Fallback OFF
    Set OFF
    If Sun -120/-330 Then PreDawn
    If Sun -060/-330 Then EarlyMorn
    If Sun 000/-330 Then MidMorn
    If Sun 090/-330 Then LateMorn
    If Sun 240/-330 Then EarlyMid
    If Sun 450/240 Then Evening
    If Sun 450/180 Then LateAfter
    If Sun 450/120 Then MidAfter
    If Sun 450/030 Then EarlyAft
    If Sun 450/-120 Then LateMid
    If Sun 360/-240 Then Midday
    If Outlet Clouds = ON Then Cloudy
    If Outlet Storms = ON Then Stormy

    I hope this helps folks. If nothing else, it is a more verbose description of how to implement the seasonal lighting capability. This took me a couple of hours while buying corals online (haha) to a) climb the learning curve, b) ask RussM (genius at large) enough questions to figure it out, and c) get the code developed and somewhat tested. This is probably the hardest programming effort I have had with the Radion to date. Keep in mind, my Apex controls 3 tanks, automatic water changes, temperature control (heating/cooling), lighting, salinity, pH control of kalkwasser, etc. The only more difficult task I have had with the Apex is isolating a stray voltage/EMI issue with my PM2 and conductivity probe. However, with that said, once you have the necessary information, this was only about a dozen lines of code - lol! I hope that this post will help/enable others who have been wanting to do something similar, but found it too cumbersome/challenging. Let me know if you have questions and I will try to help. And a sincere thanks to RussM who provided enough information to me to figure this one out!
    image.jpg
    image.jpg
    image.jpg
    image.jpg
    image.jpg
     
    Salty1962 and 143MPCo like this.
    Tags:

  2. 143MPCo

    143MPCo ASSIST PROTECT DEFEND R2R Supporter R2R Excellence Award Reef Squad Leader Photo of the Month Award CTARS Member Moderator Emeritus Article Contributor

    Joined:
    May 14, 2012
    Messages:
    6,565
    Likes Received:
    7,242
    Nice write up, thank you for posting that!!!
     
    kschweer likes this.
  3. 143MPCo

    143MPCo ASSIST PROTECT DEFEND R2R Supporter R2R Excellence Award Reef Squad Leader Photo of the Month Award CTARS Member Moderator Emeritus Article Contributor

    Joined:
    May 14, 2012
    Messages:
    6,565
    Likes Received:
    7,242
    One question... are you planning on incorporating cloud coverage and thunderstorms in to this or is that outside the scope of this endeavor?
     
  4. revhtree

    revhtree Owner Administrator Staff Member Team R2R R2R Supporter R2R Excellence Award Photo of the Month Award Build Thread Contributor Article Contributor Partner Member 2018

    Joined:
    May 8, 2006
    Messages:
    2,024
    Likes Received:
    21,358
    This is great! Thank you for sharing!
     
  5. samba_dad

    samba_dad Well-Known Member R2R Supporter

    Joined:
    Jun 6, 2014
    Messages:
    469
    Likes Received:
    141
    Location:
    Huntsville, Alabama
    So, I actually have incorporated clouds and storms already. I have done this in a somewhat "random" approach in the afternoons. I have a virtual outlet called clouds that has the following scripting...

    <<<<<<< Clouds Virtual Outlet Script >>>>>>>>
    OSC 000:00/037:00/636:00 Then ON
    If Time 21:30 to 15:59 Then OFF
    Min Time 037:00 Then ON
    If DoW -M-W-F- Then OFF

    The oscillate command is in the OFF/ON/OFF time sequence starting at midnight. Therefore, we are on for 37 minutes at midnight and then off for 636 minutes (10 hr 36 mins) and then turn back on for 37 minutes. This unusual set of times is deliberate and tends to produce a somewhat random effect. Next, I don't allow a storm from 7:30pm at night to 3:59pm the next afternoon. In other words, if the OSC happens to turn on any other time than 4:00pm to 7:30pm in the afternoon then it will not allow the clouds to occur. Finally, if the DoW is Mon, Wed or Fri then don't allow the clouds.

    Similarly for storms, I have a virtual outlet called storms with the following script...

    <<<<<<<<<<< Storms Virtual Outlet Script>>>>>>>>>>>>>>>>
    OSC 000:00/037:00/636:00 Then ON
    If Time 21:30 to 15:59 Then OFF
    Min Time 037:00 Then ON
    If DoW S-T-T-S Then OFF

    This script is very similar to the clouds, but only works on Sunday, Tuesday, Thursday and Saturday. Overall, I only seem to get clouds or storms a couple times per week in the afternoon between 4:00pm and 7:30pm. The only other code you need is the script for the radeon lights themselves.

    Fallback OFF
    Set OFF
    If Outlet Moonlight = ON Then LED_Moon
    If Sun -120/-330 Then PreDawn
    If Sun -060/-330 Then EarlyMorn
    If Sun 000/-330 Then MidMorn
    If Sun 090/-330 Then LateMorn
    If Sun 240/-330 Then EarlyMid
    If Sun 450/240 Then Evening
    If Sun 450/180 Then LateAfter
    If Sun 450/120 Then MidAfter
    If Sun 450/030 Then EarlyAft
    If Sun 450/-120 Then LateMid
    If Sun 360/-240 Then Midday
    If Outlet Clouds = ON Then Cloudy
    If Outlet Storms = ON Then Stormy

    The profiles I use for storms and clouds are shown below.
    Cloudy_Profile.JPG
    Stormy_Profile.JPG

    I am glad you found the post helpful. Let me know if you have any other questions, and I will answer them the best I can. Geek out!
     
    143MPCo likes this.
  6. samba_dad

    samba_dad Well-Known Member R2R Supporter

    Joined:
    Jun 6, 2014
    Messages:
    469
    Likes Received:
    141
    Location:
    Huntsville, Alabama
    Thanks revh!! That means a lot to me coming from you!! Just trying to give back a little from all I have learned from the R2R!!
     
  7. sromero287

    sromero287 Well-Known Member

    Joined:
    Nov 22, 2013
    Messages:
    709
    Likes Received:
    202
    Location:
    Weston Fl
    AWESOME N GREAT!!!!!!
    Thks a million samba_dad
     
  8. samba_dad

    samba_dad Well-Known Member R2R Supporter

    Joined:
    Jun 6, 2014
    Messages:
    469
    Likes Received:
    141
    Location:
    Huntsville, Alabama
    Thank you very much! Glad it was helpful!
     
  9. Joshua Cline

    Joshua Cline Well-Known Member

    Joined:
    Aug 10, 2015
    Messages:
    94
    Likes Received:
    61
    THIS.IS.AMAZING. Thank you so much. Will be using this.
     
  10. samba_dad

    samba_dad Well-Known Member R2R Supporter

    Joined:
    Jun 6, 2014
    Messages:
    469
    Likes Received:
    141
    Location:
    Huntsville, Alabama
    Awesome! Glad you found it helpful!
     
  11. Rob reef

    Rob reef Active Member

    Joined:
    May 20, 2014
    Messages:
    30
    Likes Received:
    2
    Location:
    West covina
    This is great!!!
    Is going to help a lot
     
    samba_dad likes this.
  12. 143MPCo

    143MPCo ASSIST PROTECT DEFEND R2R Supporter R2R Excellence Award Reef Squad Leader Photo of the Month Award CTARS Member Moderator Emeritus Article Contributor

    Joined:
    May 14, 2012
    Messages:
    6,565
    Likes Received:
    7,242
    Now if along with lighting you can have the apex send an RF message to a receiver to turn on thunder via a .wav file that would complete this program:D.
     
    samba_dad likes this.
  13. samba_dad

    samba_dad Well-Known Member R2R Supporter

    Joined:
    Jun 6, 2014
    Messages:
    469
    Likes Received:
    141
    Location:
    Huntsville, Alabama
    Awesome! I am glad this is helpful to you. Let me know if you have any questions and I will,do,what I can to help!
     
  14. samba_dad

    samba_dad Well-Known Member R2R Supporter

    Joined:
    Jun 6, 2014
    Messages:
    469
    Likes Received:
    141
    Location:
    Huntsville, Alabama
    Lol! Thunder would be pretty easy to do actually. Just hook up a sound machine that has a thunderstorm mode and place it by your tank. Whenever the storm mode kicks on just turn on the sound machine. Presto - sound and light!
     
    143MPCo likes this.
  15. markstubb

    markstubb Well-Known Member R2R Supporter Build Thread Contributor

    Joined:
    Jul 11, 2016
    Messages:
    92
    Likes Received:
    44
    Location:
    Kuala Lumpur, Malaysia
    @samba_dad - any way to provide that spreadsheet? The photo periods are too long for my tank - my algae went totally bonkers once I implemented it. My brain hurts when I try to calculate the If Sun statements, so instead of reinventing the wheel, was wondering if the sheet was available.
     
  16. markstubb

    markstubb Well-Known Member R2R Supporter Build Thread Contributor

    Joined:
    Jul 11, 2016
    Messages:
    92
    Likes Received:
    44
    Location:
    Kuala Lumpur, Malaysia
    So for posterity's purpose, I put @samba_dad's stuff into an excel sheet and made it do some calculations so I could tailor it more to my needs. Hopefully it helps someone - you can just make a copy if you want to modify anything, or just download it. I only enabled comments as to keep it intact, but since it's on gdocs, it should be there for as long as needed.

    @RussM if you wanted to poke at it and verify the accuracy, I'd humbly appreciate it!

    https://docs.google.com/spreadsheets/d/1jEdTEJFErcE8So21PlwG-i0Fd1WImw0PUmZLN-ED4K8/edit?usp=sharing
     
  17. hipower

    hipower Well-Known Member

    Joined:
    Apr 5, 2015
    Messages:
    95
    Likes Received:
    14
    Location:
    Sonoran Desert
    Is there a translation to tdata code for this?
     
  18. markstubb

    markstubb Well-Known Member R2R Supporter Build Thread Contributor

    Joined:
    Jul 11, 2016
    Messages:
    92
    Likes Received:
    44
    Location:
    Kuala Lumpur, Malaysia
    nah, just used profiles on mine
     
  19. hipower

    hipower Well-Known Member

    Joined:
    Apr 5, 2015
    Messages:
    95
    Likes Received:
    14
    Location:
    Sonoran Desert
    Ok I've got the profiles setup, and the outlet setup but my lights aren't coming on...
     
Draft saved Draft deleted

Share This Page

Loading...