Preliminary buying questions?

Post Reply
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Preliminary buying questions?

Post by Deckoz2302 »

I have been looking to get a reef controller for some time now and have been doing a lot of reading up on the reefangel. Although I have a few questions. I believe these things with programing will be possible but I would like some of your gus feedback on this. My main goal with this controller is a 365 day/night cycle with randomized storms.

I currently have 5 light channels, 1 for 5000k leds, 1 for 420nm, 1 for 440-460, 1 for 470-480, and moonlights. So say for example I have my channels at 35%/80%/70%/60% (and we will let moonlight be controlled via your controller). Anyway what id like to be able to do is take my four channels and be able to step up/step down depending on the day/season. For examplelets say today is a little sunnier then yesterday(randomized code within certain params of season) so my peak noon will be 37%/82/72/62....does that make sense?

Also with control of a mp10 vortech and the storm mode which you have created...will I be able to sync the pump and lights together for a "thunderstorm"?


Thanks lol hope all this makes sense
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

It's possible to randomize the code to be brighter one day and not in another, but currently there would be no input from live current weather conditions.
You can place both LEDs and MP10 into thunderstorm mode at the same time.
Roberto.
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

Ok so the lighting and vortech can be synced together cool. And as far as live weather input I'm not necessarily saying that would be needed, but if say I were to take a weather graph from a year in say the gtreat barrier reef. And had a 365 day plot, split that plot into 4 seasons and create a minumum and maximum light for each season to make a randomize code with strict parameters of each season. Also let's say with the year or two worth of weather you could get good idea of how many storms a season there are and program a variable around that. So say were on day 187 of the year which falls into the 3 month summer block, let's say for shits and giggles summer is day 180 to 270 while within these days you can have a random minimum light output of 70% and max of 80%. And while within this time period you will have a set ammount of light time...hmmm I just need to start a flow plot of w ima code this..
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

Yes, that's easy to do.
Roberto.
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

Ha, this is awesome I'm sold lol
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

Ok so here is the jist of my program flow, I believe most of this code I can grab from the forums however there aree some things ill have to modify ect ect and try not to write the same randomize code more then once but rather have each function set the randomize values. Only troubles I'm thinking will be keeping the code under 32kb

Roberto or binder, would all this be possible to fit in the memory or would I have to write all code in assembly

reef angel controller
relay box
3 temp sensors
Ph sensor
wifi attachment
pwm attachment
rf attachment
Salinity module

code:
wifi

Salinity > alarm if change from 1.025
ph > alarm if below 8.0

webbanner

feedmode > power down sump, refugium, protein skimmer, vortechs 30min

tank temp> if +80deg, turn off relay until 78 is acheived

light temp >90deg+ trigger pwm channel 5 ramp > 85deg fan off

ambient temp

protein skimmer > 1hour turn on delay after feedmode

Pwm channel 4 > 29.5 day moon cycled

vortech > lagoon normal > night start pmw chan 1-4 0%, end @ channel 1-4 +0% > if tstorm follow lighting phase > end feed mode 30min ecosmart nutrient export

seasons max-min light & length
channel 0/1/2/3 buckpuck drivers
winter 25-30%/65-70/65-70/50-55 87 days
season start sunrise/sunset 7am/530pm
mid season 730am/6pm
end season 7am/630pm

spring 30-35/70-75/70-75/55-60 89Days
start 7am/630pm
mid 630am/7pm
end 6am/7pm

summer 35-45/75-85/75-85/60-70 103days
start 6am/7pm
mid 530am/730pm
end 6am/7pm

fall 30-35/70-75/70-75/55-60 86days
start 6am/7pm
mid 630am/6pm
end 7am/530pm

wheather 30% chanceclouds on even days> if clouds 65% chance of fast clouds, 25% slow clouds, 10% chance of storm, maximum 70 minutes of clouds

min-max 3-8 storms/season> if storm 25% chance of lightning> if storm length 20min-2 hours with 20 minute phase in/out trigger vortech reefcrest(phase in)-storm(duration)-reefcrest(phaseout)-lagoon(normal)
cain
Posts: 83
Joined: Tue Aug 02, 2011 10:59 am

Re: Preliminary buying questions?

Post by cain »

rimai wrote: You can place both LEDs and MP10 into thunderstorm mode at the same time.
how to do that?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

Humm..
Kinda a lot.
Definitely doable on the RA Plus :)
Unfortunatelly they are not available yet. There are some out there though that were sold as custom orders.
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

