You are not logged in.

#1 2015-11-06 22:01:10

Coriolis
Member
From: Russian Federation
Registered: 2015-07-26
Posts: 27

Set battery charge limit

I've started to experience a strange bug, laptop just keeps charging at 99%. If I plug adapter out and back, laptop stops charging, showing 100% charge. Is there a way to limit charge at 80%, for example, stopping the charging and letting the laptop use ac power then (as it usually does when reaching 100% charge)? I've looked through my bios settings, but unfortunately there are no power management options. I also found utility called "tp_smapi", but it's only for lenovo thinkpad laptops.

Offline

#2 2015-11-06 22:50:25

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,654

Re: Set battery charge limit

Where are you getting the information that the battery is charging at 99%?  And what does that mean?  The battery reaches 99% SOC and then stays there?

The really interesting information are in the the pseudo file system /sys/class/power_supply/BAT0


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2015-11-06 23:37:02

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Set battery charge limit

I do also experience this.
In the directory ewaller mentioned, there are several files, of which are relevant:

charge_full_design
charge_full
charge_now

Your 99% is most likely the quotient of the values of charge_now and charge_full.
charge_full shows the last full charge.
The maximal battery charge decreases over time and is generally not consistent (I could also imagine it being higher at a later point in time, however I am not an expert).
That is why charge_full and charge_full_design differ significantly and why charge_now may also be smaller than charge_full even though the battery is charged to its current maximum.

Offline

#4 2015-11-07 03:38:29

Coriolis
Member
From: Russian Federation
Registered: 2015-07-26
Posts: 27

Re: Set battery charge limit

ewaller wrote:

Where are you getting the information that the battery is charging at 99%?  And what does that mean?  The battery reaches 99% SOC and then stays there?

The really interesting information are in the the pseudo file system /sys/class/power_supply/BAT0

Information is from the path you specified above and also from indicator in my xfce panel.
Anyway, when charge reaches 99%, but it doesnt stop charging, just remains on that value (I've tried to wait for a couple of hours), the charging indicator (both hardware one on my laptop and on the screen) still on and power_now shows small values (2-3 watts), though it's supposed to be 0 when battery is charged and switched to AC power.

Offline

#5 2015-11-08 11:23:29

Coriolis
Member
From: Russian Federation
Registered: 2015-07-26
Posts: 27

Re: Set battery charge limit

Just noticed, if my laptop is off and I put it on charge, everything is ok - it stops charging when the battery is full.
So, does linux kernel control charging (and is there a way to enable/disable charging on software side), or it's independent?

Last edited by Coriolis (2015-11-08 11:29:08)

Offline

#6 2015-11-08 17:49:37

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Set battery charge limit

You can't control charging but by removing or applying power.
I don't think, that a laptop provides such a switch which can be controlled by software.

A battery stops charging, when it is fully charged. If the software says it is not, it is simply wrong.
The software can't analyze the chemical processes in your battery. In fact, the battery will actually never actually reach a state where it is "fully charged" because the reaction is, like almost any chemical reaction, a dynamic equilibrium reaction.
However the software can see the approximate current charge (charge_now). And it will store the maximum charge it has measured in the last time (charge_full).

Offline

#7 2015-11-08 18:56:18

cafe
Member
From: Brasil
Registered: 2014-03-20
Posts: 165

Re: Set battery charge limit

Lithium batteries have more density power than traditional Ni-Cd ones (if I can still call that traditional). So you can carry more energy using less space. The problem with that technology is that they will usually explode when they are over charged. So you are literally carrying a portable bomb on your pocket. That's mainly why you cannot control the charging state from software. This process is usually managed by a dedicated integrated circuit. It will charge the battery fast until 80% and then slowly charge your battery for the remaining 20%. That will typically improve battery life. For safety reasons explained above, you can only read the battery state and health and cannot control the charging state of this specific hardware. More info -> Battery University

Offline

#8 2015-11-08 18:58:41

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,654

Re: Set battery charge limit

Well, bomb may be a bit of a stretch.   Think of it as a highly effective incendiary. smile

edit:  https://www.youtube.com/watch?v=HCGtRgBUHX8
https://www.youtube.com/watch?v=Tpb-n22Y-sY

Last edited by ewaller (2015-11-08 19:21:47)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#9 2015-11-08 19:06:23

cafe
Member
From: Brasil
Registered: 2014-03-20
Posts: 165

Re: Set battery charge limit

You are right. Just an impact word to make things more expressive tongue

Offline

#10 2015-11-08 19:42:29

techwiz
Member
Registered: 2012-01-26
Posts: 48

Re: Set battery charge limit

Charging is handled by hardware, not software in like 99.95% of cases. Odds are the 99% error you are seeing is just a math rounding error and the battery isn't actually charging anymore. It's not in the best interest of the company that makes your laptop for them to explode spontaneously tongue

Offline

#11 2015-11-08 20:53:59

Coriolis
Member
From: Russian Federation
Registered: 2015-07-26
Posts: 27

Re: Set battery charge limit

techwiz wrote:

Charging is handled by hardware, not software in like 99.95% of cases. Odds are the 99% error you are seeing is just a math rounding error and the battery isn't actually charging anymore. It's not in the best interest of the company that makes your laptop for them to explode spontaneously tongue

Well my device is a cheap chinesse laptop, so I dont think they actually care. Anyway I wouldnt be so bothered about that if the hardware charging indicator would go off, but it doesnt. Also strange values of power_now (~3 watts, when it's supposed to be 0 when the battery is charged).

Offline

#12 2015-11-08 21:04:07

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,654

Re: Set battery charge limit

Coriolis wrote:

Well my device is a cheap chinesse laptop, so I dont think they actually care.

They do if they import to the US, Canada, Australia, Japan, or the EU.  I am sure that other regions have safety certification standards, but I cannot cite them.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB