Multiple on/off times

Do you have a question on how to do something.
Ask in here.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

Steve, did you ever try my suggested fix?
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

I did not. Lee said to run the test he asked for.

I'll try it now.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

First off sorry for the frustrations...If you can't control the unit with our code on, then you can try it tomorrow during a cycle and see...but based on the output you sent it should be good.

I recommend just take out the debug from the last code and see.

Colin, the override would not hold up the ato the way it was works but the order change I made may help.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Good Morning. everyone.
I uploaded Colin's suggestion last night and checked the relay activity this morning.
I saw a little relay activity on port 6 at 5:15 am and the sump was at the max level.

I decided to run a little further test so unplugged port 6 because I didn't want to add RO water right now because the physical level was fine as was the salinity.

I drained a gallon of water of into a jug. Port6 turned on when I poured the water back in it turned off.

It seems like it is working, but I'm going to keep an eye on it.

Image

Thanks again for everything. Sorry I was in a bad mood before I started working on this last night and the lack of knowledge working with the serial monitor along with the wireless being out added to it.

I'm better today.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

Awesome! Try to catch the regular cycle and tell us how it goes!

--Colin
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Multiple on/off times

Post by binder »

cool! I have been following this thread a little and can completely understand your frustration. The nice thing though is that everyone here (or at least most everyone) are all willing to help. That's one of the things I love about it and I have had my controller since almost the beginning of the project a few years ago. Sorry to hijack the thread... just wanted to chime in a little. :-)

Sent from my Nexus 7
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

cosmith71 wrote:Awesome! Try to catch the regular cycle and tell us how it goes!

--Colin
Colin I caught the 1pm cycle and it looked good, but I'm not 100% certain yet becuse the level was at 29% for the entire exchange and as soon as the pump stopped sending water to the chamber it went to 30% so it never really got low enough to trigger the ATO, but I'll watch it and try to catch the 7pm cycle.

binder wrote:cool! I have been following this thread a little and can completely understand your frustration. The nice thing though is that everyone here (or at least most everyone) are all willing to help. That's one of the things I love about it and I have had my controller since almost the beginning of the project a few years ago. Sorry to hijack the thread... just wanted to chime in a little. :-)

Sent from my Nexus 7
Binder; thanks for the comments. You're not hijacking the thread, you made a comment and a nice one at that.
Colin and Lee have been great helping me. I sure there are others that chime in and help like you and Roberto, but in this case it was these two that put up with my lack of knowledge and it looks like they figured out something that works.

I would like to thank you for the work you put into the scene too. I can't wait to get my new phone so I can try out your Andriod App.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Multiple on/off times

Post by binder »

Sacohen wrote: I would like to thank you for the work you put into the scene too. I can't wait to get my new phone so I can try out your Andriod App.
You're welcome. :)

btw, there's some more cool features coming soon in the app (if you haven't been looking at the Android Reef Angel Status thread on here). :)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

I have been looking at the Andriod thread. I can't say I've been following yet, but I've been looking at it. :)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

cosmith71 wrote:Awesome! Try to catch the regular cycle and tell us how it goes!

--Colin
I caught the 7pm cycle and it worked perfectly.
While the water exchange was going on I drained about a quart of water out of the tank so that when it ended it was definitely going to be below 29% I also plugged a light into port6 to see when the port came on without actually dumping RO water in.

2 min after the exchange ended Port6 turned on and then I started putting the quart of water I drained back into the tank and when it reached 31% it turned of Port6 (the light).

Great job Colin.
Thanks for the help Lee.
I think we can close this case. :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Awesome. Post up your full code now. Lets see what you ended up with.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

This is the code that wound up working.

Code: Select all

////// Place global variable code below here

unsigned long ATOUpdate=0;
////// Place global variable code above here

Code: Select all

