Lee's Feature Complete PDE

Share you PDE file with our community
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

I use "virtual" relays, meaning I just point to outlets that I don't have a physical relay box for. In this case I actually use two outlets. One acts a as a lock to my dosing pumps. Box2_Port8 and then Box2_Port7 I use as the trigger to start the calibration mode. When in calibration mode, the routine will log how many seconds the pumps are on. You can turn them on individually or at the same time. The point is to fill up X amount of volume, let's say 10ml and stop the pump when it is at the level you want. When you exit calibration mode (turn off Box2_Port7) the times for each pump are saved. If I lock the ports without turning off calibration mode, the values aren't saved. So, now you have the time saved and you know what the volume collected was. The RA can now calculate the flow rate for that pump and dose accordingly.
caliman
Posts: 22
Joined: Sun Mar 24, 2013 4:28 pm

Re: Lee's Feature Complete PDE

Post by caliman »

Thanks for the treasure chest Lee! 8-)
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

Your welcome.

So I haven't done any updates on this code last year, when I the flag format changed and I did a fix in how I turn on some of my features (one using both a virtual relay and internal memory).

I've started working on the next version since I'll be hacking my evergrow lights to support dimming control. I am planning on having it be selectable which lighting scheme to use (parabola, slope, smoothramp) and also to have clouds enabled/disabled as an option as well. I'm also adding a feature to enable/disable my random wave modes. Right now the "Tide" class determines the speed and it's only active when I select custom mode. The problem is that once I'm in custom mode, it goes through the random modes. I'd like to try using Constant to create a gyre effect so I don't want it using random, but I do want it using the tide speeds and switching sync/anti-sync during ebb/flow.

I get the conversion kit to try out on Tuesday, so once that's in place, I'll be able to start testing :) Probably the following weekend... if I post anything sooner, just imagine a kid in a candy store :)
89delta
Posts: 163
Joined: Mon Oct 15, 2012 7:21 pm
Location: Leesburg, GA

Re: Lee's Feature Complete PDE

Post by 89delta »

Lee,

I understand your CheckPower() requires the use of a UPS. Is there any way to incorporate this for use without one. Lets say the power went out for like a min of 2-5 minutes.....to have a notice given that power did go out but was restored when the power did come back on.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

No way to do that that I can think of. Unless you're writing a heartbeat to memory on a very frequent basis, which will burn out the chip, there will be no way to know when the RA boots up how long ago it was last up. Sorry for the late reply, I must have missed this last post. You could add an alert to send you a message when the RA boots up, but that will be on any reset/reboot as well.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

So, since my last update, I've been working on a few things... I segregated the outlets for my light fixtures, so I can each channel on/off individually. I have the dimming on the evergrow lights working. I'm still waiting for ReefRadiance to address the issues I'm having, but in the meantime, I do have dimming using the standard published hacks. So I've added the ability to have each fixture offset but maintaing the same photoperiod. I've done this also for my moonlights too. I also added the ability to flip between slope/parabola/smoothramp so I don't have to recompile if I want to use a different scheme. So far I'm enjoying the variation in the lighting. I feel better about the longer photoperiod I've always had knowing that they aren't sitting at peak output the entire time. I've also been running my pumps on constant with the speed controlled by my Tide class. I switch back and forth between pumps as the tide changes direction and keep the second pump at 10% of the primary. I'm trying to generate some type of gyre like movment by using constant and letting the momentum of the water increase the flow.

At this point, I need to do some code cleanup, and also considering some type of re-write or at least a re-organization. I'm starting to sprawl a few things that I think could be better combined. I don't know we'll see... it works and that's the main point. I've been submitting patches to Roberto in the past few weeks. Getting a GUI front-end to GIT has helped a LOT. As of now, the SunLocation, Moon, Tide, and WiFiAlert classes are all merged into the DEV code!!! No longer will anyone have to install anything extra... for now :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

Here's what my dimming values look like. The main parabola you see is the moonlights which took some work as I had to adjust the offsets manually. You can see the actinic and daylights come on. Each fixture is offset by 30 minutes, same for the moonlights.
pwm_channels_moon.png
pwm_channels_moon.png (38.77 KiB) Viewed 5606 times
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

That chart is nothing :) You should see how nice it looks now :)

http://forum.reefangel.com/status/chart ... ilter=pwmd

