Page 1 of 1

Feeding mode and Jeboa

Posted: Mon Sep 16, 2013 3:42 pm
by Sebyte
In another post Inevo wrote
If you want you can define the speed for Water Change and Feeding Modes...

ReefAngel.DCPump.FeedingSpeed=10;
ReefAngel.DCPump.WaterChangeSpeed=0;

I have been using the ATOPinLow port and memory settings via the Portal to control my Jeboa WP25 for some time, but have found that during feeding mode the pump stops. What I would like is for it to continue running at a lower speed.

I have tried adding ReefAngel.DCPump.FeedingSpeed=10; to my code, but the pump still did not operate during the feed mode. I have tried a number of values up to 50 with the same result.

I am not sure if the ReefAngel.DCPump.FeedingSpeed should or will work with the ATOPinLow port or not. if it should do, then do I have the command in the right place in my code.

Any suggestions please.

My INO

Code: Select all

// Created using Wizard 14/09/2013

// DC pump set to use ATOPinLow



#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
    
    InternalMemory.LCDID_write(0); // new LCD screen
    ReefAngel.Init(); //Initialize controller
    
    // Ports toggled in Feeding Mode
    
    ReefAngel.FeedingModePorts = Port1Bit | Port6Bit;
    
    // Ports toggled in Water Change Mode
    
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port6Bit | Port7Bit | Port8Bit;
    
    // Ports toggled when Lights On / Off menu entry selected
    
    ReefAngel.LightsOnPorts = 0;
    
    // Ports turned off when Overheat temperature exceeded
    
    ReefAngel.OverheatShutoffPorts = Port3Bit;
    
    // Use T1 probe as temperature and overheat functions
    
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;

    // Feeeding and Water Change mode speed
    
    ReefAngel.DCPump.FeedingSpeed=50;
    ReefAngel.DCPump.WaterChangeSpeed=0;


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

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

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

