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

Improve battery level #179

Merged
merged 4 commits into from
Jul 2, 2024
Merged

Improve battery level #179

merged 4 commits into from
Jul 2, 2024

Conversation

ChrisDick
Copy link
Contributor

@ChrisDick ChrisDick commented Jun 27, 2024

Description

fixes issue #83
rework the battery level algorithm to be use different values for discharge and charge states and in the charge state use charge current profiles based on input current limits to calculate SOC. Reduce the charge termination current to 64mA to allow battery to charge to 4.2V.

change algorithm to be based on charge current when charging and use different voltage levels for charge and discharge. reduce termination current to allow higher top of charge voltage.
scale limits to keep battery level percentage approximately the same for all 3 input current limits and when not connected.
@kliment
Copy link
Contributor

kliment commented Jun 27, 2024

For battery lifetime I would suggest not charging up to 4.2. Do we have a reason to do so?

@ChrisDick
Copy link
Contributor Author

I've not actually changed the target voltage, just reduced the termination current. my comment is wrong, I misread issue #175 where the old max voltage used in the battery level api is 4.1V. While testing this change I saw 4.2V as the top of charge, so assumed the termination current change was allowing it to reach 4.2V. The PMIC defaults to 4.2V and we are not changing it, but we can if a lower target charge voltage is what we want.

Copy link
Contributor

@npentrel npentrel left a comment

Choose a reason for hiding this comment

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

I can't say I understand the semantics here but the syntax looks fine... so LGTM?

@ChrisDick
Copy link
Contributor Author

I'm going to merge this in and if we want to change the target charge voltage, we can do it as a separate change.

@ChrisDick ChrisDick merged commit 17b9261 into main Jul 2, 2024
3 checks passed
@ChrisDick ChrisDick deleted the Improve-BatteryLevel branch July 2, 2024 22:07
@ChrisDick ChrisDick mentioned this pull request Jul 2, 2024
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.

3 participants