How does a battery calibration work between operating systems?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
I've got an ultrabook running Ubuntu 12.04 and Windows 7 and I just installed a new battery. The system randomly shut down completely even though the battery level was at 50%, so I think that it needs a battery calibration.

I'm curious to know how battery calibration works though - how does Ubuntu or Windows 7 know what level the battery is at? Is there a chip on the battery that reports the max voltage and the empty voltage, and then reports the current voltage and the OS records past discharge data and does the calculations/extrapolations to figure out the percentage from there?

I would think that the BIOS should be storing all of the battery discharge data right?

All of the calibration guides I've read online are for Windows 7:

1. fully charge battery
2. start Windows
3. have the computer naturally hibernate once it reaches 5%
4. recharge back to 100%
5. battery is not calibrated

Great - this is for Windows, but will it make my Linux battery level more accurate as well?
 

corkyg

Elite Member | Peripherals
Super Moderator
Mar 4, 2000
27,370
239
106
I am on my 6th laptop since 1994, and have always found battery calibration in BIOS settings. Have never done it in Windows. As I recall, the User Guides tell how to do it. I have not done it in several years because I rarely use the battery. :)

AFAIK, current Thinkpads have this in the Power Management section of what many misguided users get rid of as "bloatware." There is a one button gauge reset, and that seems to be what we used to call calibration. All of this now seems to be OEM specific.
 
Last edited:

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
I am on my 6th laptop since 1994, and have always found battery calibration in BIOS settings. Have never done it in Windows. As I recall, the User Guides tell how to do it. I have not done it in several years because I rarely use the battery. :)

AFAIK, current Thinkpads have this in the Power Management section of what many misguided users get rid of as "bloatware." There is a one button gauge reset, and that seems to be what we used to call calibration. All of this now seems to be OEM specific.

Hmmm... I think I figured it out.

My ASUS UX32VD does not have user-accessible power management in the BIOS. When I first got the battery I just put it in, turned on the computer, and started using it. I guess the BIOS had no baseline on the new battery so it wasn't able to predict when the battery would go kaput. It also had no way of knowing when the battery would be fully charged.

The battery reports to the system:

battery
present: yes
rechargeable: yes
state: charging
energy: ?? Wh
energy-empty: 0 Wh
energy-full: 47.234 Wh
energy-full-design: 48.248 Wh
energy-rate: 19.203 W
voltage: 7.4 V
time to full: ?? minutes
percentage: ??%
capacity: 97.8984%
technology: lithium-ion

So the BIOS knows the battery's energy-full, the energy-rate, and the voltage. It also knows how fast it tells the computer to charge the battery. So if it knew the battery was empty, it could calculate how much energy the battery *should* have based on how long it has been charging and the rate at which the computer has been charging the battery.

But the battery started off as not empty.

The BIOS, from a blank slate, does NOT know the current energy of the battery in Wh, and Voltage is at best an inaccurate measure of battery energy left. The current energy of the battery is entirely an extrapolation of the BIOS based on historical data it has of the battery, so for a new battery, there is none.

What I ended up doing was leaving the computer on and unplugged until the battery completely died (like before). But THIS TIME I opened up the laptop again, unplugged the battery, booted up the computer a couple of times attached only to the power plug (to hopefully clear the battery history), and then plugged the battery back in.

Right now it seems to be working. It shows a percentage and a countdown time for when the battery will be fully charged. And the number is changing.

When I unplug the laptop I expect it to now be able to accurately extrapolate when the battery is nearing empty the shut off the computer accordingly.
 

Mushkins

Golden Member
Feb 11, 2013
1,631
0
0
You pretty much hit the nail on the head, a total drain is the de-facto way to "resync" a battery and is very good for its longevity. It's recommended that any Li-Ion battery is fully cycled (complete discharge, complete recharge) every month or so, and keeping it plugged in 24/7 is a surefire way to have a paperweight instead of a battery after a year or two tops.

Even the battery estimate on a modern smartphone gets less and less accurate and you've got to cycle it every month or two. With a new laptop battery, the easiest way to drain it out completely is to leave it in the BIOS or on a preboot screen until it dies, that way the OS can't misguidedly trigger any power features like you experienced.