The short answer
How to Program Lead/Lag Pump Control
Program lead/lag pump control by separating four concerns: determining which pumps are available, selecting the lead from the available set using your alternation rule, applying level setpoints to decide how many pumps should run, and protecting the motors with minimum run and minimum off timers. Keeping these separate makes the logic readable and makes failure handling straightforward.
Key points
- Separate availability, lead selection, demand, and motor protection into distinct logic sections.
- A faulted pump must drop out of the rotation automatically.
- Store alternation state in retentive memory or it resets on every power blip.
- Bring the Auto position of each HOA switch into the controller.
- Alarm distinctly when the station is down to one available pump.
What you need
- The control narrative or sequence of operation for the station
- Wet well dimensions and pump capacity data
- Motor nameplate data for the starts-per-hour limit
- PLC programming software with online access
- A way to simulate level, either forcing or a calibrator on the input
Structure the logic in four parts
The most common problem with pump control code is that these four concerns get tangled into one long chain of conditions that nobody can safely modify. Keep them separate and each becomes obvious.
- 01Availability: which pumps could run right now.
- 02Lead selection: which available pump has the lead role.
- 03Demand: how many pumps the level says should be running.
- 04Motor protection: minimum run, minimum off, and start staggering.
Step 1: availability
Available_1 := HOA_1_Auto
AND NOT Fault_1
AND NOT Overload_1
AND NOT Seal_Fail_1
AND NOT Maint_Lockout_1
AND Phase_Monitor_OK;
Available_2 := (same conditions for pump 2)
Pumps_Available := BOOL_TO_INT(Available_1) + BOOL_TO_INT(Available_2);
No_Redundancy := (Pumps_Available = 1);
Station_Down := (Pumps_Available = 0);HOA_1_Auto is a real input from the selector switch, not an assumption. Without it the controller will keep commanding a pump that an operator deliberately took out of service, and will report it as failed to start.
Step 2: lead selection
(* Advance alternation when the station finishes a cycle *)
IF All_Pumps_Stopped AND NOT All_Pumps_Stopped_Last THEN
Alt_Select := NOT Alt_Select; (* retentive memory *)
END_IF;
(* Availability overrides alternation *)
IF Available_1 AND Available_2 THEN
Lead_Is_Pump_1 := NOT Alt_Select;
ELSIF Available_1 THEN
Lead_Is_Pump_1 := TRUE;
ELSIF Available_2 THEN
Lead_Is_Pump_1 := FALSE;
END_IF;Step 3: demand from level
IF Level_Bad THEN
Pumps_Called := Float_Backup_Demand; (* fall back to floats *)
ELSE
IF Level >= Lag_Start_SP THEN
Pumps_Called := 2;
ELSIF Level >= Lead_Start_SP THEN
Pumps_Called := 1;
ELSIF Level <= All_Stop_SP THEN
Pumps_Called := 0;
END_IF; (* otherwise hold *)
END_IF;
IF Level <= Low_Level_Cutoff THEN
Pumps_Called := 0; (* dry run protection wins *)
Alarm_Low_Level := TRUE;
END_IF;Note that the middle band holds the current call rather than changing it. That is the hysteresis that keeps the station from cycling on every small level fluctuation, and it is why the conditions are written as thresholds rather than as a simple comparison.
Step 4: motor protection
(* A running pump cannot stop before minimum run elapses,
unless a protective condition demands it *)
Min_Run_Timer_1(IN := Run_Cmd_1, PT := T#90s);
Can_Stop_1 := Min_Run_Timer_1.Q OR Low_Level_Cutoff OR NOT Available_1;
(* A stopped pump cannot restart until minimum off elapses *)
Min_Off_Timer_1(IN := NOT Run_Cmd_1, PT := T#120s);
Can_Start_1 := Min_Off_Timer_1.Q AND Available_1;
(* Stagger the lag start so the service does not see two inrushes *)
Lag_Delay(IN := (Pumps_Called >= 2), PT := T#5s);
Lag_Permitted := Lag_Delay.Q;Set the minimum run time from the motor starts-per-hour rating and the wet well geometry, not from a habit. If the level band cannot produce a run that long at the lowest expected inflow, the band is too narrow and no timer will fix it.
Failure detection
(* Failed to start: commanded but no run confirmation *)
Start_Fail_Timer_1(IN := Run_Cmd_1 AND NOT Run_Status_1, PT := T#5s);
IF Start_Fail_Timer_1.Q THEN
Fault_1 := TRUE; (* latched, manual reset *)
Alarm_Pump_1_Failed_To_Start := TRUE;
END_IF;
(* Runs but does not pump: level is not falling while running *)
No_Pump_Timer(IN := Any_Pump_Running AND (Level >= Level_5min_ago - 0.1),
PT := T#300s);
IF No_Pump_Timer.Q THEN
Alarm_Pump_Running_No_Flow := TRUE; (* rag bound, air lock,
closed valve, wrong rotation *)
END_IF;Test before you leave
- Raise simulated level through lead start, lag start, and back to all stop. Confirm each transition.
- Confirm alternation swaps the lead after a completed cycle, and that it survives a controller power cycle.
- Fault one pump and confirm the other takes lead immediately and the no-redundancy alarm appears.
- Fault both and confirm the station-down alarm escalates.
- Take one HOA to Hand and confirm the controller stops calling it and does not report a start failure.
- Drive the level input to a fault current and confirm the station falls back to float control and alarms.
- Verify minimum run and minimum off by attempting to violate them.
- Record the setpoints and timer values in the control narrative before you drive away.
Frequently asked questions
- Should alternation happen on start or on stop?
- On cycle completion, meaning when all pumps stop. Alternating at start means the roles change mid-cycle when the lag pump joins, which produces confusing behavior and uneven wear.
- What if both pumps are called and one fails?
- The remaining available pump should keep running and the failed one should drop out of the rotation. Alarm the failure and the loss of redundancy separately, because they need different responses.
- How long should minimum run time be?
- Long enough that the motor stays within its starts-per-hour rating at the worst case, which is the lowest inflow. Ninety seconds to several minutes is common for municipal lift stations. Calculate it from the wet well volume and pump capacity rather than guessing.
- Do I need lead/lag logic if the panel has a mechanical alternator?
- A mechanical or dedicated alternator will run the station, but the utility cannot see the alternation state, cannot see run hours per pump, and cannot change the strategy without a site visit. Any station on SCADA is better served with the logic in the controller.
Related topics
- Lead/Lag Pump ControlWhich pump runs first, when the second joins, how they trade places, and the design decisions that determine whether a duplex station wears evenly.
- Duplex Lift Station ControlsThe two-pump station that makes up most of a collection system: what is in the panel, how the sequence works, what is monitored, and where these stations actually fail.
- Wet Well Level ControlThe measurement that runs a lift station: choosing setpoints, protecting the pumps, validating the signal, and the failures that flood a station.
- Interlocks and PermissivesA permissive lets you start. An interlock stops you. Confusing the two produces equipment that either will not run or will not protect itself.
- How to Scale a 4-20 mA Input in a PLCTurn raw analog counts into engineering units, verify at three points, and add the validity checks that stop a failed transmitter from producing a believable number.
- How to Build a SequencerBuild a step sequencer in a controller that will not stick, restart into the wrong step, or leave equipment half way: define the steps from the narrative, choose a step register, and test every path before the plant depends on it.
Direct contact
Have a controls question?
Reach Eric Sullivan directly about anything on this site, a controls or automation topic, or one of his personal projects.