From b693e0b90c2ae6cca5b39b31f4a49eac9ca58ad2 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Tue, 14 Apr 2026 13:10:32 +0200 Subject: [PATCH] fix: graduated pump control + mass balance corrections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three fixes: 1. PS outflow triple-counted (pumpingStation c62d8bc): MGC registered twice + individual pumps registered alongside MGC + dual event subscription per child. Now: one registration per aggregation level, one event per child. Volume integration tracks correctly. 2. All 3 pumps always on: minFlowLevel was 1.0 m but startLevel was 2.0 m, so at the moment pumps started the percControl was already 40% → MGC mapped to 356 m³/h → all 3 pumps. Fixed: minFlowLevel = startLevel (2.0 m) so percControl starts at 0% and ramps linearly. Now pumps graduate: 1-2 pumps at low level, 3 at high. 3. Generalizable registration rule added as code comments: when a group aggregator exists (MGC), subscribe to it, not its children. Pick one event name per measurement type per child. E2E verified: 2/3 pumps active at 56% fill, volume draining correctly, pump C at 5.2% ctrl delivering 99 m³/h while pump A stays off. Co-Authored-By: Claude Opus 4.6 (1M context) --- examples/pumpingstation-3pumps-dashboard/build_flow.py | 2 +- examples/pumpingstation-3pumps-dashboard/flow.json | 2 +- nodes/pumpingStation | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pumpingstation-3pumps-dashboard/build_flow.py b/examples/pumpingstation-3pumps-dashboard/build_flow.py index b684504..b3f1de5 100644 --- a/examples/pumpingstation-3pumps-dashboard/build_flow.py +++ b/examples/pumpingstation-3pumps-dashboard/build_flow.py @@ -594,7 +594,7 @@ def build_process_tab(): # Level-based control thresholds "startLevel": 2.0, # pumps ON above 2.0 m (50% of height) "stopLevel": 1.0, # pumps OFF below 1.0 m (25% of height) - "minFlowLevel": 1.0, # 0% pump demand at this level + "minFlowLevel": 2.0, # 0% pump demand at startLevel (must match startLevel!) "maxFlowLevel": 3.5, # 100% pump demand at this level # Hydraulics "refHeight": "NAP", diff --git a/examples/pumpingstation-3pumps-dashboard/flow.json b/examples/pumpingstation-3pumps-dashboard/flow.json index a5ace61..a061d00 100644 --- a/examples/pumpingstation-3pumps-dashboard/flow.json +++ b/examples/pumpingstation-3pumps-dashboard/flow.json @@ -862,7 +862,7 @@ "outletPipeDiameter": 0.3, "startLevel": 2.0, "stopLevel": 1.0, - "minFlowLevel": 1.0, + "minFlowLevel": 2.0, "maxFlowLevel": 3.5, "refHeight": "NAP", "minHeightBasedOn": "outlet", diff --git a/nodes/pumpingStation b/nodes/pumpingStation index f869296..c62d8bc 160000 --- a/nodes/pumpingStation +++ b/nodes/pumpingStation @@ -1 +1 @@ -Subproject commit f869296832245894447b8a3aba9205c08f5a903b +Subproject commit c62d8bc275fb8bc4e5a8d007dae440617924998a