News for hackers. Stuff that matters.
Re:Linux Kernel Fastboot [pdf] by lonelappde on Saturday September 14, 2019 @10:13PM (#20975150)
That's a good way to estimate but not appropriate for comparing to powertop, due to overhead. Also "50%" of energy is an estimate based on voltage, not actually energy usage. That's why Apple has stopped showing percentages in their OSes.

You should use the same methodology for both.

Re:Linux Kernel Fastboot [pdf] by aidenn0 on Saturday September 14, 2019 @11:03PM (#20975313)
I thought most laptop batteries use coulomb counting rather than voltage for estimating battery level?
Re:Linux Kernel Fastboot [pdf] by BeeOnRope on Sunday September 15, 2019 @12:37AM (#20975589)
Yes, any decent laptop for sure uses coulomb counting, not a simple voltage measurement.
Re:Linux Kernel Fastboot [pdf] by jimmaswell on Saturday September 14, 2019 @10:17PM (#20975170)
I'd assume the voltage->percentage function was worked out and the percentage displayed was thus accurate. It would be weird if that wasn't the case.
Re:Linux Kernel Fastboot [pdf] by konstmonst on Sunday September 15, 2019 @05:11AM (#20976308)
It us not. I programmed Accu controller. The best way is to track the enery coming in and out. Using only voltage is imprecise bevause the voltage/charge graph look a bit logarihmic, so the more charge you have, the more presision you need to have while measuring charge.This graph as well as total possible energy capacity and ability to Charge depend on Temperature. Also you normally have multiple cells that age differently.
Re:Linux Kernel Fastboot [pdf] by rabidrat on Saturday September 14, 2019 @10:27PM (#20975198)
I think it varies with the age of the battery and the operating temperature (probably other things too). Although if they were clever they could probably incorporate those parameters as well..
Re:Linux Kernel Fastboot [pdf] by Filligree on Sunday September 15, 2019 @12:39PM (#20978040)
They use coulomb counting, along with an estimate of how much safely-usable energy is left in the battery.

That estimate is usually accurate, but it can drift a bit over time if you never fully recharge or discharge the battery. Also, when the battery gets old it starts having trouble delivering full current when mostly discharged, which is why you'll sometimes see shutdowns at 5-15% remaining.