Skip to content

Conversation

@dguittet
Copy link
Collaborator

The calculate_current_for_power_kw function reduces the battery's target power and current to what is available given SOC. Fix the bug in the charging portion where the reduced power and current should have been negative.

Fix #1361

@dguittet dguittet requested a review from brtietz November 14, 2025 13:03
@dguittet dguittet changed the title fix #1361 Battery Charging Bug Nov 14, 2025
@brtietz
Copy link
Collaborator

brtietz commented Nov 14, 2025

Thanks for looking into this! A few requests:

  1. Can you add a test that establishes this sign convention explicitly? There are a few tests in lib_resilience_test that are close, but I'm getting lost with multiple negative sign conventions. Bonus points for establishing the convention in the discharging function as well.
  2. Can you review other uses of the function to ensure the sign convention is correct? I'm seeing some additional inconsistencies in the below.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue in Battery

3 participants