Expansion relay trouble

Expansion modules and attachments
Post Reply
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Expansion relay trouble

Post by joshlawless »

My expansion relay box keeps briefly powering off all the attached devices.

At first, it was so rare that I couldn't track down what I was experiencing -- I heard the click of one or more relays firing at the same time, but nothing seemed to happen in the tank. I figured it must be heaters (although the temperatures weren't right to toggle heater statuses, unless the temp probes were acting up). Eventually, it became more frequent, and the duration of the power cycle was long enough that the attached devices that were in the powered-on state reacted noticeably: the FlowWolf diverter rebooted its controller, the Waveline closed loop pump (with its own controller, not attached to a dimming channel) ramped up from 0, and the Jebao return pumps (attached to the PWM actinic and daylight dimming channels) could be heard to briefly pause (for maybe half a second).

I tried removing the WiFi module, having read that suggestion somewhere else. No dice.

I checked the VGA cable was seated properly (as deep as possible, since the screws on the cable do not fit into the nuts on the relay box or the expansion module), and it is as deep as it goes.

I checked the USB connections between the main relay box, the expansion hub, and the relay expansion module, and all are fine.

I haven't made any code changes that should be firing those particular relays (they're all set to be permanently on).

The only recent changes have been to hook up (some of) my lights to the custom 16 channel boards, but I think I've finally got that code sorted so that it no longer overdoes pushing updates.

But as I've typed this post over the last minute or two, the power to those devices has cycled three times. Which is bound to eventually kill my FlowWolf controller (and trust me, you don't want to deal with their RMA process).

Could my relay box be bad?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Expansion relay trouble

Post by rimai »

I don't think it is the relay box.
It is something on the bus and I wonder if it is the dimming module.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

I did try removing the expansion hub and connecting the expansion relay module directly to the first relay box, but the issue still persisted with that setup.

I didn't try that hardware arrangement with a different code, so the controller was still trying to send signals to the 16-channel dimming module, but I can't see how that would be an issue (given the hard-coding of the I2C address in my code).
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

Is it possible that something could be funky with the head unit? I'm just recollecting this issue http://forum.reefangel.com/viewtopic.php?f=2&t=5361 and thinking maybe there's something quirky about my unit?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Expansion relay trouble

Post by rimai »

Ok, why don't you use a basic code from the wizard and see if that changes anything.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

I'll try tonight when I get home.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

I hooked up a 60W lamp to one of the outlets on my expansion box last night, and uploaded some basic wizard code that just used the always-on functions to give power to what I needed. About twenty minutes in, the lamp flicked off and on. I didn't have time to re-run the test with the relay expansion module hooked directly to the first relay box (bypassing the expansion hub), but I will try to do so tonight.

It looks like some of my other modules occasionally lose their connections to the bus, too. Today I left the tank running with simplified lighting code (no forced updates, just the CRC to push only changed values to the 16 channel board). Around 10:30, the lights were off, and required a power cycle to the system to get them back on (because the controller wouldn't push an update to the lights without a change in value, power cycling just the expansion board wouldn't do the trick).

Checking my web chart, I see that some of my other modules are occasionally misbehaving:
Image

The salinity probe, when unplugged, returns a value of 6.0. The ORP probe returns a value of 0, hence the missing data point from the chart. The water level probe similarly returns a value of 0, and is absent from its chart, too. So when I check my portal values, occasionally I'll see correct values for Temps 1-3 and pH (plugged into the head unit), but missing data from the expansion module probes (WL, SAL and ORP).

Do you think this might be connected to the behavior of the expansion relay box?
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

Curiously, on the head unit page displaying the DC pump status, the DC pump mode is rapidly flashing (blinking, really), the words "Air Pump".

https://dl.dropboxusercontent.com/u/230 ... 9%20PM.mov
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Expansion relay trouble

Post by rimai »

I think those custom labels are messing up with something there.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

But this (weird display of DC Pump mode) persists with the following cleaned-up code, that I'm using for test purposes, which doesn't have the custom labels:

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


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

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

