Repository navigation
Conversation
segran2
marked this pull request as ready for review
October 24, 2026 22:22
Signed-off-by: Segran <goran@andersson-stehag.se>
This was referenced Oct 25, 2026
frahlg
added a commit
that referenced
this pull request
Oct 28, 2026
…1918) * test(control): port #1816's battery relief reproductions to master Two reproductions from #1816, adapted to master's capBatteryCharge and clampEVBatteryHeadroom: - Pending rise: 25 A site, 1 A margin, phases 22.3/12.3/12.3 A. The battery measures -2000 W and our newer -1000 W order may not show yet. Ending the relief must keep -827 W so L1 lands on 24 A, not 25.2 A. - Shared relief: two batteries end -1000 W and -2000 W of relief. When the first cannot keep its share (SoC floor or a 300 W bound), the second keeps the missing 1827 W instead of the old 1218 W. Master's keepEndingDischarge (#1847) passes both. Dropping it, ignoring pending rises, or sharing before bounds makes them fail. Import only: master leaves the export direction to the fuse pipeline. Co-authored-by: segran2 <268038031+segran2@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(control): say which relief gaps master leaves open The header said master leaves the export case to the fuse pipeline. Nothing on master holds it. Name both no-car gaps instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: segran2 <268038031+segran2@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ending battery discharge raises import just as adding charge does. The shared fuse allocator could spend phase room twice across pending rises, and could lose required relief when one of several batteries could not retain its allocated share. The mirrored export pass has the same allocation requirements when ending battery charge.
Stacked on #1789, targeting fix/fuse-one-function at c60da23. This is a bounded follow-up to that implementation, not adoption of #1763's different EV-reservation policy. Retarget after #1789 lands; do not merge independently into master.
Change
Reproductions
Pending rise: 25 A three-phase site, 230 V, 1 A working margin; phases 22.3/12.3/12.3 A leave 1173 W room. A battery measures -2000 W, an unseen -1000 W command is pending, and the next target is 0. Before the original fix, 0 W is allowed (conditional 25.198551 A). Retaining -827 W limits the projected phase to 24 A. The export mirror retains +827 W.
Multiple batteries: at the same phase reading, A measures and was commanded -1000 W but is below its SoC floor; healthy B measures and was commanded -2000 W. Both targets are 0. Required retained relief is 3000−1173 = 1827 W. On prior head c2246d1, proportional allocation assigned 609 W to A and 1218 W to B, then discarded A's unavailable share. B=-1218 W projects 24.882609 A. The new head gives A=0, B=-1827 W: conditional 24 A. Export with a charge-blocked battery is covered by the same tests.
These are conditional balanced-response calculations assuming unchanged other loads and response before the next correction, not measured overcurrent or evidence of fuse operation. Infeasible bounds cannot guarantee the working limit.
Validation — head 1d13585
Acceptance and history
The 25 October comparison of #1763 7361f9d, #1789 c60da23 and previous #1816 c2246d1 exposed the redistribution failure above at allocation, idle and manual layers; a pure helper test confirmed it without telemetry adapters. This follow-up addresses that finding, while retaining #1816's earlier pending-rise correction.
Review of this follow-up, #1789/current-master integration, the separate EV-reservation policy decision and affected-hardware acceptance remain outstanding. GitHub's existing ready-for-review flag was left unchanged. No branch was merged, no channel/release published and no running household FTW, driver, history or settings modified.