Programming Apex to Control Calcium Reactor

CCK_8814

2500 Club Member
View Badges
Joined
May 22, 2018
Messages
3,014
Reaction score
1,405
Location
Detroit
Rating - 89.5%
17   2   0
So I’m trying to figure out how to write a code for my apex to help control the CO2 regulator on my calcium reactor. Basically, I need it to do something like this:

If alkalinity >8.8 then reactor pH 6.90
If alkalinity <9.0 then reactor pH 7.00

Or even something as simple as:

If alkalinity >8.8 then CO2 solenoid on
If alkalinity <9.0 then CO2 solenoid off

I’m hoping someone with better apex coding skills then myself can help me out. If need any info/screen shots from my fusion let me know. Thanks!
 

vetteguy53081

Well known Member and monster tank lover
View Badges
Joined
Aug 11, 2013
Messages
92,190
Reaction score
203,837
Location
Wisconsin -
Rating - 100%
14   0   0
I have mine setup (thanks to coralfuture) the way as written on the second example you have. It is spot on
 

LondonJon

Community Member
View Badges
Joined
Dec 26, 2019
Messages
25
Reaction score
15
Rating - 0%
0   0   0
What happens when alk is 8.9?
Solenoid off and then On constantly switching.

Better to code
>8.9
<8.8
 

Thales

Valuable Member
View Badges
Joined
Nov 21, 2009
Messages
1,964
Reaction score
4,726
Location
SF BA
Rating - 0%
0   0   0
OP
OP
CCK_8814

CCK_8814

2500 Club Member
View Badges
Joined
May 22, 2018
Messages
3,014
Reaction score
1,405
Location
Detroit
Rating - 89.5%
17   2   0
for 6 hours. If that happened in my systems the alk would plummet over that time. The code using limiter vo’s and trident to control carx that seem much more effective and safer.

It’s controlled via KH guardian. System auto doses as needed, is also supplemented with kalkwasser & there is also a virtual outlet programmed that automatically kicks the solenoid on for 15 minutes of its off for more than 45.
 
OP
OP
CCK_8814

CCK_8814

2500 Club Member
View Badges
Joined
May 22, 2018
Messages
3,014
Reaction score
1,405
Location
Detroit
Rating - 89.5%
17   2   0
for 6 hours. If that happened in my systems the alk would plummet over that time. The code using limiter vo’s and trident to control carx that seem much more effective and safer.

Still being dialed in but a 0.5 fluctuation throughout day isn’t bad IMO.

4E8D8598-19B7-4483-B377-D173773563EA.png
 

Thales

Valuable Member
View Badges
Joined
Nov 21, 2009
Messages
1,964
Reaction score
4,726
Location
SF BA
Rating - 0%
0   0   0
It’s controlled via KH guardian. System auto doses as needed, is also supplemented with kalkwasser & there is also a virtual outlet programmed that automatically kicks the solenoid on for 15 minutes of its off for more than 45.
Gotcha. I missed the KH guardian part.
 

ca1ore

10K Club member
View Badges
Joined
Oct 28, 2014
Messages
13,918
Reaction score
19,769
Location
Stamford, CT
Rating - 0%
0   0   0
Apex cannot do comparative statements unfortunately. I just set my CaRx to run continuously at a specified pH.
 
OP
OP
CCK_8814

CCK_8814

2500 Club Member
View Badges
Joined
May 22, 2018
Messages
3,014
Reaction score
1,405
Location
Detroit
Rating - 89.5%
17   2   0
If it’s off, the code isn’t working correctly,
Because

If alkalinity >8.8 then CO2 solenoid on

Should turn it on when it’s at 8.9
This is how it’s coded. If it’s less than 8.85 solenoid is on. If it’s greater than 9.0 it’s off. If it’s off for longer than 45 minutes it turns on for 10 even if alk is above 9.

122DC6DB-B806-4E7F-BF9F-D840ADEF7B31.png BFCCAFC1-90EB-4617-91C2-A0D26F54FF87.png
 

ca1ore

10K Club member
View Badges
Joined
Oct 28, 2014
Messages
13,918
Reaction score
19,769
Location
Stamford, CT
Rating - 0%
0   0   0
If alkalinity >8.8 then CO2 solenoid on
If alkalinity <9.0 then CO2 solenoid off

Wouldn’t you want the CO2 solenoid on if the alkalinity were below 8.8, rather than above? Something like

FALLBACK OFF
SET ON
If ALK > 9.0 Then OFF
DEFER 001:00 Then OFF

Edit - never mind, I see you fixed it.
 
OP
OP
CCK_8814

CCK_8814

2500 Club Member
View Badges
Joined
May 22, 2018
Messages
3,014
Reaction score
1,405
Location
Detroit
Rating - 89.5%
17   2   0
Wouldn’t you want the CO2 solenoid on if the alkalinity were below 8.8, rather than above? Something like

FALLBACK OFF
SET ON
If ALK > 9.0 Then OFF
DEFER 001:00 Then OFF
See my response above showing code. If alk is below 8.85 the solenoid is on.
 

LondonJon

Community Member
View Badges
Joined
Dec 26, 2019
Messages
25
Reaction score
15
Rating - 0%
0   0   0
This is how it’s coded. If it’s less than 8.85 solenoid is on. If it’s greater than 9.0 it’s off. If it’s off for longer than 45 minutes it turns on for 10 even if alk is above 9.

122DC6DB-B806-4E7F-BF9F-D840ADEF7B31.png BFCCAFC1-90EB-4617-91C2-A0D26F54FF87.png

this code makes sense.

the code in the original post did not!
 

Kjames

Active Member
View Badges
Joined
Aug 14, 2019
Messages
172
Reaction score
176
Location
Athens, GA
Rating - 0%
0   0   0
Ya it took some tweaking but with the help of another member here I was able to get it going!
I know this is an old post but can you clarify - When using VOs to control the CO2, are you letting your effluent run without interruption and relying on only the CO2 levels to control effluent concentration? If so, do you have a failsafe high alk setpoint at which the effluent turns off?
 

Form or function: Do you consider your rock work to be art or the platform for your coral?

  • Primarily art focused.

    Votes: 15 7.9%
  • Primarily a platform for coral.

    Votes: 34 17.8%
  • A bit of each - both art and a platform.

    Votes: 127 66.5%
  • Neither.

    Votes: 9 4.7%
  • Other.

    Votes: 6 3.1%
Back
Top