I use a Raspberry Pi to control my CaRx dosing to target a preset alkalinity level.
To achieve this, I have my Alkatronic test every 3 hours and publish the alk reading over MQTT. The RPI listens for the alk reading and adjusts the flow rate of the CaRx based on it. I run a static flow rate of 8.5 ml/min for the CaRx, and every 15 minute block of time, the RPI toggles the CaRx effluent pump on for a portion of the time and off for the rest of the time. The ratio of on and off is adjusted with a logarithmic back off if the target is exceeded and a balance factor starts to accumulate. The more the overshoot, the faster the balance factor accumulates. The balance factor is used to slow down dosing and persists even if the next reading is no longer exceeding the target. When the reading is not reaching the target alk, if there is a accumulated balance factor still being used, the balance factor starts to be decremented to slowly unwind the adjustment until it reaches zero.
My lights are on from 9 AM to 9 PM, so I run a varying flow rate. From 12 AM until 6 AM, the flow rate is 30% (of 8.5 ml/min), from 6 AM to 3 PM 65%, from 3 PM to 9 PM 75%, and from 9 PM until 12 AM 65%.
I keep my effluent at a fairly strong 90 dKH by auto venting my CaRx everyday.
The varying flowrate gets me pretty close to a flat line assuming there is no increase or decrease of alk uptake.
My 30 day view shows how effective this can be when there is a perturbation in the alk uptake. I recently used Chemiclean after getting frustrated with some cyano that was getting out of hand. You can see the disruptions starting around June 12th, from the addition of the Chemiclean. When I started a water change on the 14th, the alk shot up, and the CaRx went into automatic shutdown. Once the water change ended on the 15th, the RPI brought the CaRx back online and started wrestling the alk back down towards the target. During this process, the balance ratio reached 22%. As the corals started to return to normal alk usage, you can see the sag in alk levels at two points where the increased uptake was exceeding the rate that the balance ratio was being unwound. Around July 2nd, the balance ratio and alk uptake were in sync (about 8% balance ratio), and the alk readings returned to their flat line. Well until the change to the Coralvue reagent messed it up. Interestingly the existing balance ratio is being unwound further, currently 6.38%, and the last 3 alk readings are showing the increase as the flow is sped up to try to get closer to 8.6 dKH.
During the alk uptake disruption from the Chemiclean, I made no changes to the dosing in any way and just let the RPI handle it. I think it did pretty well dealing with it on it's own.