Speedwave Pump for Closed Loop

Do you have a question on how to do something.
Ask in here.
User avatar
Posts: 48
Joined: Sat Apr 21, 2012 7:44 pm
Location: Burlington, Ontario, Canada
PostPosted: Tue Jul 30, 2013 9:46 am
Hi, I recently acquired a Speedwave 10000lph pump for my closed loop system. It pulls water from two 1.5" drains and pushes the water back into the tank through four 1" return lines. I have purchased the Jebao cable from RA and connected to the daylight port. I am running Vortech pumps as well and haven't made a move to the WP pumps, so this is the only DC pump running on my system.

My PDE has code to run the Vortech pumps through the memory function and then switch to feed mode, when selected, Nutrient Transport Mode after feed mode for 10 minutes and also a night mode. I would like to replicate these settings, but realize the modes may not transfer to the closed loops the same as they do to the MP and WP pumps. I haven't been able to test night mode yet because I haven't been through a day, but when Feed Mode is selected the pumps stops and after feed mode there doesn't seem to be any difference with the NTSP mode to the Reef Crest.

What I am looking for in the NTSP mode is to help the Vortech kick up any debris that has landed on the sand bed and rock to have another chance at being eaten or to flow down the overflow. The feed mode needs to be a slight flow just to move things around a little rather than being off all together. Night mode I have selected Reef Crest with a lighter flow, still random, but a more gentle variation.

I'm not concerned about picking up the settings from the portal or memory, but this might make life easier, but I definitely want to keep the feed mode, night mode and some form of NTSP mode after feeding, which can revert back to portal or memory settings after.

Here is my PDE:

Code: Select all
//
// This version updated for v1.0.3 or later


/*
The following features are enabled for this File:
#define DisplayImages
#define OverheatSetup
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define SaveRelayState
#define WDT
#define PWMEXPANSION
#define CUSTOM_MAIN
#define COLORS_PDE
#define SALINITYEXPANSION
#define RFEXPANSION
#define FONT_8x8
#define FONT_8x16

Ports assignment:
Port1 - Fuge Light
Port2 - Avast ATO
Port3 - Heater(s)
Port4 - Kalk Reactor
Port5 - Avast Schwabble
Port6 - Closed Loop Pump
Port7 - Skimmer
Port8 - Return Pump
*/

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

//*********************************************************************************************************************************
//--------------------------------------------------- Start of Global Variables ---------------------------------------------------

// Globals Needed for RF Mode on Custom Menu
byte vtmode;
byte vtspeed;

// Globals Needed for Params on Custom Main
byte x,y;
char text[10];
int v;

// Globals Needed for RF Mode on Custom Main
byte vtechmode;
byte vtechspeed;
boolean bFeeding=false;

//------------------------------------------------------ End of Global Variables --------------------------------------------------
//----------------------------------------------------------- Custom Menu ---------------------------------------------------------

