fix: work the sustainable current from whichever ambient leaves less headroom - #33
Closed
zebraengine wants to merge 1 commit into
Closed
zebraengine wants to merge 1 commit into
zebraengine wants to merge 1 commit into
Conversation
…headroom Two failures of the sustainable-current ambient in one evening, in opposite directions. At the end of the 32 A probe the trajectory-implied ambient named 47 A where the sensor's 30.3 C named 44, which held: the current law extrapolated to 32 A over-reads the rise, and the error comes back doubled at 47. Preferring the sensor fixed that and was shipped in #31. Then the car restarted 1.7 h after a 55 min charge: the sensor read 25.6 C, the handle behaved like 28.7 C - the cable and wall were still warm - and the sensor route named 48 A against a correct 46. Neither source deserves to be first. The sensor reads the air, not the hardware's thermal state; the trajectory reads the hardware, through a model that is weakest far from the fits. So the sustainable current is worked from whichever of the two leaves the handle less headroom. Both incidents come out right: 44 A after the probe, 46 A on the warm restart. On model basis the two coincide and nothing changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Owner
Author
|
Superseded: the backtest in #34 shows every ambient-selection rule sits under a 3–5 °C model error that grows with ambient. The model gets an ambient term instead; the restore ambient gets re-evaluated with numbers after that. |
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.
Problem
Two failures of the ambient behind
sustainable_max_a, same evening, opposite directions:suggested_max_a) named 46 A, which is right.So "sensor first" is optimistic on a warm restart and "implied first" is optimistic after a low-current probe.
Code touched
wallmonitor/thermal.pypredict():sustainable_max_ais worked from whichever of the two ambients is warmer — i.e. leaves the handle less headroom.sustainable_ambient_sourcesays which won ("measured"/"implied"). On model basis the implied ambient is the model's ambient, so nothing changes there.suggested_max_auntouched (implied, as before).sustainable_max_current, the amp-control module docstring, anddocs/amp-control.mdupdated to describe the rule and both incidents.tests/test_wallmonitor.py: sensor cooler than the trajectory implies → implied wins (42 A); sensor warmer → sensor wins (< 42 A). Existing trajectory test assertssustainable_ambient_source == "implied"with no sensor.Risk
max(step, sustainable)) bounds a tiny value. Unchanged from feat: fit how rise scales with current, and restore straight to the sustainable rate #31.Verification
uv run pytest: 153 passed (one new).max(30.25, 27.3)= 30.25 → 44 A; warm restart →max(25.6, 28.7)= 28.7 → 46 A.Deploy: pull +
sudo systemctl restart wallmonitor.service. Server-only.🤖 Generated with Claude Code