Apex RoDi Auto flush code

espinobj

Community Member
View Badges
Joined
Jul 6, 2020
Messages
50
Reaction score
24
Location
Dallas
Rating - 0%
0   0   0
I'm doing a big upgrade to my RODI setup. Im adding three additional solenoids. The main solenoid (RODIswitch) is existing and used as a on/off switch.
There is a leak sensor labeled "GarageLK" and will work as a master shut off. Each of my storage containers have a high and low optical sensor - SALT_H, SALT_L, ATO_H, ATO_L.
The goal is to have my RODI auto flush every hour while filling. Auto flush when the RODI system turns on and a flush when filling is complete.
Auto fill the fresh water top off container whenever its low with no input. I will like to use a virtual outlet to manually control the salt reservoir being filled. When I start the Salt being filled I wish for the system to go through the same flushing cycle as the fresh system - start, finish, and hourly. Ill only ever fill the salt or the fresh tanks. There is the chance both may trigger a low sensor around the same time but the salt VO will manually turned on when Im ready.

Here's my tentative code. I'm 100% making this is simple and foolproof as possible. The code does need to be robust even if that's at the cost of complexity or more VO to ensure it runs as designed.



This is the main solenoid It shall shut off IMMEDIATELY if "RO_Shutdown" turns On Otherwise it will be on as long as we are filling the Fresh or salt systems
Code:
"RODIswitch"
Fallback OFF
Set OFF
If Outlet FreshVO_Fill On Then On
If Outlet SALT_Fill On Then On
If Outlet RO_Shutdown On then OFF

This is the flush solenoid. It needs to be on whenever the 3 flush VOs are on "Initial_FlushVO", "Final_FlushVO", "Hourly_FlushVO". When the flush solenoid is on "Salt_Fill" and "Fresh_Fill" solenoids need to be off. It shall shut off IMMEDIATELY if "RO_Shutdown" turns On
Code:
"ROFlush"
Fallback OFF
If Outlet RO_Shutdown On then OFF
If Outlet Initial_FlushVO On then ON
If Outlet Initial_FlushVO OFF then OFF
If Outlet Final_FlushVO On then ON
If Outlet Final_FlushVO OFF then OFF
If Outlet Hourly_FlushVO On then ON
If Outlet Hourly_FlushVO OFF then OFF

This is the ato holding tank. The "Fresh_Fill" solenoid needs to be off when RO membrane is being flushed and on if we are filling the fresh ato tank. It shouldn't turn on if we are filling the Salt tank. It shall shut off IMMEDIATELY if "RO_Shutdown" turns On
Code:
"Fresh_Fill"
Fallback OFF
If Outlet RO_Shutdown On then OFF
If Outlet Initial_FlushVO On then OFF
If Outlet Final_FlushVO On then OFF
If Outlet Hourly_FlushVO On then OFF
If Outlet FreshVO_Fill On then On

This is the Salt holding tank. It can take 12+ hours to fill. The "Salt_Fill" solenoid needs to be off when RO membrane is being flushed and on if we are filling the Salt tank. It shouldn't turn on if we are filling the ATO tank. It shall shut off IMMEDIATELY if "RO_Shutdown" turns On
Code:
"Salt_Fill"
Fallback OFF
If Outlet RO_Shutdown On then OFF
If Outlet Initial_FlushVO On then OFF
If Outlet Final_FlushVO On then OFF
If Outlet Hourly_FlushVO On then OFF

This VO is to look at a leak sensor "GarageLK" and IMMEDIATELY turn off all 4 solenoids in the Mixing station. I deferred the On state for 5 seconds to prevent any false alarms. It will turn off the entire mixing station for 10 days or until I manually reset.
Code:
VO - "RO_Shutdown"
Fallback OFF
Set OFF
If GarageLK Closed then On
Defer 00:05 Then On
Min Time 14400:00 Then Off

This VO is to Flush the RO membrane by turning on for the FIRST ten min when the RODIswitch solenoid gets triggered on. I think I have an issue here where it will go into a 20 min on off cycle. I only want this to trigger once when the RO system turns on.
Code:
VO - "Initial_FlushVO"
Fallback OFF
Set OFF
If RODIswitch ON Then ON
Min Time 10:00 Then On
When ON > 10:01 Then OFF

This VO is to Flush the RO membrane by turning on for the LAST ten min. I figured by triggering this flush when the High fill limits are reach is the best way to ensure we are at the end of the filling session. I only want this to trigger once when the RO system (salt tank or the fresh tank) is full and once complete the whole system should shut down and all solenoid are to close.
Code:
VO - "Final_FlushVO"
Fallback OFF
Set OFF
If ATO_H Closed Then On
If SALT_H Closed Then On
Min Time 10:00 Then On
When ON > 10:01 Then OFF

