Pump Alternation (Duty/Standby)
Ready to build this?
Sign up free — no credit card required. This scenario requires the Basic plan.
Sign up to play this scenario →Already have an account? Log in
Briefing
A water/wastewater lift station uses two pumps in a duty/standby arrangement. The duty (lead) pump starts whenever the tank reaches the high level and stops when it drains to the low level. After each completed pump cycle the duty assignment swaps so both pumps accumulate equal runtime. If the duty pump fails (PUMP1_FAULT or PUMP2_FAULT asserted) the standby pump takes over immediately. If both pumps fault simultaneously, COMMON_FAULT latches and stays on until RESET_PB is pressed with both faults cleared.
Objectives
- LEVEL_HIGH starts the duty pump; LEVEL_LOW stops it
- After each fill cycle (LEVEL_HIGH deasserts) the duty pump alternates: Pump 1 → Pump 2 → Pump 1 …
- PUMP1_FAULT causes Pump 2 to become active immediately
- PUMP2_FAULT causes Pump 1 to become active immediately
- Both faults simultaneously latches COMMON_FAULT (cleared by RESET_PB once both faults clear)
- PUMP1_LAMP and PUMP2_LAMP mirror their respective RUN outputs
Hints
- Use a DUTY_IS_2 bit (T-flipflop) that toggles on every falling edge of LEVEL_HIGH (end of cycle)
- Effective duty: if DUTY_IS_2=0 → PUMP1 runs (unless PUMP1_FAULT, then PUMP2 takes over)
- COMMON_FAULT: SET when PUMP1_FAULT AND PUMP2_FAULT; R= when RESET_PB AND NOT PUMP1_FAULT AND NOT PUMP2_FAULT
- RUN output: PUMP1_RUN := LEVEL_HIGH AND (NOT DUTY_IS_2 OR PUMP2_FAULT) AND NOT PUMP1_FAULT AND NOT COMMON_FAULT
- PUMP1_LAMP := PUMP1_RUN; PUMP2_LAMP := PUMP2_RUN
I/O Table
Inputs
LEVEL_HIGHHigh level float switch (tank >90%)
BOOL · %I0.0
LEVEL_LOWLow level float switch (tank <20%)
BOOL · %I0.1
PUMP1_FAULTPump 1 fault / overload
BOOL · %I0.2
PUMP2_FAULTPump 2 fault / overload
BOOL · %I0.3
RESET_PBCommon fault reset push-button
BOOL · %I0.4
Outputs
PUMP1_RUNPump 1 run contactor
BOOL · %Q0.0
PUMP2_RUNPump 2 run contactor
BOOL · %Q0.1
PUMP1_LAMPPump 1 running indicator lamp
BOOL · %Q0.2
PUMP2_LAMPPump 2 running indicator lamp
BOOL · %Q0.3
COMMON_FAULTCommon fault latch lamp/relay
BOOL · %Q0.4
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1Pump 1 (duty) starts on LEVEL_HIGH
With no faults and tank rising, PUMP1_RUN asserts when physics raises LEVEL_HIGH
- #2Duty pump stops on LEVEL_LOW
Once running, the pump stops when physics lowers the level to LEVEL_LOW
- #3Duty pump alternates after each cycle
After one complete cycle (LEVEL_HIGH → LEVEL_LOW), Pump 2 becomes duty
- #4PUMP1_FAULT causes Pump 2 to take over
When Pump 1 is duty and faults, Pump 2 starts immediately
- #5Both faults latch COMMON_FAULT
PUMP1_FAULT AND PUMP2_FAULT simultaneously latches COMMON_FAULT; RESET_PB clears it
Related scenarios
Ready to build this?
Sign up free — no credit card required. This scenario requires the Basic plan.
Sign up to play this scenario →Already have an account? Log in