Water change mode and Vortech

Do you have a question on how to do something.
Ask in here.

Posts: 67
Joined: Sat Jun 30, 2012 9:21 am
PostPosted: Sat Jul 31, 2021 9:52 am
Hi

I am trying to set my mp40s to a constant speed when activating water change mode, it kind of works but it seems like the pumps are trying to run at constant and another mode, ie they run at constant for a moment the a lower speed then ramp up for a second or two the change to some other speed.

Any ideas would be appreciated.

My code:
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 <DCPump.h>
#include <ReefAngel.h>


////// Place global variable code below here
// Globals Needed for RF Mode on Custom Main
byte vtechmode;   
byte vtechspeed;
byte vtechpercent;
boolean bFeeding=false;

byte x = 6;
byte y = 2;
byte t;
char text[7];

//Custom Main, Graph & Menu

void DrawCustomMain()
{
  //      ReefAngel.LCD.DrawDate(6, 2);
  ReefAngel.LCD.DrawText(3,255,6,2," Reef of Low");

  ReefAngel.LCD.DrawDate(7, 120);
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
  pingSerial();

  /*
      ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 90, "--------------------");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 126, "--------------------");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 93, "|");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 103, "|");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 113, "|");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 123, "|");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 93, "|");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 103, "|");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 113, "|");
   ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 123, "|");
   */


  vtechmode=ReefAngel.RF.Mode;
  vtechspeed=ReefAngel.RF.Speed;
  vtechpercent=ReefAngel.RF.Duration;

  ReefAngel.LCD.Clear(255, 35, 20, 20, 85);

  ReefAngel.LCD.DrawText(0,255,18,21,"EcoSmart Mode");
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,25,31,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,31,"Lagoonal");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,31,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,25,31,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,31,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,25,31,"STM_NTM.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,25,31,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,31,"Night");
  //
  char text[10];

  ReefAngel.LCD.DrawText(2,255,32,42,"Speed");
  ConvertNumToString(text, vtechspeed, 1);
  if (vtechspeed )ReefAngel.LCD.DrawLargeText(0,255,35,51,text);

  ReefAngel.LCD.DrawText(23,255,32,62,"Duration");
  ConvertNumToString(text, vtechpercent, 1);
  if (vtechpercent) ReefAngel.LCD.DrawLargeText(0,255,35,70,text);
  //   
  ReefAngel.LCD.DrawText(0,255,10,80,"T1");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 10, 88, text, Num8x8);
  pingSerial();

 ReefAngel.LCD.DrawText(0,255,50,80,"T2");
  ConvertNumToString(text, ReefAngel.Params.Temp[T2_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 50, 88, text, Num8x8);
  pingSerial();
 
  ReefAngel.LCD.DrawText(0,255,100,80,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO, 255, 85, 88, text, Num8x8);
  pingSerial();
  //
  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 100, TempRelay);
  //
}
void DrawCustomGraph()
{
}


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


void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  ReefAngel.SetTemperatureUnit( Celsius );  // set to Celsius Temperature

  // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = Port4Bit; //| Port6Bit | Port7Bit;
  // Ports toggled in Water Change Mode
  // ReefAngel.WaterChangePorts = Port4Bit | Port7Bit;
  // 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( 290 );



 


  // Ports that are always on
  ReefAngel.Relay.On( Port6 );
  ReefAngel.Relay.On( Port7 );
  //    ReefAngel.Relay.On( Port8 );

  ReefAngel.DCPump.FeedingSpeed=100;
 
  ReefAngel.Timer[FEEDING_TIMER].SetInterval(2100);

  //   if (!ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port7); // Turn Skimmer off if Return is off and water level increases in sump
    //    ReefAngel.Relay.Set(Port7,ReefAngel.LowATO.IsActive()); // Turn Skimmer on if Return is on and water level in the sump is norma


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


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