This VO is to Flush the RO membrane by turning on every hour for 1 min.
Code:
VO - "Hourly_FlushVO"
Fallback OFF
Set OFF
If RODIswitch On then ON
Min Time 1:00 Then On
When ON > 1:01 Then OFF
Defer 59:00 Then ON

This VO is the trigger to kick off filling the ato Fresh tank. Its on when the low optical sensor is triggered and turns off 10 min and 5 sec after the high sensor is triggered. This is to allow the final 10 min flush to occur.
Code:
VO - "FreshVO_Fill"
Fallback OFF
Set OFF
If ATO_L Open Then ON
If ATO_H Closed Then OFF
Defer 10:05 Then OFF

*I will manually turn on the VO when I’m ready to fill the Salt reservoir. It turns off 10 min and 5 sec after the high sensor is triggered. This is to allow the final 10 min flush to occur.
Code:
VO - "SALT_Fill"
If SALT_H Closed Then OFF
Defer 10:05 Then OFF


 

blaxsun

10K Club member
View Badges
Joined
Dec 15, 2020
Messages
26,709
Reaction score
31,151
Location
The Abyss
Rating - 0%
0   0   0
Do you think the code is sound? I'll begin implementing it next week when I return from a trip. Hoping to work out any major flaws now.
Haha, you would ask that. I've found the stand-alone optical sensors are less than reliable which is why I'm switching to a LLS for one of my reservoirs (it never seems to trigger the open/closed properly). The leak sensors have always worked great and the dual optical/float sensor on the ATK kit works reliably.
 
OP
OP
espinobj

espinobj

Community Member
View Badges
Joined
Jul 6, 2020
Messages
50
Reaction score
24
Location
Dallas
Rating - 0%
0   0   0
Haha, you would ask that. I've found the stand-alone optical sensors are less than reliable which is why I'm switching to a LLS for one of my reservoirs (it never seems to trigger the open/closed properly). The leak sensors have always worked great and the dual optical/float sensor on the ATK kit works reliably.
You can't fully submerge the LLS and my Saltwater tank is about 64" tall. It wouldn't work for me.
 

KeepAFish

Community Member
View Badges
Joined
Feb 26, 2023
Messages
69
Reaction score
61
Location
22827
Rating - 0%
0   0   0
I was looking at doing something very similar and implementing multiple solenoids to accomplish it. I have not had a chance to review the code completely, but I am not a seasoned expert in Fusion either. Please let us know how it goes.

I highly recommend redundancy with float valves, multiple types of sensors, etc. I usually focus on figuring out anything that could go wrong and try to address that as much as possible. I assume everything will fail at some point. I am sure you will monitor everything closely for a while before you fully trust the code.

You mentioned it can take 12+ hours to fill. I like the idea of using a when on statement to turn it off if the max time to fill is ever exceeded. Another concern is that if your ATO or salt reservoir is full, it may not be willing to fill the other until the sensor is open again -probably not a concern, just something to be aware of.

For my own benefit, what are you using for your acc ports?
 
OP
OP
espinobj

espinobj

Community Member
View Badges
Joined
Jul 6, 2020
Messages
50
Reaction score
24
Location
Dallas
Rating - 0%
0   0   0
I was looking at doing something very similar and implementing multiple solenoids to accomplish it. I have not had a chance to review the code completely, but I am not a seasoned expert in Fusion either. Please let us know how it goes.

I highly recommend redundancy with float valves, multiple types of sensors, etc. I usually focus on figuring out anything that could go wrong and try to address that as much as possible. I assume everything will fail at some point. I am sure you will monitor everything closely for a while before you fully trust the code.

You mentioned it can take 12+ hours to fill. I like the idea of using a when on statement to turn it off if the max time to fill is ever exceeded. Another concern is that if your ATO or salt reservoir is full, it may not be willing to fill the other until the sensor is open again -probably not a concern, just something to be aware of.

For my own benefit, what are you using for your acc ports?
The lack of ACC ports is my biggest complaint with my APEX. I purchased two 1 links modules and I have two FMM modules. I wish I could get a single "ACC" module with only 5 ACC ports. I don't have many items that use the 1 link ports. Maybe one day...
List of ACC usage is:
- PMUP for sending ATO water to the tank. I think the length of tubing is about 50'. This has failed about once a year on me. Will eventually switch to a different pump once I install an energy bar for the mixing station.
- 4 solenoids for the mixing station as mentioned above.