Anyway, I have discovered my Ecotech backup battery is no longer working :( I have decided that instead of replacing it or building a DIY backup battery, that I'll replicate the functionality with my RA :)

First, I will move my vortech power cables which are currently on the second relay (which is the one I use to detect power outages) to the main relay box. I then plan to modify my CheckPower script to not turn these off and leave them running on the UPS. Since I'll lose the automatic functionality that the Ecotech's give to cut the power down to 50% or whatever it is, I'll put some code to slow down the pumps and extend the battery life :) I think while I'm at it, I'll put some logic to shut off the return pump if the outage lasts longer than an hour, but maybe run it for 10 minutes every hour so that the sump continues to circulate.

My biggest problem that I have now is that my UPS (CPAVR850LCD - 850VA) is not a true sine wave UPS which does not like my return pump. So even now my return pump only stays on for 10-20 minutes when I lose power. I can reset the power on the port and the return pump comes back on, but it's obviously not ideal. So, rather than invest in another Ecotech battery or even the $60 it would take to DIY a 12V battery to hook up to the vortech's, I'm putting the money toward a 1500VA True Sine wave UPS (CP15000PFCLCD) which will double my capacity and let my return pump work properly.

I think the cool thing is that without having the ecotech backup battery, my code will essentially replicate the spin down while maintaining some flow and leverage the UPS instead of a separate battery. As usual, the code will get posted when it's ready. I owe you guys my latest copy, but it's still being revised...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

Ok, I've posted my current code. It's a bit of mess since I've been adding stuff to it, but haven't really cleaned it up. I want to remove some things that aren't working like they should (like logging my Water change volume...) and add Alk adjustments (Thanks Alan!) and add dimming to my acclimation cycle. But I figured I've added enough new features to post for people looking.

Some of the new features included are selectable types for the dimming modes (choose between slope, parabola, etc.)
Slow down of Vortech pumps during power outage since I'm no longer using the Ecotech battery.
Use of moonlights to complete the dimming cycle since my drivers only go to 5% which is still pretty bright.

Enjoy
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

We don't post enough pictures on here :)
Image
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Lee's Feature Complete PDE

Post by TanksNStuff »

Hi Lee, first off, your tank looks great! :D

I have a few questions about your code as I would like to borrow a section or two and incorporate it into my code. You have a lot of custom memory locations, variables defined, etc. that I probably won't need because they relate to your custom main screen, etc. and I don't want to add in stuff I don't need. I was wondering if you could help me select only what I would need for the following features that you use:

1. Custom feeding mode - I would want it just like you have it (minus the reactor control since I have mine off the return pump manifold). I would also like to delay the ATO port for 5 minutes instead of the skimmer... though I can figure that part out myself (just changing the port). But definitely want the VorTechs to Nutrient mode for 15 mins after.

2. Lighting Effects - Does this part give you cloud/lighting effects? Is it set for random or just on-demand via an app or something? I see you have the sun rise/set, moonphase, checkcloud stuff all in there, so I'm guessing you have some sort of storm effects coded in. This is where you have a lot of custom main screen stuff involved and I don't need that since I'm going to use the "2014Screen".

I also noticed that you were active in Colin's thread and talking about converting his "standard dimmer" code over to the expansion dimmer module. Any progress on that?

Any help would be appreciated! Thanks in advance.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

No progress on the clouds/lightning. That effects function isn't functional yet and none of my custom memory locations are for the screen drawing, though they do get used sometimes. You can replace any call to InternalMemory with a hard coded variable if it makes it easier for you.

Take a look at Sacohen's code for an easier post feeding mode function, but I think mine is pretty straight forward. If you take a stab at it we can debug in your INO thread.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Lee's Feature Complete PDE

Post by TanksNStuff »

OK, thanks. I'll take a look at Steves code and see if that works for me.

In the meantime, I think I'll start my INO thread to show what I have and what I need help on. That might be the best way to go about it.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

:)
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Lee's Feature Complete PDE

Post by rimai »

Very cool!!!
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Lee's Feature Complete PDE

Post by Sacohen »

Very nice Lee. I love the music :)
No really, the tank looks incredible. Keep it up.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

Thanks guys. Would not be doing this good without my RA!!!
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Lee's Feature Complete PDE

Post by TanksNStuff »

Video was great Lee! Nice work.
User avatar
Rodasphoto
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
Contact:

Re: Lee's Feature Complete PDE

Post by Rodasphoto »

What does your BioHazard mode do? What does the custom waves mode accomplish?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

BioHazard mode was one of the attempts to replicate Else mode. It works pretty good.

