Duplex Pump Control PLC Program (Lead/Lag)
This page covers the full duplex pump control PLC program — lead/lag control of a two-pump wet-well station driven by LOW, HIGH and HIGH-HIGH level floats. It is grounded in a live scenario you can run directly in your browser: write the ladder, watch the well fill and drain, and get instant pass/fail feedback. The lead pump starts at HIGH, the lag pump joins at HIGH-HIGH, a high alarm tracks the top float, and the two pumps alternate duty each pump-down to even out wear — the textbook lead lag pump control PLC pattern, runnable and auto-graded.
processpumpsalternation
How a duplex pump control PLC program works
A duplex pump station is a wet well with two identical pumps and three level floats. Effluent flows in; the pumps draw it down. Pump control using a PLC keeps the level inside a safe band, brings a second pump online when one cannot keep up, raises an alarm at the top float, and shares the running hours evenly between the two pumps.
The station is armed by an operator. START latches an ENABLED bit; STOP clears it and stops both pumps. Everything else is gated by ENABLED, so a disarmed station never runs a pump no matter what the level does (the high float still drives the alarm, but not the pumps).
Three floats report level. LEVEL_LOW (%I0.2) is the pump-off float at the bottom of the working band. LEVEL_HIGH (%I0.3) is the start-the-lead float. LEVEL_HIGHHIGH (%I0.4) is the start-the-lag-and-alarm float at the top. Two outputs drive the pump motor contactors — PUMP_1 (%Q0.0) and PUMP_2 (%Q0.1) — and HIGH_ALARM (%Q0.2) is the high-high level alarm lamp.
The behaviour, in one line per float: the LEAD pump runs from HIGH down to LOW; the LAG pump joins at HIGH-HIGH and also runs down to LOW; HIGH_ALARM mirrors LEVEL_HIGHHIGH; and each pump-down the lead and lag roles swap. This is a wet well pump station PLC program in its standard form — the same logic runs lift stations, sumps and reservoir transfer pumps.
Lead pump at HIGH, lag pump at HIGH-HIGH — latching the levels
The heart of lead lag pump control PLC logic is that the pumps latch on at a high float and stay on until the well is drained to LOW — they do not chatter with every wobble of the level. That means SET/RESET latches, not direct level-following coils.
Latch the lead: SET LEAD_RUN on (ENABLED AND LEVEL_HIGH), RESET LEAD_RUN on (LEVEL_LOW OR NOT ENABLED). The lead pump must wait for HIGH — it must not run at LOW or in an empty well. This is exactly what the discriminating 'lead-starts-at-high-not-before' test checks: it arms the station, rises the level to the LOW float, and asserts both pumps stay off; only when LEVEL_HIGH trips does the lead start. A naive 'run a pump whenever there's water' solution fails here immediately.
Latch the lag the same way one float higher: SET LAG_RUN on (ENABLED AND LEVEL_HIGHHIGH), RESET LAG_RUN on (LEVEL_LOW OR NOT ENABLED). When inflow outpaces the lead pump and the level climbs to HIGH-HIGH, the lag joins so both pumps run together, and they both keep running through HIGH-HIGH-clear and HIGH-clear until the LOW float finally drops. The 'both-stop-at-low' test verifies precisely this: both pumps stay on as HIGH-HIGH and then HIGH clear, and only de-energise when LOW clears.
HIGH_ALARM is the simplest rung on the page — drive it straight from LEVEL_HIGHHIGH, ungated by ENABLED, so the alarm reports a high-high level even on a disarmed station.
Pump alternation — swapping lead and lag each pump-down
Running the same pump as lead every cycle wears it out while the other sits idle. Pump alternation PLC ladder logic fixes that by swapping the lead and lag roles each time the well is pumped down, so the two pumps share the duty evenly.
The clean way to do this is to separate the run latches (LEAD_RUN, LAG_RUN) from the physical pumps (PUMP_1, PUMP_2) and route between them with a toggle bit. Use a toggle — call it LEAD_IS_2 — that flips on the rising edge of LEVEL_LOW. The moment LEVEL_LOW asserts is the moment a pump-down completes, so flipping the toggle there means the next fill cycle starts with the other pump in the lead.
Route the latches to the contactors through the toggle:
PUMP_1 := (LEAD_RUN AND NOT LEAD_IS_2) OR (LAG_RUN AND LEAD_IS_2)
PUMP_2 := (LEAD_RUN AND LEAD_IS_2) OR (LAG_RUN AND NOT LEAD_IS_2)
On cycle 1 the toggle is clear, so LEAD_RUN drives PUMP_1; on cycle 2 the toggle is set, so LEAD_RUN drives PUMP_2. The 'alternation-second-cycle-pump2-leads' test runs a full PUMP_1-leads cycle down to LOW, then refills to HIGH and asserts PUMP_2 now leads while PUMP_1 stays off.
Get the edge right: flip the toggle on the LEVEL_LOW transition, not on its level, or the lead will swap on every scan the well sits at the bottom. A single rising-edge detector on LEVEL_LOW is all the alternation logic needs.
STOP, the high alarm, and why this is a step up from a single pump
STOP must do more than stop the pumps — it must disarm the station. The 'stop-disarms-station' test starts a pump, presses STOP, and then drives LEVEL_HIGHHIGH true; it asserts both pumps stay off (the station is disarmed) while HIGH_ALARM still lights (the alarm tracks the level regardless of arm state). Implement STOP as a RESET on the ENABLED latch and include NOT ENABLED in both pump-run resets, so a disarmed station can never start a pump even at the top float. Only a fresh START re-arms it.
That alarm-independent-of-arm behaviour is deliberate and realistic: a flooded wet well is a hazard whether or not an operator has armed the pumps, so HIGH_ALARM is wired straight off LEVEL_HIGHHIGH and never gated by ENABLED.
This scenario is a genuine step up from a single pump control using PLC exercise. A single-pump tank fill is one SET/RESET latch between two floats. Duplex control adds three things at once: a second pump that conditionally joins at a higher setpoint, an alarm, and stateful alternation that remembers which pump led last across cycles. That combination — multiple latched states, edge-triggered role swapping, and a setpoint hierarchy — is why it sits at a higher difficulty tier.
Everything here is runnable and auto-graded in your browser. Write the ladder, press Run, and watch the well level rise and fall while the two pumps stage in and alternate. Five automated test cases grade the lead start, the lag join plus alarm, the both-stop-at-LOW pump-down, the second-cycle alternation, and the STOP disarm.