Other items out there is a leak sensor possible an additional in the future, a DOS for auto water changes, 4 optical sensors, and as mentioned a future energy bar and possibly a COR. I use a external pump on a simple WiFi timer to mix the salt tank and run it through a sediment filter 15 min twice a day.
 

Dburr1014

7500 Club Member
View Badges
Joined
May 8, 2016
Messages
8,475
Reaction score
8,518
Location
CT
Rating - 0%
0   0   0
I'm doing a big upgrade to my RODI setup. Im adding three additional solenoids. The main solenoid (RODIswitch) is existing and used as a on/off switch.
There is a leak sensor labeled "GarageLK" and will work as a master shut off. Each of my storage containers have a high and low optical sensor - SALT_H, SALT_L, ATO_H, ATO_L.
The goal is to have my RODI auto flush every hour while filling. Auto flush when the RODI system turns on and a flush when filling is complete.
Auto fill the fresh water top off container whenever its low with no input. I will like to use a virtual outlet to manually control the salt reservoir being filled. When I start the Salt being filled I wish for the system to go through the same flushing cycle as the fresh system - start, finish, and hourly. Ill only ever fill the salt or the fresh tanks. There is the chance both may trigger a low sensor around the same time but the salt VO will manually turned on when Im ready.

Here's my tentative code. I'm 100% making this is simple and foolproof as possible. The code does need to be robust even if that's at the cost of complexity or more VO to ensure it runs as designed.



This is the main solenoid It shall shut off IMMEDIATELY if "RO_Shutdown" turns On Otherwise it will be on as long as we are filling the Fresh or salt systems
Code:
"RODIswitch"
Fallback OFF
Set OFF
If Outlet FreshVO_Fill On Then On
If Outlet SALT_Fill On Then On
If Outlet RO_Shutdown On then OFF

This is the flush solenoid. It needs to be on whenever the 3 flush VOs are on "Initial_FlushVO", "Final_FlushVO", "Hourly_FlushVO". When the flush solenoid is on "Salt_Fill" and "Fresh_Fill" solenoids need to be off. It shall shut off IMMEDIATELY if "RO_Shutdown" turns On
Code:
"ROFlush"
Fallback OFF
If Outlet RO_Shutdown On then OFF
If Outlet Initial_FlushVO On then ON
If Outlet Initial_FlushVO OFF then OFF
If Outlet Final_FlushVO On then ON
If Outlet Final_FlushVO OFF then OFF
If Outlet Hourly_FlushVO On then ON
If Outlet Hourly_FlushVO OFF then OFF

This is the ato holding tank. The "Fresh_Fill" solenoid needs to be off when RO membrane is being flushed and on if we are filling the fresh ato tank. It shouldn't turn on if we are filling the Salt tank. It shall shut off IMMEDIATELY if "RO_Shutdown" turns On
Code:
"Fresh_Fill"
Fallback OFF
If Outlet RO_Shutdown On then OFF
If Outlet Initial_FlushVO On then OFF
If Outlet Final_FlushVO On then OFF
If Outlet Hourly_FlushVO On then OFF
If Outlet FreshVO_Fill On then On

This is the Salt holding tank. It can take 12+ hours to fill. The "Salt_Fill" solenoid needs to be off when RO membrane is being flushed and on if we are filling the Salt tank. It shouldn't turn on if we are filling the ATO tank. It shall shut off IMMEDIATELY if "RO_Shutdown" turns On
Code:
"Salt_Fill"
Fallback OFF
If Outlet RO_Shutdown On then OFF
If Outlet Initial_FlushVO On then OFF
If Outlet Final_FlushVO On then OFF
If Outlet Hourly_FlushVO On then OFF

This VO is to look at a leak sensor "GarageLK" and IMMEDIATELY turn off all 4 solenoids in the Mixing station. I deferred the On state for 5 seconds to prevent any false alarms. It will turn off the entire mixing station for 10 days or until I manually reset.
Code:
VO - "RO_Shutdown"
Fallback OFF
Set OFF
If GarageLK Closed then On
Defer 00:05 Then On
Min Time 14400:00 Then Off

This VO is to Flush the RO membrane by turning on for the FIRST ten min when the RODIswitch solenoid gets triggered on. I think I have an issue here where it will go into a 20 min on off cycle. I only want this to trigger once when the RO system turns on.
Code:
VO - "Initial_FlushVO"
Fallback OFF
Set OFF
If RODIswitch ON Then ON
Min Time 10:00 Then On
When ON > 10:01 Then OFF