The custom waves uses the RA modes instead of the Vortech built in functions. It also goes through a random mode each day if set to use the random mode.
User avatar
Rodasphoto
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
Contact:

Re: Lee's Feature Complete PDE

Post by Rodasphoto »

lnevo wrote:BioHazard mode was one of the attempts to replicate Else mode. It works pretty good.

The custom waves uses the RA modes instead of the Vortech built in functions. It also goes through a random mode each day if set to use the random mode.
I want to redo the code I have programmed on my RA+ and want to borrow heavily on your code. I am in awe with you have done with your RA.
Image
User avatar
Rodasphoto
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
Contact:

Re: Lee's Feature Complete PDE

Post by Rodasphoto »

lnevo wrote:BioHazard mode was one of the attempts to replicate Else mode. It works pretty good.

The custom waves uses the RA modes instead of the Vortech built in functions. It also goes through a random mode each day if set to use the random mode.
Many thanks for the answers. I want to redo the code I have programmed on my RA+ and want to borrow heavily on your code. I am in awe with you have done with your RA.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

Wow, I haven't updated the code in this thread since January of 2013... I've certainly made a few tweaks here in there, but pretty incredible that I've been able to use the same code base for soooo long. Thanks to using memory for just about everything, I've been able to toggle and modify most every routine without needing new code. It's really only been minor tweaks for all this time. Anyway, page 1 is updated but in summary here are some features I've added this past go around

RF FeedingMode speed - override the vortech feeding mode and set a custom speed during feeding mode.
Acclimation code for dimming - Enahnced the acclimation so it can adjust the dimming % in addition to photoperiod.
Adjust alk manually (thanks AlanM) - Added a function I got from AlanM that lets you input the current alk measurement and dose the appropriate amount to get to your target amount.
Daily email report - Send an alert 2x a day since I rarely check on things so obsessively anymore
Light modes (select in memory which wavetype for lighting) - choose slope/parabola/sigmoid/slowramp
East/West offset dimming - Self explanatory I hope
Filll in gap from 5%->0% with moonlights - Extend the dimming past lights out with the moonlights for a smoother sunset routing
Jim_J
Posts: 13
Joined: Sat Jun 15, 2013 3:21 pm

Re: Lee's Feature Complete PDE

Post by Jim_J »

Thanks for this great code Lee!
As a complete novis on ReefAngel its really valuable to check complex codes like this for reference. One question, what does the custom memory settings do?

//Jim
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

The memory settings are basically persistent variables that let me change how things work on the fly without having to reupload a new program to the controller. In order to "save" them you have to assign them a memory location where it will be stored.
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: Lee's Feature Complete PDE

Post by alexwbush »

Adjust alk manually (thanks AlanM) - Added a function I got from AlanM that lets you input the current alk measurement and dose the appropriate amount to get to your target amount.
Daily email report - Send an alert 2x a day since I rarely check on things so obsessively anymore
Please expand. I'd like info on how to do these two :D
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

Both of these are in their own isolated functions so it should be easy to carry over.

This thread details the daily reminder mail
http://forum.reefangel.com/viewtopic.php?p=45678#p45678

The adjustAlk was a function I got from AlanM but I have not tested it yet. It's all in theory, but look for void adjustAlk() in my code and let me know what questions you have. It would have to be adapted to your tank and dosing regimen.
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: Lee's Feature Complete PDE

Post by alexwbush »

lnevo wrote:Both of these are in their own isolated functions so it should be easy to carry over.

This thread details the daily reminder mail
http://forum.reefangel.com/viewtopic.php?p=45678#p45678

The adjustAlk was a function I got from AlanM but I have not tested it yet. It's all in theory, but look for void adjustAlk() in my code and let me know what questions you have. It would have to be adapted to your tank and dosing regimen.
Thanks! I got the daily e-mails to work. Great tool... now working on:
1. Change time from 0600/1800
2. Change contents of e-mail to include other info
3. Change title of e-mail. I'm so used to those e-mails meaning something is wrong!

Also going to start working with dosing.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Lee's Feature Complete PDE

Post by lnevo »

Can't change the title of the emajl unless roberto adds a parameter to the aspx script and then I'd have to add support in the class. Doable just needs work.

If you look at the function there is a 6 and a 12. The 12 is for every 12 hours and the 6 means start 6 hours from midnight. Feel free to change those numbers to your preference.

Other parameters should be easy to add just make sure the msg buffer will be large enough.
Post Reply