Battery mot charging past 54%
#13
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.
  Reply


Messages In This Thread
Battery mot charging past 54% - by StickyPine - 05-15-2021, 05:16 PM
RE: Battery mot charging past 54% - by dsimic - 05-16-2021, 06:35 AM
RE: Battery mot charging past 54% - by StickyPine - 05-16-2021, 10:58 AM
RE: Battery mot charging past 54% - by marcih - 05-16-2021, 12:30 PM
RE: Battery mot charging past 54% - by dsimic - 05-16-2021, 12:30 PM
RE: Battery mot charging past 54% - by 8bit - 05-16-2021, 08:06 AM
RE: Battery mot charging past 54% - by dsimic - 05-16-2021, 08:27 AM
RE: Battery mot charging past 54% - by 8bit - 05-16-2021, 09:14 AM
RE: Battery mot charging past 54% - by dsimic - 05-16-2021, 09:38 AM
RE: Battery mot charging past 54% - by StickyPine - 05-16-2021, 02:57 PM
RE: Battery mot charging past 54% - by StickyPine - 05-17-2021, 02:32 AM
RE: Battery mot charging past 54% - by dsimic - 05-17-2021, 09:34 AM
RE: Battery mot charging past 54% - by dsimic - 07-28-2021, 06:08 AM
RE: Battery mot charging past 54% - by bcnaz - 07-28-2021, 08:09 AM
RE: Battery mot charging past 54% - by evilbunny - 05-18-2021, 07:52 AM
RE: Battery mot charging past 54% - by dsimic - 07-07-2021, 08:15 PM
RE: Battery mot charging past 54% - by biketool - 06-30-2021, 05:59 AM
RE: Battery mot charging past 54% - by bcnaz - 07-26-2021, 03:47 AM
RE: Battery mot charging past 54% - by megous - 09-18-2021, 09:16 PM
RE: Battery mot charging past 54% - by Ppuser77 - 11-19-2021, 06:00 AM
RE: Battery mot charging past 54% - by Jack Kim - 07-27-2021, 03:57 AM
RE: Battery mot charging past 54% - by Ppuser77 - 11-24-2021, 05:06 AM
RE: Battery mot charging past 54% - by bcnaz - 11-24-2021, 07:04 PM
RE: Battery mot charging past 54% - by vusra - 01-14-2022, 04:49 AM
RE: Battery mot charging past 54% - by kqlnut - 01-14-2022, 08:29 AM
RE: Battery mot charging past 54% - by vusra - 02-25-2022, 12:47 AM
RE: Battery mot charging past 54% - by bcnaz - 02-26-2022, 12:01 AM
RE: Battery mot charging past 54% - by vusra - 01-14-2022, 04:01 PM
RE: Battery mot charging past 54% - by kqlnut - 01-14-2022, 05:13 PM
RE: Battery mot charging past 54% - by vusra - 02-26-2022, 02:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  power circuit can't charge battery and can't supply enough power for modem or wifi vortex 2 528 02-17-2024, 04:15 PM
Last Post: vortex
  Battery life improvement freelectro 10 3,294 06-01-2023, 08:27 PM
Last Post: KC9UDX
Thumbs Down Battery Issue or Power Management IC? bcoyle 2 1,519 03-20-2023, 12:54 AM
Last Post: bcoyle
  Charging Indicator On - Not Charging SJSEng 0 786 08-30-2022, 07:33 AM
Last Post: SJSEng
  Power supply vs battery albafrati 11 4,634 06-22-2022, 06:04 PM
Last Post: albafrati
  PPKB with phone; phone dies while charging SwordfishII 1 1,369 06-08-2022, 04:14 AM
Last Post: SwordfishII
  What PD charger/dock combo results in PP battery not draining while using convergence james8880 0 1,461 04-28-2022, 12:45 PM
Last Post: james8880
  Screen has pixel-thin horizontal stripes that are black or get stuck in the past yasmi 5 4,020 03-08-2022, 12:25 PM
Last Post: jopple
  Battery replacement alternative sax1960 7 6,312 08-29-2021, 07:03 AM
Last Post: bcnaz
  Battery Capacity and Software Interaction food 2 2,416 08-15-2021, 07:19 AM
Last Post: bcnaz

Forum Jump:


Users browsing this thread: 2 Guest(s)