Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate scaled remaining capacity using estimated total capacity from SOC #560

Merged

Conversation

amarofarinha
Copy link
Collaborator

What

Implemented a new approach to calculate the scaled remaining capacity by estimating the total battery capacity based on the real remaining capacity and SOC, then adjusting for min_soc to determine the reserved capacity.

Why

This method provides a more accurate representation of usable capacity, as the real remaining capacity and SOC values do not directly align with the fixed total capacity. The updated calculation accommodates variations in reported capacity, improving accuracy for systems where SOC and capacity data fluctuate, like in the Leaf battery.

How

  • Estimated total capacity by factoring in the current real remaining capacity and SOC.
  • Calculated reserved capacity based on min_soc.
  • Updated reported_remaining_capacity_Wh to reflect this refined capacity calculation.

Copy link
Owner

@dalathegreat dalathegreat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@amarofarinha amarofarinha merged commit b8cb5fe into dalathegreat:main Oct 25, 2024
30 checks passed
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.

2 participants