DosingPumpRepeat and actually time dosing pumps run...???

Do you have a question on how to do something.
Ask in here.
Post Reply
DavidinGA
Posts: 83
Joined: Fri Jun 07, 2013 11:26 am

DosingPumpRepeat and actually time dosing pumps run...???

Post by DavidinGA »

I'm curious as to how much 2 part I'm actually dosing using the RA DosingPumpRepeat command as it's set to run every so many hours each day. I think it's running an additional time each day at midnight; could someone confirm that?

For example here is my calcium dosing:

ReefAngel.DosingPumpRepeat( Port8,0,300,22 ); ////cal 300min = 5hrs 82.5ml day


So every 5 hours it doses for 22 seconds. So - 5am, 10am, 3pm, 8pm, and midnight? or 1am?

I assume it resets somehow for each day and doesn't go past dosing at midnight (otherwise the dosing pumps would always dose at different times each day if the hours carried over to the next day ~1am); right?

So will any hours set that would be after midnight for the day simply dose at midnight?

I'm trying to figure out how much I'm really dosing per 24 hours.

I've attached my full code and the ml amounts dosed (my dosing pumps dose 0.75ml per sec) if the pumps do all run at midnight to finish the days cycle if any hours would be past midnight.

Hopefully that all makes sense.
Thanks

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>

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


////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 845 );

    // Feeeding and Water Change mode speed
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;


    // Ports that are always on

    ////// Place additional initialization code below here


    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.StandardHeater( Port1,795,800 );  ////2 Heaters
    
    ReefAngel.StandardLights( Port3,24,0,15,0 );   ////scrubber lights 12am-3pm  15hrs on 9off
    
    ReefAngel.StandardLights( Port5,19,0,23,0 ); ////Metal Halide 7pm to 11pm
    ReefAngel.DosingPumpRepeat( Port6,0,660,10 ); /////mag 720min = 11hrs  15ml day
    ReefAngel.DosingPumpRepeat( Port7,0,360,25 );  /////alk 360min = 6hrs  75ml day
    ReefAngel.DosingPumpRepeat( Port8,0,300,22 );  ////cal 300min = 5hrs   82.5ml day 3cups per gal
    ReefAngel.DCPump.UseMemory = false;
    ReefAngel.DCPump.SetMode( LongPulse,60,10 );
    ReefAngel.DCPump.DaylightChannel = Sync;
    ReefAngel.DCPump.ActinicChannel = AntiSync;
    ////// Place your custom code below here
    if (hour()<8)
{
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
}
else if (hour()==8 && minute()<4)
ReefAngel.DCPump.SetMode( LongPulse,85,20);
else if (hour()>=8 && hour()<10)
ReefAngel.DCPump.SetMode( ShortPulse,75,40 );
else if (hour()>=10 && hour()<12)
ReefAngel.DCPump.SetMode( LongPulse,85,4 );
else if (hour()>=12 && hour()<14)
ReefAngel.DCPump.SetMode( ReefCrest,56,20 );
else if (hour()>=14 && hour()<16)
ReefAngel.DCPump.SetMode( LongPulse,80,5 );
else if (hour()>=16 && hour()<22)
ReefAngel.DCPump.SetMode( LongPulse,70,14 );
else if (hour()==23 && minute()<4)
ReefAngel.DCPump.SetMode( LongPulse,90,5);
else
{
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
}

{
   ReefAngel.AddWifi();
}

{
if (ReefAngel.Relay.Status(Port5)) 
  ReefAngel.StandardFan(Port4,813,820);
else
  ReefAngel.Relay.Off(Port4);
}

{
if ((hour()>=14 && hour()<19) || (hour()>=23)) ReefAngel.Relay.On(Port2);
  else ReefAngel.Relay.Off(Port2);
}
    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.Portal( "davidinga" );
    ReefAngel.ShowInterface();
}

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // pH Expansion
    ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,15,66, "PHE:" );
    ReefAngel.LCD.DrawSingleMonitor( ReefAngel.Params.PHExp,COLOR_MEDIUMSEAGREEN,39,66, 100 );    
    pingSerial();

    // Main Relay Box
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox( 12, 92, TempRelay );
    pingSerial();

    // Date and Time
    ReefAngel.LCD.DrawDate( 6, 122 );
    pingSerial();
}

void DrawCustomGraph()
{
}

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

Re: DosingPumpRepeat and actually time dosing pumps run...??

Post by rimai »

It will not dose a midnight, but it will reset every midnight.
So, for your schedule, you are only getting 4 doses.
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: DosingPumpRepeat and actually time dosing pumps run...??

Post by rimai »

Sorry, my bad.
You are correct.
It does dose at midnight.... So you are getting 5 doses.
Roberto.
DavidinGA
Posts: 83
Joined: Fri Jun 07, 2013 11:26 am

Re: DosingPumpRepeat and actually time dosing pumps run...??

Post by DavidinGA »

rimai wrote:Sorry, my bad.
You are correct.
It does dose at midnight.... So you are getting 5 doses.

So...


ReefAngel.DosingPumpRepeat( Port6,0,660,10 ); /////mag 720min = 11hrs 15ml day

This will actually dose 3 times per 24 hour cycle?



ReefAngel.DosingPumpRepeat( Port7,0,360,25 ); /////alk 360min = 6hrs 75ml day

This will only dose exactly what it says since it ends on hour 24?



ReefAngel.DosingPumpRepeat( Port8,0,300,22 ); ////cal 300min = 5hrs 82.5ml

And this will dose 5 times like you said.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: DosingPumpRepeat and actually time dosing pumps run...??

Post by rimai »

Correct.
Here is the math behind it:

Code: Select all

	signed long t=(elapsedSecsToday(now())-((long)OffsetMinute*60));
	Relay.Set(DPRelay,(t%((long)RepeatMinute*60))<RunTime && t>=0);
It basically gets the number of seconds today, which starts at midnight, and uses modulo to find out the residual of the division.
If the residual is less than runtime, it turns on the relay.
Roberto.
DavidinGA
Posts: 83
Joined: Fri Jun 07, 2013 11:26 am

Re: DosingPumpRepeat and actually time dosing pumps run...??

Post by DavidinGA »

Ok.

Thanks
Post Reply