Don't collapse pure-DC pool on brief negative-grid transients (#359)#360
Conversation
The charge-blind/steer-to-zero path in `_compute_auto_target` exists to keep a B2500 from stealing the surplus a Venus needs to wake up (see issue #338). It fired on any `grid_total < 0` reading, even when no AC-chargeable battery was reporting — so a pure DC-only pool would slam every inverter to 0 W on a brief negative-grid transient (load drop, ramp overshoot) and then have to re-ramp from scratch. Gate the whole charge-territory check on at least one AC-chargeable battery actually being present. Pure-DC setups now ride the transient through the regular fair-share path; the B2500s' own AC-charge clamp still keeps them at 0 W under a sustained surplus, and the existing "no AC-chargeable battery reporting" diagnostic notice is decoupled from `charge_blind` so it still fires for the all-DC case.
Adds a balancer-only assertion to complement the existing closed-loop all-DC-surplus test. Previously ``_steer_to_zero`` guaranteed every DC target was 0 under surplus; with the #359 fix that path falls through to fair-share, so the safety property now rests on the ``grid_total < 0 and target > 0`` sign-clamp plus fair-share producing a non-positive share of a negative grid. Pin the batteries at 0 W and verify the emitted target stays ``<= 0`` every tick.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughLoadBalancer's ChangesDC-only pool transient protection
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The charge-blind/steer-to-zero path in
_compute_auto_targetexists tokeep a B2500 from stealing the surplus a Venus needs to wake up (see
issue #338). It fired on any
grid_total < 0reading, even when noAC-chargeable battery was reporting — so a pure DC-only pool would
slam every inverter to 0 W on a brief negative-grid transient (load
drop, ramp overshoot) and then have to re-ramp from scratch.
Gate the whole charge-territory check on at least one AC-chargeable
battery actually being present. Pure-DC setups now ride the transient
through the regular fair-share path; the B2500s' own AC-charge clamp
still keeps them at 0 W under a sustained surplus, and the existing
"no AC-chargeable battery reporting" diagnostic notice is decoupled
from
charge_blindso it still fires for the all-DC case.Summary by CodeRabbit
Release Notes
Bug Fixes
Tests