#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Feeding";
prog_char menu1_label[] PROGMEM = "Water Change Pause";
prog_char menu2_label[] PROGMEM = "Vortech Mode";
prog_char menu3_label[] PROGMEM = "Vortech Speed";
prog_char menu4_label[] PROGMEM = "Lights On";
prog_char menu5_label[] PROGMEM = "Lights Off";
prog_char menu6_label[] PROGMEM = "Overheat Clear";
prog_char menu7_label[] PROGMEM = "PH Calibration";
prog_char menu8_label[] PROGMEM = "Salinity Calibration";
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()
{
     vtmode++;
     vtechmode++;
     if (vtmode>6)
     {
       vtmode=0;
       vtechmode=0;
     }
     InternalMemory.RFMode_write(vtmode); // Set the Internal Memory Setting for RF Mode
     ReefAngel.RF.SetMode(vtmode, InternalMemory.RFSpeed_read(), InternalMemory.RFDuration_read());
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;   
}
void MenuEntry4()
{
     vtspeed+=10;
     vtechspeed+=10;
     if (vtspeed>100)
     {
       vtspeed=0;
       vtechspeed=0;
     }
     InternalMemory.RFSpeed_write(vtspeed); // Set the Internal Memory Setting for RF Speed
     ReefAngel.RF.SetMode(InternalMemory.RFMode_read(), vtspeed, InternalMemory.RFDuration_read());
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;   
}
void MenuEntry5()
{
     ReefAngel.Relay.RelayMaskOn = ReefAngel.LightsOnPorts;
     ReefAngel.Relay.Write();
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;
}
void MenuEntry6()
{
     ReefAngel.Relay.RelayMaskOn = 0;
     ReefAngel.Relay.Write();
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;
}
void MenuEntry7()
{
     ReefAngel.OverheatClear();
     ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry8()
{
     ReefAngel.SetupCalibratePH();
     ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry9()
{
     ReefAngel.SetupCalibrateSalinity();
     ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}

//--------------------------------------------------------- End Custom Menu -------------------------------------------------------
//*********************************************************************************************************************************
//*********************************************************************************************************************************
//---------------------------------------------Custom Main for PWM Expansion Module------------------------------------------------

void DrawCustomMain()
{
        //Top Banner
        ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 9, 3, "WISEGUYS' REEF", Font8x16);
        ReefAngel.LCD.Clear(DefaultFGColor,3,21,126,21);
       
        // Display T1 Header Text
        ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,10,25,"Tank");
        char text[7];
 
        // Display the T1 Temp Value
        ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
        ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE, 255, 4, 35, text, Font8x16);
 
        // Display the Salinity Header Text
        ReefAngel.LCD.DrawText(COLOR_CRIMSON,255,55,25,"Sal.");
 
        // Display the Salinity Value
        ConvertNumToString(text, ReefAngel.Params.Salinity, 10);
        ReefAngel.LCD.DrawLargeText(COLOR_CRIMSON, 255, 57, 35, text, Font8x16);
       
        // Display pH Header Text
        ReefAngel.LCD.DrawText(COLOR_INDIGO,255,105,25,"pH");
 
        // Display pH Value
        ConvertNumToString(text, ReefAngel.Params.PH, 100);
        ReefAngel.LCD.DrawLargeText(COLOR_INDIGO, 255, 94, 35, text, Font8x16);
         
        //Display Alternate Temp Parameters
        ReefAngel.LCD.DrawText(0,255,8,54,"Sump");
        ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_CORNFLOWERBLUE, 36, 54, 10);

        ReefAngel.LCD.DrawText(0,255,72,54,"Hood");
        ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], COLOR_CORNFLOWERBLUE, 100, 54, 10);

        // Display EcoSmart Mode Value & Speed %     
        ReefAngel.LCD.Clear(DefaultFGColor,3,65,126,65);   
        ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 17, 69, "Ecotech Mode");
        ConvertNumToString(text, vtechspeed, 1);
        if (vtechmode == 0)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,1,80,"Constant -  ", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,121,80,"%", Font8x16);
        }
        else if(vtechmode == 1)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,1,80,"Lagoon -    ", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 2)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,1,80,"Reef Crest -", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 3)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,1,80,"Short Pulse-", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 4)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,1,80,"Long Pulse -", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 5)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,1,80,"Nutrient TM-", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,121,80,"%", Font8x16);
         }
        else if (vtechmode == 6)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,1,80,"Tidal Swell-", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 9)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_BLACK,255,1,80,"Night -     ", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_BLACK,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_BLACK,255,121,80,"%", Font8x16);
        }

 
        // Display Main Relay Box
        ReefAngel.LCD.Clear(DefaultFGColor,3,99,126,99);
        byte TempRelay = ReefAngel.Relay.RelayData;
        TempRelay &= ReefAngel.Relay.RelayMaskOff;
        TempRelay |= ReefAngel.Relay.RelayMaskOn;
        ReefAngel.LCD.DrawOutletBox(13, 102, TempRelay);

        //Draw Date & Time
        ReefAngel.LCD.Clear(DefaultFGColor,3,116,126,116);
        ReefAngel.LCD.DrawDate(6, 119);
}