Roberto.
wolfador
Posts: 241
Joined: Sun Sep 04, 2011 9:59 am
Location: Pittsburgh, PA

Re: Preliminary buying questions?

Post by wolfador »

rimai wrote:Humm..
Kinda a lot.
Definitely doable on the RA Plus :)
Unfortunatelly they are not available yet. There are some out there though that were sold as custom orders.

OOOOhhh RA Plus? Sounds interesting :mrgreen:
John
ReefAngel and ReefAngel-HD developer
If the RA iOS app has helped please consider a donation
Image
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: Preliminary buying questions?

Post by alexwbush »

threads like this make my tank feel basic... I need to play some more with it all. I am running LEDs, but I stopped the lightning... kept the clouds. I think flashing 100% on my daylight LEDs killed some of the coraline (or maybe it was something else). Unfortunately my MP10 isn't wireless, so I can't play with those features.

This controller is extremely capable and always improving. Thanks Roberto!
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

Yea I was gonna say its gonna be a bit of code, everything has been coded except for seasons, vortech calls, and a

If (cloudchance == 1 && cloudduration > 20 && lightningchance< forgot the value) statement to change the 3 minute pwm slope to a 20 minute slope for this occurance along with calling the vortech pump modes.

Seasons could be easy I just have to figure a way to compute the string, say for winter build up to mid season from 730 is a 40.90 second addition in sunrise each day. Problem being being mostly the defining of each pwm value for 4 channels

pwmslope ledpwm0 (led0sl0,led0sl1 ect ect sorry typing on phone don't have all the characters to complete the line lol you get my jist, how much memory does the raplus have? And is it avail for custom order?

And my tank is pretty basic alex, id just like to recreate some natural effects, maybe helping my mandarins along in they're mating ritual...my entire system uses exactly 8 plugs(sump, fuge pump, protein skimmer, vortech,heater, led powersupply, fuge light, fuge light), would be six plugs if I decided to put my refugium lights on the rest of the led powersupply and pwm but my fuge lights run at full blast all the time, my tank is a custom rimless 25 gallon with a gravity fed refugium and sump w/ refugium, the double fuge is to keep the pod population up, along with feeding nutramar ova 3x daily.
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

how is date called in RA in a mmdd form or day number as in what is the integer/byte label? If I can figure out how to call date and turn it into a day number then ill be able to write some statments to denote how many seconds are added or removed per day from the season start/stop/end
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Preliminary buying questions?

Post by binder »

Deckoz2302 wrote:how is date called in RA in a mmdd form or day number as in what is the integer/byte label? If I can figure out how to call date and turn it into a day number then ill be able to write some statments to denote how many seconds are added or removed per day from the season start/stop/end
Here's the reference link to the date/time functions:

http://www.arduino.cc/playground/Code/Time

Now, if you are referring to the /d command for setting the date, that's mentioned here:

http://forum.reefangel.com/viewtopic.ph ... mand#p1683

curt
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

Thank you curt
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

Deckoz2302 wrote:If (cloudchance == 1 && cloudduration > 20 && lightningchance< forgot the value) statement to change the 3 minute pwm slope to a 20 minute slope for this occurance along with calling the vortech pump modes.
Seem like you've done your homework and has a good knowledge of programming too.
I think you would have no problems getting this done :)
You may even be able to stick everything in the 32K :)
The RA Plus has 256K. That's the only difference.
Roberto.
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

Haha yea funny story....I have a BA in computer science, but I work for RedBull lol
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

heres what i got so far... hmmm still a little bit to go ...and decide if i wanna rewrite some...and which direction to take with the code to keep as short as possible..lol is it sad im trying to code my ra before ordering it?

Code: Select all

void season()

//Define the time you want the sunrise/set to start at beginning, and middle of winter, we wont use end of winter to save space, because spring begin will be the same as winter end.
#define winter_rise_begin=
#define winter_rise_mid=
#define winter_set_begin=
#define winter_set_mid=

//Define the time you want the sunrise to start at beginning, middle of of spring
#define spring_rise_begin=
#define spring_rise_mid=
#define spring_set_begin=
#define spring_set_mid=

//Define the time you want the sunrise to start at beginning, middle of winter
#define summer_rise_begin=
#define summer_rise_mid=
#define summer_set_begin=
#define summer_set_mid=

//Define the time you want the sunrise to start at beginning and middle of fall
#define  fall_rise_begin=
#define fall_rise_mid=
#define fall_set_begin=
#define fall_set_mid=

#define forceseasoncalculation

