Icecap Module

Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

rimai wrote:
Ismaclst wrote:I have the maxspect gyre and was thinking about purchasing the Icecap module to go with it. Has anyone else bought this? Does it come with the cable you need to connect to the RA? I'm assuming you can use any of the DC pump modes?
You should be able to use the DCPump modes.
The Kessil cable in the webstore should be able to be used with the Icecap module too :)

How long is the Kessil cable? My RA is in the basement so it needs to be a decent length.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Icecap Module

Post by rimai »

Won't reach.
It's about 6ft.
You better off just splicing your own cable. You can build one from scratch or get an stereo audio cable at the local store than is long enough.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

He way I wrote the function I added 10 to the speed for reverse and forward uses the values you provide.
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

What do all three of these numbers mean?

Code: Select all

    tide.Init(40,10,30);
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

40 speed, 35-45 during 1/4 moons and 25-55 during new and full moon. It might be
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

Sorry for all the questions, but I'm still confused on how you got 35-45 and 25-55? I can't seem to find the correlation between those numbers and the 40, 10 and 30 ones.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

40 is the speed for the tide. As it goes from high tide to low tide its going to start at a range of 10 so 35-45 between the high tide and low tide speed. As the month progresses the range will increase to 3 which is 25-55.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

Image
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

Ok, I understand now. I don't have the icecap module yet but I wanted to upload the code so it was ready when I did get it. I noticed that both the daylight and actnitic values didn't change when I uploaded the new code. Should they? I did notice that where it says dc pump in the portal, that it shows that the mode is constant, speed is 50% and duration is 50.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

Can you post your new code?
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

Here is my latest 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 <Tide.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

Tide tide;

void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  ReefAngel.Use2014Screen();  // Let's use 2014 Screen
  ReefAngel.DDNS("Damien"); 
  ReefAngel.AddMultiChannelWaterLevelExpansion();  // Multi-Channel Water Level Expanion Module
  // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = Port1Bit | Port6Bit;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port6Bit | Port7Bit | Port8Bit;
  // Ports toggled when Lights On / Off menu entry selected
  ReefAngel.LightsOnPorts = Port5Bit;
  // 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;
  ReefAngel.Relay.Set(Port8, now()%6*SECS_PER_HOUR<30*SECS_PER_MIN);
  // Set the Overheat temperature setting
  InternalMemory.OverheatTemp_write( 800 );
  InternalMemory.WaterLevelMax_write(1800);        


  // Feeeding and Water Change mode speed


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

  tide.Init(55,10,30);
  tide.SetWaveLength(12+SECS_PER_HOUR);
  ////// Place additional initialization code below here


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

