New RAGen code has singleATO reversed??

Do you have a question on how to do something.
Ask in here.
Post Reply
YuppiWanna
Posts: 29
Joined: Sun Apr 17, 2011 6:46 pm

New RAGen code has singleATO reversed??

Post by YuppiWanna »

I've been having issues with my controller locking up from the wavemakers on the wrong ports so I recently remade my internal memory and main code with the latest version of RAGen. Now my singleATO float is working backwards.

The old ATO setup that’s been working flawlessly for me for nearly 10 months consists of two floats, with the top float serving solely as a failsafe to kill power to the ATO pump if the bottom float gets stuck down. Both floats are positioned with the wires coming out of the top. The bottom switch turns the ATO pump on when the water lets the float drop down and then turns the pump back off once the float rises back up enough.

Now with the freshly generated code, the ATO pump is only turned on when the bottom ATO switch’s float is UP (closest to the wires) and NOT down (float furthest from the wires and closest to the water). The high ATO switch retains its intended functionality. It would appear something is backwards in the latest libraries?


Code: Select all

// Autogenerated file by RAGen (v1.2.2.171), (04/10/2012 22:45)
// RA_041012_2245.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayImages
#define VersionMenu
#define wifi
#define SIMPLE_MENU
#define ENABLE_EXCEED_FLAGS
*/


#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 <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

//Overrides the values that are configured within Controller menu
    ReefAngel.PHMin=417; //7.0 PH Calibration Fluid, was 300 now 417
    ReefAngel.PHMax=744; //10.0 PH Calibration Fluid, was 615 now 744


    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port5Bit | Port6Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port3Bit;

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
    ////// Place additional initialization code below here
    

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

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.SingleATOLow(Port1);
    ReefAngel.Relay.DelayedOn(Port2, 5);
    ReefAngel.StandardLights(Port3);
    ReefAngel.StandardFan(Port4);
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.Wavemaker2(Port6);
    ReefAngel.StandardHeater(Port7);
    ////// Place your custom code below here
    

    if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1);  //Turns off ATO if high float is activated


    ////// Place your custom code above here
    // This sends all the data to the portal
    // Do not add any custom code that changes any relay status after this line
    // The only code after this line should be the ShowInterface function
    ReefAngel.Portal("yuppiwanna", "*************");

    // This should always be the last line
    ReefAngel.ShowInterface();
}
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New RAGen code has singleATO reversed??

Post by rimai »

Are you sure you did not swap the connections on the RA ATO ports?
Try swapping them around and try again.
Roberto.
YuppiWanna
Posts: 29
Joined: Sun Apr 17, 2011 6:46 pm

Re: New RAGen code has singleATO reversed??

Post by YuppiWanna »

Tried that at first, but even if the floats were on the wrong ATO plug it still doesn't explain the backwards functionality of the ATO pump turning on when the float is raised up (closest to the wires).
Image
YuppiWanna
Posts: 29
Joined: Sun Apr 17, 2011 6:46 pm

Re: New RAGen code has singleATO reversed??

Post by YuppiWanna »

Any idea..?
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New RAGen code has singleATO reversed??

Post by rimai »

Nothing got changed and I can't seem to replicate the issue.
Try disconnecting the high float switch from RA and use just the low.
Does it work as intended?
Are you sure you were not using StandardATO() before?
Roberto.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New RAGen code has singleATO reversed??

Post by binder »

like roberto said, nothing has changed with the ato code in the libraries. not sure what is going on. :?:
YuppiWanna
Posts: 29
Joined: Sun Apr 17, 2011 6:46 pm

Re: New RAGen code has singleATO reversed??

Post by YuppiWanna »

Okay, this is driving me crazy manually topping off the water twice a day. Here is a video of my lower float clearly working in reverse. It's plugged in to the same left ATO port as it has always been (left ato port on the controller).

[youtube]http://www.youtube.com/watch?v=9uWYNyQ1Hl4[/youtube]



Here is my code:

Code: Select all

// Autogenerated file by RAGen (v1.2.2.171), (05/03/2012 08:33)
// RA_050312_0833.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define wifi
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 9
#define ENABLE_ATO_LOGGING
*/


#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 <ReefAngel.h>

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


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

#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Feeding";
prog_char menu1_label[] PROGMEM = "Water Change";
prog_char menu2_label[] PROGMEM = "ATO Clear";
prog_char menu3_label[] PROGMEM = "Overheat Clear";
prog_char menu4_label[] PROGMEM = "PH Calibration";
prog_char menu5_label[] PROGMEM = "Date / Time";
prog_char menu6_label[] PROGMEM = "Version";
prog_char menu7_label[] PROGMEM = "Sump Lights ON";
prog_char menu8_label[] PROGMEM = "Sump Light OFF";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label, menu6_label, menu7_label, menu8_label  };

