Building an Industrial Water Treatment Simulator: Intake Permissives, Basin Hysteresis & Automated Pump Alternation

Intake station and receiving tank P&ID
FIG 1.1 // PROCESS FLOW & P&ID OVERVIEWINTAKE STATION & RECEIVING TANK (TK-101 → P-101A/B → TK-102)

The Midnight Basin 3 Overflow & Mechanical Seal Blowout

At 2:40 AM during a torrential spring thunderstorm, the regional municipal water reclamation plant suffered an environmental disaster. The lead intake centrifugal pump (P-101A) suddenly started screaming with a deafening rattle that sounded like pumping gravel through a steel pipe.

Heavy debris had blinded the raw intake bar screens, starving the wet well. The suction pressure plummeted far below the vapor pressure of water, throwing the impeller into violent cavitation. Vapor bubbles imploded against the stainless steel vanes with shockwaves exceeding 10,000 PSI. Within ninety seconds, the mechanical seal shattered, spraying river water across the motor floor and tripping the 480V thermal overload.

To make matters worse, the downstream clarifier basin relied on a software polling loop rather than a dedicated hardware interlock. When the standby pump was manually kicked on by a panicked night-shift operator, the inlet valve was forced wide open into an already saturated sedimentation tank. By 3:15 AM, over 120,000 gallons of untreated wastewater had overflowed the weir into the adjacent municipal canal, drawing state environmental citations and hundreds of thousands of dollars in fines.

Physical Protection vs. PLC Software Permissives

Hardwired interlocks (emergency stop, dry-run float switches LSL-101, and motor thermal overloads) must act independently of PLC software logic. Never rely solely on software polls to protect rotating machinery from cavitation or tanks from environmental overflow.

Stage 1: Intake Permissives & Dry-Run Lockout

In industrial automation, there is a strict engineering distinction between an Operational Permissive and an Interlock Trip:

  • Permissive (Pre-Condition): A set of criteria that must ALL be satisfied before a piece of equipment is allowed to start. For example: "Intake isolation valve ZSO-101 confirmed 100% open AND suction level switch LSL-101 confirmed submerged AND motor thermal overload healthy".
  • Interlock (Active Protection): A condition that de-energizes the contactor immediately during operation if breached. If the suction well drains or the isolation valve drifts shut during pumping, the run request must drop instantly.

Below is Stage 1 of the simulation. We implement a fail-safe start/stop circuit using an RS_LATCH with reset priority. The Start command can only latch if all permissives are proved; any loss of permissive or Stop press immediately clears the run memory:

Stage 1 of 3Intake 1 - Permissives clear the run memory
0.0 s
Mini Map

YOUR NEXT EXPERIMENT

Start with a signal.

Add an input from the component library, connect a block, and press Run.

SIMULATION PAUSED100 ms / scan
Paused · Click to inspect

Loading workspace…

0 blocks · 0 wires
Interactive Exercise — Stage 1

In Stage 1 above, click on Start pulse to energize Pump P-101A. The RS Latch holds the pump energized. Now toggle LSL-101 suction water available to OFF (dry suction). Notice how the lost permissive immediately forces a reset on the latch, killing motor command instantly! Try starting the pump while the intake valve ZSO-101 is closed—the permissive gate prevents any start command from passing.

Stage 2: Receiving Tank Level Band & Duty Alternation

Why do naive programmers burn out pump contactors in wastewater lift stations? Because they implement single-point setpoint logic:

IF Tank_Level < 50% THEN Pump = ON
ELSE Pump = OFF

Surface ripples and turbulence cause level transmitters (LT-102) to flutter between 49.9% and 50.1% dozens of times per minute. This causes rapid contactor chattering, excessive electrical arcing, and severe water hammer.

The correct methodology uses a wide Hysteresis Band:

  • Start threshold (Low Level): 35%
  • Stop threshold (High Level): 75%

When the tank level drains down to 35%, needsFill trips and latches the fill memory ON. The pump runs steadily until the tank reaches 75%, where full trips and resets the latch. Furthermore, to balance impeller and bearing wear across 24/7 operations, a bistable toggle (PULSE_RELAY) alternates the duty between P-101A and P-101B on every completed fill cycle!

Stage 2 of 3Intake 2 - Level band and cycle duty alternation
0.0 s
Mini Map

YOUR NEXT EXPERIMENT

Start with a signal.

Add an input from the component library, connect a block, and press Run.

SIMULATION PAUSED100 ms / scan
Paused · Click to inspect

Loading workspace…

0 blocks · 0 wires
Interactive Exercise — Stage 2

In Stage 2 above, click LT-102 level percent. Change the level from 55% down to 30%—notice that Fill Demand engages and starts Duty Pump P-101A. Now raise the level to 50%—the pump continues running! Raise the level to 75%—the fill demand clears, and the duty toggle flips to Pump B! Lower the level back to 30%—watch Pump B take the next run cycle while Pump A rests!

Stage 3: Closed-Loop Dynamic Plant Simulation & Continuous Cycling

In this final stage, we close the loop with a real-time dynamic tank model. The simulation couples the PLC control logic with physical plant dynamics:

  1. Pump Inflow: Active pumps deliver pressurized inflow to the receiving tank.
  2. Dynamic Gravity Drain: Fluid continuously exits the tank to downstream process units.
  3. Continuous Duty Balancing: As the tank fills and drains over time, the controller transitions between P-101A and P-101B automatically without human intervention.

Press ▶ Run below to start the continuous dynamic simulation:

Stage 3 of 3Intake 3 - Closed-loop tank and alternating duty
0.0 s
Mini Map

YOUR NEXT EXPERIMENT

Start with a signal.

Add an input from the component library, connect a block, and press Run.

SIMULATION PAUSED100 ms / scan
Paused · Click to inspect

Loading workspace…

0 blocks · 0 wires
Interactive Exercise — Stage 3

Press ▶ Run. Watch the tank level steadily climb from 35% toward 75% driven by Pump P-101A. As soon as the level reaches 75%, Pump A shuts off, and the tank begins draining. Once the water drops back to 35%, watch Standby Pump P-101B automatically start up! Open the Logic Analyzer at the bottom to watch the square waves and level ramps record in real time!

Commissioning & Engineering Takeaways

  • Physical Permissives are Non-Negotiable: Never issue a motor start command without proving open suction path and positive suction head.
  • Always Band Your Analog Thresholds: Single-point hysteresis causes cavitation and destroys contactors. Maintain at least a 20–40% deadband between start and stop thresholds.
  • Duty Alternation Extends Mean-Time-Between-Failures (MTBF): Automatic alternation balances mechanical seal wear and prevents bearing brinelling in idle equipment.
  • Hardware Interlocks Must Override Software: Always wire independent high-high level switches (LSHH) directly into the motor control center (MCC) trip circuit.