LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-15-2021, 06:15 AM   #1
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Rep: Reputation: Disabled
Laptop battery - hard shut down without warning


Endeavouros-Plasma
MSI GP60 Leopard

My battery indicator indicated there are 20% battery left in laptop. When i close the lid and reopen the lid, it said 40% of battery left (even when i was not charging it).
I used for a few minutes.. and the laptop just did a hard power off without any warning.

I have set in power management to have critical action at 20%... it seems that is totally useless.

Any idea how to solve the issue ? is there way to calibrate the battery or something ?
thx
 
Old 01-15-2021, 07:53 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by andrewysk View Post
Endeavouros-Plasma
MSI GP60 Leopard

My battery indicator indicated there are 20% battery left in laptop. When i close the lid and reopen the lid, it said 40% of battery left (even when i was not charging it).
I used for a few minutes.. and the laptop just did a hard power off without any warning.

I have set in power management to have critical action at 20%... it seems that is totally useless.

Any idea how to solve the issue ? is there way to calibrate the battery or something ?
thx
What was the situation leading up to 20%?

My thoughts are possibly that this could be user misunderstanding.

When a device newly turns on, or back on, it has no historical data about the battery, so it begins to build that information. It may start assuming full charge, 50% charge, or empty/nearly empty charge, then it incorporates new readings and runs a filter to derive a better approximation over time. Battery measurements are usually measured in seconds, as in 5 or 10 second intervals between measurements, it could be longer. A typical filter however it is initialized, may have a time period measured in minutes. As a result, a more valid reading will appear after those few minutes.

If the outcome of this occurs at that point, and is lower than the safe operation limits for staying on battery, the shutdown may occur at about the same time a warning is ready to be posted.

Other things are:
What does it normally do when you close the lid? Hibernate or sleep? And how long did you close the lid for? If you closed it for a brief time, but enough for it to start sleeping, on one hand, any battery filter should have been retained as far as state of it was, but also the battery was 20% and dropping when you closed the lid. It already was very close to low battery shutdown. Using it for those few minutes may have been all which was available in the battery.

Last edited by rtmistler; 01-15-2021 at 07:55 AM.
 
1 members found this post helpful.
Old 01-15-2021, 09:14 AM   #3
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
The only way I know to calibrate a battery is to fully drain it, then recharge it. But if the battery is old and/or failing even this will not work.
My old laptop would run for 30 minuets at 0% before shutting down and would drain fast once fully charged. When it would last less then 30 minutes on battery it was time for a new system.
 
Old 01-15-2021, 05:03 PM   #4
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
What was the situation leading up to 20%?

My thoughts are possibly that this could be user misunderstanding.

When a it has no historical data about the battery, so it begins to build that information. device newly turns on, or back on, It may start assuming full charge, 50% charge, or empty/nearly empty charge, then it incorporates new readings and runs a filter to derive a better approximation over time. Battery measurements are usually measured in seconds, as in 5 or 10 second intervals between measurements, it could be longer. A typical filter however it is initialized, may have a time period measured in minutes. As a result, a more valid reading will appear after those few minutes.

If the outcome of this occurs at that point, and is lower than the safe operation limits for staying on battery, the shutdown may occur at about the same time a warning is ready to be posted.

Other things are:
What does it normally do when you close the lid? Hibernate or sleep? And how long did you close the lid for? If you closed it for a brief time, but enough for it to start sleeping, on one hand, any battery filter should have been retained as far as state of it was, but also the battery was 20% and dropping when you closed the lid. It already was very close to low battery shutdown. Using it for those few minutes may have been all which was available in the battery.
I set it to standby in ram when close the lid. I closed the lid until it fully standby in ram then i open the lid immediately... it then shows to a higher value than before i closed the lid. After a short few minutes.. it suddenly off.