void loop()
{
ReefAngel.StandardLights( Port1,12,0,22,0 );
ReefAngel.StandardLights( Port2,13,0,21,0 );
ReefAngel.Relay.Set( Port3, !ReefAngel.Relay.Status( Port1 ) );
ReefAngel.StandardLights( Port7,13,0,21,0 );
ReefAngel.Relay.Set(Port5,(now()-3600)%21600<1200); // Runs for 1200s every 21600 seconds
ReefAngel.Relay.Set(Port8,((now()-3600)-1200)%21600<1200); // Runs for 1200s every 21600 seconds with 1200s offset
ReefAngel.WaterLevelATO(Port6,720,29,31); // Enable ATO the ATO
if (ReefAngel.Relay.Status(Port5)) // Check to see if port 5 is on and update time is empty
{ 
ATOUpdate = now(); // If so, set the update time to now
} 

if (now() - ATOUpdate < 120) // If it hasnt been 120 seconds turn off the port
{ 
ReefAngel.WaterLevelATO(Port6,720,0,1);
}
ReefAngel.PWM.SetActinic(MyCustomWave(50));
if( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.PWM.SetActinic(0);
if( ReefAngel.DisplayedMenu==WATERCHANGE_MODE ) ReefAngel.PWM.SetActinic(0);
if (hour()<12 || hour()>=22) ReefAngel.PWM.SetActinic(30);
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

See, I told you we'd get it!

--Colin
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

I knew we would get it, but I didn't want to take any more of your and Lee's time.
Glad we wrapped it up this quick.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Can you set at partial # in the water level sensor.
like 29.5% or does it need to be full #'s?

If so would it be 295 or 29.5?
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

Sacohen wrote:Can you set at partial # in the water level sensor.
like 29.5% or does it need to be full #'s?

If so would it be 295 or 29.5?
Nope. Has to be a whole number. They're defined as byte type.

--Colin
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Im still waiting to hear what happened with the priest and rabbi..
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Thanks Colin. Lee I'll get back to you on that.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

A rabbi, a priest, and a Lutheran minister walk into a bar. The bartender looks up and says, "Is this some kind of joke?"

or

the Priest asks the Rabbi "Have you ever tried a bacon sandwich or even fancied one? The Rabbi answers "Well i have speculated about it but my faith forbids me from trying, but father, have you ever fancied a nice night of sex with a good woman, i mean a really good woman?" The Priest thinks hard and answers " Well Rabbi, i have sometimes wondered but my vow of celibacy prevents it from ever occurring" The Rabbi answers "Sure as hell beats a bacon sandwich, don't it?"
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Lol! Ty :)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Lee;

I've forgot how my code for the denitrification chamber is set up.

I want to change the amount of time that the pump is on from 20 min to 10 min.

This is the original code...

Code: Select all

// DeNitrate Routine
  int DeNit_Offset=3600; 
  int DeNit_Repeat=21600;
  int DeNit_Doser_Offset=1200;
  int DeNit_Doser_Runtime=1200;
  int DeNit_Pump_Runtime=1200;
  int DeNit_ATO_Offtime=1500;

  // Pump comes on first
  ReefAngel.Relay.Set(DeNit_Pump,(now()-3600)%21600<1200);       // Runs for 1200s every 21600 seconds  
  // Doser comes on second
  ReefAngel.Relay.Set(DeNit_Doser,((now()-3600)-1200)%21600<1200); // Runs for 1200s every 21600 seconds with 1200s offset
  
Do I change it at the DeNit_Doser Runtime or in this line...

Code: Select all

// Doser comes on second
  ReefAngel.Relay.Set(DeNit_Doser,((now()-3600)-1200)%21600<1200); // Runs for 1200s every 21600 seconds with 1200s offset
To this....

Code: Select all

// Doser comes on second
  ReefAngel.Relay.Set(DeNit_Doser,((now()-3600)-1200)%21600<600); // Runs for 600s every 21600 seconds with 1200s offset
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

First off why don't we confirm that we're talking about the carbon source dosing pump and not the chamber fill/flush pump. Is yours like DrThompson? Are you dosing methanol?

Finally I believe you got it perfect it. What you should do now is change it ALSO in the Denit_Doser_Runtime and then at some point replace the numbers defined with the variable names so next time or for someone else who comes along you/them just need to change the variables.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

I'm talking about changing the time on the dosing pump.
Yes it is like DrThompsons. I have an actual denitrification chamber and pump from NatuReef and am switching from the Nitragone that they sell to a 50% Methanol/RODI mix, like he runs.

So it would be like this...

Code: Select all

// DeNitrate Routine
  int DeNit_Offset=3600; 
  int DeNit_Repeat=21600;
  int DeNit_Doser_Offset=1200;
  int DeNit_Doser_Runtime=600;
  int DeNit_Pump_Runtime=1200;
  int DeNit_ATO_Offtime=1500;

  // Pump comes on first
  ReefAngel.Relay.Set(DeNit_Pump,(now()-3600)%21600<1200);       // Runs for 1200s every 21600 seconds  
  // Doser comes on second
  ReefAngel.Relay.Set(DeNit_Doser,((now()-3600)-1200)%21600<600); // Runs for 600s every 21600 seconds with 1200s offset
 
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Yes, but let's use this finally...

Code: Select all

// DeNitrate Routine
int DeNit_Offset=3600; 
int DeNit_Repeat=21600;
int DeNit_Doser_Offset=1200;
int DeNit_Doser_Runtime=600;
int DeNit_Pump_Runtime=1200;
int DeNit_ATO_Offtime=1500;

// Pump comes on first
ReefAngel.Relay.Set(DeNit_Pump,(now()-DeNit_Offset)%DeNit_Repeat<DeNit_Pump_Runtime);  // Runs denitrator pump
// Doser comes on second
ReefAngel.Relay.Set(DeNit_Doser,((now()-DeNit_Offset)-DeNit_Doser_Offset)%DeNit_Repeat<DeNit_Doser_Runtime); // Runs denitrator doser
And replace the DeNit_ATO_Offtime wherever you have that as well so you can just use the variables moving forward. You'll be less confused and you'll see what each number means.
Post Reply