LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-22-2014, 05:04 PM   #1
akseli0x61
LQ Newbie
 
Registered: Aug 2014
Distribution: Arch
Posts: 19

Rep: Reputation: Disabled
Large variation between estimated battery time remaning


akseli@arch> acpi
Battery 0: Discharging, 58%, 01:59:15 remaining
akseli@arch> acpi
Battery 0: Discharging, 58%, 03:03:50 remaining
akseli@arch>

These commands have about one second time between them. I would expect a lot smaller variation between the estimated times. Does anybody know what could cause this? Or is it just normal?
 
Old 12-22-2014, 05:53 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by akseli0x61 View Post
akseli@arch> acpi
Battery 0: Discharging, 58%, 01:59:15 remaining
akseli@arch> acpi
Battery 0: Discharging, 58%, 03:03:50 remaining
akseli@arch>

These commands have about one second time between them. I would expect a lot smaller variation between the estimated times. Does anybody know what could cause this? Or is it just normal?
The status reports being one second apart actually tells you nothing about the sample period, and we also don't know anything about the algorithm used to calculate remaining time or what was happening on the system at the time... so I would not put much confidence in either of those samples.

But taking a step back from the system itself, the general method of calculating time remaining would be something like this...

Code:
Tr := (Pr/Dr)Fk

Where

Tr is time remaining
Pr is power remaining in the battery
Dr is discharge rate
Fk is a proportionality constant representing a fully charged state
Determining Pr, how much power remains in the battery is itself difficult to do. Usually this is inferred from measuring the instantaneous battery voltage, but that relationship will vary with age of battery, temperature, sum of previous discharge history, etc... every downstream use of the resulting number is similarly blurred.

But, back to your example, lets assume the system takes a battery voltage reading which it interprets as 58% charge remaining. It also samples the instantaneous discharge rate and arrives at the Tr = 2hrs.

A short time later, not necessarily the one second between your commands, but no more than a few seconds, it again finds 58% remaining, but maybe the disk has become quiescent so that the instantaneous discharge rate, Dr is much lower for this sample. The resulting Tr is now calculated at 3 hrs.

So the point is that time remaining as reported for a given sample depends on many things, but primarily the instantaneous dishcarge rate all else being equal. The discharge rate depends on what the system is doing at that instant and can vary significantly between samples.

Moral of story: Use the indication of time remaining as a relative moving average - not something to set you clock by!

Hope that helps.

Last edited by astrogeek; 12-22-2014 at 05:57 PM. Reason: tpos, typs, typos
 
Old 12-22-2014, 06:27 PM   #3
akseli0x61
LQ Newbie
 
Registered: Aug 2014
Distribution: Arch
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thanks for the awesome response! From what i now understand the estimate would be little better if that discharge rate would be an average discharge rate from eg. few seconds.
 
Old 12-22-2014, 06:40 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by akseli0x61 View Post
Thanks for the awesome response! From what i now understand the estimate would be little better if that discharge rate would be an average discharge rate from eg. few seconds.
You are welcome!

Yes, an average value is better, but still only if the average system use remains relatively constant. Hence, the idea of a moving average which will adapt somewhat to average demand changes over time.

Think of any sample as "This is about the time remaining, assuming nothing changes between now and then".
 
  


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
Replaced CMOS battery and time is still not correct...??? cbjhawks Linux - Hardware 8 08-24-2010 08:04 AM
LXer: At least 125m Firefox users estimated LXer Syndicated Linux News 0 12-04-2007 06:00 PM
Estimated release date and screenshots of KDE 4? Aleksandersen Linux - Desktop 4 02-10-2007 09:33 AM
battery time totti10 Linux - Laptop and Netbook 2 11-04-2004 04:18 PM
Laptop Battery Time w/FC2 VinnySem Linux - Laptop and Netbook 8 10-26-2004 09:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:01 AM.

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