void setup()
{
    ReefAngel.Init();                                
    ReefAngel.Use2014Screen();                       
    ReefAngel.AddSalinityExpansion();                
    ReefAngel.AddORPExpansion();                     
    ReefAngel.AddWaterLevelExpansion();              
    ReefAngel.Add16ChPWM();                          

    ReefAngel.FeedingModePorts = 0;                  
    ReefAngel.FeedingModePortsE[0] = Port4Bit;      

    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit;
    ReefAngel.WaterChangePortsE[0] = Port4Bit; 

    ReefAngel.LightsOnPorts = 0;           
    ReefAngel.LightsOnPortsE[0] = 0;       

    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit;   
    ReefAngel.OverheatShutoffPortsE[0] = 0; 

    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;

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

    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port6 );
    ReefAngel.Relay.On( Box1_Port1 );
    ReefAngel.Relay.On( Box1_Port2 );
    ReefAngel.Relay.On( Box1_Port5 );
    ReefAngel.Relay.On( Box1_Port6 );

    ReefAngel.CustomVar[0] = 64;
    ReefAngel.CustomVar[1] = 64;
    ReefAngel.CustomVar[2] = 48;
    ReefAngel.CustomVar[3] = 32;
    ReefAngel.CustomVar[4] = 24;
    ReefAngel.CustomVar[5] = 32;
    ReefAngel.CustomVar[6] = 24;
    ReefAngel.CustomVar[7] = 16;
}

void loop()
{

  if ( ReefAngel.Params.Temp[T1_PROBE] < 775 ) ReefAngel.Relay.On( Port1 );
  if ( ReefAngel.Params.Temp[T1_PROBE] > 780 ) ReefAngel.Relay.Off( Port1 );
  if ( ReefAngel.Params.Temp[T2_PROBE] < 775 ) ReefAngel.Relay.On( Port2 );
  if ( ReefAngel.Params.Temp[T2_PROBE] > 780 ) ReefAngel.Relay.Off( Port2 );
  if ( ReefAngel.Params.Temp[T3_PROBE] < 775 ) ReefAngel.Relay.On( Box1_Port7 );
  if ( ReefAngel.Params.Temp[T3_PROBE] > 780 ) ReefAngel.Relay.Off( Box1_Port7 );
                                                                        
  ReefAngel.Relay.DelayedOn( Port3 );                                  
  if ( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.Relay.Off( Port3 );
  if ( !ReefAngel.HighATO.IsActive() ) ReefAngel.Relay.Override( Port3, 0 ); // skimmate full

  ReefAngel.MoonLights( Port7 );  //refugium light

  ReefAngel.PWM.Set16ChannelRaw( 0, ReefAngel.CustomVar[0]*16 );
  ReefAngel.PWM.Set16ChannelRaw( 1, ReefAngel.CustomVar[1]*16 );
  ReefAngel.PWM.Set16ChannelRaw( 2, ReefAngel.CustomVar[2]*16 );
  ReefAngel.PWM.Set16ChannelRaw( 3, ReefAngel.CustomVar[3]*16 );
  ReefAngel.PWM.Set16ChannelRaw( 4, ReefAngel.CustomVar[4]*16 );
  ReefAngel.PWM.Set16ChannelRaw( 5, ReefAngel.CustomVar[5]*16 );
  ReefAngel.PWM.Set16ChannelRaw( 6, ReefAngel.CustomVar[6]*16 );
  ReefAngel.PWM.Set16ChannelRaw( 7, ReefAngel.CustomVar[7]*16 );
  
  ReefAngel.DCPump.UseMemory = false;
  ReefAngel.DCPump.Threshold = 70;   
  ReefAngel.DCPump.SetMode( Sine, 100, 240 );
  ReefAngel.DCPump.DaylightChannel = Sync; 
  ReefAngel.DCPump.ActinicChannel = AntiSync;

  if ( ReefAngel.Params.ORP>450 || ReefAngel.Params.ORP==0 ) ReefAngel.Relay.Off( Port8 );
  if ( ReefAngel.Params.ORP<400 && ReefAngel.Params.ORP>0 ) ReefAngel.Relay.On( Port8 );
                                                                                  
  ReefAngel.Portal( "joshlawless" );
  ReefAngel.DDNS( "reef" );         
  ReefAngel.ShowInterface();        
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Expansion relay trouble

Post by rimai »

I think you just found a bug with this sine mode.
It works fine with constant.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

Missing string entry from the ReefAngel_1.5_LCD?

Code: Select all

	String PUMP_MODES[] = {"Constant","Lagoon","ReefCrest","Short Pulse","Long Pulse","Nutrient Trans.","Tidal Swell","Feeding","","Night","Custom"};
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Expansion relay trouble

Post by rimai »

You got it :)
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

So, as I start with the Wizard code, and monitor my 60W lamp for misbehavior (debugging an intermittent problem is a huge pain -- wish I had one of these power outage alarms to plug into the relay expansion box), I notice one line missing from my code that's in the Wizard code. Not sure how it got dropped from my code (which was based on wizard code).

Is this line:

Code: Select all

    ReefAngel.AddStandardMenu();  // Add Standard Menu
important / causing problems because it's missing?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Expansion relay trouble

Post by binder »

rimai wrote:I think you just found a bug with this sine mode.
It works fine with constant.
i have fixed those issues with the libraries (or at least i think i fixed these..it has been a little while since i did) they are in a pull request on github. i have not merged them though...i was waiting for you to double check before committing the merge.


Sent from my iPad mini
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

joshlawless wrote:I hooked up a 60W lamp to one of the outlets on my expansion box last night, and uploaded some basic wizard code that just used the always-on functions to give power to what I needed. About twenty minutes in, the lamp flicked off and on. I didn't have time to re-run the test with the relay expansion module hooked directly to the first relay box (bypassing the expansion hub), but I will try to do so tonight.

It looks like some of my other modules occasionally lose their connections to the bus, too. Today I left the tank running with simplified lighting code (no forced updates, just the CRC to push only changed values to the 16 channel board). Around 10:30, the lights were off, and required a power cycle to the system to get them back on (because the controller wouldn't push an update to the lights without a change in value, power cycling just the expansion board wouldn't do the trick).

Checking my web chart, I see that some of my other modules are occasionally misbehaving:
Image

The salinity probe, when unplugged, returns a value of 6.0. The ORP probe returns a value of 0, hence the missing data point from the chart. The water level probe similarly returns a value of 0, and is absent from its chart, too. So when I check my portal values, occasionally I'll see correct values for Temps 1-3 and pH (plugged into the head unit), but missing data from the expansion module probes (WL, SAL and ORP).

Do you think this might be connected to the behavior of the expansion relay box?

Roberto, I haven't had a chance to directly connect my expansion relay module to the main relay box, yet, but I note that the behavior of many of the modules connected to the expansion hub is problematic simultaneously (the ORP, salinity, and water level probes all stop reporting accurate values at the same time, and all come back online together). Do you think that it might be a bad expansion hub?
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

While the behavior of the relay box doesn't seem like it can be explained by the expansion hub (unplugging the expansion hub doesn't toggle the states of the relays), the behavior of the other modules (probes) sure can be. It seems as if the mini-usb plug on the expansion hub is loose inside the project box -- gently wiggling the usb plug there causes the light on the hub to briefly flicker off (and the probe values to all drop to 0).

