Tidal Effect Simulation

Share you PDE file with our community
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Mar 25, 2013 2:12 pm
Just as a reference, my base speed is 45 and my night speed is 25.. So you don't see so much change in the graphs above. I do have 2 mp-40 on a 65g tank... so I try to avoid going above 65 (my Smart_NTM setting) :)
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Mar 25, 2013 2:16 pm
oh, and I don't have good long term graphs because I keep playing with them... but at some point :)

Posts: 91
Joined: Tue Apr 16, 2013 7:33 pm
Location: 650 Bay Area..
PostPosted: Fri May 10, 2013 6:46 pm
Has this code been working well for you? I'm going to be tinkering and setting up my RA in the next few weeks and so far I'm really liking this option. I still need to get the RF module but I will have 4 MP10's and 2 Wp40's on my tank and was wondering if this would be sufficient for that many pumps?

Still really new to RA but I need some randomized flow and the WP's are gonna prob be running max 50-70% so I would just have to alter the speeds and implement this code? Or would I have to have different options installed as I'm running the WP's off PWM and the MP's on the RF? Maybe I should just run the MP's on this and do a seperate code for the WP's?

Sorry if I sidetracked the thread a little but I def would like to try this out and have something that is really not a recurring/looping current.. Thanks in advance for the time put into the code. ;)
My other hobby has 450rwhp and eats tires instead of mysis!
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri May 10, 2013 7:25 pm
dapg8gt wrote:Has this code been working well for you? I'm going to be tinkering and setting up my RA in the next few weeks and so far I'm really liking this option. I still need to get the RF module but I will have 4 MP10's and 2 Wp40's on my tank and was wondering if this would be sufficient for that many pumps?

Still really new to RA but I need some randomized flow and the WP's are gonna prob be running max 50-70% so I would just have to alter the speeds and implement this code? Or would I have to have different options installed as I'm running the WP's off PWM and the MP's on the RF? Maybe I should just run the MP's on this and do a seperate code for the WP's?

Sorry if I sidetracked the thread a little but I def would like to try this out and have something that is really not a recurring/looping current.. Thanks in advance for the time put into the code. ;)


This code is more about how you use it. There is a tide mode function now in the library or you could use the class posted. The difference being that the class tracks ebb and flow of the tide effect. Using the value by itself, you would get a constant speed that varied from a max speed to a min speed with two "high tides" and two "low tides" a day. The gap between the max and min is adjusted based on MoonPhase. I use this value returned and feed it to the RA ReefCrestMode and get that effect on top of it. I'm using the custom rf function so I can control each mp40 separately so I basically flip the primary pump when the tide changes. So far I've been happy. I'm going to go back Ectotech mode for a little while just to see if there's any difference.

Posts: 91
Joined: Tue Apr 16, 2013 7:33 pm
Location: 650 Bay Area..
PostPosted: Tue May 14, 2013 11:21 pm
Thanks for responding. I am gonna have 2 wp40's along with the four MP10's . I think if I use the ecotechs with a tidal swell mode I can have the random chaotic flow delivered by my wp's.. just brainstorming and trying to gauge all my options as I will have a good chance that the MP's will not overpower the larger tank and can have them follow this code 24/7 while the wp adds the main flow and add night mode to them.. I may just run them all on alternating reef crest, lagoon and long pulse at various speeds antisynched between the two brands. Still unsure. Thanks for the info
My other hobby has 450rwhp and eats tires instead of mysis!
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Nov 03, 2013 6:47 pm
Latest version and 1.1.0 compatible
Attachments
Tide.zip
(1.52 KiB) Downloaded 163 times

Posts: 32
Joined: Fri Aug 30, 2013 3:50 pm
PostPosted: Thu Aug 07, 2014 12:44 pm
is their an easy way to incorporate this code into my file? looking at this coding is like trying to count the number of branches on a birds nest.

I only have to WP40's with the max output at 80%.