void loop()
{
   // ReefAngel.StandardATO( Port2 );
    ReefAngel.StandardHeater( Port3 );
    ReefAngel.DosingPumpRepeat1( Port7 );
    ReefAngel.DosingPumpRepeat2( Port8 );
    ReefAngel.PWM.DaylightPWMParabola();
    ReefAngel.PWM.ActinicPWMParabola();
  
    ReefAngel.DCPump.UseMemory = true;
    
    ReefAngel.DCPump.LowATOChannel = Sync ; // Jebo connected to AtoPINLow
   
   
   // Waterlevel code changed 20/04/13 to stop quick cycle of ATO pump

byte l = ReefAngel.WaterLevel.GetLevel();
  if (l>85) ReefAngel.Relay.Off(Port2);
  if (l<82 && l>0) ReefAngel.Relay.On(Port2);

  if (now()%20<10)
      
   // 

 // Delay turning Skimmer back on 
    ReefAngel.Relay.DelayedOn( Port1,60 );
   
   
    ////// Place your custom code below here
    
     //********************************************************************************************************************************
  // Activate Watch Dog Timer at 6am and 6pm 

  if ((now()%86400)==21600) delay(1000);

  if ((now()%86400)==43200) delay(1000);

// Wavemaker not available 9 pm to 10 am

  if ( (hour() >= 20) || (hour() <= 9) ) 
  {

    ReefAngel.DCPump.Mode==Custom;

  }


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

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Water Level
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,66, "WL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,66, ReefAngel.WaterLevel.GetLevel() );
    pingSerial();

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

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

void DrawCustomGraph()
{
}


Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 9:36 am
by Sacohen
I have my WP-40 and 25 on the dimming ports, not the ATO port, but my 40 will run at 20% fine, anything lower than that it will stop.

My 25 will not go below 30% before it stops.

Apparently the pumps don't like to go to slow for too long,it can dip below 30% during a variable swing, but if it stays there too long it will stop.

I wouldn't think the the ATO port would behave any differently, but you never know.

Sorry I couldn't be more help.

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 9:44 am
by lnevo
I think your issue is that the pumps are not made to go that low and stall out. Try raising the speed until you get a stable behavior.

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 10:05 am
by Sacohen
He said he took it up to 50%. It should have not problem running at 50%, the stock controller will take it that low.

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 10:24 am
by lnevo
I'm not sure then... the ATO port is only 5V vs the other ports are 0-10V, but not sure if the jaebo cable does anything differently. It might be an affect of that....

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 1:43 pm
by Sebyte
Thank you both for your comments. I had read that they don't like too low a speed, that's why I ranged up to 50%. Could you please take a look at my code to see if the feed mode statement is in the right section of code.

Failing that I might try hard coding all of the wave modes as Paul911 (I think that's who I looking at) is working on with Inevo.

Thanks again.

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 1:54 pm
by Sacohen
How difficult would it be to connect the Jebao to one of the dimming ports?
That way we can see if it is the port or the pump.

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 3:26 pm
by lnevo
The code is fine. Your using the built in methods to set the feeding mode speed so if there are any issues its roberto's fault ;)

Anyway, i know you went to 50. Can you continue trying in 5% increments to see where it stops getting stuck? If it does not come back even at higher I'd say there was an issue

If it comes back on around 65+ then it may be because the reduced voltage of the ato port.

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 5:40 pm
by Sebyte
I increased the setting by 5% from 50 right up to 100%, and the Jeboa was stopped every time I entered feeding mode.

So I then commented out the line of code, and the pump was stopped again during feeding.

I must say that I did not check to see if the pump was functioning prior to adding the feedmode code, so I am now thinking that the problem is with the DCpump library and the ReefAngel.DCPump.LowATOChannel=Sync function.

I guess it is possible that I am the only person so far that is using the ATOPinLow and needs it to run at a reduced speed or at all during feeding.

The reason I like some water movement is that I turn off the closed loop during feeding. I may not have noticed it was not running before because I had a small Koreli wave-maker as well as the WP-25 in the tank. I took the Koreli a few days ago when I changed the code, and that clearly was giving some water movement.

If there is a solution it would be great :D

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 5:58 pm
by lnevo
I'll have to check the code in the libraries...maybe i missed the feeding mode section...

Re: Feeding mode and Jeboa

Posted: Tue Sep 17, 2013 6:10 pm
by Sebyte
Many thanks.

Re: Feeding mode and Jeboa

Posted: Fri Sep 20, 2013 9:11 am
by Sebyte
Over the last couple of days I have tried a number of things to isolate why the lowATOPin does not provide an output when in feeding mode.

As well as using the internal memory I have hard coded the lowATOPin using the example provided by Oscarinw http://forum.reefangel.com/viewtopic.ph ... on+the+ato

In all cases there is no output during feeding mode. I even commented out all references to the feeding mode in the ReefAngel.cpp file, but this did not change the situation.

I have also read through all the Library .cpp & .h files to see if I could find any obvious connection between the feeding mode and lowATOpin. I must confess I am not an expert in coding but can find my way around scripts. I did not see anything obvious.

However I wonder if there is something in one of the libraries causing the OneWire library functions to turn the pin off?

Because the pin does not have an output during the feed mode I feel convinced that there is something in the libraries that is causing the problem.

I would be grateful if anyone with the skills to understand the interaction of the library files could take a look at this and please advise me on how I can work around it.

Many thanks.

Re: Feeding mode and Jeboa

Posted: Fri Sep 20, 2013 9:34 am
by rimai
I'm looking at the lnevo's code and I see the code for feeding in there.
The easiest way to make it work for now is doing this:

Code: Select all

if (ReefAngel.DisplayedMenu==FEEDING_MODE)
{
pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,2.55*ReefAngel.DCPump.FeedingSpeed);
}

Re: Feeding mode and Jeboa

Posted: Fri Sep 20, 2013 9:53 am
by Sebyte
Thank Roberto for looking at the problem.

I had already tried the same approach as you without success. But to be on the safe side I have just pasted your code into my INO and I am afraid it did not result in the pump being on during feeding mode.

I may be a long way off but I seems to me that there is an issue with pinMode preventing an output signal.

Thanks again.

Re: Feeding mode and Jeboa

Posted: Fri Sep 20, 2013 9:59 am
by rimai
Humm...
I'll have to try on an actual controller later to see what I can find out then.

Re: Feeding mode and Jeboa

Posted: Wed Sep 25, 2013 4:15 pm
by Sebyte
Hi Roberto,

Have you had a chance to look at. This yet?

Regards

Re: Feeding mode and Jeboa

Posted: Wed Sep 25, 2013 4:28 pm
by rimai
I loaded into a controller and measured the voltage and it is outputting the correct voltage.
Did you measure the voltage?

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 6:19 am
by ganjero
For me this works

Code: Select all

if (ReefAngel.DisplayedMenu==FEEDING_MODE)
{
analogWrite(lowATOPin,45*2.55);
}
I used an actual number but it should work if I define and use "DCPump.FeedingSpeed"

I only have this command "pinMode(lowATOPin,OUTPUT)" once in the code but you are using Lee's DCPump library to tell the controller how to use the ATO port, I'm not sure if that make a difference.

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 11:31 am
by Sebyte
Roberto said
I loaded into a controller and measured the voltage and it is outputting the correct voltage.
Did you measure the voltage?
I have tested the voltages and this is what I found that there was an output during the feeding mode from the controller but still no output from the board, although it works fine in reef mode etc.

I tested with various speed setting values. The results were the same both direct on the ATOpinLow of the controller and at input pins on interface board.

ReefAngel.DCPump.FeedingSpeed=50; ( 2.3v)

ReefAngel.DCPump.FeedingSpeed=70; (3.07v)

ReefAngel.DCPump.FeedingSpeed=100; (4.76v)

However the pump still did not spin!

So I repeated the test on the following pins of the interface board.

Ground to Signal (the same as above for the various speeds.)

Ground to pin 24v was zero volts on every test.

I even tried increasing the speed value above 100 but found that the voltage decreased e.g. Speed 140 gave a voltage of 1.76.

It would seem from the above that the problem lies in the interface board, do you have any ideas?

Regards

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 12:04 pm
by rimai
Huh?
GND to 24V should yield 24V no matter what.
Do you get 24V when not in feeding mode?

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 12:07 pm
by Sebyte
Yes, 24v

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 12:36 pm
by rimai
Do you have the pump power supply connected to a feeding mode port?

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 12:59 pm
by Sebyte
No it is in a standard wall outlet. My RA+ is in the sump room in the basement and I have spliced a CAT5 cable into ATO/PWM line to extend the feed up to the tank on the first floor. There is no voltage drop as the output at the ATO port is the same voltage on the other end of the cable at the board.

I am at a loss as to why the 24v is shut off as the signal voltage of 4.7v is as high, if not higher than the applied voltage during the Reef mode or any of the other modes I have tried via the portal. Looking at the circuit for the interface board there are no logic IC's to pull the voltage down, the resistor R1 and the capacitor should not do so either.

Is there a polarity on the ATO output and if it were reversed could it pull the signal down?

I made sure that when I spliced in the CAT5 the polarity of the cable remained intact. Could it have been reversed accidentally when the board was assembled?

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 1:05 pm
by rimai
No, if it was reversed, you would get negative voltages when you were measuring it.
I also highly doubt that 24V would go down to zero.... It's hard to believe. The power supply is a hefty one and if it was brought down to 0, you would see sparks and other crap going on.
I just can't see where the problem is though :(

Re: Feeding mode and Jeboa

Posted: Thu Sep 26, 2013 2:20 pm
by Sebyte
Roberto,

I think I would have noticed sparks and smoke, :lol:

I am mystified as well, but will continue to play around and if I come up with a solution I will let you know. Failing finding a solution I will revert from using internal memory and go back to hard code again.

Than you for taking the time to look at this.

Regards