static int ssn = 0;
static int ndays = 0
//Chose Base minimum & maximum light intensities per channel for lowest light season - winter
static byte ledch0base = random(25,30);
static byte ledch1base = random(65,70);
static byte ledch2base = random(65,70);
static byte ledch3base = random(50,55);



if (hour()==0 && minute()==0 && second()==0) ssn=0;
#ifdef forceseasoncalculation
	If (ssn==0)
#else
    if (hour()==0 && minute()==0 && second()==1 && ssn==0) 
#endif
	{
		//leapyear or not?
		if (year()%4 == 0 && !(year()%100 == 0 && year()%400 != 0)) 
DaysPerMonth = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
		//every other year
 else DaysPerMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
//adding up past months days
 for (i=0; i<month() - 1; i++) 
ndays += DaysPerMonth[i];
//adding current months days, julian day number is output ex: nday = 192
ndays += day(); 

//Season define
If (nday>=329 || nday<=45) ssn=1;
#else
If (nday>=46 && nday<=135) ssn=2;
#else
If (nday>=135 && nday<=238) ssn=3
#endif
If (nday>=239 && nday<=328) ssn=4;

rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

I think you can use this:

Code: Select all

int ssn=((month()-1)/3)+1;
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

actually use byte instead to save even more RAM:

Code: Select all

byte ssn=((month()-1)/3)+1;
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Preliminary buying questions?

Post by binder »

Deckoz2302 wrote:lol is it sad im trying to code my ra before ordering it?
No. You are being smart and making sure it does everything that you want it to do before you invest the money. Sounds like a smart shopper there. Now if you could only do this with the other stuff out there.......

curt
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

Lol yea your right binder, none of the other controllers can do this lol. And thanks roberto, I'm just trying to get the flow of the code first, then work out efficiency/size. Quick question for you though, are math libraries included to be able to do trig andcalculus functions? I'm debating between using an array formula to change the time each day, or using a true sunrise sunset with a set lat/longitude....I might code both to see how much space each takes up, true sunrise I think I could do in 150 lines maybe less, array I may be able to do in very little. Decisions, then again with an array, user has the ability to set they're sunset/sunrise parameters for each season which would help more with the ra community as everyones tank is different and everyone has a different idea of a time schedule. Where as a sunrise/set algorithm will be a truerise/set, unless I code in and offset variable for calculated time ex: if sunrise calc is at 7am, but you work and would like to see your tank lite later at night, offset sunrise 240minutes to rise 4 hours later(offset sunset to set 4hours later also)

Also I'm going to try to do this in ut time, because fish and corals don't get daylight savings time in the wild lol
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

I was phone coding earlier while i was working haha, writing code on a cell phone while putting orders together lol, the code i pasted was a little...meh
Last edited by Deckoz2302 on Fri Nov 04, 2011 3:22 pm, edited 3 times in total.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

http://www.arduino.cc/en/Math/H
The time library is based on UNIX time, which represents numbers of seconds from January 1, 1970.
Roberto.
StuGotz
Posts: 95
Joined: Sat Oct 15, 2011 9:17 am

Re: Preliminary buying questions?

Post by StuGotz »

rimai wrote:
Deckoz2302 wrote:If (cloudchance == 1 && cloudduration > 20 && lightningchance< forgot the value) statement to change the 3 minute pwm slope to a 20 minute slope for this occurance along with calling the vortech pump modes.
Seem like you've done your homework and has a good knowledge of programming too.
I think you would have no problems getting this done :)
You may even be able to stick everything in the 32K :)
The RA Plus has 256K. That's the only difference.
Not to hijack the thread but.... ACK, an RA Plus! Will the existing RAs be upgradable to 256K memory? I don't want to be left behind with all the cool menus and add-ons everyone is going to be able to fit on the new ones.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Preliminary buying questions?

Post by rimai »

I've made them so anyone could just replace the head unit board and still keep and use all the original investment they've made. Drop-in replacement of a single board with minimum down-time.
Roberto.
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Preliminary buying questions?

Post by Deckoz2302 »

I created a different threat for the progressive sunphase
http://forum.reefangel.com/viewtopic.php?f=12&t=411
StuGotz
Posts: 95
Joined: Sat Oct 15, 2011 9:17 am

Re: Preliminary buying questions?

Post by StuGotz »

rimai wrote:I've made them so anyone could just replace the head unit board and still keep and use all the original investment they've made. Drop-in replacement of a single board with minimum down-time.
Whew! Thanks Roberto!
Post Reply