void loop()
{
  ReefAngel.StandardHeater( Port3,780,785 );
  ReefAngel.WaterLevelATO(4,Port4,240,28,31); 



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

  if (ReefAngel.WaterLevel.GetLevel(1)<5) //Disable the port until overriden manually
    ReefAngel.Relay.Override(Port8,0);    //Saltwater Reservoir
  if (ReefAngel.WaterLevel.GetLevel(1)>80)   // Set port back to auto
    ReefAngel.Relay.Override(Port8,2); 

  if (ReefAngel.WaterLevel.GetLevel(2)>80) //Overflow
    ReefAngel.Relay.Off(Port1);
  else
    ReefAngel.Relay.On(Port1);

  if (ReefAngel.WaterLevel.GetLevel(3)>87) //ATO Reservoir
    ReefAngel.Relay.Off(Port5);
  if (ReefAngel.WaterLevel.GetLevel(3)<1)
    ReefAngel.Relay.On(Port5);

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

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



byte setMaxspect(byte minSpeed, byte maxSpeed, boolean PulseSync)
{
  int reverse_speed=0;
  int forward_speed=45;
  
   // swap between forward and reverse every X seconds 
   reverse_speed = ShortPulseMode(0,100,ReefAngel.DCPump.Duration*2,true); 
   if (reverse_speed == 100) {
     //
     // while we are going in reverse increase the speed by 10 
     forward_speed = ShortPulseMode(35+10, 60+10,ReefAngel.DCPump.Duration,true);
   } else {
     //
     // while we are going forward set speed to 25-40 to keep
     // from blowing corals off the rocks
     forward_speed = ShortPulseMode(35,70, ReefAngel.DCPump.Duration, true);
  }

  if (PulseSync) {
    return forward_speed;
  } else {
    return reverse_speed;
  }
}
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

You added the function but you have to call it. Same with the tide you set. We have to tie them together now.

You need to add the following now to set your dimming channels.

I need to be on the computer to give you the right code. I also made some mistakes that I need to fix in the setMaspect function.
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

I bought a stereo audio cable for forward and reverse. How many wires should be in it? I cut the end off and there are three, a red, blue and white.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

One should be ground and the other two would be for your two signals. If you are wiring to the dimming leads you'll share the ground.
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

lnevo wrote:You added the function but you have to call it. Same with the tide you set. We have to tie them together now.

You need to add the following now to set your dimming channels.

I need to be on the computer to give you the right code. I also made some mistakes that I need to fix in the setMaspect function.
Did you ever get a chance to look into this more?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

No, i got swamped this weeken. I'll probably have a chance friday if you can hang in...
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

No problem
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Icecap Module

Post by lnevo »

Ok, this should do it. I've set the min speed to 1/2 the Tidal speed and used the Tidal speed as the max speed. As discussed the tidal speed will vary +/- depending on the range you gave which means 55 (+/-5 during quarter moons and half moon, versus +/-15 during newmoon and full moon) It will also vary throughout the day based on the wavelength you have set.. which is currently 72 minutes... tide.SetWaveLength(12+SECS_PER_HOUR); The default is 12 hours which would be 12*SECS_PER_HOUR. Anyway below is the code that will set the Actinic/Daylight to the value of the the setMaxspect function using the tide class as an input. I also included the change I made in your RO/Valve post

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 <Tide.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

Tide tide;

void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  ReefAngel.Use2014Screen();  // Let's use 2014 Screen
  ReefAngel.DDNS("Damien"); 
  ReefAngel.AddMultiChannelWaterLevelExpansion();  // Multi-Channel Water Level Expanion Module
  // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = Port1Bit | Port6Bit;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port6Bit | Port7Bit | Port8Bit;
  // Ports toggled when Lights On / Off menu entry selected
  ReefAngel.LightsOnPorts = Port5Bit;
  // 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;
  // Set the Overheat temperature setting
  InternalMemory.OverheatTemp_write( 800 );
  InternalMemory.WaterLevelMax_write(1800);        


  // Feeeding and Water Change mode speed


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

  tide.Init(55,10,30);
  tide.SetWaveLength(12+SECS_PER_HOUR);
  ////// Place additional initialization code below here


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

void loop()
{
  ReefAngel.StandardHeater( Port3,780,785 );
  ReefAngel.WaterLevelATO(4,Port4,240,28,31); 
  ReefAngel.Relay.Set(Port8, (now()%(6*SECS_PER_HOUR))<(30*SECS_PER_MIN));

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

  if (ReefAngel.WaterLevel.GetLevel(1)<5) //Disable the port until overriden manually
    ReefAngel.Relay.Override(Port8,0);    //Saltwater Reservoir
  if (ReefAngel.WaterLevel.GetLevel(1)>80)   // Set port back to auto
    ReefAngel.Relay.Override(Port8,2); 

  if (ReefAngel.WaterLevel.GetLevel(2)>80) //Overflow
    ReefAngel.Relay.Off(Port1);
  else
    ReefAngel.Relay.On(Port1);

  ReefAngel.Relay.Off(Port5); // Set Default to off
  if (ReefAngel.WaterLevel.GetLevel(3)>87) //ATO Reservoir
    ReefAngel.Relay.Off(Port5);
  if (ReefAngel.WaterLevel.GetLevel(3)<1)
    ReefAngel.Relay.On(Port5);

  ////// Place your custom code above here
  ReefAngel.PWM.SetDaylight(setMaxspect(tide.GetSpeed(),tide.GetSpeed()/2,true)); // Set the Speed
  ReefAngel.PWM.SetActinic(setMaxspect(tide.GetSpeed(),tide.GetSpeed()/2,false)); // Set the direction - speeds here are irrelevant actually.

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



byte setMaxspect(byte minSpeed, byte maxSpeed, boolean PulseSync)
{
  int reverse_speed=0;
  int forward_speed=45;
  
   // swap between forward and reverse every X seconds 
   reverse_speed = ShortPulseMode(0,100,ReefAngel.DCPump.Duration*2,true); 
   if (reverse_speed == 100) {
     //
     // while we are going in reverse increase the speed by 10 
     forward_speed = ShortPulseMode(minSpeed+10, maxSpeed+10,ReefAngel.DCPump.Duration,true);
   } else {
     //
     // while we are going forward set speed to 25-40 to keep
     // from blowing corals off the rocks
     forward_speed = ShortPulseMode(minSpeed,maxSpeed, ReefAngel.DCPump.Duration, true);
  }

  if (PulseSync) {
    return forward_speed;
  } else {
    return reverse_speed;
  }
}
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Icecap Module

Post by Ismaclst »

Thanks for taking the time and correcting my code. I appreciate it.
Image
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Icecap Module

Post by slm222 »

I know this is an old thread. But I wanted to check before moving forward. Icecap just came out with their gyre pump as a license off maxspect. If i get their gyre pump and the ice cap module will this work with the DC pump codes? i current have two jeabo but would like to swap out to two opposing gyres. I have the jebaos set up to randomly select the wave pattern for the day. would this still be relevant for the gyre control? along with feed mode?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Icecap Module

Post by rimai »

I don't see why not.
It should work just the same.
Roberto.
Post Reply