Repository navigation
Account for series batteries in the voltage-based SOC estimate - #136
Draft
Solarboaters wants to merge 1 commit into
Draft
Solarboaters wants to merge 1 commit into
Solarboaters wants to merge 1 commit into
Conversation
Solarboaters
marked this pull request as draft
November 16, 2026 21:54
This branch has not been deployed
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.
The voltage-based SOC calculation compares total battery-bus voltage with the single-battery OCV limits, even when detect_num_batteries has set series_multiplier to 2. A two-battery bank at the midpoint between empty and full OCV is consequently reported as 100%.
Normalize the measured voltage by series_multiplier before calculating SOC. Added a regression case to the existing battery tests.
An isolated C++ harness executing the production update_soc method reproduced 100% for a two-battery midpoint before the fix and approximately 50% afterward. A single-battery midpoint control also passed. The full Zephyr test suite and hardware testing remain pending.
Audit status (16 November 2026): returned to draft pending actual firmware/test execution. The current GitHub runner fails in setup because apt cannot locate clang-format-15; this occurs before the firmware build and tests. The isolated harness evidence above remains limited to that scope. No successful full CI or hardware test is claimed.
Evidence audit — 17 November 2026
Individually rebuilt and ran the production Zephyr native test image from public revision
e58d104e0: 96 tests, zero failures. This is separate from the combined run of #135–#145, which passes all 103 tests. Replacing the relevant production implementations with the original code reproduces the new regression failures.Reproduction in the west workspace, from the firmware directory:
Environment: Linux x86-64, GCC host toolchain, Zephyr 4.4.2, manifest dependencies. These tests use the project's native simulated interfaces; no ARM board or charging hardware was operated.
The earlier GitHub CI failure was a runner setup failure locating clang-format-15, before source tests ran. The local native result above does not turn that CI run green; board firmware CI remains unverified.