I know this is asking alot, but can someone put the tidal effect simulation into my ino file?
Attachments
sketch_oct04a.ino
(4.51 KiB) Downloaded 90 times
Image
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Aug 07, 2014 1:18 pm
The question I always ask when someone wants this is what do you want it to do?

The class is pretty easy to use and overall pretty easy to add, but you need to do something with the data it gives you... Right now the output looks like a wave going from the min speed to the max speed 2 times a day (2 high tides and 2 low todes per 24 hours). The speed needs to get passed back to something like the other wave functions, otherwise it's just a constant speed.

Posts: 32
Joined: Fri Aug 30, 2013 3:50 pm
PostPosted: Thu Aug 07, 2014 2:15 pm
lnevo wrote:The question I always ask when someone wants this is what do you want it to do?

The class is pretty easy to use and overall pretty easy to add, but you need to do something with the data it gives you... Right now the output looks like a wave going from the min speed to the max speed 2 times a day (2 high tides and 2 low todes per 24 hours). The speed needs to get passed back to something like the other wave functions, otherwise it's just a constant speed.



is that pig latin? LOL

ok, what data are you refering too? are you talking about the graphs... ummm, i don't need it

can it go back to reefcrest mode or lagoon or nutrient export mode?
Image

Posts: 132
Joined: Mon Oct 15, 2012 7:21 pm
Location: Albany, GA
PostPosted: Wed May 20, 2015 4:57 pm
lnevo

I've tried to add this to my nighttime mode but am getting some errors....here is the error msg:

My_RA_Version2_1.cpp: In function 'void loop()':
My_RA_Version2_1:253: error: expected primary-expression before '.' token
My_RA_Version2_1:253: error: '2' cannot be used as a function

And this is the code in the loop:

// Jebao Code
// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;
pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,ReefCrestMode(50,20,true)*2.55);
ReefAngel.DCPump.UseMemory = true;
ReefAngel.DCPump.LowATOChannel = Sync ; // Jebo connected to AtoPINLow



// Add random mode if we set to Mode to Custom in portal
static int rmode;
static boolean changeMode=true;


// These are the modes we can cycle through. You can add more and even repeat...
byte modes[] = { Lagoon, ReefCrest, TidalSwell, Sine, Gyre, NutrientTransport, Else };

if (now()%SECS_PER_DAY==0 || changeMode==true) { // Change at midnight or if controller rebooted
rmode=random(100)%sizeof(modes); // Change the mode once per day to pick from our array
changeMode=false;
}

// Set timer when in feeding mode
static unsigned long feeding;
if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();

if (now()-feeding<900) {
// First 15 minutes after feeding mode stops. Smart_NTM
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Mode=NutrientTransport;
} else if (now()-feeding<2250) { // 15 minutes plus 1 hour
// Continue NTM for the next 60 minutes (75 minutes total)
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Mode=NutrientTransport;
} else if (now()%SECS_PER_DAY<27000 || now()%SECS_PER_DAY>=67500) { // 8:30am / 10:30pm
// Night mode (go to 30%)
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Mode=(Custom,ReefCrest(Tide.CalcSpeed()),-1Tide.isIncoming());
//ReefAngel.DCPump.Speed=30;

} else if (InternalMemory.DCPumpMode_read()==11) {
// Custom Mode and nothing else going on
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
if (modes[rmode]==Else) {
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.Mode=Constant;
ReefAngel.DCPump.Speed=ElseMode(InternalMemory.DCPumpSpeed_read(),25,true ); // ElseMode on sync mode, Portal Speed Setting +/- 25%
} else {
ReefAngel.DCPump.Mode=modes[rmode]; // Put the mode to the random mode :)
ReefAngel.DCPump.Speed=InternalMemory.DCPumpSpeed_read(); // Set speed from portal
}
} else {
ReefAngel.DCPump.UseMemory=true; // Will reset all values from memory
}
Image
PreviousNext

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 2 guests

cron