PINE64
Battery mot charging past 54% - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Hardware (https://forum.pine64.org/forumdisplay.php?fid=122)
+--- Thread: Battery mot charging past 54% (/showthread.php?tid=13912)

Pages: 1 2 3 4


RE: Battery mot charging past 54% - nightranger73 - 05-16-2021

It's hardcoded in kernel so the answer is no... Unless you rebuild it


RE: Battery mot charging past 54% - StickyPine - 05-17-2021

(05-16-2021, 10:25 PM)nightranger73 Wrote: It's hardcoded in kernel so the answer is no... Unless you rebuild it
Ok, thanks !


RE: Battery mot charging past 54% - dsimic - 05-17-2021

Actually, the battery charging limit (i.e. the charging target) is rather easily configurable, if the PinePhone runs Ondrej's patched kernel.  Using the command below will allow the battery to be charged to 100% of its capacity, which I've already tested and verified on my PinePhone:

Code:
echo 4350000 > /sys/class/power_supply/axp20x-battery/voltage_max_design   # microVolts (uV)

Here's a more detailed explanation, based on the source code of the AXP803 driver in the Linux kernel, Ondrej's kernel patches, and the relevant sections of the AXP803 datasheet (the PMIC that charges the battery):
  • Mainline Linux kernel disallows the battery charging voltage limit to be set over 4.2 V, but the lithium-ion polymer battery that ships with the PinePhone can be charged to about 4.37 V, according to page 4 of the battery datasheet.
  • Ondrej has written a patch for the AXP803 driver that allows 4.35 (or 4.36 V, doesn't matter) to be set as the AXP803's battery charging voltage target.
  • The default value of the bits 6-5 in the AXP803's register 33h is 10b, as visible on page 62 of the AXP803 datasheet, which means that the default battery charging voltage target is 4.2 V.  Expectedly, 4200000 (in uV) is the default value for the above-specified /sys parameter, which effectively prevents the battery from charging over 4.2 V, or over about 87-90% of its capacity.
  • It can be safely concluded that the AXP803, in the default state of its battery calibration, expects the battery voltage to reach about 4.33 V in order to report the battery as charged to 100% of its capacity, which is visible in the table on page 44 of the AXP803 datasheet.
  • Adjusting the battery charging voltage target to 4.35 V, using the command above, caused the AXP803 to charge the battery to its full capacity, or to about 4.32 V as measured by the AXP803 in my PinePhone, and to report the battery as charged to 100% of its capacity.  This also confirms the assumption about the default battery calibration that was made in the previous point in the list.

However, I wouldn't recommend charging the battery to 100% of its capacity, or to about 4.35 V, because it would surely reduce the battery lifetime, and may also cause the battery to overheat while charging under certain circumstances.  See also a couple of very good comments made by Ondrej here and here.

The right approach would be to instruct the AXP803 to perform the battery calibration, as described on pages 43 and 44 of the AXP803 datasheet, and to alter the resulting OCV percentage table so a battery charged to about 4.2 V (which equals to about 87-90% of the battery capacity) is reported by the AXP803 as being charged to 100%.  Of course, the final table needs to be stored in the phone and loaded into the AXP803 upon each boot.  All that would bring the best of both worlds: longer battery lifetime, no risk of overheating, and no confusion among the end users. Cool

I'll probably get to performing the above-described battery calibration at some point in time.  By the way, charging the battery to 100% may be safe in combination with a userspace daemon that monitors the phone thermals and keeps them within the safe temperature ranges, which I'm already working on.  With some additional "trickery", the userspace daemon should also be able stop the battery charging at 95%, for example, which might strike the right balance.


RE: Battery mot charging past 54% - evilbunny - 05-18-2021

Made Sticky


RE: Battery mot charging past 54% - Xzska-collab - 06-29-2021

(05-15-2021, 05:16 PM)StickyPine Wrote: Hello,

I juste got the PinePhone but the battery does not seem to be charging past 54%.

I saw on the wiki that some OS' limit the maximum charging percentage in order to improve the longevity of the battery. Because I'm having this issue on different OS' it got me thinking that it is a hardware problem, but it might not be.

Is it a known issue ? What can I do about it ?

Many thanks !
 I had the same issue, both with the Mobian and Beta versions, but I solved it by placing the charger directly to an outlat and let it charge for 10+ hours or until it showed 90+% charge. I also interchanged the batteries between both pinephone versions and charged as above. No more batteries issues.


RE: Battery mot charging past 54% - biketool - 06-30-2021

The battery calibrates by going to full charge and then letting it discharge until it shuts down.
I had to do this on my N900 once I started using the FOSS charge control driver.
It is better than having it never get above 80% after a few years of use.


RE: Battery mot charging past 54% - dsimic - 07-07-2021

(06-29-2021, 09:42 AM)Xzska-collab Wrote: I had the same issue, both with the Mobian and Beta versions, but I solved it by placing the charger directly to an outlat and let it charge for 10+ hours or until it showed 90+% charge. I also interchanged the batteries between both pinephone versions and charged as above. No more batteries issues.

Quite frankly, this is rather confusing.  None of the actions you've described would lead to achieving a battery charge level higher than the default.  Please, read my post above for a detailed background explanation.

(06-30-2021, 05:59 AM)biketool Wrote: The battery calibrates by going to full charge and then letting it discharge until it shuts down. I had to do this on my N900 once I started using the FOSS charge control driver.

What I referred to in my post above was the battery calibration procedure mentioned in the AXP803 datasheet.  Of course, the procedure must involve charging the battery fully and letting it discharge completely, but the datasheet also briefly describes the use of a few AXP803 registers; see pages 43, 44, 79 and 83–85 of the datasheet for more details.


RE: Battery mot charging past 54% - Xzska-collab - 07-16-2021

(05-17-2021, 09:34 AM)dsimic Wrote: Actually, the battery charging limit (i.e. the charging target) is rather easily configurable, if the PinePhone runs Ondrej's patched kernel.  Using the command below will allow the battery to be charged to 100% of its capacity, which I've already tested and verified on my PinePhone:

Code:
echo 4350000 > /sys/class/power_supply/axp20x-battery/voltage_max_design   # microVolts (uV)

Here's a more detailed explanation, based on the source code of the AXP803 driver in the Linux kernel, Ondrej's kernel patches, and the relevant sections of the AXP803 datasheet (the PMIC that charges the battery):
  • Mainline Linux kernel disallows the battery charging voltage limit to be set over 4.2 V, but the lithium-ion polymer battery that ships with the PinePhone can be charged to about 4.37 V, according to page 4 of the battery datasheet.
  • Ondrej has written a patch for the AXP803 driver that allows 4.35 (or 4.36 V, doesn't matter) to be set as the AXP803's battery charging voltage target.
  • The default value of the bits 6-5 in the AXP803's register 33h is 10b, as visible on page 62 of the AXP803 datasheet, which means that the default battery charging voltage target is 4.2 V.  Expectedly, 4200000 (in uV) is the default value for the above-specified /sys parameter, which effectively prevents the battery from charging over 4.2 V, or over about 87-90% of its capacity.
  • It can be safely concluded that the AXP803, in the default state of its battery calibration, expects the battery voltage to reach about 4.33 V in order to report the battery as charged to 100% of its capacity, which is visible in the table on page 44 of the AXP803 datasheet.
  • Adjusting the battery charging voltage target to 4.35 V, using the command above, caused the AXP803 to charge the battery to its full capacity, or to about 4.32 V as measured by the AXP803 in my PinePhone, and to report the battery as charged to 100% of its capacity.  This also confirms the assumption about the default battery calibration that was made in the previous point in the list.

However, I wouldn't recommend charging the battery to 100% of its capacity, or to about 4.35 V, because it would surely reduce the battery lifetime, and may also cause the battery to overheat while charging under certain circumstances.  See also a couple of very good comments made by Ondrej here and here.

The right approach would be to instruct the AXP803 to perform the battery calibration, as described on pages 43 and 44 of the AXP803 datasheet, and to alter the resulting OCV percentage table so a battery charged to about 4.2 V (which equals to about 87-90% of the battery capacity) is reported by the AXP803 as being charged to 100%.  Of course, the final table needs to be stored in the phone and loaded into the AXP803 upon each boot.  All that would bring the best of both worlds: longer battery lifetime, no risk of overheating, and no confusion among the end users. Cool

I'll probably get to performing the above-described battery calibration at some point in time.  By the way, charging the battery to 100% may be safe in combination with a userspace daemon that monitors the phone thermals and keeps them within the safe temperature ranges, which I'm already working on.  With some additional "trickery", the userspace daemon should also be able stop the battery charging at 95%, for example, which might strike the right balance.
Thank you for the info...how do I find out if the Mbian or KDE Pinephones use the Ondrej's patched kernel?


RE: Battery mot charging past 54% - bcnaz - 07-26-2021

I have a 'Post Market Edition' Pine phone, running a 'recent Mobian nightly release'.
It charges to 100%, then it discharges to 93 - 95%... then charges again to 100% ... repeat...
I think the developers are still fine tuning the charging software.

Just curious, have you tried different chargers ?
I do see slight differences when I use different chargers.

Note : I have several Pine phones, one has Arch installed and it charges about the same as the ones with Mobian installed.


RE: Battery mot charging past 54% - Jack Kim - 07-27-2021

in my case it was charging cable issue, and after replacement, it is OK. however the overheating issue is still continuing.