DC pump shutting down

Do you have a question on how to do something.
Ask in here.
Post Reply
Sleepingtiger
Posts: 32
Joined: Fri Aug 30, 2013 3:50 pm

DC pump shutting down

Post by Sleepingtiger »

The pumps do not run. The only time it runs is after feeding mode when the NTM is enabled. I got this code off another member from the forum. Can someone tell me what i did wrong. BTW, according to the display, the DP and AP has numbers next to it. I guess it means that it should be running. I am really new to this. thanks for the help
Attachments
sketch_sep22a.ino
(5.51 KiB) Downloaded 303 times
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: DC pump shutting down

Post by rimai »

I think there was an error in the if statement.
Try this:

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
  ReefAngel.AddStandardMenu();  // Add Standard Menu

    // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = 0;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = Port1Bit;
  // Ports toggled when Lights On / Off menu entry selected
  ReefAngel.LightsOnPorts = 0;
  // Ports turned off when Overheat temperature exceeded
  ReefAngel.OverheatShutoffPorts = Port1Bit;
  // Use T1 probe as temperature and overheat functions
  ReefAngel.TempProbe = T1_PROBE;
  ReefAngel.OverheatProbe = T1_PROBE;
  // Set the Overheat temperature setting
  InternalMemory.OverheatTemp_write( 840 );

  // Feeeding and Water Change mode speed
  ReefAngel.DCPump.FeedingSpeed=5;
  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,790,808 );
  ReefAngel.StandardFan( Port2,810,820 );
  ReefAngel.DosingPumpRepeat( Port3,10,120,1 );
  ReefAngel.DosingPumpRepeat( Port4,3,120,1 );
  ReefAngel.StandardLights( Port7,12,0,23,30 );
  ReefAngel.StandardLights( Port8,12,0,23,30 );
  ReefAngel.PWM.SetChannel( 0, PWMParabola(10,30,22,45,0,85,0) );
  ReefAngel.PWM.SetChannel( 1, PWMParabola(10,30,22,30,0,85,0) );
  ReefAngel.PWM.SetChannel( 2, PWMParabola(11,0,22,15,0,85,0) );
  ReefAngel.PWM.SetChannel( 3, PWMParabola(11,30,21,50,0,90,0) );
  ReefAngel.DCPump.UseMemory = false;
  ReefAngel.DCPump.DaylightChannel = Sync;
  ReefAngel.DCPump.ActinicChannel = AntiSync;
  ReefAngel.DCPump.ExpansionChannel[0] = None;
  ReefAngel.DCPump.ExpansionChannel[1] = None;
  ReefAngel.DCPump.ExpansionChannel[2] = None;
  ReefAngel.DCPump.ExpansionChannel[3] = None;
  ReefAngel.DCPump.ExpansionChannel[4] = None;
  ReefAngel.DCPump.ExpansionChannel[5] = None;
  ////// Place your custom code below here

    // Schedule for WP40 #1 and #2  
  if (hour()<8) // WP40 #1 and #2 at 30% from 12am-8am
  {
    ReefAngel.DCPump.SetMode( Lagoon,30,10 );
  }
  if (hour()>=8 && hour()<11) // WP40 #1 and #2 at 50% in Lagoon mode from 8am-11am
  {
    ReefAngel.DCPump.SetMode( Lagoon,50,10 );
  }
  if (hour()>=11 && hour()<20) // WP40 #1 and #2 at 60% in Reef Crest mode from 11am-10pm
  { 
    ReefAngel.DCPump.SetMode( ReefCrest,65,20 );
  }
  if (hour()>=20 && hour()<21) // WP40 #1 and #2 at 50% in Lagoon mode from 10pm-11pm
  {
    ReefAngel.DCPump.SetMode( Lagoon,50,10 );
  }
  if (hour()>=21) // WP40 #1 and #2 at 30% 11pm-12am
  {
    ReefAngel.DCPump.SetMode( Lagoon,30,10 );
  }

  // Run Nutrient Transport Mode after Feeding Mode completes
  static unsigned long feeding;
  if (ReefAngel.DisplayedMenu==FEEDING_MODE)
  {
    feeding = now();
    ReefAngel.DCPump.SetMode( Constant,10,10 ); // Set WP40 #1 and #2 to 10% speed 
  }
  else 
  {
    if (now()-feeding<=30) // Next 30 seconds are in Nutrient Transport Mode(for testing)
    { 
      ReefAngel.DCPump.SetMode( NutrientTransport,70,30 ); // Set WP40 #1 and #2 to 70% speed with 30ms pulse in Nutirnet Transport Mode
    }
  }

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

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

void DrawCustomMain()
{
  int x,y;
  char text[10];
  // Dimming Expansion
  x = 15;
  y = 2;
  for ( int a=0;a<6;a++ )
  {
    if ( a>2 ) x = 75;
    if ( a==3 ) y = 2;
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
    y += 10;
  }
  pingSerial();

  // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor( 15, 39, ReefAngel.Params,
  ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor( 15, 39, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
  pingSerial();

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

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

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

void DrawCustomGraph()
{
}

Roberto.
Sleepingtiger
Posts: 32
Joined: Fri Aug 30, 2013 3:50 pm

Re: DC pump shutting down

Post by Sleepingtiger »

I uploaded the new code. The wp40 works fine in reefcrest, when it goes to lagoon, it shuts down the pump. The DP and AP still has a percentage next to it.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: DC pump shutting down

Post by rimai »

That may be the pump.
I'm pretty sure they shut down when you go below around 25%
Roberto.
Sleepingtiger
Posts: 32
Joined: Fri Aug 30, 2013 3:50 pm

Re: DC pump shutting down

Post by Sleepingtiger »

i think you're partially correct. when on lagoon mode and i set the power to 50%, the wp40 does not work. I raised it to 55% and its been working great. so now I got a problem, the wp40 is to powerful at night. during the daytime its fine, but at night i would prefer the water to be a bit calmer. do you think there is a way i can turn off one of the pump at night? i know i can probably put one of the wp40 on the power bar and set a timer, but that doesn't sound as cool. or maybe have the two pumps alternate at a set interval. thanks
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: DC pump shutting down

Post by rimai »

You can set them to constant 30% instead of lagoon.
Roberto.
Sleepingtiger
Posts: 32
Joined: Fri Aug 30, 2013 3:50 pm

Re: DC pump shutting down

Post by Sleepingtiger »

i really don't like the idea of constant... makes me feel like i got a koralia instead of a dc pump. so i guess there is no way to shut down one of the pumps without taking out the power?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: DC pump shutting down

Post by rimai »

There is, but not if you are using the DCPump class.
You would need to refactor the code to use the channels directly instead.
http://forum.reefangel.com/viewtopic.php?f=14&t=2895
Roberto.
Post Reply