You are not logged in.

#1 2022-06-03 00:21:11

Amphitryon
Member
Registered: 2013-09-20
Posts: 39

Battery Percentage possibly wrong

I am using an HP G62 and in GNOME it tells me the battery is 4% charged.  If I unplug the AC adaptor it immediately turns off.  Upon plugging in the AC adaptor there is a light next to the socket that briefly turns orange and then goes to white.  As far as I know the orange indicates charging and the white fully charged.

So something seems odd here.  The almost immediate switch from charging to not charging suggests that whatever controls the charging of the battery thinks it is fully charged.  On the other hand the 4% seems more consistent with the laptop turning off when AC power is removed unless, of course, it is something monitoring the state of battery charge that is forcing the power off rather than the battery actually being unable to deliver the required current.

There is a BIOS warning during boot from power off 601: Primary Battery (Internal).  I had assumed that by internal it was referring to a lithium button cell on the PCB to operate the RTC/CMOS RAM but maybe this is relevant.

Software issues not withstanding, can the hardware directly detect the state of charge of the battery or is it doing something like detecting when fully charged and then measuring current flow over time to get an approximation for its current state of charge.  I am sure I read of the latter being used on mobile phones and occasionally needing to reset this mechanism.  Any ideas?

Offline

#2 2022-06-03 02:20:19

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: Battery Percentage possibly wrong

its an old laptop, the battery is dead

Offline

#3 2022-06-03 14:51:08

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: Battery Percentage possibly wrong

Amphitryon wrote:

Software issues not withstanding, can the hardware directly detect the state of charge of the battery or is it doing something like detecting when fully charged and then measuring current flow over time to get an approximation for its current state of charge.  I am sure I read of the latter being used on mobile phones and occasionally needing to reset this mechanism.  Any ideas?

Lithium Ion / Lithium Polymer batteries are not your grandfathers Lead Acid or Nickle Cadmium batteries.

Lithium secondary (rechargeable) batteries have a *very* flat voltage/state of charge curve that makes it practically impossible to determine the state of charge based upon a measurement of the voltage at the terminals.  They also have the issue of having a minimum voltage that, if exceeded, kills the cells and prevents them from ever being charged again.  This, plus the nasty tendency of Li chemistry batteries to self immolate if charged incorrectly, pretty much requires all Li battery systems to include battery management systems.  These systems control the charging and discharging of the cells, and include "Coulomb" counters that monitor charge into and out of the cells by integrating the current as a function of time.   These battery managers typically have a way of communicating with a host -- in most modern computers is via a System Management bus (SMBus)  https://en.wikipedia.org/wiki/System_Management_Bus

I tend to agree with jonno2002, the battery is probably pinning for the fjords.   Information generated by the battery manager is exposed on under the /sys virtual file system.   On my system it is at /sys/class/power_supply/BAT0.   It may be something slightly different on your system.  You need to poke around.   That directory includes pseudo "files" that the kernel uses to express state.   For example:

ewaller@odin/home/ewaller % cat /sys/class/power_supply/BAT0/uevent 
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Unknown
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000
POWER_SUPPLY_VOLTAGE_NOW=15860000
POWER_SUPPLY_CURRENT_NOW=0
POWER_SUPPLY_CHARGE_FULL_DESIGN=2208000
POWER_SUPPLY_CHARGE_FULL=2208000
POWER_SUPPLY_CHARGE_NOW=1792000
POWER_SUPPLY_CAPACITY=81
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=Primary
POWER_SUPPLY_MANUFACTURER=Hewlett-Packard
POWER_SUPPLY_SERIAL_NUMBER= 
ewaller@odin/home/ewaller % 

Take note of POWER_SUPPLY_CHARGE_FULL_DESIGN, POWER_SUPPLY_CHARGE_FULL, and POWER_SUPPLY_CHARGE_NOW  (Again YMMV, you may have to explore)
The POWER_SUPPLY_CHARGE_FULL_DESIGN will tell you what the battery capacity was when it was new.  The POWER_SUPPLY_CHARGE_FULL tells you what the capacity is now, and POWER_SUPPLY_CHARGE_NOW is the current charge in the battery.   The "percentage" is probably the ratio of the last two.

My guess is the the POWER_SUPPLY_CHARGE_FULL has gone south.    Regardless, the kernel (and "BIOS" or system firmware) is provided this information from the battery manager and it has to make decisions based on what it is provided -- correct or not.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB