emfcamp / badge-2024-software

46 stars 29 forks source link

Improve battery level #179

Closed ChrisDick closed 4 months ago

ChrisDick commented 4 months ago

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.

kliment commented 4 months ago

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

ChrisDick commented 4 months ago

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.

ChrisDick commented 4 months ago

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.