Kalk dosing pump, continuous dosing for low pH, turns off for high pH need to check my code please!

Lousybreed

Well-Known Member
View Badges
Joined
Feb 11, 2017
Messages
822
Reaction score
648
Location
Sussex, WI
Rating - 0%
0   0   0
Ok here is my goal and I wanted to check with the coding masters for apex of this is what I want. I want to dose kalk on a timed basis (every XX minutes dose for YY minutes), except when the pH gets above 8.35 dosing turns off and if the pH gets below 8.25 the dosing turns on. Would this be the code:
1 fallback Off
2 OSC 000:00/00X:XX/0YY:YY then on
3 If pH > 8.35 then off
4 If pH < 8.25 then on
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
No, there's a big problem with this approach. The Apex evaluates each line of code from top to bottom, and the last line that evaluates True will set the output state. If the pH is between 8.25 and 8.35, the only True line of code is the OSC command, so it will turn on and off on the timed schedule. Once the pH is over 8.35, it will turn off. But the problem is if the pH is ever below 8.25, then the doser will run continuously and override the OSC schedule. Depending on the rate of your dosing pump, this could overdose the kalk and cause a rapid spike in pH.

Since kalk will always raise pH, a better approach is to only check if it's too high to turn off the doser, but if it's too low, just send an alert which would let you know you need to change the OSC schedule to deliver more because the schedule is not enough to keep up. Example:

[Kalk_Pump]
Fallback OFF
OSC 000:00/001:00/029:00 then ON
If pH > 8.35 then OFF

[EmailAlm]
Set OFF
If pH < 8.25 Then ON

When you receive the alert that pH is too low, then edit the OSC command to increase the kalk dosing frequency:

[Kalk_Pump]
Fallback OFF
OSC 000:00/002:00/028:00 then ON
If pH > 8.35 then OFF
 
OP
OP
Lousybreed

Lousybreed

Well-Known Member
View Badges
Joined
Feb 11, 2017
Messages
822
Reaction score
648
Location
Sussex, WI
Rating - 0%
0   0   0
What happens if I am crazy and I want my doser to run until the pH gets above 8.25? Would my code work? Thank you for the response by the way!!! I appreciate it. Basically I am chasing ph. I only want to add kalk when my pH is under 8.35. For most of the time the OSC function will work nicely. My question also is if the doser gets the pH above 8.25 will it go from constantly on back to the OSC function?
 
OP
OP
Lousybreed

Lousybreed

Well-Known Member
View Badges
Joined
Feb 11, 2017
Messages
822
Reaction score
648
Location
Sussex, WI
Rating - 0%
0   0   0
My alk is sitting right around 8.0 which is a little low for my liking but my pH is only swinging about 0.10 on a daily basis.
 

Attachments

  • 30BE441A-21B9-4D98-96F6-CA65064C7069.png
    30BE441A-21B9-4D98-96F6-CA65064C7069.png
    368 KB · Views: 38
  • 219B96DD-3857-4B8D-9415-153755910627.png
    219B96DD-3857-4B8D-9415-153755910627.png
    286.5 KB · Views: 43

hans4811

Active Member
View Badges
Joined
Dec 30, 2019
Messages
425
Reaction score
393
Location
Jax, FL
Rating - 0%
0   0   0
My alk is sitting right around 8.0 which is a little low for my liking but my pH is only swinging about 0.10 on a daily basis.
So what was the code you ended up using ? Are you using a DOS pump ? I ask as I’m getting ready to start dosing Kalk as well…
 

ZombieEngineer

Valuable Member
View Badges
Joined
Apr 3, 2022
Messages
1,310
Reaction score
1,175
Location
Broomfield
Rating - 0%
0   0   0
I have an in depth guide on the right way to do this here. Please read this first then come back with any questions.

 

Heabel7

Active Member
View Badges
Joined
Aug 10, 2018
Messages
427
Reaction score
384
Rating - 0%
0   0   0
Just an update this has been rock solid for my needs. Thanks for the help.
Code you used sir? I want to do same thing.

zombie can you point out the part specific to this question. That thread starts with ATO and has so much programming involved that seems far beyond the simply dosing from a reservoir.
 
Back
Top