This VO is to Flush the RO membrane by turning on for the LAST ten min. I figured by triggering this flush when the High fill limits are reach is the best way to ensure we are at the end of the filling session. I only want this to trigger once when the RO system (salt tank or the fresh tank) is full and once complete the whole system should shut down and all solenoid are to close.
Code:
VO - "Final_FlushVO"
Fallback OFF
Set OFF
If ATO_H Closed Then On
If SALT_H Closed Then On
Min Time 10:00 Then On
When ON > 10:01 Then OFF

This VO is to Flush the RO membrane by turning on every hour for 1 min.
Code:
VO - "Hourly_FlushVO"
Fallback OFF
Set OFF
If RODIswitch On then ON
Min Time 1:00 Then On
When ON > 1:01 Then OFF
Defer 59:00 Then ON

This VO is the trigger to kick off filling the ato Fresh tank. Its on when the low optical sensor is triggered and turns off 10 min and 5 sec after the high sensor is triggered. This is to allow the final 10 min flush to occur.
Code:
VO - "FreshVO_Fill"
Fallback OFF
Set OFF
If ATO_L Open Then ON
If ATO_H Closed Then OFF
Defer 10:05 Then OFF

*I will manually turn on the VO when I’m ready to fill the Salt reservoir. It turns off 10 min and 5 sec after the high sensor is triggered. This is to allow the final 10 min flush to occur.
Code:
VO - "SALT_Fill"
If SALT_H Closed Then OFF
Defer 10:05 Then OFF


That is a lot of code.

