Field fix / guideDesign DocumentVendor-agnostic (IEC 61131-3)Water / Wastewaterindustrial-automation
Membrane Filtration with Automated Backwash Sequencing — Control Design
Shared by TSIMEREZIVO Team · 4 Oct 2026 · 38 views
# Water/Wastewater Template: Membrane Filtration with Automated Backwash Sequencing
## 1. Overview
**Purpose:**
Operate crossflow ultrafiltration (UF) or microfiltration (MF) membrane systems with **pressure-driven permeate production** and **air-assisted backwashing** to restore permeability. Membrane fouling increases transmembrane pressure (TMP) over time; periodically reversing flow + air bubbles removes accumulated solids. Goal: maintain TMP < 0.5 bar while maximizing treated water production (permeate).
**Industry Standards:**
- AWWA M53 (Membrane Processes for Water Treatment)
- EPA LT2ESWTR (Enhanced Surface Water Treatment Rule — Cryptosporidium removal)
- ASME BPE (Bioprocessing Equipment Standards — sanitary design)
- NFPA 68 (Dust Explosion Prevention)
- 3-A Sanitary Standards (Food & beverage grade water quality)
**Critical Constraints:**
- **TMP (Transmembrane Pressure):** feed pressure – permeate pressure – ΔP across membrane
- TMP ↑ over time as cake layer builds → filtration slows → eventually membrane clogs
- Target: stay <0.5 bar; exceed <0.7 bar before backwash
- **Fouling rate:** 5–20 kPa/hour depending on feed quality; clean water = slow fouling
- **Backwash frequency:** every 15–45 minutes typical (adjustable per fouling rate)
- **Backwash duration:** 30–120 seconds; longer = more complete, more permeate lost
- **CIP (Clean-in-Place):** chemical soak (citric acid, NaOH) every 2–4 weeks for deep cleaning
- **Air scour:** coarse bubbles during backwash dislodge particles; air flow ~100–200 m³/h per module
- **Membrane life:** 5–10 years if TMP managed well; <3 years if routinely overpressurized
- **Permeate flux:** typical 100–200 L/(m²·h); lower = less fouling, less capital cost
**Relevant Physics:**
- **Flux (J):** $J = \frac{\Delta P}{\eta \times R_m + R_c}$ (L/(m²·h))
- ΔP = transmembrane pressure
- η = water viscosity
- $R_m$ = membrane resistance (fixed, intrinsic)
- $R_c$ = cake resistance (increases as particles accumulate)
- **Backwash:** reverse flow restores resistance from $R_m + R_c$ → $R_m$ (removes $R_c$)
- **Air scour:** mechanical disruption of cake layer (non-destructive to membrane)
---
## 2. Control Philosophy
**Challenge:**
Membrane systems require **predictive fouling management**. Cannot run continuously — eventually TMP spikes and membrane ruptures. Must time backwashes before critical TMP, but not so frequently that you waste permeate and reduce net production.
**Solution: Adaptive Fouling Model with Dual-Trigger Backwash**
```
LAYER 1 — Fouling Rate Monitor
Input: TMP trend (last 30 minutes)
Output: Estimated time-to-critical-TMP (when TMP will reach 0.7 bar)
Method: Linear regression of TMP(t); if slope = 5 kPa/min, predict critical in 12 min
LAYER 2 — Backwash Scheduling
Trigger 1: Timer (backwash every 30 min regardless)
Trigger 2: TMP threshold (if TMP >0.6 bar, backwash now — emergency)
Trigger 3: Fouling rate prediction (if slope >10 kPa/min, backwash sooner to stay ahead)
LAYER 3 — Backwash Sequence (Automated)
Step 1: Close feed valve; open permeate drain valve
Step 2: Pressurize from permeate side (backward flow) — 10 seconds at 0.3 bar
Step 3: Simultaneously open air valve → feed coarse bubble air — 30 seconds
Step 4: Close air; hold reverse pressure 5 more seconds
Step 5: Open feed valve; resume normal filtration
Step 6: Log: TMP before, TMP after, duration, air volume
LAYER 4 — CIP Interval Management
Every 2 weeks: insert membrane into chemical bath (citric acid, followed by rinse)
CIP = deep clean; removes organic/inorganic scaling that backwash cannot
```
**Why This Approach:**
- Prevents crisis (TMP overshoot → rupture) with two triggers
- Fouling model adapts to feed water quality variations
- Air scour gentler than pure hydraulic backwash (extends membrane life)
- Automatic accounting reduces operator overhead
- Predictive scheduling reduces total backwash frequency → higher net permeate
---
## 3. Control Logic
**Pseudocode: Membrane Filtration Backwash Control**
```pascal
{ === MEMBRANE FILTRATION & BACKWASH CONTROLLER === }
{ Crossflow UF/MF with pressure-driven backwashing + air scour }
PROCEDURE Membrane_Filtration_Master
CONSTANTS
NUM_MODULES = 4 { parallel membrane skids }
MEMBRANE_AREA_M2 = [25, 25, 25, 25] { each }
TMP_TARGET_NOMINAL = 0.35 { bar, comfortable operating TMP }
TMP_WARNING = 0.55 { bar, start thinking about backwash }
TMP_TRIGGER_EMERGENCY = 0.70 { bar, force backwash now }
BACKWASH_TIME_SEC = 60 { duration }
AIR_SCOUR_TIME_SEC = 45 { simultaneous with backwash }
BACKWASH_INTERVAL_NOM_MIN = 30 { time-based trigger }
FOULING_RATE_ALARM_KPA_MIN = 10 { kPa per minute = critical rise }
CIP_INTERVAL_DAYS = 14 { clean-in-place chemical soak }
BACKWASH_PRESSURE_BAR = 0.3 { reverse pressure }
VARIABLES
{ Pressures }
feed_pressure_bar[1..NUM_MODULES] : REAL { bar }
permeate_pressure_bar[1..NUM_MODULES] : REAL
tmp_measured[1..NUM_MODULES] : REAL { bar, feed - permeate }
{ Flow measurements }
feed_flow_m3h[1..NUM_MODULES] : REAL
permeate_flow_m3h[1..NUM_MODULES] : REAL
permeate_flux_lpm2h[1..NUM_MODULES] : REAL { L/(m²·h) }
air_flow_m3h[1..NUM_MODULES] : REAL { during backwash }
{ Fouling tracking }
tmp_history[1..NUM_MODULES, 1..30] : REAL { last 30 minutes of TMP }
tmp_trend_slope[1..NUM_MODULES] : REAL { kPa per minute }
time_to_critical_min[1..NUM_MODULES] : REAL
{ Backwash state }
backwash_needed[1..NUM_MODULES] : BOOLEAN { 0/1, should trigger }
backwash_running[1..NUM_MODULES] : BOOLEAN { 0/1, in progress }
backwash_timer[1..NUM_MODULES] : INTEGER { seconds remaining }
air_scour_timer[1..NUM_MODULES] : INTEGER
last_backwash_time[1..NUM_MODULES] : TIMESTAMP
time_since_last_backwash[1..NUM_MODULES] : INTEGER { seconds }
{ Valve control }
feed_valve_cmd[1..NUM_MODULES] : REAL { 0–100% open }
permeate_drain_valve_cmd[1..NUM_MODULES] : REAL
backwash_pump_speed_vfd[1..NUM_MODULES] : REAL { Hz }
air_scour_solenoid[1..NUM_MODULES] : BOOLEAN { 0/1 open }
{ Diagnostics }
total_permeate_produced_m3 : REAL { cumulative }
backwash_count_today : INTEGER { tally }
tmp_exceedance_events : INTEGER { times >0.7 bar }
cip_due_days : INTEGER
BEGIN
{ === SENSOR ACQUISITION === }
FOR m = 1 TO NUM_MODULES DO
feed_pressure_bar[m] = Read_Feed_Pressure(m) { bar }
permeate_pressure_bar[m] = Read_Permeate_Pressure(m) { typically ~0.0 bar gauge }
feed_flow_m3h[m] = Read_Feed_Flow(m)
permeate_flow_m3h[m] = Read_Permeate_Flow(m)
{ Calculate TMP }
tmp_measured[m] = feed_pressure_bar[m] - permeate_pressure_bar[m]
{ Permeate flux }
permeate_flux_lpm2h[m] = (permeate_flow_m3h[m] / MEMBRANE_AREA_M2[m]) × 1000
END FOR
{ === FOULING RATE ESTIMATION === }
FOR m = 1 TO NUM_MODULES DO
{ Shift history back 1 minute, insert newest TMP }
SHIFT_LEFT(tmp_history[m, 1..30]) { discard oldest }
tmp_history[m, 30] := tmp_measured[m]
{ Linear regression: fit TMP(t) over last 30 minutes }
{ slope_kpa_min = (TMP_last_min - TMP_first_min) / 30 }
tmp_slope_kpa_min = (tmp_history[m, 30] - tmp_history[m, 1]) / 30
tmp_trend_slope[m] := tmp_slope_kpa_min × 100 { convert bar to kPa }
{ Predict when TMP will hit critical (0.7 bar) }
IF tmp_trend_slope[m] > 0 THEN
time_to_critical_min[m] = (TMP_TRIGGER_EMERGENCY - tmp_measured[m]) / (tmp_trend_slope[m] / 100 / 60)
{ divided by kPa per second }
ELSE
time_to_critical_min[m] = 999 { no fouling }
END IF
END FOR
{ === BACKWASH TRIGGERING LOGIC === }
FOR m = 1 TO NUM_MODULES DO
CLEAR backwash_needed[m]
time_since_last_backwash[m] := time_since_last_backwash[m] + 1
{ Trigger 1: Timer — backwash every BACKWASH_INTERVAL_NOM_MIN }
IF time_since_last_backwash[m] > (BACKWASH_INTERVAL_NOM_MIN × 60) THEN
backwash_needed[m] = TRUE
Log_Event("BACKWASH_TRIGGER_TIMER", module=m)
END IF
{ Trigger 2: Emergency — TMP exceeded warning threshold }
IF tmp_measured[m] > TMP_TRIGGER_EMERGENCY THEN
backwash_needed[m] = TRUE
Log_Alarm("BACKWASH_EMERGENCY_TMP_CRITICAL", module=m, tmp=(tmp_measured[m]))
tmp_exceedance_events := tmp_exceedance_events + 1
END IF
{ Trigger 3: Fouling prediction — high slope = backwash soon }
IF tmp_trend_slope[m] > FOULING_RATE_ALARM_KPA_MIN AND tmp_measured[m] > TMP_WARNING THEN
backwash_needed[m] = TRUE
Log_Warning("BACKWASH_PREDICTIVE_FOULING_RATE_HIGH", module=m, slope_kpa_min=(tmp_trend_slope[m]))
END IF
END FOR
{ === BACKWASH SEQUENCE EXECUTION === }
FOR m = 1 TO NUM_MODULES DO
IF backwash_needed[m] AND NOT backwash_running[m] THEN
{ Initiate backwash sequence }
backwash_running[m] = TRUE
backwash_timer[m] := BACKWASH_TIME_SEC
air_scour_timer[m] := AIR_SCOUR_TIME_SEC
{ Step 1: Close feed valve, open permeate drain }
feed_valve_cmd[m] := 0.0 { 0% = closed }
permeate_drain_valve_cmd[m] := 100.0 { 100% = open to tank }
Log_Event("BACKWASH_START", module=m, tmp_before=tmp_measured[m])
END IF
{ Backwash in progress }
IF backwash_running[m] THEN
{ Step 2–3: Reverse pressure + air scour (0–45 sec) }
IF air_scour_timer[m] > 0 THEN
{ Backwash pump: force permeate backward through membrane }
backwash_pump_speed_vfd[m] := 40 { Hz, proportional to 0.3 bar }
Write_Backwash_Pump_Frequency(m, backwash_pump_speed_vfd[m])
{ Air scour: coarse bubbles disrupt cake layer }
air_scour_solenoid[m] := TRUE { open air valve }
air_flow_m3h[m] = Read_Air_Flow(m)
air_scour_timer[m] := air_scour_timer[m] - 1
{ Step 4: Hold reverse pressure without air (45–60 sec) }
ELSIF backwash_timer[m] > 0 THEN
backwash_pump_speed_vfd[m] := 40
air_scour_solenoid[m] := FALSE { close air }
air_flow_m3h[m] := 0
backwash_timer[m] := backwash_timer[m] - 1
{ Step 5: Backwash complete, resume normal operation }
ELSE
backwash_pump_speed_vfd[m] := 0
air_scour_solenoid[m] := FALSE
feed_valve_cmd[m] := 100.0 { reopen feed }
permeate_drain_valve_cmd[m] := 0.0
backwash_running[m] = FALSE
last_backwash_time[m] := Get_Timestamp()
time_since_last_backwash[m] := 0
backwash_count_today := backwash_count_today + 1
Log_Event("BACKWASH_COMPLETE", module=m, tmp_after=tmp_measured[m])
END IF
END IF
END FOR
{ === CUMULATIVE MONITORING === }
FOR m = 1 TO NUM_MODULES DO
IF NOT backwash_running[m] THEN { only during normal filtration }
total_permeate_produced_m3 := total_permeate_produced_m3 + (permeate_flow_m3h[m] / 3600)
END IF
END FOR
{ === CIP SCHEDULING === }
time_since_last_cip := Get_Days_Since(last_cip_timestamp)
cip_due_days := MAX(0, CIP_INTERVAL_DAYS - time_since_last_cip)
IF cip_due_days = 0 THEN
Log_Warning("CIP_DUE_TODAY_SCHEDULE_CHEMICAL_CLEAN")
{ In real system: trigger CIP procedure (citric acid soak, rinse, drain) }
END IF
{ === DIAGNOSTICS & ALARMS === }
IF MOD(scan_count, 600) = 0 THEN { every 10 minutes }
FOR m = 1 TO NUM_MODULES DO
{ Performance metrics }
recovery_pct = (SUM(permeate_flow) / SUM(feed_flow)) × 100
IF recovery_pct < 80 THEN
Log_Warning("LOW_RECOVERY_POSSIBLE_MEMBRANE_FOULING", module=m, recovery_pct)
END IF
{ Log diagnostics }
Log_Process_Data({
timestamp: Get_Timestamp(),
module: m,
feed_pressure_bar: feed_pressure_bar[m],
tmp_bar: tmp_measured[m],
flux_lpm2h: permeate_flux_lpm2h[m],
fouling_rate_kpa_min: tmp_trend_slope[m],
time_to_critical_min: time_to_critical_min[m],
permeate_production_m3_hour: permeate_flow_m3h[m],
backwash_count_today: backwash_count_today
})
END FOR
END IF
END PROCEDURE
```
---
## 4. Tag List
```
MEMBRANE_MODULE_01_FEED_PRESSURE_BAR { bar }
MEMBRANE_MODULE_01_TMP_BAR { bar, transmembrane pressure }
MEMBRANE_MODULE_01_PERMEATE_FLUX_LPM2H { L/(m²·h) }
MEMBRANE_MODULE_01_FOULING_SLOPE_KPA_MIN { rate of TMP rise }
MEMBRANE_MODULE_01_BACKWASH_NEEDED { boolean }
MEMBRANE_MODULE_01_BACKWASH_RUNNING { boolean }
BACKWASH_COUNT_TODAY { cumulative }
TOTAL_PERMEATE_PRODUCED_M3 { cumulative }
TOTAL_RECOVERY_PERCENT { permeate / feed }
CIP_DUE_DAYS { countdown to clean-in-place }
TMP_EXCEEDANCE_EVENTS { alarms >0.7 bar }
```
---
## 5. Alarm & Trip Matrix
| **Condition** | **Severity** | **Action** |
|---|---|---|
| **TMP > 0.7 bar** | 🔴 CRIT | Immediate backwash; investigate feed turbidity |
| **Fouling slope >10 kPa/min** | ⚠ WARN | Backwash sooner; check feed water quality |
| **Recovery <80%** | ⚠ WARN | Membrane may be partially fouled; schedule CIP |
| **CIP due** | 🟡 WARN | Schedule chemical clean; book maintenance window |
| **Backwash air failed** | 🔴 CRIT | Backwash effectiveness reduced; manual inspection |
---
## 6. HMI Layout
```
╔════════════════════════════════════════════════════════════════════╗
║ MEMBRANE FILTRATION SYSTEM — 4 MODULE CONFIGURATION ║
╚════════════════════════════════════════════════════════════════════╝
SYSTEM STATUS: [ OPERATING ] ✓ 3 modules filtering, 1 in backwash
REAL-TIME MONITORING:
Module │ TMP (bar) │ Flux │ Fouling Rate │ Status │ Last BW
───────┼───────────┼───────────┼───────────────┼───────────────────┼────────
1 │ 0.38 ✓ │ 156 L/m²h │ +2.1 kPa/min │ FILTERING │ 8:42 AM
2 │ 0.48 ✓ │ 144 L/m²h │ +3.8 kPa/min │ FILTERING │ 8:39 AM
3 │ 0.52 ⚠ │ 138 L/m²h │ +4.6 kPa/min │ BACKWASHING 15/60s│ NOW
4 │ 0.42 ✓ │ 150 L/m²h │ +2.4 kPa/min │ FILTERING │ 8:44 AM
───────┴───────────┴───────────┴───────────────┴───────────────────┴────────
PERFORMANCE SUMMARY:
┌─────────────────────────────────────────────────────────────────┐
│ Total Permeate Flow: 575 m³/h (target: 600 m³/h, 95%) │
│ Feed Flow: 625 m³/h │
│ Total Recovery: 92% ✓ GOOD │
│ │
│ Backwash Events Today: 24 (avg 30 min interval) │
│ TMP Exceedances: 0 (no emergency trips) │
│ CIP Due In: 3 days (2026-04-16) │
└─────────────────────────────────────────────────────────────────┘
TREND: TMP Rising Across All Modules (Spring runoff season — high turbidity)
Module 3 Fouling Slope: [ ││ ││ ││ ] = +4.6 kPa/min
Time to critical TMP: 13 minutes
(will trigger emergency backwash in ~10 min if trend continues)
DIAGNOSTICS BUTTONS:
[ View Detailed Charts ] [ Simulate CIP ] [ Export Hist Data ]
```
---
## 7. Configuration
**JSON (membrane_filtration_config.json)**
```json
{
"system": {
"name": "Membrane Train A",
"num_modules": 4,
"total_membrane_area_m2": 100,
"design_capacity_m3h": 700,
"membrane_type": "ultrafiltration",
"membrane_pore_size_um": 0.01
},
"operating_conditions": {
"tmp_nominal_bar": 0.35,
"tmp_warning_bar": 0.55,
"tmp_critical_bar": 0.70,
"target_flux_lpm2h": 150
},
"backwash": {
"interval_nominal_minutes": 30,
"duration_seconds": 60,
"air_scour_duration_seconds": 45,
"reverse_pressure_bar": 0.3,
"fouling_rate_alarm_kpa_min": 10
},
"cleaning": {
"cip_interval_days": 14,
"cip_chemical": "citric_acid_then_naoh",
"cip_temperature_c": 40
},
"alarms": {
"tmp_emergency_bar": 0.70,
"recovery_min_pct": 80,
"flux_decline_pct_alert": 20
}
}
```
---
## 8. Commissioning Checklist
- [ ] Membrane modules installed; all 4 in parallel
- [ ] Pressure transmitters calibrated (0–1 bar range minimum)
- [ ] Backwash pump (positive displacement) sized for 0.3 bar reverse pressure
- [ ] Air scour compressor tested: >150 m³/h at operating pressure
- [ ] Fouling model: baseline TMP collected over 1 hour at clean conditions
- [ ] First backwash: observe pressure recovery (should drop 0.2 bar after wash)
- [ ] CIP system: citric acid & NaOH reservoirs filled, rinse water supply confirmed
- [ ] 72-hour test run: all modules stable; backwash intervals consistent
- [ ] Recovery ratio: measure permeate / feed; target >90% (>85% acceptable)
- [ ] TMP trend validation: fouling slope calculated minute-by-minute for 24 hours
---
**Document Version:** 1.0
**Last Updated:** 2026-04-13
**Status:** Ready for Production
**Approval:** Water Treatment Engineering (pending)