Still wondering what could cause the expansion relay box behavior, but I've been watching it for a while with my test code, and it's only ever caused the attached lamp to flicker once.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Expansion relay trouble

Post by rimai »

I think they are all related and it does sound like the hub. If wiggling messes with the LED, you may be right.
Let's RMA that. Send me PM.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Expansion relay trouble

Post by joshlawless »

joshlawless wrote:So, as I start with the Wizard code, and monitor my 60W lamp for misbehavior (debugging an intermittent problem is a huge pain -- wish I had one of these power outage alarms to plug into the relay expansion box), I notice one line missing from my code that's in the Wizard code. Not sure how it got dropped from my code (which was based on wizard code).

Is this line:

Code: Select all

    ReefAngel.AddStandardMenu();  // Add Standard Menu
important / causing problems because it's missing?
Any thoughts on this one? I can't find where in the libraries this function does ... anything. Did I miss something?

I used grep on my library folders, and only turned up

Code: Select all

	void inline AddStandardMenu() {};
in the ReefAngel.h file. Also its inclusion in the keywords.txt file. Is this function doing anything?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Expansion relay trouble

Post by rimai »

That function is to enable the standard menu feature.
You can see all the features you can enable in the file \Arduino\update\feature.txt
Our version of the Arduino IDE searches for keywords and enables a #define in the code if that particular keyword is found.
Roberto.
Post Reply