Pump sequencing · Control systems
Duplex pump controller
Control logic for a pair of pumps that share duty. It handles lead rotation, assist demand, failed starts, and recovery after a power interruption.
Executable controller model tested

Implementation
Implemented OFF, STARTING, RUNNING and FAULT states with scan-ordered interlocks.
Executed 23 regression tests, a 14,336-case one-scan interlock sweep, and a 46-second fault trace.
Executed synthetic/theoretical validation with a selected operating envelope, adverse conditions, and reproducible acceptance evidence.
Inputs and assumptions
- Three ordered level switches; reference timers of 3 s start timeout, 1 s feedback loss, and 10 s minimum run.
- Quiet-input manual reset is required at initial boot and after control-power loss.
Results
| Automated tests | 23 |
|---|---|
| Interlock snapshots | 14336 |
| Independent trace checkpoints | 10 |
| Virtual validation checks | 36 / 36 |
| Virtual plant cases | 11 |
| Reference 1 L/s cycles | 7 |
Verification
23 tests and 10 independent trace checkpoints passed. Additional virtual validation: 36 checks matched their expected outcomes. Adverse design conditions remain in the results.
python run.pyDownload the verification record ↓Additional scenarios
36 outcomes checked through synthetic/theoretical. The report lists the expected and observed outcomes for each check.
Read the validation report ↗Project files
The ZIP contains the source, inputs, results, and instructions. These files are also available individually.
- Controller sourcecontroller.py · 7 KB
- Regression teststest_controller.py · 8 KB
- I/O listio_list.csv · 1 KB
- Cause-and-effect tablecause_and_effect.csv · 1 KB
- Simulation traceresults/scenario_trace.csv · 2 KB
- Expected outputsresults/expected_outputs.csv · 1 KB
- Hardware acceptance procedurehardware_acceptance.md · 2 KB
- Verification recordverification.json · 3 KB
- Virtual validation reportvirtual-validation.html · 13 KB
- Completion evidence and source hashescompletion.json · 12 KB
- Reproducible virtual validationvirtual_commissioning.py · 12 KB
- Executed acceptance matrixresults/virtual-acceptance.csv · 6 KB
- Selected plant envelope and restoration policyselected-operating-envelope.json · 1 KB
- Synthetic reservoir traces: 200 L capacity and 180 L high-level referencefigures/virtual-reservoir.svg · 49 KB
- Reservoir case summaryresults/virtual-reservoir-summary.csv · 1 KB
- All coupled reservoir and command tracesresults/virtual-reservoir-traces.csv · 3.9 MB
- Scan timing sweepresults/virtual-scan-timing.csv · 1 KB
Archive checksum
SHA-256
92717bb5d1bf4c544cffd32a34e5c2fea02cb715344b8a699cce1b7dda8a37c6Original project scope
Archived brief PDF ↗Run locally
Python 3.10+ / NumPy and Matplotlib for report plots; the controller and tests use the Python standard library.
Extract the ZIP and open a terminal in the duplex-pump-controller folder. The README includes setup and usage details.
python -m pip install -r requirements.txt
python run.py
python -m unittest -vLimits
- An executable supervisory model, not deployed PLC firmware or commissioned pump hardware.
- External availability inputs stand in for motor protection, emergency circuits, and mechanical safeguards.
- Timers are evaluated on scans. A physical implementation must bound scan time and feedback latency.
- The input sweep is exhaustive for one scan at seven representative states, not for all continuous-time histories.
- Persistent fault/lead memory is modeled in a live process; a deployed controller needs specified nonvolatile storage behavior.