I didn't really grasp what you were saying.
Please bear with me, I think you meant linux does not keep a value of my battery condition in system.
So each time laptop starts, it has no historical data about the battery stored in hdd, so it have to build that information, and the measurement could take a few sec per cycle. It is this measurement that it will know what level is my battery and how long will the battery reach to a certain drain value.
Even when measurement takes a few seconds, my laptop got shutdown suddenly after several minutes.. surely enough for a few cycle of battery power testing.

BTW, what does it mean by "battery filter " that you mentioned ?

Thx

PS: also there is no calibration or something for battery as such in windows os ? if has, what is the command or package ?

Last edited by andrewysk; 01-15-2021 at 05:15 PM.
 
Old 01-15-2021, 05:44 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
For me there is no such thing as battery calibration. A battery discharges, as the battery gets older the rate of discharge gets faster. It is represented by a mathematical equation where the charge gets lower over time and as the battery ages, the charge will drop more rapidly. This is not a single equation, instead it is generally expressed and for each battery type these are slightly different.

A filter is a software or hardware method which is intended to take data and determine a trend. (Not exactly but that's the best explanation I feel may help here.)

Neither of these topics are anything I feel you can control.

Given that your system did not show the same charge after you woke it up, or even close, then the OS did not remember it across a sleep-wake cycle and it had to take more data and reach a new filtered conclusion. An issue is that "right away" software like the desktop wants a value so it can be displayed, so the filter output is read, and used, before it has settled on a more correct value.

These things are controlled by the kernel and drivers, and there are variations as to how it is done.

My primary point is, based on you original description, you got to 20%, closed the lid, let it sleep, and then opened the lid, without any charging involved. The battery is still about 20%. When you opened the lid, you used it for some time, which drains the battery.

All the details above and mentioned earlier are a possible explanation as to why it gave you a higher reading, which wasn't sensible, or correct.

I don't feel there's anything for you to be concerned about, batteries drain.
 
Old 01-15-2021, 07:54 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
How old is this battery?
 
1 members found this post helpful.
Old 01-15-2021, 08:19 PM   #7
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by uteck View Post
The only way I know to calibrate a battery is to fully drain it, then recharge it. But if the battery is old and/or failing even this will not work.
I agree with uteck. Also when a battery is brand new you should deliberately let it run to flat zero charge and then recharge it to 100%. Do this two or three cycles and you should get much better service out of your battery than if at the beginning you haphazardly recharge it at random points in the battery drain cycle.

----------------------------
Steve Stites
 
Old 01-15-2021, 11:49 PM   #8
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by jailbait View Post
I agree with uteck. Also when a battery is brand new you should deliberately let it run to flat zero charge and then recharge it to 100%. Do this two or three cycles and you should get much better service out of your battery than if at the beginning you haphazardly recharge it at random points in the battery drain cycle.
I am unable to confirm, nor to verify these statements. Are there results published somewhere, produced by trustworthy people after serious attempts to compare comparable situations? Opinions have been refuted in the past, but even that is an unsatisfactory base for advice.

[OFF-TOPIC/analogy]
The battery of my current mobile-phone (Crosscall – unsmart) keeps going several times longer than that of my previous (Motorola – unsmart, too) without me paying any attention to the current state; I charge when I can and avoid and empty battery. AFAIK, the old Motorola had more advanced technology than the Crosscall. I bought the latter for the robustness of the case. But now I would buy it for the battery, too..., If I had to. It does not break, either.

Last edited by Michael Uplawski; 01-15-2021 at 11:51 PM. Reason: Cosmetics.
 
Old 01-16-2021, 04:09 AM   #9
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Exclamation

Quote:
Originally Posted by jailbait View Post
when a battery is brand new you should deliberately let it run to flat zero charge and then recharge it to 100%. Do this two or three cycles and you should get much better service out of your battery

----------------------------
Steve Stites
Heard that before. Noted. I think this "drain to zero" is only meant for Li-ion and some more moderm battery which has not memory effect.. ** just saying.. **

Quote:
Originally Posted by uteck
The only way I know to calibrate a battery is to fully drain it, then recharge it. But if the battery is old and/or failing even this will not work.
My old laptop would run for 30 minuets at 0% before shutting down and would drain fast once fully charged. When it would last less then 30 minutes on battery it was time for a new system.
Yes, old battery, it was working fine on windows os.. windows can detect the level of my battery power quite accurately.. I noticed the battery drops it remain power faster at the lower of it percentage power..
Example: at 95% it runs for 5 mins to reach 90%; but at 25% it reaches 20% at 2 minutes..

Like my old lead acid car battery.. when you check it voltage with voltage meter with 0 load, it is 12.6v, but when you apply a load (car starter) to it and check the voltage, it is actually 11.9v and it drops exponentially.
I believe laptop battery is also the same.



Quote:
Originally Posted by frankbell
How old is this battery?
Min 4 yrs old.

Quote:
Originally Posted by rtmistler

I don't feel there's anything for you to be concerned about, batteries drain.
Yes, i do not have big worry about the battery, since it is old.

Last night, i unplugged the battery at 100% to do a test.. then i forgot to plug it back, within less than 20 minutes (i would say), the whole linux screen blank... whole laptop just crash hard shutdown.. no warning.. nothing!
That's what i "concern", because the TLP and all those warning system of the linux os does not work! even when i have set it to have critical action at 20% of the battery power..
TLP does not function! I won't dare to unplug laptop even for a minute if it behave eradically like this.

I don't know how to make it work, or how to check why it didn't auto suspend laptop at 20% (no matter how fast the power drops exponentially, it should at least beep before got crash shut down)


 
Old 01-16-2021, 09:35 AM   #10
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
I don't know how to make it work, or how to check why it didn't auto suspend laptop at 20% (no matter how fast the power drops exponentially, it should at least beep before got crash shut down)
As batteries age their useful life per charge drops. Laptop batteries have an almost flat voltage output until the charge depletes then a sharp drop at the end. It sounds like yours is at the end of its life and the sharp drop is what killed the power. The laptop is not necessarily able to keep up with that short a charge cycle when reporting the charge on screen.
 
1 members found this post helpful.
Old 01-16-2021, 10:55 AM   #11
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
As stated before, the OS is using a mathematical formula to determine the remaining power, it is not like a cars fuel tank were you can get an accurate measurement of remaining fuel in the tank.

Some areas of the battery will become less able to hold elections during a charge cycle and that is why you see the the power drop so fast from 100%. As the battery gets to the remaining areas that work better, the rate of discharge slows. The OS may have some logic that averages out discharge over time, so it seems more accurate, but if you turned off the power save features you may find that it actually has quit a bit of life left even at 1% beyond what was reported.
 
1 members found this post helpful.
Old 01-18-2021, 01:04 PM   #12
eionmac
LQ Newbie
 
Registered: Dec 2005
Location: UK
Distribution: many: openSUSE LEAP15.2 & Live Knoppix 8.6 / Windows 10
Posts: 13

Rep: Reputation: 1
Use only when on power.

BATTERY problems of age / charging / retained voltage to operate are very problematical.
Your battery is at point where you should use laptop permanently powered from mains electricity.
My battery is about 11 years old in a 13 year old system (I bought a replacement in year 3).
Battery only holds about 22% of original new condition. My settings are that it closes down at 20%. It works plugged in quite happily, it also works well with no battery in it. If you want a 'portable machine' used from battery it is time for a new battery.
Average battery life from my firm's records for portable use persons (sales staff etc.) was 3 years. However very variable depending on maker.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
openSUSE Tumbleweed with XFCE: Laptop battery dies without warning at ~40% svm49 Linux - Newbie 4 02-16-2016 05:39 PM
making XFCE shut down computer for low battery newbiesforever Linux - Software 4 05-12-2014 01:07 PM
shut down problem - wont shut down.. UbrInKid Linux - Newbie 4 12-10-2009 06:20 AM
Xubuntu won't shut down - black screen after trying to shut down Snickar-Lasse Ubuntu 2 11-30-2009 04:33 PM
shut down won't shut system down taoweijia Linux - General 3 03-03-2004 06:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration