Wave patterns
Re: Wave patterns
Can they go to zero then?
Re: Wave patterns
Not with this function.
We can code it differently to get the same results in order to go down to zero.
We can code it differently to get the same results in order to go down to zero.
Roberto.
Re: Wave patterns
Thanks. For what I have in mind that would be very usefulrimai wrote:Not with this function.
We can code it differently to get the same results in order to go down to zero.
Re: Wave patterns
Use this instead then:
Code: Select all
byte Jebao=(now()%(20*2)<20?0:30);
ReefAngel.PWM.SetActinic(Jebao);
ReefAngel.PWM.SetDaylight(Jebao==0?30:0);
Roberto.
Re: Wave patterns
Sorry Roberto how does that code work the parameters, just so I can tweak itrimai wrote:Use this instead then:Code: Select all
byte Jebao=(now()%(20*2)<20?0:30); ReefAngel.PWM.SetActinic(Jebao); ReefAngel.PWM.SetDaylight(Jebao==0?30:0);
Thanks
Dave
Re: Wave patterns
This is easier:
Change what's in the define section
Code: Select all
#define JebaoDuration 20
#define JebaoMin 0
#define JebaoMax 30
byte Jebao=(now()%(JebaoDuration*2)<JebaoDuration?JebaoMin:JebaoMax);
ReefAngel.PWM.SetActinic(Jebao);
ReefAngel.PWM.SetDaylight(Jebao==JebaoMin?JebaoMax:JebaoMin);
Roberto.
Re: Wave patterns
And what do I do about the lines I have already put in? Sorry its national daft question day in the UKrimai wrote:This is easier:Change what's in the define sectionCode: Select all
#define JebaoDuration 20 #define JebaoMin 0 #define JebaoMax 30 byte Jebao=(now()%(JebaoDuration*2)<JebaoDuration?JebaoMin:JebaoMax); ReefAngel.PWM.SetActinic(Jebao); ReefAngel.PWM.SetDaylight(Jebao==JebaoMin?JebaoMax:JebaoMin);
Re: Wave patterns
OK will give it a try and let you knowrimai wrote:Remove them and replace with the post above
Dave
Re: Wave patterns
Thanks for contributing!!!
If I don't hear anyone else, I'll lower it to 25 on the next update.
If I don't hear anyone else, I'll lower it to 25 on the next update.
Roberto.
Re: Wave patterns
That worked brilliantly and taught me a bit too, do you thnk that dropping the speed to zero over long periods could cause wear on the pumps?coolbird wrote:And what do I do about the lines I have already put in? Sorry its national daft question day in the UKrimai wrote:This is easier:Change what's in the define sectionCode: Select all
#define JebaoDuration 20 #define JebaoMin 0 #define JebaoMax 30 byte Jebao=(now()%(JebaoDuration*2)<JebaoDuration?JebaoMin:JebaoMax); ReefAngel.PWM.SetActinic(Jebao); ReefAngel.PWM.SetDaylight(Jebao==JebaoMin?JebaoMax:JebaoMin);
I remember having 2 sicce voyager pumps and over a period of time they would not start up and you ended up having to change the impellers.
Just a thought but this is working fine until I can work out a wave pattern that suits the tank better.
regards
Dave
-
- Posts: 132
- Joined: Tue Jan 24, 2012 6:20 pm
Re: Wave patterns
Is there a way to have a pattern that I can put a group of speeds and to change every second? So for example: 87,76,100,91,65,46,92, etc. and also have it change speeds every second? If so how many numbers could I use?
Re: Wave patterns
Yes, this should do it...you'll have to put the sequence you want and change the array size and rollover number to match.
Code: Select all
static int speed=0;
byte speeds[4] = { 93, 81, 72, 63 };
if (millis()%1000=0) speed++;
if (speed>=4) speed=0;
ReefAngel.PWM.SetActinic(speeds[i]);
Re: Wave patterns
Will give it a go and post. Thanksjerry27 wrote:since theyre DC pumps they start properly everytime and the wear shouldnt be an issue. if youre worried about it just drop it to around 20 or so. the water movement at that speed for mine is not even noticable but they keep turning.coolbird wrote: That worked brilliantly and taught me a bit too, do you thnk that dropping the speed to zero over long periods could cause wear on the pumps?
I remember having 2 sicce voyager pumps and over a period of time they would not start up and you ended up having to change the impellers.
Just a thought but this is working fine until I can work out a wave pattern that suits the tank better.
regards
Dave
if youre using the standard menu and you want to experiment with how low your pumps will go and find the minimum that they will turn back on, use thiscomment out your wave patterns then go to lights>led pwm and the "ap:" will control one pump and the "dp:" will control another.Code: Select all
ReefAngel.PWM.Override(OVERRIDE_DAYLIGHT, InternalMemory.LEDPWMDaylight_read()); ReefAngel.PWM.Override(OVERRIDE_ACTINIC, InternalMemory.LEDPWMActinic_read());
you can comment out an entire block of code by using /**/.
/*
code
code
code
*/
instead of line by line using //
if you give it a shot post your minimums so roberto can better adjust the libraries.
Re: Wave patterns
Will give it a go and post. Thanksjerry27 wrote:since theyre DC pumps they start properly everytime and the wear shouldnt be an issue. if youre worried about it just drop it to around 20 or so. the water movement at that speed for mine is not even noticable but they keep turning.coolbird wrote: That worked brilliantly and taught me a bit too, do you thnk that dropping the speed to zero over long periods could cause wear on the pumps?
I remember having 2 sicce voyager pumps and over a period of time they would not start up and you ended up having to change the impellers.
Just a thought but this is working fine until I can work out a wave pattern that suits the tank better.
regards
Dave
if youre using the standard menu and you want to experiment with how low your pumps will go and find the minimum that they will turn back on, use thiscomment out your wave patterns then go to lights>led pwm and the "ap:" will control one pump and the "dp:" will control another.Code: Select all
ReefAngel.PWM.Override(OVERRIDE_DAYLIGHT, InternalMemory.LEDPWMDaylight_read()); ReefAngel.PWM.Override(OVERRIDE_ACTINIC, InternalMemory.LEDPWMActinic_read());
you can comment out an entire block of code by using /**/.
/*
code
code
code
*/
instead of line by line using //
if you give it a shot post your minimums so roberto can better adjust the libraries.
Re: Wave patterns
Roberto, can we make this number a define or mem location that can be overidden? I'm using these functions to feed the Custom mode on my mp40s and don't need to be constrained at all though I wouldnt mind setting it to 10 or something..rimai wrote:Thanks for contributing!!!
If I don't hear anyone else, I'll lower it to 25 on the next update.
Other option is to set the default but overide the fuction so we can pass the constrain as an argument?
I can submit a pull request but not sure what the preference would be..
Re: Wave patterns
On second thought it would probably be best to override the function and make the current default to whatever number works good for Jaebo.
Re: Wave patterns
Actually, I'm thinking I'm just going to remove the constrain.
It seems that you can only get a wave if you set the min speed to 0.
It seems that you can only get a wave if you set the min speed to 0.
Roberto.
Re: Wave patterns
Hi Is it possible to have a both wave patters for one pump? I want it to run nutrition export for 2 hrs a day then go back into the reef crest mode. Is this possible? If yes how can this be done? Thanks
Re: Wave patterns
tomek77pl wrote:Hi Is it possible to have a both wave patters for one pump? I want it to run nutrition export for 2 hrs a day then go back into the reef crest mode. Is this possible? If yes how can this be done? Thanks
Yep you can. Which wave patterns are you trying to run, and at what times?
Here's an example. I have different modes run throughout the day.
Code: Select all
if (hour()>=8 && hour()<11)
{
vtechmode=6;
ReefAngel.PWM.SetDaylight( TidalSwellMode(40,true) ); // Tidal Swell at 40% on sync mode
ReefAngel.PWM.SetActinic( TidalSwellMode(40,false) ); // Tidal Swell at 40% on anti-sync mode
}
else if (hour()>=11 && hour()<12)
{
vtechmode=2;
ReefAngel.PWM.SetDaylight( ReefCrestMode(50,20,true) ); // ReefCrest at 50% + - 20 on sync mode
ReefAngel.PWM.SetActinic( ReefCrestMode(50,20,false) ); // ReefCrest at 50% + - 20 on anti-sync mode
}
else if (hour()>=12 && hour()<13)
{
vtechmode=0;
ReefAngel.PWM.SetDaylight( millis()%1000>800?80:0); // WaveMode on sync mode
ReefAngel.PWM.SetActinic( ElseMode(70,30,true) ); // ElseMode at 70 on anti-sync mode
}
else if (hour()>=13 && hour()<14)
{
vtechmode=2;
ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% + - 20 on sync mode
ReefAngel.PWM.SetActinic( ReefCrestMode(70,20,false) ); // ReefCrest at 70% + - 20 on anti-sync mode
}
else if (hour()>=15 && hour()<18)
{
vtechmode=0;
ReefAngel.PWM.SetDaylight( ElseMode(70,30,true) ); // Else on sync mode
ReefAngel.PWM.SetActinic( millis()%1000>800?80:0); // Wave on anti-sync mode
}
else if (hour()>=18 && hour()<21)
{
vtechmode=5;
ReefAngel.PWM.SetDaylight( NutrientTransportMode(77,90,3000,true) ); // Nutrient Transport on sync mode
ReefAngel.PWM.SetActinic( NutrientTransportMode(77,90,3000,false) ); // Nutrient Transport on anti-sync mode
}
else if (hour()>=21 && hour()<24)
{
vtechmode=1;
ReefAngel.PWM.SetDaylight( millis()%1000>800?70:0); // Wave on sync mode
ReefAngel.PWM.SetActinic( ElseMode(70,30,true) ); // Else on anti-sync mode
}
else
{
vtechmode=4;
ReefAngel.PWM.SetDaylight( LongPulseMode(40,40,10,true) ); // Long pulse at 40% with 10s pulse on syncy mode
ReefAngel.PWM.SetActinic( LongPulseMode(40,40,10,false) ); // Long pulse at 40% with 10s pulse on on anti-sync mode
}
if (ReefAngel.DisplayedMenu==FEEDING_MODE)
{
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
}
if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE)
{
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
}
Barry
Current tank info: 150g mixed reef
"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
Current tank info: 150g mixed reef
"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
Re: Wave patterns
Lets say I want nutrition export to run from 4pm-6pm and reef crest to run the remaining 22 hrs. This is for the jeabo pump.
Re: Wave patterns
Try this, although Nutrient export needs to be ran 2.5 hours to complete the mode.
You can change the values of the modes too, if its too much flow
Code: Select all
if (hour()>=16 && hour()<18)
{
ReefAngel.PWM.SetDaylight( NutrientTransportMode(77,90,3000,true) ); // Nutrient Transport on sync mode
ReefAngel.PWM.SetActinic( NutrientTransportMode(77,90,3000,false) ); // Nutrient Transport on anti-sync mode
}
else if (hour()>=18 && hour()<16)
{
ReefAngel.PWM.SetDaylight( ReefCrestMode(50,20,true) ); // ReefCrest at 50% + - 20 on sync mode
ReefAngel.PWM.SetActinic( ReefCrestMode(50,20,false) ); // ReefCrest at 50% + - 20 on anti-sync mode
}
Last edited by ReeferBee on Sun Jun 30, 2013 8:20 pm, edited 1 time in total.
Barry
Current tank info: 150g mixed reef
"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
Current tank info: 150g mixed reef
"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
Re: Wave patterns
Thank you!!! I just made it for 3 hrs instead of 2 so at least it finished one cycle of nutrition export.
Re: Wave patterns
Barry,
A question for you.
I am just beginning to learn the arduino language and at the moment only using the Wizard for the basic settings.
If I want to use your wave pattern code (different waves throughout the day), I understand I will have to cut and paste the code in the wizard where it says "your custom code goes below this line" but do I need to remove any lines from the wizard code or make any other changes?
I recall a similar situation where a member suggested to remove a code line before using a custom wave pattern code.
Appreciate your help.
A question for you.
I am just beginning to learn the arduino language and at the moment only using the Wizard for the basic settings.
If I want to use your wave pattern code (different waves throughout the day), I understand I will have to cut and paste the code in the wizard where it says "your custom code goes below this line" but do I need to remove any lines from the wizard code or make any other changes?
I recall a similar situation where a member suggested to remove a code line before using a custom wave pattern code.
Appreciate your help.
Re: Wave patterns
Can someone else help me?
Re: Wave patterns
Anesthdoc,
His code states specific times during the day, and what wave pattern runs during those times. The first line is an if statement everything following that for different times is an else if statement.
Add as many else if statements as you want. Make sure the times don't overlap. Also, he made a mistake in his code. For the last code in the day, let's say you want it to run between 11pm and 8 am you would use || (or) instead of && (and). the time cannot be greater than 11pm and less than 2am as the RA logic only views a 24 hour time period. So you would use
Also, I find it easier to always use >= and always use just < by itself.
if you want to add in minutes you could do this
His code states specific times during the day, and what wave pattern runs during those times. The first line is an if statement everything following that for different times is an else if statement.
Code: Select all
if (hour()>=16 && hour()<18)
{
ReefAngel.PWM.SetDaylight( NutrientTransportMode(77,90,3000,true) ); // Nutrient Transport on sync mode
ReefAngel.PWM.SetActinic( NutrientTransportMode(77,90,3000,false) ); // Nutrient Transport on anti-sync mode
}
else if (hour()>=18 && hour()<16)
{
ReefAngel.PWM.SetDaylight( ReefCrestMode(50,20,true) ); // ReefCrest at 50% + - 20 on sync mode
ReefAngel.PWM.SetActinic( ReefCrestMode(50,20,false) ); // ReefCrest at 50% + - 20 on anti-sync mode
}
Code: Select all
else if (hour()>=18 || hour()<16)
if you want to add in minutes you could do this
Code: Select all
if ((hour()>=18 && minute()>=30) || (hour()<16 && minute()==0)) // >=6:30pm ||(OR) <4:00pm
Wave patterns
That last example with minute() will not work. It will only cover 18:30-18:59 then 19:30-19:59 and so on. Or you'll need another || hour()>=19
Re: Wave patterns
Good catch, I wrote that real quick off the top of my head. I just looked at my old code and I did have the additional || hour()