Pro
40 min

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
Duplex Pump Control scenario preview

Ready to build this?

Sign up free — no credit card required. This scenario requires the Pro plan.

Sign up to play this scenario →

Already have an account? Log in

Briefing

A wet-well pump station holds two identical pumps (PUMP_1 and PUMP_2). Effluent flows into the well; level sensors report LOW, HIGH and HIGH-HIGH. Once an operator presses START the station is armed until STOP. The LEAD pump must run when the level reaches HIGH and keep running until the well is pumped down below LOW. If inflow outpaces a single pump and the level keeps climbing to HIGH-HIGH, the LAG pump joins so both pumps run — again until LOW. A HIGH-HIGH condition also lights HIGH_ALARM. To even out wear, the lead and lag roles ALTERNATE: each time the well is drained to LOW the two pumps swap duty, so PUMP_1 leads the first fill cycle, PUMP_2 leads the second, and so on.

Objectives

  • START arms the station (latched); STOP disarms it and stops both pumps
  • The LEAD pump starts at LEVEL_HIGH and stops at LEVEL_LOW
  • The LAG pump joins at LEVEL_HIGHHIGH (both pumps run) and stops at LEVEL_LOW
  • HIGH_ALARM is energised whenever LEVEL_HIGHHIGH is true
  • Alternate lead/lag every pump-down: PUMP_1 leads cycle 1, PUMP_2 leads cycle 2, …

Hints

  • Latch an ENABLED bit with S= on START and R= on STOP. Gate everything else with ENABLED.
  • Use a toggle bit (e.g. LEAD_IS_2) that flips on the rising edge of LEVEL_LOW — that is the moment the well finishes a pump-down, so the next fill cycle starts with the other pump in the lead.
  • Latch LEAD_RUN: S= on (ENABLED AND LEVEL_HIGH), R= on (LEVEL_LOW OR /ENABLED). Latch LAG_RUN: S= on (ENABLED AND LEVEL_HIGHHIGH), R= on (LEVEL_LOW OR /ENABLED).
  • Route the latches to the physical pumps via the toggle: PUMP_1 := (LEAD_RUN AND /LEAD_IS_2) OR (LAG_RUN AND LEAD_IS_2); PUMP_2 is the mirror. HIGH_ALARM := LEVEL_HIGHHIGH.

I/O Table

Inputs

START

Start push-button (latches the station ON)

BOOL · %I0.0

STOP

Stop push-button (disarms the station)

BOOL · %I0.1

LEVEL_LOW

Low-level float (well drained to pump-off level)

BOOL · %I0.2

LEVEL_HIGH

High-level float (start the lead pump)

BOOL · %I0.3

LEVEL_HIGHHIGH

High-high-level float (start the lag pump + alarm)

BOOL · %I0.4

Outputs

PUMP_1

Pump 1 motor contactor

BOOL · %Q0.0

PUMP_2

Pump 2 motor contactor

BOOL · %Q0.1

HIGH_ALARM

High-high level alarm lamp

BOOL · %Q0.2

Your program will be tested against:

All test cases run automatically when you submit. Assertions are hidden until you pass.

  1. #1Lead pump waits for HIGH (does not run at LOW or empty)

    After START, the lead pump stays off through LOW and only energises when LEVEL_HIGH is reached. Exactly one pump runs (the lead) — the lag stays off below HIGH-HIGH.

  2. #2Lag pump joins at HIGH-HIGH and HIGH_ALARM lights

    With the lead already running, reaching HIGH-HIGH starts the lag pump (both run) and energises HIGH_ALARM.

  3. #3Both pumps stop when the well is drained to LOW

    After both pumps have run (HIGH-HIGH), draining back through HIGH and down to LOW must stop both pumps; HIGH_ALARM clears when HIGH-HIGH clears.

  4. #4Alternation: PUMP_2 leads the second fill cycle

    Run a full cycle (PUMP_1 leads, drains to LOW), then fill again to HIGH — the lead role must have swapped, so PUMP_2 now leads and PUMP_1 stays off.

  5. #5STOP disarms the station and drops both pumps

    While a pump is running, STOP must immediately stop both pumps and the station stays disarmed (HIGH no longer starts a pump) until START is pressed again.

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.

Frequently asked questions

What is duplex pump control in a PLC?

Duplex pump control is PLC logic for a two-pump wet-well or tank station that designates one pump as lead and the other as lag. The lead pump starts at the high level float and runs until the well is drained to the low float. If inflow outpaces the lead pump and the level keeps rising to a high-high float, the lag pump joins so both run. A high-high alarm lights at the top float, and the lead/lag roles alternate each pump-down so the two pumps share running hours and wear evenly.

How does lead lag pump control work in PLC ladder logic?

Latch the lead pump with SET/RESET: SET on (station enabled AND high float), RESET on (low float OR not enabled), so the lead runs from HIGH down to LOW. Latch the lag pump the same way one float higher: SET on (enabled AND high-high float), RESET on (low float OR not enabled). Both pumps then keep running until the low float drops. A high-high alarm output simply mirrors the high-high float. This SET/RESET-between-floats structure is the core of lead lag pump control PLC ladder logic.

How do you alternate two pumps in a PLC program?

Use a toggle bit that flips on the rising edge of the low-level float — the moment a pump-down completes. Keep the run latches (LEAD_RUN, LAG_RUN) separate from the physical pump outputs, then route them through the toggle: PUMP_1 := (LEAD_RUN AND NOT toggle) OR (LAG_RUN AND toggle), and PUMP_2 is the mirror. On the first cycle the lead latch drives PUMP_1; after the well drains and the toggle flips, the next cycle's lead latch drives PUMP_2. Detect the float's edge, not its level, so the lead swaps once per cycle rather than every scan.

What sensors does a wet well pump station PLC program need?

A standard wet well pump station PLC program uses three level floats: a LOW float (the pump-off level at the bottom of the working band), a HIGH float (start the lead pump), and a HIGH-HIGH float (start the lag pump and raise the alarm). In this scenario those are LEVEL_LOW (%I0.2), LEVEL_HIGH (%I0.3) and LEVEL_HIGHHIGH (%I0.4), plus START and STOP push-buttons. Outputs are the two pump motor contactors (PUMP_1, PUMP_2) and a high-high alarm lamp (HIGH_ALARM).

Can I simulate a duplex pump control PLC program without hardware?

Yes. The Duplex Pump Control scenario on this page runs in your browser — write the ladder logic, press Run, and watch the wet-well level rise and fall while the lead and lag pumps stage in and alternate. The physics model drives a realistic fill and draw-down rate so the floats trip just as they would on hardware, and the auto-grader checks five cases: the lead starting at HIGH, the lag joining at HIGH-HIGH with the alarm, both pumps stopping at LOW, the second cycle alternating the lead, and STOP disarming the station. No physical PLC, pumps or floats required.

Ready to build this?

Sign up free — no credit card required. This scenario requires the Pro plan.

Sign up to play this scenario →

Already have an account? Log in