void loop()
{
//  ReefAngel.StandardHeater( Port1,251,261 );
//  ReefAngel.StandardHeater( Port2,251,261 );
  //    ReefAngel.StandardFan( Port3,271,281 );
  //    ReefAngel.StandardLights( Port3,20,0,5,0 );
  //    ReefAngel.StandardLights( Port6,20,0,0,0 );
  ReefAngel.StandardLights( Port4,8,0,20,0 );   //SKIMMER
  ReefAngel.StandardLights( Port5,20,0,8,0 );   //REFUG
  //    ReefAngel.DosingPumpRepeat( Port8,0,180,30);
//  ReefAngel.CO2Control ( Port8,650,670 ); //was 630 - 640
  ReefAngel.DosingPumpRepeat( Port3,0,180,180);
  ////
  ReefAngel.RF.UseMemory = false;
  ///////
  //    ReefAngel.RF.SetMode(Constant,80,5);
  //    ReefAngel.RF.SetMode(Random2,50,5);
  //    ReefAngel.RF.SetMode(Smart_NTM,50,10);
  //    ReefAngel.RF.SetMode(Smart_NTM,60,8);
  //    ReefAngel.RF.SetMode(Custom,30,0); //Custom Mode Sync
  //    ReefAngel.RF.SetMode(Custom,50,1); //Custom Mode Anti-Sync
  //    ReefAngel.RF.SetMode(Custom,50,2); //Custome Mode Back of tank


///////    ATTEMPT TO CHANGE MODE @ TIMES
  if ( ReefAngel.RF.Mode != Feeding_Start)

  if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) ReefAngel.RF.SetMode(Constant,80,5);

    if (hour()==10)
      ReefAngel.RF.SetMode(ReefCrest,30,2);
  //
    else if (hour()>=0 && hour()<1)
      ReefAngel.RF.SetMode(ReefCrest,30,1);           

    else if (hour()>=1 && hour()<2)
      ReefAngel.RF.SetMode(ReefCrest,40,3);           

    else if (hour()>=2 && hour()<3)
      ReefAngel.RF.SetMode(ReefCrest,60,2);           

    else if (hour()>=3 && hour()<4)
      ReefAngel.RF.SetMode(ReefCrest,40,3);                     

    else if (hour()>=4 && hour()<5)
      ReefAngel.RF.SetMode(ReefCrest,30,2);

    else if (hour()>=5 && hour()<6)
      ReefAngel.RF.SetMode(ReefCrest,20,1);           

    else if (hour()>=6 && hour()<7)
      ReefAngel.RF.SetMode(LongPulse,60,10);                     

    else if (hour()>=7 && hour()<8)
      ReefAngel.RF.SetMode(Lagoon,40,3);                     

    else if (hour()>=8 && hour()<9)
      ReefAngel.RF.SetMode(Lagoon,50,4);                     

     else if (hour()>=9 && hour()<10)
      ReefAngel.RF.SetMode(Lagoon,60,7);

    else if (hour()>=10 && hour()<11)
      ReefAngel.RF.SetMode(Lagoon,50,6);

    else if (hour()>=11 && hour()<12)
      ReefAngel.RF.SetMode(Lagoon,40,2);

   else if (hour()>=12 && hour()<13)
      ReefAngel.RF.SetMode(Constant,60,4);

    else if (hour()>=13 && hour()<14)
      ReefAngel.RF.SetMode(Lagoon,20,3);

   else if (hour()>=14 && hour()<15)
     ReefAngel.RF.SetMode(Lagoon,60,4);

    else if (hour()>=15 && hour()<16)
      ReefAngel.RF.SetMode(LongPulse,50,15);

    else if (hour()>=16 && hour()<17)
      ReefAngel.RF.SetMode(Lagoon,50,5);

    else if (hour()>=17 && hour()<18)
      ReefAngel.RF.SetMode(Lagoon,40,6);           

    else if (hour()>=18 && hour()<19)
      ReefAngel.RF.SetMode(Smart_NTM,40,20);

    else if (hour()>=19 && hour()<20)
      ReefAngel.RF.SetMode(Smart_NTM,60,15);                       

    else if (hour()>=20 && hour()<21)
      ReefAngel.RF.SetMode(Constant,70,4);   

    else if (hour()>=21 && hour()<22)
      ReefAngel.RF.SetMode(Lagoon,60,5);

    else if (hour()>=22 && hour()<23)
      ReefAngel.RF.SetMode(Lagoon,40,10);

    else if (hour()>=23 && hour()<0)
      ReefAngel.RF.SetMode(Lagoon,10,5);           
  //
    else
      ReefAngel.RF.SetMode(ReefCrest,40,20);

  ////// Place your custom code below here

  //    ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 60% +/- 20% on sync mode
  //    ReefAngel.PWM.SetDaylight( NutrientTransportMode(80,100,10,true) );

//  if (hour()>=8 && hour()<10)
//    ReefAngel.PWM.SetDaylight( LongPulseMode(0,40,10,true) ); // Long pulse at 40% with 10s pulse on sync mode

//    else if (hour()>=10 && hour()<16)
//    ReefAngel.PWM.SetDaylight( NutrientTransportMode(75,90,2000,true) ); // Nutrient Transport on sync mode

//    else if (hour()>=16 && hour()<17)
//    ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 75% + - 20 on sync mode

