Edge AI · Predictive Coagulation
Predictive Alum Auto-Dosing
Edge-AI fuses upstream river, JPS hydrology and weather with downstream SCV/SCD and jar-test recipe to forecast NTU spikes and recommend the alum setpoint before the disturbance reaches the intake.
PLC has final control
Operator view · Live
Stage 1 · AdvisoryForecast NTU
22NTU
↑ spike in 0 min
Recommended dose
+0%stroke
38 → 38 ppm
Loop status
PLC in control
Stage 1 · Decision support
Loop nominal — SCV −105 tracking, no dose change recommended.
ConfidenceModel: rainfall→NTU · v3.2 · Edge inference @ UTHM node
86%
Raw-water NTU · actual vs forecast
Next 3h · 15-min step Actual (past 60 min) Forecast Predicted spike
Live dosing plan · execution
PLC setpoint ramp 38 → 38 ppm(0 steps · ETA 0 min · ramp ±4 ppm/5 min)
Now
38 ppm
current
Recommended dose is driven by recipe base × (1 + forecast %), clamped to jar-test guardrails. Apply a jar-test to refresh instantly.
Predictive actuator auto-tune · Edge-AI advises PID/PLC
PID · stroke length · pump frequency fused upstream forecast + downstream SCV feedback
Upstream feed-forward
peak 22 NTU in — · ff gain 0%
Downstream feedback (SCV)
SCV -108 · target -100 · err -8
Spike urgency
0% · coag pH 6.85
PID gains
Kp
1.201.20
Ki
0.1500.155(+0.005)
Kd
0.400.40
Kp/Kd ride the forecast; Ki settles residual SCV offset.
Dosing pump stroke
%
Stroke length
56%56%
baselinetuned
4–20 mA stroke command · target dose 38 ppm within 24–68 ppm envelope.
VFD pump frequency
Hz
Frequency
35.0 Hz35.3 Hz(+0.3)
baselinetuned
VFD held 20–50 Hz. Lifts ahead of NTU spike to pre-load coagulant.
Early-warning SCV setpoint
SCV SP
-100-100
Predictive layer nudges the PID target more negative before the spike lands, keeping SCD/PID in control.
Guardrails & fail-safe
- • Kp ≤ 2.5 · Ki ≤ 0.35 · Kd ≤ 1.0 (tuning envelope from jar-test regression)
- • Stroke clamped to 24–68 ppm equivalent
- • VFD 20–50 Hz · ramp ±4 ppm/5 min
- • Fail-safe trip: SCV < −250 or filtered NTU > 4 → revert to baseline
- • Every write logged to audit centre with recipe version + snapshot
- • AI advising — PLC has final authority
Spike simulator · Replay forecast patterns
Auto-tune response replay synthetic upstream/downstream shock — no plant impact
t = +0 minNTU now 25 · peak 41 in 45m · SCV -100
Kp
1.201.62
Stroke
56%56%
VFD
35.0Hz40.5Hz
SCV SP
-100-114
Forecast drivers
Forecast NTU (upstream)40.50 NTU
NTU nowNTU peak
SCV feedback (downstream)-100 µA
SCVtarget
Actuator responses — baseline vs tuned
Kp (proportional gain)1.62
baselinetuned
Ki (integral gain)0.19
baselinetuned
Kd (derivative gain)0.49
baselinetuned
Pump stroke length56.00 %
baselinetuned
VFD frequency40.50 Hz
baselinetuned
Early-warning SCV setpoint-114 µA
baselinetuned
Replays are simulated — actuator writes are suppressed. Baseline traces show the reactive PID; tuned traces show the predictive layer's advisory setpoints.
Predict
Upstream signals
- Rainfall (JPS station 3313040)
- 0.0 mm/h
- River level (Selangor U/S)
- 2.10 m
- Catchment lag
- ≈ 45 min
- Weather (next 3h)
- —
Fuse
Process signals
- Raw NTU (intake)
- 22.0 NTU
- Streaming current (SCV)
- −108 (target −100 ± 50)
- Coagulation pH
- 6.85
- Filtered turbidity
- 0.28 NTU (target < 1.0)
Act safely
Recipe & guardrails
- Jar-test recipe
- 38 ppm · pH 6.8 · pAC boost off
- Dose limits (guardrail)
- 24 – 68 ppm
- Max ramp rate
- ±4 ppm / 5 min
- Failsafe trip
- SCV < −250 or NTU > 4 (filtered)
Staged pathway to autonomy
Advisory → Supervised → Guarded autonomy
Twin model
Rainfall → NTU → dose · v3.2
Training window
180 days
Predict horizon
45 min
Bench calibrations
0 applied
Rolling dose MAE
2.10 ppm
Confidence boost
+0%
False-alarm rate
0.06 / day
Continuous learning
Awaiting first bench calibration. Each accepted bench recipe is fused with the upstream rainfall/NTU forecast and downstream SCV/pH residuals, then written to the audit trail so drift is traceable.Audit trail
Recent decisions
- Dose recommendation—+8% stroke · target SCV −105 · by AI
- Recommendation accepted—Setpoint 38 → 41 ppm · applied via PLC · by Operator
- Model retrained—Rainfall model refreshed · UTHM node · confidence 0.91 · by AI
Expected outcomes · pilot
What the twin puts in front of the plant
Earlier spike detection
≥ 45 min
vs reactive PID/SCD
Coagulant saved
6 – 12%
vs 7-day baseline
Filtered NTU excursions
−80%
above 1.0 NTU / week
Operator interventions
−60%
manual dose changes / shift