void MenuEntry1()
{
ReefAngel.FeedingModeStart();

}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();

}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.OverheatClear();
ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry5()
{
ReefAngel.SetupCalibratePH();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;

}
void MenuEntry6()
{
ReefAngel.SetupDateTime();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;

}
void MenuEntry7()
{
ReefAngel.DisplayVersion();

}
void MenuEntry8()
{
ReefAngel.DisplayMenuEntry("Lights ON");

ReefAngel.Relay.RelayMaskOn = ReefAngel.LightsOnPorts;
#ifdef RelayExp
for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
{
    ReefAngel.Relay.RelayMaskOnE[i] = ReefAngel.LightsOnPortsE[i];
}
#endif  // RelayExp
ReefAngel.Relay.Write();

}
void MenuEntry9()
{
ReefAngel.DisplayMenuEntry("Lights OFF");
ReefAngel.Relay.RelayMaskOn = 0;
#ifdef RelayExp
for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
{
    ReefAngel.Relay.RelayMaskOnE[i] = 0;
}
#endif  // RelayExp
ReefAngel.Relay.Write();

}


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Initialize the custom menu
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port2Bit | Port5Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port2Bit | Port5Bit | Port6Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port3Bit;

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
    ////// Place additional initialization code below here
    

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

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.SingleATOLow(Port1);
    ReefAngel.Relay.DelayedOn(Port2, 5);
    ReefAngel.StandardLights(Port3);
    ReefAngel.StandardFan(Port4);
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.Wavemaker2(Port6);
    ReefAngel.StandardHeater(Port7);
    ////// Place your custom code below here
    

    if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1);  //Turns off ATO if high float is activated



    ////// Place your custom code above here
    // This sends all the data to the portal
    // Do not add any custom code that changes any relay status after this line
    // The only code after this line should be the ShowInterface function
    ReefAngel.Portal("yuppiwanna", "*****************");

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

Here is my OLD code (generated about a year ago):

Code: Select all

// Autogenerated file by RAGen (v1.0.4.92), (04/23/2011 21:43)
// RA_042311_2143.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define SetupExtras
#define WavemakerSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define DirectTempSensor
#define SingleATOSetup
#define StandardLightSetup
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller
    
    //Overrides the values that are configured within Controller menu
    ReefAngel.PHMin=417; //7.0 PH Calibration Fluid, was 300 now 417
    ReefAngel.PHMax=744; //10.0 PH Calibration Fluid, was 615 now 744

    // Ports that are toggled in the selected mode.  Port1 starts on the right, port8 on the left.
    ReefAngel.FeedingModePorts = B10011010;
    ReefAngel.WaterChangePorts = B11111011;
    ReefAngel.LightsOnPorts = B00000100;

    // Ports that are always on
    ReefAngel.Relay.On(Port2); //Port2 is HOT Magnum canister
    ReefAngel.Relay.On(Port8); //Port8 is return pump/skimmer
}

void loop()
{
    ReefAngel.ShowInterface();

    // Specific functions
    ReefAngel.SingleATOLow(Port1);
    ReefAngel.StandardLights(Port3);
    ReefAngel.Wavemaker1(Port4);
    ReefAngel.Wavemaker2(Port5);
    ReefAngel.StandardFan(Port6);
    ReefAngel.StandardHeater(Port7);
    

    if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1);  //Turns off ATO if high float is activated


}
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New RAGen code has singleATO reversed??

Post by rimai »

I think you've got inverted check.
Can you remove this and disconnect the high float switch from the head unit and check what happens?

Code: Select all

    if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1);  //Turns off ATO if high float is activated
I think you've got inverted check on the code and inverted float switches on the head unit.
When you get it working with just the low float switch connected, plug the top one and add this code:

Code: Select all

    if (!ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1);  //Turns off ATO if high float is activated
Let me know what happens.
Roberto.
YuppiWanna
Posts: 29
Joined: Sun Apr 17, 2011 6:46 pm

Re: New RAGen code has singleATO reversed??

Post by YuppiWanna »

Still doing the same thing with that code removed and the ATO high unplugged
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New RAGen code has singleATO reversed??

Post by rimai »

Did you ever disassemble the float switch for maintenance?
Can you disconnect from RA and check continuity??
Does it close when it is down or up?
Roberto.
YuppiWanna
Posts: 29
Joined: Sun Apr 17, 2011 6:46 pm

Re: New RAGen code has singleATO reversed??

Post by YuppiWanna »

Okay, I just took them apart and reversed the floats for the low and the high. It works fine now, but something changed at some point. It's been at least 6 months, maybe more, since I've even touched those floats and the issue didn't start until I generated a new main code for the first time in about a year a month ago.

Ohwell, all is fine now though. Thanks for the help y'all!!
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New RAGen code has singleATO reversed??

Post by rimai »

Cool :)
Roberto.
Post Reply