I kept mine very very simple.
When RODI for auto-topoff goes empty, I do flush, fill with flush every hour.
To do salt water reservoir fill, I went manually to pump over. Reasoning is if both containers were empty I would have to wait anyway. (I'm doing AWC changes also.)
Here is some code I have.

This is ato-ro-di

Screenshot_20230301_113543_APEXFusion.jpg

And everything else for 1st flush timer and hourly flush and when the float valve first starts(rodi empty) The 2 flush outlets are virtual. Screenshot_20230301_113346_APEXFusion.jpg Screenshot_20230301_113311_APEXFusion.jpg Screenshot_20230301_113238_APEXFusion.jpg

I also have leak sensors so if anything leaks the whole system shuts down.
 
Last edited:

n2585722

2500 Club Member
View Badges
Joined
Jun 17, 2013
Messages
3,676
Reaction score
2,119
Location
Cedar Park, Tx
Rating - 0%
0   0   0
I have done this but it is not on a Apex so I would not know how you would do it on the Apex but my controller automatically refills my DI tank when it goes low. It has a float switch for low level and full but I have a float valve on the line coming from the RODI as a backup. There is also a time limit set for the refill and if exceeded the fill solenoid is turned off and a alert is sent. I also have a fresh saltwater tank and mix tank. The fresh salt water tank also has a low level float switch and a full float switch. if it goes low and the mix tank is ready to use the contents from the mix tank is transferred to the fresh saltwater tank. Then the mix than which also has a low level float switch and a full float switch will automatically refill from RODI until it is full. All I have to do is add the salt mix and press the mix ready button when it is ready to use. The flush solenoid and a booster pump if you have one are also controlled by the controller. I only have the flush solenoid and not a booster pump. Your code seems to be quite complex but as I said I don't know Apex code.Below are three outputs I have setup. The first three screenshots are of the RODI output that controls the input solenoid to the RODI. It uses the RODI filter output type. The Feed Output Device is the input solenoid. The flush output device is the flush solenoid. The Boost Output Device is the boost output. These outputs are AC outputs on one of the controllers. I don't actually have the booster pump but setup an output for it in case I get one later. The flush output comes on for 1 minute when it starts and for1 minute ever hour after that until the out put goes off. The high level input is usually a full sensor and the low level input is usually an empty sensor. In this case since I also use other solenoids to determine where the RODI output goes I use the same relay contacts in a input to trigger both High and low sensors for this particular outputs. The other individual outputs control which of the tanks are refilled. The maximum on time is set to 5 hours for any one run time. If it get to the maximum on time it is set to turn off and will send an alert.

The forth and fifth screenshots are one of those outputs for DI refill. It also uses the RODI output type but it does not use the flush output or booster output. This output uses a drive port which powers the solenoid with 12v when on. On this output the DI low is a float switch input in the DI tank. The DI high input is a full float switch in the DI tank. The maximum on time for this output is set to 5 hours so it will only stay on for 5 hours for any one instance. It is also set to turn off if it stays on for 5 hours and a alert will be sent.

The sixth and seventh screenshots are f an output used to turn on the first output discussed if one of the other outputs where we want the first output on is on this output will power the relay to create a low level. It also creates a full indication when off since both of the inputs on the first output are the same relay input. This output uses the combiner output type. It has an input count of three so three different outputs can cause this output to be on which will turn on the first output. The first input from an output is from the output RODI timer. All this output does s come on on a schedule every 4 hours for 15 minutes six times in a 24 hour period. This is to refill the RO bladder tank which supplies my fridge for the ice maker and water dispense. So that is a non aquarium use. The Second input from a output is from the DI refill output which is the second output from the previous paragraph. The third input from an output is from the mix refill output which I did not discuss here vut is very similar to the DI refill output. The combiner mode is OR since we want this output on if any of the three inputs are active which would be on. This output also has a dependency on the output Leak Garage which is on if there is a leak. That is the location of my RODI and my three storage tanks. The dependency mode is set to off if on. So if the Leak Garage output is on then this output will be off regardless of any other input state. Some of the other outputs here also have the dependency setup but I just now brought it up. If you have questions on the inputs or other outputs that go with this you can let me know. I also have more info on this in my build thread here on R2R. The RODI info starts on page 7 post #128. Just click on my build thread contributor banner on my post to get to my build thread. I have changed it some since those first post about it. Mainly it has to do with the RODI filter output type which did not exist when I first set it up so there are more outputs used in the original setup. I don't think I got around to adding an update after adding the flush solenoid which is why I have the input solenoid and the flush valve on the first output which is the main change along with the added relay.


0A056DDE-F10A-4BCC-9857-C5D5486880EF.png

502158B7-FDD0-49B2-8744-DEBF0DB9674B.png

FA5F0362-76B8-4876-AE9B-D84F77EEB46C.png


61C18668-35B5-4134-BEC0-A6CC978AF5F6.png

875757E7-80D9-4A2D-8DF1-E9DB5C2FE813.png


BF4FBEB5-F92E-4C22-B751-16CC6C81F551.png

0AEBDEA1-555C-48B5-919D-ACE66BD250B7.png
 

AJsReef

Valuable Member
View Badges
Joined
Oct 19, 2017
Messages
1,121
Reaction score
1,060
Location
North Florida
Rating - 0%
0   0   0
Manufacturers in the hobby have made a small fortune selling flush kits and prescribing flushing as a necessity. The reality it's a frivolous exercise. If you maintain the recommended waste water ratio for your membrane there's no need to flush.

If TDS creep is a major concern find a way to bypass your DI beds as soon as you turn it for the appropriate amount of needed to prevent the spike from hitting DI stages.
 
OP
OP
espinobj

espinobj

Community Member
View Badges
Joined
Jul 6, 2020
Messages
50
Reaction score
24
Location
Dallas
Rating - 0%
0   0   0
That is a lot of code.

I kept mine very very simple.
When RODI for auto-topoff goes empty, I do flush, fill with flush every hour.
To do salt water reservoir fill, I went manually to pump over. Reasoning is if both containers were empty I would have to wait anyway. (I'm doing AWC changes also.)
Here is some code I have.

This is ato-ro-di

Screenshot_20230301_113543_APEXFusion.jpg

And everything else for 1st flush timer and hourly flush and when the float valve first starts(rodi empty) The 2 flush outlets are virtual. Screenshot_20230301_113346_APEXFusion.jpg Screenshot_20230301_113311_APEXFusion.jpg Screenshot_20230301_113238_APEXFusion.jpg

I also have leak sensors so if anything leaks the whole system shuts down.
Ok so I really like the idea of using OSC for the hourly flush. However do you flush the system and leave water flowing into the water reservoir? Dumb question is there any benefit to stopping that flow during a flush?
 

Dburr1014

7500 Club Member
View Badges
Joined
May 8, 2016
Messages
8,475
Reaction score
8,518
Location
CT
Rating - 0%
0   0   0
Ok so I really like the idea of using OSC for the hourly flush. However do you flush the system and leave water flowing into the water reservoir? Dumb question is there any benefit to stopping that flow during a flush?
I think your asking me... During a flush the water keeps going in my rodi can?
When a flush happens ALL water is diverted to the drain. After 1 minute it continues to make pure water. No "bad" water mixes with the pure water.
 

Bubbles, bubbles, and more bubbles: Do you keep bubble-like corals in your reef?

  • I currently have bubble-like corals in my reef.

    Votes: 21 34.4%
  • I don’t currently have bubble-like corals in my reef, but I have in the past.

    Votes: 7 11.5%
  • I don’t currently have bubble-like corals in my reef, but I plan to in the future.

    Votes: 21 34.4%
  • I don’t currently have bubble-like corals in my reef and have no plans to in the future.

    Votes: 11 18.0%
  • Other.

    Votes: 1 1.6%
Back
Top