[TRACKING] Linux battery life tuning

By “tuneD”, do you mean:

tuned - daemon for monitoring and adaptive tuning of system devices

?

I am still wanting an app of some kind that shows the speed of changing and discharging and I am not sure why this is so difficult. It seems to me to be an obvious way to look at the reliability of the battery.

And it does not help that the power statistics gathered by the ‘Power Statistics’ are so spotty, with the data showing a dample only a very few times a day.

It is nice that frame.work makes it so easy to replace the battery? But when should you replace it? This is still a fairly unanswerable question, as far as I can tell. Because of this, the ability to replace the library means less. One would think that FW would care about that….

You know the age of your battery, you can read out the charging cycles of the battery and the OS gives you an estimate on the remaining battery health.
Pair that information with your needs in terms of battery life and you are good to go.

E.g. someone who travels much, needs maximum battery life and burns through cycles pretty fast, may want to replace the battery after only a few years.
If you, like me, use your machine plugged in almost all the time, have a charging limit in place, your battery may last much longer.
My FW is almost 3 years old now. Only 29 cycles and KDE shows an estimate of 93% battery capacity left. For my usecase, my battery is probably good for the next 3 years and ahead.

IMO FW should not need to tell you, when to replace your battery.
You do.

Unfortunately it IS quite difficult, It relies on what is known as ‘coulomb counting’ which in turn relies on counting the electrons as the battery charges ad discharges. It is not an exact science as the electronics involved is complex and requires calibration for each battery chemistry.

There is a reason that there are a lot of house fires due to batteries in electric scooters going up in flames because the scooter manufacturers attempt to save money on the battery charging electronics. Laptop manufacturers have problems even though they go to considerable lengths to make sure they are careful about sticking to charging limits, and leaving enough margin at maximum charge to make sure the battery doesn’t catch fire. Dealing with the differences between what the chemistry does and what the electrnics thinks it does is not easy.

2 Likes

Both good points. Thanx much.

Not really, in fact, lithium ion batteries have the easiest charging algorithm, constant current constant voltage. The battery is first charging at a constant current while the voltage rises, when the voltage reaches the limit, maintain that voltage and let current decline, when the current is low enough, cut power and charging is finished. Another key advantage of Li-ion is the easiness of measuring battery level. At a given %, the open circuit voltage (OCV) is determined, you can acquire a battery charge v. OCV curve.

Lead-Acid is worse, the OCV stays nearly the same but the less the % the higher the internal resistance. Charging Lead-Acid is the same CC-CV but it’s float charge voltage needs to be compensated by temperature, making it slightly difficult to charge than Li-ion.

NiMH and NiCd are harder, although the internal resistance stays the same, the discharge curve is very flat and they have higher self discharge rate. A smart algorithm such as -dv/dt or dT/dt is a requirement for fast charging. Slow charging is possible, just charge at 0.1C for 15 hours. These kinds of batteries dissipate excessive electricity as heat at 100% charging, as long as the battery isn’t overheating and the charging rate is low, overcharging won’t damage them.

The simple charging algorithm plus easy charge % detection makes Li-ion one of the most favorable battery chemistry for most devices. However, this is both a blessing and a curse.

The range anxiety is crippling, people want more than NiMH. Enter coulomb counting, the state-of-the-art technique for precise capacity and health measurements, only available on Li-ion. A 5000mAh battery will discharge from 100% to 0% if you draw 5000mAh and to charge from 0% to 100%, charge 5000mAh. If it’s worn down to 80% health, the same principle applies except the mAh has reduced to 4000. Coulomb counting makes it possible to measure capacity accurately with 1% error. However coulomb counting is NOT used for charging, CC-CV is the charging algorithm while coulomb counting is used to display battery %.

The curse is since the elections flow strictly, over charging or discharging can and will severely damage the battery. Lead-Acid has float charging, NiMH has recombination. Li-ion can’t be float charged. A minor error on voltage measurement can lead to catastrophic results like this.

So here’s my conclusion. The lack of coulomb counting is NOT the reason of battery fire as this is not a requirement of charging Li-ion battery. Li-ion charging is simple but mistakes are also unforgivable

2 Likes

Hi all. I’ve not read the whole long thread, but . . is nvme.noacpi=1 still needed (for decent battery usage during sleep) if one has a recent distro and/or recent BIOS?

Warning; :warning: This will break s2idle on AMD systems.

3 Likes

exactly, it saves time. I would like to know if PopOS still has any advantage on battery compared to the rest of distros, or if that is no longer the case.

Hey Mario, I tried running the script on ZorinOS but this comes up:

python3 amd_s2idle.py
This script has been merged into the amd-debug-tools python wheel @ amd-debug-tools · PyPI
Install amd-debug-tools python wheel (y/N)? y
Relaunching with sudo
sudo: amd_s2idle.py: orden no encontrada

Yeah install the wheel now from PyPi and don’t launch as root.

   Hello! Just to say, a new beta of tlp is out (namely, tlp beta 1.8). The new version has power-profiles switchable via GUI and via power-state. Also, it has battery thresholds for Framework laptops. Or so I gather; I have not tried this beta yet.

3 Likes

This GNOME extension allows automatically disabling bluetooth when inactive for a set time, which may help save some battery

1 Like

Is the use of tlp-pd compatible with amd_s2idle.py?

TLP per AMD themselves, is not recommended if you want the full benefits of battery life. I know this might not be what you expected to hear, but ideally you are using the defaults that come with your distro or with DIY distros, tuneD. Using the power profiles GUI and battery save for battery mode.

Now, that said, if you are dead set on using TLP and understand AMD suggests this is not going to help, you will want to disable your existing power profile configuration (tuneD or on older distros, PPD)