Automating Lead-Lag Pump Rotation Based on Lowest Operating Hours with CountOh and MinMaxAvg in PCS 7

Automating Lead-Lag Pump Rotation Based on Lowest Operating Hours with CountOh and MinMaxAvg in PCS 7

To automate the rotation of multiple pumps (e.g. selecting the lead pump from a bank of 5) based on lowest operating hours in SIMATIC PCS 7, engineers combine the runtime tracking of CountOh with the mathematical selection power of the APL MinMaxAvg block. Each pump's running hours are converted to REAL format using the DW_R block or read directly from CountOh.Hours1. The five runtime signals are connected to inputs In01 through In05 of the MinMaxAvg block. MinMaxAvg automatically evaluates the lowest accumulated runtime, outputting the minimum value on pin Min and the specific pump number (1 to 5) on pin MinIdx. The MinIdx integer is fed into sequential start logic (or an SFC Type) to automatically start the pump with the fewest operating hours.

Table of Contents

Executive Summary

In continuous process facilities, wastewater lift stations, and industrial cooling water circuits, multiple redundant pumps are installed in parallel to ensure process availability and balance equipment wear. Automation engineers frequently need to design an automated lead-lag rotation strategy where the controller evaluates five parallel pumps and automatically selects and starts the pump that has accumulated the least operational wear. Without specialized blocks, comparing five analog runtime values requires complex, error-prone cascades of binary comparators. This article outlines the optimal PCS 7 APL architecture combining CountOh runtime counters with the MinMaxAvg multi-channel analog selection block to achieve elegant, deterministic pump rotation.

Architecture and Fundamental Mechanics

APL Pump Wear Balancing Architecture: CountOh and MinMaxAvg Interface:

  • Individual Pump Runtime Tracking via CountOh:
  • Each pump motor block (e.g. MotL) provides operational feedback (FbkRun) to an associated CountOh block.
  • CountOh outputs runtime in two primary formats:

    1. TotalTim (DWORD): Accumulated runtime in seconds (integer).
    2. Hours1 (STRUCT: REAL + Byte): Accumulated runtime in hours with floating-point precision, including APL signal quality code (ST).
  • Multi-Channel Selection Mechanics via MinMaxAvg (FB1871):

  • The MinMaxAvg block from the PCS 7 Advanced Process Library is engineered specifically for multi-channel analog evaluation, supporting up to 16 analog structural inputs (In01 through In16).
  • For every execution cycle, MinMaxAvg evaluates all active, healthy inputs (filtering out bad quality codes per Feature settings) and computes:

    • Min (STRUCT REAL): The absolute lowest value among active inputs.
    • MinIdx (INT): The 1-based index number (1 to 16) corresponding to the input channel that possesses the lowest value.
    • Max / MaxIdx: The highest runtime value and corresponding pump index.
    • Avg: The mean operating hours across the active pump bank.
  • Equipment Availability Filtering:

  • A critical operational requirement is ignoring pumps that are out of service, in maintenance, or faulted.
  • If Pump 3 is locked out in Local mode or tripped on overload, its input to MinMaxAvg must be suppressed. This is accomplished by setting input connection parameter In03En := FALSE on MinMaxAvg, ensuring the algorithm evaluates only available pumps.

Step-by-Step Implementation Procedure

  1. Instantiate CountOh Counters for Each Pump:
    * In your CFC charts, verify that each of the 5 pumps (Pump1 to Pump5) has a dedicated CountOh instance.
    * Connect MotL.FbkRunOut.Value of each motor to CountOh.Tracking (or In).
    * Confirm that each CountOh block accumulates running hours in Hours1.

  2. Instantiate and Configure MinMaxAvg in CFC:
    * From the PCS 7 AP Library, drag and drop MinMaxAvg (FB1871) into your coordination chart.
    * Name the block descriptively (e.g. Pump_Lead_Selector).
    * Connect the runtime hours outputs from the 5 pumps to MinMaxAvg:

    • Pump1_CountOh.Hours1 -> MinMaxAvg.In01
    • Pump2_CountOh.Hours1 -> MinMaxAvg.In02
    • Pump3_CountOh.Hours1 -> MinMaxAvg.In03
    • Pump4_CountOh.Hours1 -> MinMaxAvg.In04
    • Pump5_CountOh.Hours1 -> MinMaxAvg.In05
  3. Implement Pump Availability Interlocks:
    * For each pump, combine operational availability conditions: (Not Faulted AND Remote/Auto Mode AND Not E-Stopped).
    * Connect the availability boolean to the corresponding channel enable pin on MinMaxAvg (In01En to In05En).
    * When a pump is disabled, MinMaxAvg excludes it from the comparison, preventing the system from attempting to start an unavailable pump.

  4. Decode MinIdx to Command Pump Start:
    * Output pin MinMaxAvg.MinIdx outputs an integer from 1 to 5 indicating which pump has the lowest runtime.
    * Route MinIdx into a demultiplexer block (e.g. DemuxInt or custom SFC Type branching logic).
    * When process conditions call for an additional pump (e.g. high sump level), the controller triggers the start command specifically to Pump[MinIdx].

  5. Compile and Test Dynamic Rotation:
    * Compile CFC and download to the AS in RUN mode.
    * In CFC test mode, simulate different running hours on Pump1 through Pump5.
    * Verify that MinIdx dynamically tracks the pump with the lowest hours, and updates immediately when a pump is marked unavailable.

Verification

Verify Lead Pump Selection and Runtime Balancing:
1. In CFC test mode, inspect MinMaxAvg.Min: verify that it matches the lowest numeric value among active pumps.
2. Confirm that MinMaxAvg.MinIdx correctly identifies the channel index of the lead pump.
3. Disable In01En (simulating Pump 1 tripping); verify that MinIdx immediately shifts to the next-lowest available pump.
4. In WinCC Runtime, observe automated pump staging; confirm that pumps rotate evenly over multi-day operational cycles.

Limitations and Operational Precautions

Operational Precautions and Chattering Prevention:
- Implement anti-hunting logic: Do not switch lead pump assignments dynamically while a pump is actively running; sample MinIdx only at the moment a start sequence is triggered, latching the selected pump until shutdown.
- Ensure that pumps have minimum run time and minimum rest time timers configured in MotL to prevent rapid cycling when running hours across pumps are nearly identical.

Engineer FAQ

What block finds the lowest running hours among multiple pumps in PCS 7?

The APL MinMaxAvg block (FB1871) compares up to 16 analog inputs, outputting the minimum value on Min and the channel index of that pump on MinIdx.

How do I exclude a pump that is in maintenance from selection?

De-energize the channel enable pin (e.g. setting In03En := FALSE) on MinMaxAvg. The block automatically excludes disabled channels from the minimum calculation.

Can I connect CountOh.TotalTim directly to MinMaxAvg?

TotalTim is a DWORD. It must be converted to REAL using DW_R, or you can directly connect CountOh.Hours1, which is already a structural REAL with quality code.

What happens if two pumps have identical running hours?

MinMaxAvg selects the first input channel encountered (e.g. selecting Channel 1 over Channel 2 if both have identical runtimes).

Can MinMaxAvg be used for lag pump stopping (stopping the highest hours pump)?

Yes. Pin MaxIdx identifies the pump with the highest accumulated runtime, allowing automated shedding of the most worn pump first during capacity reductions.

Technical References

Related Articles

Related Tags

  • CountOh
  • MinMaxAvg
  • Pump Rotation
  • Lead-Lag
  • Operating Hours
  • APL
  • CFC Logic
  • PCS 7 V9.0
20 respuestas