Repository navigation
fix(control): car charging takes priority over home battery charging (#1868) - #1872
Merged
Merged
Conversation
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Closes #1868.
A 0.1 A phase overage reduced the car's 4140 W offer to 4071 W. The car's only nonzero step was 4140 W, so it stopped while the home battery kept charging. After stopping, the battery reserved exactly the requested car power, but the idle-start guard required another unused step. That could prevent an automatic restart.
The car has priority over optional home battery charging in every battery mode, including manual battery holds and self-tune. An existing car offer may wait up to 20 seconds for battery charging to fall, only while fresh phase readings, fuse heat and outstanding raises stay within the rated main fuse current. Battery charge is capped at the required lower level. The wait cannot renew during the same overage. If the battery cannot yield, stops responding or the rated current is exceeded, the normal car cut applies. A battery cut never grants an unmeasured car rise.
An idle car can restart once its minimum fits below the working fuse limit throughout the existing 35-second dwell. When battery charging would otherwise keep a running car one step short, its final step can use measured room below that working limit. No new setting.
Validation:
The simulator's recovery check now starts after actual fuse heat permits a restart and includes the existing battery-command settling window. This accounts for measured relief while recent battery raises still reserve room; the new scenario also checks recovery at fixed times.
Scope: based on shipping master, including #1870/#1871. Drafts #1789, #1782 and #1792 touch parts of the same control files. This fix keeps their broader fuse, phase-sign and two-phase changes for those PRs; it adds the issue-specific behavior and tests to the released path at the owner's request. No driver or UI change. No physical equipment used.