//    else if (hour()>=17 && hour()<20)
//    ReefAngel.PWM.SetDaylight( LongPulseMode(0,60,4,true) );
  //  ReefAngel.PWM.SetDaylight( NutrientTransportMode(75,90,2000,true) ); // Nutrient Transport on sync mode


//    else if (hour()>=20 && hour()<24)
//    ReefAngel.PWM.SetDaylight( TidalSwellMode(60,true) ); // Tidal Swell at 60% on sync mode

//    else
//    ReefAngel.PWM.SetDaylight( LongPulseMode(0,40,10,true) ); // Long pulse at 40% with 10s pulse on sync mode



    ////// Place your custom code above here
Image

Posts: 12797
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Aug 04, 2021 2:15 pm
Try moving this:
Code: Select all
  if ( ReefAngel.RF.Mode != Feeding_Start)

    if (ReefAngel.DisplayedMenu == WATERCHANGE_MODE) ReefAngel.RF.SetMode(Constant, 80, 5);

To the end of the code as the last check.
Roberto.

Posts: 67
Joined: Sat Jun 30, 2012 9:21 am
PostPosted: Fri Aug 06, 2021 6:15 am
Hi Roberto,

I tried what you suggested and it still does it, it definatley sounds like the MP's are trying to run both the waterchange (Constant) and the tech mode thats set based on the time the water change mode is activated.

Code: Select all
///////    CHANGE Vortech MODE @ TIMES

//    if ( ReefAngel.RF.Mode != Feeding_Start)

    if (hour()==10)
      ReefAngel.RF.SetMode(ReefCrest,40,3);
  //
    else if (hour()>=0 && hour()<1)
      ReefAngel.RF.SetMode(ReefCrest,30,1);           

    else if (hour()>=1 && hour()<2)
      ReefAngel.RF.SetMode(ReefCrest,40,3);           

    else if (hour()>=2 && hour()<3)
      ReefAngel.RF.SetMode(ReefCrest,60,2);           

    else if (hour()>=3 && hour()<4)
      ReefAngel.RF.SetMode(ReefCrest,40,3);                     

    else if (hour()>=4 && hour()<5)
      ReefAngel.RF.SetMode(ReefCrest,30,2);

    else if (hour()>=5 && hour()<6)
      ReefAngel.RF.SetMode(ReefCrest,20,1);           

    else if (hour()>=6 && hour()<7)
      ReefAngel.RF.SetMode(LongPulse,60,10);                     

    else if (hour()>=7 && hour()<8)
      ReefAngel.RF.SetMode(Lagoon,40,3);                     

    else if (hour()>=8 && hour()<9)
      ReefAngel.RF.SetMode(Lagoon,50,4);                     

     else if (hour()>=9 && hour()<10)
      ReefAngel.RF.SetMode(Lagoon,60,7);

    else if (hour()>=10 && hour()<11)
      ReefAngel.RF.SetMode(Lagoon,50,6);

    else if (hour()>=11 && hour()<12)
      ReefAngel.RF.SetMode(Lagoon,40,2);

   else if (hour()>=12 && hour()<13)
      ReefAngel.RF.SetMode(Constant,60,4);

    else if (hour()>=13 && hour()<14)
      ReefAngel.RF.SetMode(Lagoon,50,3);

   else if (hour()>=14 && hour()<15)
     ReefAngel.RF.SetMode(Lagoon,60,4);

    else if (hour()>=15 && hour()<16)
     ReefAngel.RF.SetMode(LongPulse,50,15);

    else if (hour()>=16 && hour()<17)
      ReefAngel.RF.SetMode(Lagoon,50,5);

    else if (hour()>=17 && hour()<18)
      ReefAngel.RF.SetMode(Lagoon,40,6);           

    else if (hour()>=18 && hour()<19)
      ReefAngel.RF.SetMode(Smart_NTM,40,20);

    else if (hour()>=19 && hour()<20)
      ReefAngel.RF.SetMode(Smart_NTM,60,15);                       

    else if (hour()>=20 && hour()<21)
      ReefAngel.RF.SetMode(Constant,70,4);   

    else if (hour()>=21 && hour()<22)
      ReefAngel.RF.SetMode(Lagoon,60,5);

    else if (hour()>=22 && hour()<23)
      ReefAngel.RF.SetMode(Lagoon,40,10);

    else if (hour()>=23 && hour()<0)
      ReefAngel.RF.SetMode(Lagoon,10,5);           

if ( ReefAngel.RF.Mode != Feeding_Start)

if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) ReefAngel.RF.SetMode(Constant,80,5);

    else
      ReefAngel.RF.SetMode(ReefCrest,40,3);

Image

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 5 guests