Page 1 of 1

Preventing ATO timeout

Posted: Tue Aug 02, 2011 1:17 pm
by fd678
I have my ATO setup using the low ATO port, and I have two float switches wired in series, one is a fail safe.
The problems that I use an aqualifeter pump and it is kind of slow, so I need to disable the ATO timeout because I need it to run longer than 255 seconds per hour. I have the interval set to 0 which says "disabled" but after 60 seconds my pump kicks off.

Re: Preventing ATO timeout

Posted: Tue Aug 02, 2011 1:49 pm
by binder
that "disabled" is referring to the hourly repeat interval meaning that you will only allow the ATO to run 1 time every specified number of hours.

there is no easy way to override this without modifying the libraries. i do not recommend modifying the libraries at all BUT if you must, here's what you can do to get rid of the timeout check.

here's the singleato code that you need to locate inside ReefAngel.cpp:

Code: Select all

void ReefAngelClass::SingleATO(bool bLow, byte ATORelay, byte byteTimeout, byte byteHrInterval)
{
	/*
	If the switch is active, the float is opposite of the 2 wires,
		Check if we are not currently topping, if we are not check if we can run
		If we have an hour interval, check if we can run
		If we can run, activate the pump because we need water
	Otherwise the switch is not active, we need to see if we are currently topping
		If we are topping, then we need to stop the pump because we are topped off
	*/
    bool bCanRun = true;
    static int iLastTop = -1;
    if ( byteHrInterval )
    {
        int iSafeTop = NumMins(hour(), minute()) - iLastTop;
        if ( iSafeTop < 0 )
        {
            iSafeTop += 1440;
        }
        if ( (iSafeTop < (byteHrInterval * 60)) && (iLastTop >= 0) )
        {
            bCanRun = false;
        }
    }
    ReefAngel_ATOClass *ato;
    if ( bLow )
    {
        ato = &LowATO;
    }
    else
    {
        ato = &HighATO;
    }
    unsigned long t = byteTimeout;
    t *= 1000;
    if ( ato->IsActive() )
    {
        if ( (! ato->IsTopping()) && bCanRun )
        {
            ato->Timer = millis();
            ato->StartTopping();
            Relay.On(ATORelay);
        }
    }
    else
    {
    	// not active
		if ( ato->IsTopping() )
		{
			iLastTop = NumMins(hour(), minute());
			ato->StopTopping();
			Relay.Off(ATORelay);
		}
    }

// either remove or comment out these next 5 lines
// or you can just comment out or remove the LED and Relay.Off lines
    if ( ((millis() - ato->Timer) > t) && ato->IsTopping() )
    {
        LED.On();  // comment this line out
        Relay.Off(ATORelay);  // comment this line out
    }
}
If you do that, you can put whatever value you want in the timeout (preferably still 255) and then when the timeout expires the port will not shutoff and the led light will not come on.

It's the simplest way I can thing of to fix this for you.

curt

Re: Preventing ATO timeout

Posted: Sat Feb 04, 2012 3:39 pm
by ingtar_shinowa
I have a similar problem but I am using the standard ATO option. Is there another option besides altering the library?

Re: Preventing ATO timeout

Posted: Sat Feb 04, 2012 5:43 pm
by rimai
You could add this to your code:

Code: Select all

  ReefAngel.StandardATO(Port1,1000);
Change 1000 to how many seconds you would like.