void DrawCustomGraph()  // Not Used
{
}
//------------------------------------------------------ End Custom Main ----------------------------------------------------------
//*********************************************************************************************************************************
//-------------------------------------------------------- Begin Setup ------------------------------------------------------------
void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));  //Intialize Custom Menu
   
    vtmode=InternalMemory.RFMode_read();
    vtspeed=InternalMemory.RFSpeed_read();
    vtechmode=InternalMemory.RFMode_read();
    vtechspeed=InternalMemory.RFSpeed_read();
   
    ReefAngel.FeedingModePorts = Port2Bit | Port7Bit | Port6Bit; // Turn off Skimmer, ATO and Close Loop when feeding mode is activated
    ReefAngel.WaterChangePorts = Port2Bit | Port7Bit | Port8Bit; // Turn off Return Pump, Skimmer & ATO when water change mode is actived
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port3Bit;
    ReefAngel.LightsOnPorts = Port1Bit;
    ReefAngel.TempProbe = T1_PROBE; // Use T1 probe as temperature and overheat functions
    ReefAngel.OverheatProbe = T1_PROBE;
    InternalMemory.OverheatTemp_write( 850 ); // Set the Overheat temperature setting

    // Ports that are always on
    ReefAngel.Relay.On(Port4);
    ReefAngel.Relay.On(Port6);
    ReefAngel.Relay.On(Port8);
}
//---------------------------------------------------------- End Setup ------------------------------------------------------------
//*********************************************************************************************************************************
//--------------------------------------------------------- Begin Loop ------------------------------------------------------------
void loop()
{
    // Specific functions
    ReefAngel.Relay.DelayedOn(Port7, 2); // Turn on Port 7 (Skimmer) with 2 minute delay
    ReefAngel.Relay.DelayedOn(Port2, 10); // Turn on Port 2 (Avast ATO) with 10 minute delay
    ReefAngel.StandardLights(Port1,21,0,9,00); //Fuge Light on at night
    ReefAngel.StandardHeater(Port3,790,800); // Standard Heater Using Internal Memory
    ReefAngel.DosingPumpRepeat(Port5,0,360,60); //Turn Schwabble on for 1 minute every 4 hours
     
    // Fan Speed Functions
    signed int HoodFanSpeed;
    HoodFanSpeed=map(ReefAngel.Params.Temp[T3_PROBE],750,1000,25,100); // Calculate Hood Fan speed
    HoodFanSpeed=constrain(HoodFanSpeed,0,100);
    ReefAngel.PWM.SetChannel(0,HoodFanSpeed);

    signed int SumpFanSpeed;
    SumpFanSpeed=map(ReefAngel.Params.Temp[T2_PROBE],750,850,25,100); // Calculate Sump Fan speed
    SumpFanSpeed=constrain(SumpFanSpeed,0,100);
    ReefAngel.PWM.SetChannel(1,SumpFanSpeed);
 
    ReefAngel.PWM.SetDaylight(ReefCrestMode(80,20,true));
   
/*
------------------------------------------------ Start Time-of-Day Based Functions ----------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These are the mode numbers for the RF Expansion Module for reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #define Constant      0
    #define Random1       1 // Lagoonal
    #define Random2       2 // Reef Crest
    #define ShortWave     3
    #define LongWave      4
    #define Smart_NTM     5 // Nutrient Transport Mode
    #define Smart_TSM     6 // Tidal Swell Mode
    #define Feeding_Start 7
    #define Feeding_Stop  8
    #define Night         9
    #define Slave_Start   97
    #define Slave_Stop    98
    #define None          99
   
    RF Mode      = http://YOURIPADDRESS:2000/mb855,X
    RF Speed     = http://YOURIPADDRESS:2000/mb856,X
    RF Duration  = http://YOURIPADDRESS:2000/mb857,X
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

//---------------------------------------------- Start RF Control Mode for Daytime, Night and Feeding ---------------------------
  if (hour() >=9  && hour() < 21)
  { 
    if (vtechmode == 9)
    {
      ReefAngel.PWM.SetDaylight(ReefCrestMode(80,20,true));
      ReefAngel.RF.UseMemory=true; 
      vtechmode = InternalMemory.RFMode_read();
      vtechspeed = InternalMemory.RFSpeed_read();
    }
    if (ReefAngel.DisplayedMenu==FEEDING_MODE)
    {
      bFeeding=true;
      ReefAngel.PWM.SetDaylight(50);     
    }
    if (ReefAngel.DisplayedMenu==DEFAULT_MENU && bFeeding)
    {
      bFeeding=false;
      ReefAngel.Timer[1].SetInterval(600); // Timer for 10min
      ReefAngel.Timer[1].Start();
      ReefAngel.RF.UseMemory=false;
      ReefAngel.PWM.SetDaylight(NutrientTransportMode(50,100,500,true));
      ReefAngel.RF.SetMode(Smart_NTM,100,6);
      vtechmode = 5;
      vtechspeed = 100;
    }
    if (ReefAngel.DisplayedMenu==DEFAULT_MENU && ReefAngel.Timer[1].IsTriggered())
    {
      ReefAngel.PWM.SetDaylight(ReefCrestMode(80,20,true));
      ReefAngel.RF.UseMemory=true;
      vtechmode = InternalMemory.RFMode_read();
      vtechspeed = InternalMemory.RFSpeed_read();
    }
  }
  else
  {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.PWM.SetDaylight(ReefCrestMode(50,5,true));
      ReefAngel.RF.SetMode(Night,15,0);
      vtechmode = 9;
      vtechspeed = 15;
  }
//------------------------------------------------ End RF Control Mode for Daytime, Night and Feeding -----------------------------   

    ReefAngel.Portal("mvwise");
    ReefAngel.ShowInterface();
}
//--------------------------------------------------------------- End Loop --------------------------------------------------------

//*********************************************************************************************************************************


Any help would be appreciated!
Image

Posts: 12510
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Jul 30, 2013 10:36 am
Speedwave pumps are very slow in response.
You can't create waves with it :(
It takes about 20 to 30 seconds for it to go from 0% to 100%.
Roberto.
User avatar
Posts: 48
Joined: Sat Apr 21, 2012 7:44 pm
Location: Burlington, Ontario, Canada
PostPosted: Tue Jul 30, 2013 11:06 am
Okay thanks, I figured there would be a difference between the two. Does that mean that reefcrest will not work? I'm looking for something a little random in terms of flow, it doesn't need to be instantaneous, but variable and random would be nice.

Also, if we go with constant at slow speeds for night and feeding and perhaps 100% after feeding for five minutes would my PDE work as follows, or is there something in the feed mode section that is preventing it from running?

Code: Select all
//
// This version updated for v1.0.3 or later


/*
The following features are enabled for this File:
#define DisplayImages
#define OverheatSetup
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define SaveRelayState
#define WDT
#define PWMEXPANSION
#define CUSTOM_MAIN
#define COLORS_PDE
#define SALINITYEXPANSION
#define RFEXPANSION
#define FONT_8x8
#define FONT_8x16

Ports assignment:
Port1 - Fuge Light
Port2 - Avast ATO
Port3 - Heater(s)
Port4 - Kalk Reactor
Port5 - Avast Schwabble
Port6 - Closed Loop Pump
Port7 - Skimmer
Port8 - Return Pump
*/

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

//*********************************************************************************************************************************
//--------------------------------------------------- Start of Global Variables ---------------------------------------------------

// Globals Needed for RF Mode on Custom Menu
byte vtmode;
byte vtspeed;

// Globals Needed for Params on Custom Main
byte x,y;
char text[10];
int v;

// Globals Needed for RF Mode on Custom Main
byte vtechmode;
byte vtechspeed;
boolean bFeeding=false;

//------------------------------------------------------ End of Global Variables --------------------------------------------------
//----------------------------------------------------------- Custom Menu ---------------------------------------------------------

#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Feeding";
prog_char menu1_label[] PROGMEM = "Water Change Pause";
prog_char menu2_label[] PROGMEM = "Vortech Mode";
prog_char menu3_label[] PROGMEM = "Vortech Speed";
prog_char menu4_label[] PROGMEM = "Lights On";
prog_char menu5_label[] PROGMEM = "Lights Off";
prog_char menu6_label[] PROGMEM = "Overheat Clear";
prog_char menu7_label[] PROGMEM = "PH Calibration";
prog_char menu8_label[] PROGMEM = "Salinity Calibration";
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()
{
     vtmode++;
     vtechmode++;
     if (vtmode>6)
     {
       vtmode=0;
       vtechmode=0;
     }
     InternalMemory.RFMode_write(vtmode); // Set the Internal Memory Setting for RF Mode
     ReefAngel.RF.SetMode(vtmode, InternalMemory.RFSpeed_read(), InternalMemory.RFDuration_read());
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;   
}
void MenuEntry4()
{
     vtspeed+=10;
     vtechspeed+=10;
     if (vtspeed>100)
     {
       vtspeed=0;
       vtechspeed=0;
     }
     InternalMemory.RFSpeed_write(vtspeed); // Set the Internal Memory Setting for RF Speed
     ReefAngel.RF.SetMode(InternalMemory.RFMode_read(), vtspeed, InternalMemory.RFDuration_read());
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;   
}
void MenuEntry5()
{
     ReefAngel.Relay.RelayMaskOn = ReefAngel.LightsOnPorts;
     ReefAngel.Relay.Write();
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;
}
void MenuEntry6()
{
     ReefAngel.Relay.RelayMaskOn = 0;
     ReefAngel.Relay.Write();
     ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;
}
void MenuEntry7()
{
     ReefAngel.OverheatClear();
     ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry8()
{
     ReefAngel.SetupCalibratePH();
     ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry9()
{
     ReefAngel.SetupCalibrateSalinity();
     ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}

//--------------------------------------------------------- End Custom Menu -------------------------------------------------------
//*********************************************************************************************************************************
//*********************************************************************************************************************************
//---------------------------------------------Custom Main for PWM Expansion Module------------------------------------------------

void DrawCustomMain()
{
        //Top Banner
        ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 9, 3, "WISEGUYS' REEF", Font8x16);
        ReefAngel.LCD.Clear(DefaultFGColor,3,21,126,21);
       
        // Display T1 Header Text
        ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,10,25,"Tank");
        char text[7];
 
        // Display the T1 Temp Value
        ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
        ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE, 255, 4, 35, text, Font8x16);
 
        // Display the Salinity Header Text
        ReefAngel.LCD.DrawText(COLOR_CRIMSON,255,55,25,"Sal.");
 
        // Display the Salinity Value
        ConvertNumToString(text, ReefAngel.Params.Salinity, 10);
        ReefAngel.LCD.DrawLargeText(COLOR_CRIMSON, 255, 57, 35, text, Font8x16);
       
        // Display pH Header Text
        ReefAngel.LCD.DrawText(COLOR_INDIGO,255,105,25,"pH");
 
        // Display pH Value
        ConvertNumToString(text, ReefAngel.Params.PH, 100);
        ReefAngel.LCD.DrawLargeText(COLOR_INDIGO, 255, 94, 35, text, Font8x16);
         
        //Display Alternate Temp Parameters
        ReefAngel.LCD.DrawText(0,255,8,54,"Sump");
        ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_CORNFLOWERBLUE, 36, 54, 10);

        ReefAngel.LCD.DrawText(0,255,72,54,"Hood");
        ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], COLOR_CORNFLOWERBLUE, 100, 54, 10);

        // Display EcoSmart Mode Value & Speed %     
        ReefAngel.LCD.Clear(DefaultFGColor,3,65,126,65);   
        ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 17, 69, "Ecotech Mode");
        ConvertNumToString(text, vtechspeed, 1);
        if (vtechmode == 0)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,1,80,"Constant -  ", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,121,80,"%", Font8x16);
        }
        else if(vtechmode == 1)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,1,80,"Lagoon -    ", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 2)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,1,80,"Reef Crest -", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 3)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,1,80,"Short Pulse-", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 4)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,1,80,"Long Pulse -", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 5)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,1,80,"Nutrient TM-", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,121,80,"%", Font8x16);
         }
        else if (vtechmode == 6)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,1,80,"Tidal Swell-", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,121,80,"%", Font8x16);
        }
        else if (vtechmode == 9)
        {
          ReefAngel.LCD.DrawLargeText(COLOR_BLACK,255,1,80,"Night -     ", Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_BLACK,255,97,80,text, Font8x16);
          ReefAngel.LCD.DrawLargeText(COLOR_BLACK,255,121,80,"%", Font8x16);
        }

 
        // Display Main Relay Box
        ReefAngel.LCD.Clear(DefaultFGColor,3,99,126,99);
        byte TempRelay = ReefAngel.Relay.RelayData;
        TempRelay &= ReefAngel.Relay.RelayMaskOff;
        TempRelay |= ReefAngel.Relay.RelayMaskOn;
        ReefAngel.LCD.DrawOutletBox(13, 102, TempRelay);

        //Draw Date & Time
        ReefAngel.LCD.Clear(DefaultFGColor,3,116,126,116);
        ReefAngel.LCD.DrawDate(6, 119);
}

void DrawCustomGraph()  // Not Used
{
}
//------------------------------------------------------ End Custom Main ----------------------------------------------------------
//*********************************************************************************************************************************
//-------------------------------------------------------- Begin Setup ------------------------------------------------------------
void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));  //Intialize Custom Menu
   
    vtmode=InternalMemory.RFMode_read();
    vtspeed=InternalMemory.RFSpeed_read();
    vtechmode=InternalMemory.RFMode_read();
    vtechspeed=InternalMemory.RFSpeed_read();
   
    ReefAngel.FeedingModePorts = Port2Bit | Port7Bit | Port6Bit; // Turn off Skimmer, ATO and Close Loop when feeding mode is activated
    ReefAngel.WaterChangePorts = Port2Bit | Port7Bit | Port8Bit; // Turn off Return Pump, Skimmer & ATO when water change mode is actived
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port3Bit;
    ReefAngel.LightsOnPorts = Port1Bit;
    ReefAngel.TempProbe = T1_PROBE; // Use T1 probe as temperature and overheat functions
    ReefAngel.OverheatProbe = T1_PROBE;
    InternalMemory.OverheatTemp_write( 850 ); // Set the Overheat temperature setting

    // Ports that are always on
    ReefAngel.Relay.On(Port4);
    ReefAngel.Relay.On(Port6);
    ReefAngel.Relay.On(Port8);
}
//---------------------------------------------------------- End Setup ------------------------------------------------------------
//*********************************************************************************************************************************
//--------------------------------------------------------- Begin Loop ------------------------------------------------------------
void loop()
{
    // Specific functions
    ReefAngel.Relay.DelayedOn(Port7, 2); // Turn on Port 7 (Skimmer) with 2 minute delay
    ReefAngel.Relay.DelayedOn(Port2, 10); // Turn on Port 2 (Avast ATO) with 10 minute delay
    ReefAngel.StandardLights(Port1,21,0,9,00); //Fuge Light on at night
    ReefAngel.StandardHeater(Port3,790,800); // Standard Heater Using Internal Memory
    ReefAngel.DosingPumpRepeat(Port5,0,360,60); //Turn Schwabble on for 1 minute every 4 hours
     
    // Salinity ATO Drop Function
    if (ReefAngel.Params.PH < 750 || ReefAngel.Params.PH > 850 || ReefAngel.Params.Salinity < 33)
      ReefAngel.Relay.Off(Port2); // If PH or Salinity too low too much fresh water, too high too much Kalk
     
    // Fan Speed Functions
    signed int HoodFanSpeed;
    HoodFanSpeed=map(ReefAngel.Params.Temp[T3_PROBE],750,1000,25,100); // Calculate Hood Fan speed
    HoodFanSpeed=constrain(HoodFanSpeed,0,100);
    ReefAngel.PWM.SetChannel(0,HoodFanSpeed);

    signed int SumpFanSpeed;
    SumpFanSpeed=map(ReefAngel.Params.Temp[T2_PROBE],750,850,25,100); // Calculate Sump Fan speed
    SumpFanSpeed=constrain(SumpFanSpeed,0,100);
    ReefAngel.PWM.SetChannel(1,SumpFanSpeed);
 
    ReefAngel.PWM.SetDaylight(ReefCrestMode(80,20,true));
   
/*
------------------------------------------------ Start Time-of-Day Based Functions ----------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These are the mode numbers for the RF Expansion Module for reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #define Constant      0
    #define Random1       1 // Lagoonal
    #define Random2       2 // Reef Crest
    #define ShortWave     3
    #define LongWave      4
    #define Smart_NTM     5 // Nutrient Transport Mode
    #define Smart_TSM     6 // Tidal Swell Mode
    #define Feeding_Start 7
    #define Feeding_Stop  8
    #define Night         9
    #define Slave_Start   97
    #define Slave_Stop    98
    #define None          99
   
    RF Mode      = http://YOURIPADDRESS:2000/mb855,X
    RF Speed     = http://YOURIPADDRESS:2000/mb856,X
    RF Duration  = http://YOURIPADDRESS:2000/mb857,X
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

//---------------------------------------------- Start RF Control Mode for Daytime, Night and Feeding ---------------------------
  if (hour() >=9  && hour() < 21)
  { 
    if (vtechmode == 9)
    {
      ReefAngel.PWM.SetDaylight(ReefCrestMode(80,20,true));
      ReefAngel.RF.UseMemory=true; 
      vtechmode = InternalMemory.RFMode_read();
      vtechspeed = InternalMemory.RFSpeed_read();
    }
    if (ReefAngel.DisplayedMenu==FEEDING_MODE)
    {
      bFeeding=true;
      ReefAngel.PWM.SetDaylight(50);     
    }
    if (ReefAngel.DisplayedMenu==DEFAULT_MENU && bFeeding)
    {
      bFeeding=false;
      ReefAngel.Timer[1].SetInterval(600); // Timer for 10min
      ReefAngel.Timer[1].Start();
      ReefAngel.RF.UseMemory=false;
      ReefAngel.PWM.SetDaylight(100));
      ReefAngel.RF.SetMode(Smart_NTM,100,6);
      vtechmode = 5;
      vtechspeed = 100;
    }
    if (ReefAngel.DisplayedMenu==DEFAULT_MENU && ReefAngel.Timer[1].IsTriggered())
    {
      ReefAngel.PWM.SetDaylight(ReefCrestMode(80,20,true));
      ReefAngel.RF.UseMemory=true;
      vtechmode = InternalMemory.RFMode_read();
      vtechspeed = InternalMemory.RFSpeed_read();
    }
  }
  else
  {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.PWM.SetDaylight(50));
      ReefAngel.RF.SetMode(Night,15,0);
      vtechmode = 9;
      vtechspeed = 15;
  }
//------------------------------------------------ End RF Control Mode for Daytime, Night and Feeding -----------------------------   

    ReefAngel.Portal("mvwise");
    ReefAngel.ShowInterface();
}
//--------------------------------------------------------------- End Loop --------------------------------------------------------

//*********************************************************************************************************************************
Image

Posts: 12510
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Jul 30, 2013 11:26 am
I think it should work for the feeding and night mode at slower speeds.
It should also work for the reefcrest too, since it is a pretty slow mode.
You just can't make large changes in speed in a short period of time
Roberto.
User avatar
Posts: 48
Joined: Sat Apr 21, 2012 7:44 pm
Location: Burlington, Ontario, Canada
PostPosted: Wed Jul 31, 2013 12:50 pm
For some reason I get no pump flow during feeding mode and the speed does not slow down at night as I would like.

I wonder if it has something to do with me calling the Reef Crest mode at the beginning of the loop at it probably always reverts back top this except when it is in feed mode, where I get nothing. If I leave the function call out of the loop it doesn't seem to work at all.

I know there is new functionality in the libraries that lets me set the speeds through the portal and then possibly override during feed and night mode, would that work better in this scenario?
Image

Posts: 12510
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Jul 31, 2013 1:41 pm
What about the vortech? Is it changing?
Roberto.

Posts: 12510
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Jul 31, 2013 1:46 pm
The first reefcrest you mentioned is actually not doing anything.
It gets overridden by the code that follows it, so you can even remove it.
Roberto.
User avatar
Posts: 48
Joined: Sat Apr 21, 2012 7:44 pm
Location: Burlington, Ontario, Canada
PostPosted: Wed Jul 31, 2013 2:37 pm
Yes the Vortech pumps work fine. I thought I had tried removing the first Reefcrest before, but for some reason I got very little flow. I'll give it a try again and see if anything changes.
Image

Posts: 12510
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Jul 31, 2013 2:39 pm
What does it show on DP when you are on feeding and night mode?
Roberto.
User avatar
Posts: 48
Joined: Sat Apr 21, 2012 7:44 pm
Location: Burlington, Ontario, Canada
PostPosted: Wed Jul 31, 2013 2:55 pm
The DC pump has no flow on feeding mode and stays at ReefCrest 80, 20 during night mode.

I am also having a little trouble with my Vortech pumps. We have two separate tanks with two RA controllers running in the basement. Each RA has the RF module installed and controls the Vortech pumps for each tank. There appears to be an overlap from the RF module as master that sends controls to both sets of pumps. The pumps have a fast alternation between 50% (Reefcrest setting on tank 1) and 100% (reefcrest setting on tank 2). I have gone through the setup twice, using soft and hard resets of all pumps, but seem to run into the problems over and over. Is there any solution to this through the RF modules?
Image
Next

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 5 guests

cron