Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Discharge Rate
03-19-2010, 06:04 AM (This post was last modified: 03-19-2010 06:06 AM by Zyxmon.)
Post: #31
RE: Discharge Rate
Here is a log with a jump around 50%(It is easily explained). I'm still trying to log a more strange behavior.


Attached File(s)
.zip  BatteryBar.zip (Size: 4 KB / Downloads: 117)
Visit this user's website Find all posts by this user
Quote this message in a reply
03-21-2010, 02:02 AM (This post was last modified: 03-21-2010 02:04 AM by Zyxmon.)
Post: #32
RE: Discharge Rate
After some changes to reduce the power consumption I've desided to make a log in BB. Here is a part of it
Code:
[01]:[20.03.2010    18:29:22] <Info> (TimeEstimateBase.UpdateStatus) Percent [58] - Seconds Added = 300  Average = 263
[01]:[20.03.2010    18:29:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 58 vs 64   Real Diff = 00:34:58.2180853  Est. Diff = 00:28:51  Accuracy = 0,82
[01]:[20.03.2010    18:29:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 58 vs 63   Real Diff = 00:29:52.7695488  Est. Diff = 00:24:17  Accuracy = 0,81
[01]:[20.03.2010    18:29:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 58 vs 62   Real Diff = 00:23:47.1985067  Est. Diff = 00:19:28  Accuracy = 0,82
[01]:[20.03.2010    18:29:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 58 vs 61   Real Diff = 00:18:36.7423614  Est. Diff = 00:14:26  Accuracy = 0,78
[01]:[20.03.2010    18:29:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 58 vs 60   Real Diff = 00:12:01.1256666  Est. Diff = 00:09:52  Accuracy = 0,82
[01]:[20.03.2010    18:29:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 58  Accuracy = 81,05%
[01]:[20.03.2010    18:29:23] <Info> (BatteryManager.OnStatusUpdated) Percent = 59,0%  TimeRemaining = 4:59
[01]:[20.03.2010    18:34:28] <Info> (TimeEstimateBase.UpdateStatus) Percent [57] - Seconds Added = 305  Average = 255
[01]:[20.03.2010    18:34:28] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 57 vs 63   Real Diff = 00:34:58.2512867  Est. Diff = 00:28:40  Accuracy = 0,82
[01]:[20.03.2010    18:34:28] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 57 vs 62   Real Diff = 00:28:52.6802446  Est. Diff = 00:23:51  Accuracy = 0,83
[01]:[20.03.2010    18:34:28] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 57 vs 61   Real Diff = 00:23:42.2240993  Est. Diff = 00:18:49  Accuracy = 0,79
[01]:[20.03.2010    18:34:28] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 57 vs 60   Real Diff = 00:17:06.6074045  Est. Diff = 00:14:15  Accuracy = 0,83
[01]:[20.03.2010    18:34:28] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 57 vs 59   Real Diff = 00:10:05.9838657  Est. Diff = 00:09:12  Accuracy = 0,91
[01]:[20.03.2010    18:34:28] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 57  Accuracy = 83,66%
[01]:[20.03.2010    18:34:28] <Info> (BatteryManager.OnStatusUpdated) Percent = 58,0%  TimeRemaining = 4:44
[01]:[20.03.2010    18:37:49] <Info> (PopupStatus.OnVisibleChanged) Setting PopupStatus to Always On Top
[01]:[20.03.2010    18:39:23] <Info> (TimeEstimateBase.UpdateStatus) Percent [56] - Seconds Added = 295  Average = 268
[01]:[20.03.2010    18:39:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 56 vs 62   Real Diff = 00:33:48.1135635  Est. Diff = 00:28:06  Accuracy = 0,83
[01]:[20.03.2010    18:39:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 56 vs 61   Real Diff = 00:28:37.6574182  Est. Diff = 00:23:04  Accuracy = 0,81
[01]:[20.03.2010    18:39:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 56 vs 60   Real Diff = 00:22:02.0407234  Est. Diff = 00:18:30  Accuracy = 0,84
[01]:[20.03.2010    18:39:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 56 vs 59   Real Diff = 00:15:01.4171846  Est. Diff = 00:13:27  Accuracy = 0,90
[01]:[20.03.2010    18:39:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 56 vs 58   Real Diff = 00:10:00.9462568  Est. Diff = 00:08:38  Accuracy = 0,86
[01]:[20.03.2010    18:39:23] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 56  Accuracy = 84,68%
[01]:[20.03.2010    18:39:23] <Info> (BatteryManager.OnStatusUpdated) Percent = 57,0%  TimeRemaining = 4:36
[01]:[20.03.2010    18:44:24] <Info> (TimeEstimateBase.UpdateStatus) Percent [55] - Seconds Added = 300  Average = 276
[01]:[20.03.2010    18:44:24] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 55 vs 61   Real Diff = 00:33:38.1139460  Est. Diff = 00:27:32  Accuracy = 0,82
[01]:[20.03.2010    18:44:24] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 55 vs 60   Real Diff = 00:27:02.5128512  Est. Diff = 00:22:58  Accuracy = 0,85
[01]:[20.03.2010    18:44:24] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 55 vs 59   Real Diff = 00:20:01.8893124  Est. Diff = 00:17:55  Accuracy = 0,89
[01]:[20.03.2010    18:44:24] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 55 vs 58   Real Diff = 00:15:01.4183846  Est. Diff = 00:13:06  Accuracy = 0,87
[01]:[20.03.2010    18:44:24] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 55 vs 57   Real Diff = 00:09:55.9366467  Est. Diff = 00:08:43  Accuracy = 0,88
[01]:[20.03.2010    18:44:24] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 55  Accuracy = 86,24%
[01]:[20.03.2010    18:44:24] <Info> (BatteryManager.OnStatusUpdated) Percent = 56,0%  TimeRemaining = 4:26
[01]:[20.03.2010    18:49:34] <Info> (TimeEstimateBase.UpdateStatus) Percent [54] - Seconds Added = 310  Average = 286
[01]:[20.03.2010    18:49:34] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 54 vs 60   Real Diff = 00:32:12.8129962  Est. Diff = 00:27:34  Accuracy = 0,86
[01]:[20.03.2010    18:49:34] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 54 vs 59   Real Diff = 00:25:12.1894574  Est. Diff = 00:22:31  Accuracy = 0,89
[01]:[20.03.2010    18:49:34] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 54 vs 58   Real Diff = 00:20:11.7185296  Est. Diff = 00:17:42  Accuracy = 0,88
[01]:[20.03.2010    18:49:34] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 54 vs 57   Real Diff = 00:15:06.2367917  Est. Diff = 00:13:19  Accuracy = 0,88
[01]:[20.03.2010    18:49:34] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 54 vs 56   Real Diff = 00:10:10.8034728  Est. Diff = 00:09:04  Accuracy = 0,89
[01]:[20.03.2010    18:49:34] <Info> (DischargeTimeEstimate.GetAccuracy) Percent = 54  Accuracy = 87,96%
[01]:[20.03.2010    18:49:34] <Info> (BatteryManager.OnStatusUpdated) Percent = 55,0%  TimeRemaining = 4:16
It takes about 300 seconds (5 minutes) to discharge my battery by 1%. But the remaining time estimate drops 6,8,10,10 minutes. Every 5 minutes. It is not a jump as happened before, but I do not think it is a correct estimate.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-24-2010, 07:16 AM (This post was last modified: 03-24-2010 07:28 AM by Zyxmon.)
Post: #33
RE: Discharge Rate
Here is some sort of the jump I was speaking about. It is not an hour jump, but it is noticeable.
In the period 23:47-23:53 the CPU load was higher then usual. So
23:50:33] <Info> (TimeEstimateBase.UpdateStatus) Percent [94] - Seconds Added = 180 Average = 248
(the seconds added is lower)
But the time estimate is
23:50:33] <Info> (BatteryManager.OnStatusUpdated) Percent = 95,0% TimeRemaining = 6:40
23:53:39] <Info> (BatteryManager.OnStatusUpdated) Percent = 94,0% TimeRemaining = 6:35
Only several minutes later, when the cpu load is normal the estimate drops
23:58:09] <Info> (BatteryManager.OnStatusUpdated) Percent = 93,0% TimeRemaining = 5:51
In several minutes it is high again
0:03:00] <Info> (BatteryManager.OnStatusUpdated) Percent = 92,0% TimeRemaining = 6:21

I am attaching the log. The estimate drop is due to cpu load, but it is late.
While I was typing this post (low cpu usage) the estimate went up to more then 7 hours. This is in the second attached file.

The summery:
Five minutes of more then average CPU usage at ~23:50 made the estimate drop to 5:51 at 23:58 and rise to 7:05 at 0:22!


Attached File(s)
.zip  log23.03.ZIP (Size: 2.82 KB / Downloads: 86)
.zip  BatteryBar.zip (Size: 1.87 KB / Downloads: 114)
Visit this user's website Find all posts by this user
Quote this message in a reply
04-03-2010, 06:07 PM (This post was last modified: 04-03-2010 06:13 PM by Chris.)
Post: #34
RE: Discharge Rate
It all comes down to the function in the code I call "GetAccuracy". Basically, BatteryBar uses your profile data to determine an average time remaining at any given battery level. I suggest you go look at the post about the new graphs in the beta forum. If you look at the graph you'll see how moving from one point to the next is a very straight line. In other words, there aren't big jumps in time remaining.

However, the problem is how to calculate the time remaining when the user isn't using the computer at the "average" level. Let's say you're watching a movie. You want to know your time remaining determined by how fast its discharging while watching the movie. It's not very useful to just see your "average" time remaining.

So, the GetAccuracy method runs a timer while your battery is discharging. As your battery discharges, it keeps track of the differences between how long it estimated that it should have taken to discharge versus how long it actually took.

For example, from your log when your battery is at 92%, it goes back and looks at the previous 5 percentage points:
Code:
Percent = 92 vs 97   Real Diff = 00:18:31.7279298  Est. Diff = 00:21:35  Accuracy = 1,16
Percent = 92 vs 96   Real Diff = 00:14:36.3547164  Est. Diff = 00:15:49  Accuracy = 1,08
Percent = 92 vs 95   Real Diff = 00:10:35.9625686  Est. Diff = 00:12:06  Accuracy = 1,14
Percent = 92 vs 94   Real Diff = 00:07:35.7217857  Est. Diff = 00:08:11  Accuracy = 1,08
Percent = 92  Accuracy = 111,67%

So as you can see, from 97% down to 92%, your battery profile suggests that it should have taken a total of 21 minutes, 35 seconds. However, in reality, it only took 18 minutes, 31 seconds, meaning that it discharged 16% faster than estimated. Going down the line, the method pulls an average accuracy rating of 111.7%, meaning that your battery is discharging 11.7% faster than expected.

As we get down to 88%, this is what's happening:
Code:
Percent = 88 vs 94   Real Diff = 00:27:02.4946350  Est. Diff = 00:25:07  Accuracy = 0,93
Percent = 88 vs 93   Real Diff = 00:23:57.2243271  Est. Diff = 00:20:59  Accuracy = 0,88
Percent = 88 vs 92   Real Diff = 00:19:26.8040494  Est. Diff = 00:16:56  Accuracy = 0,87
Percent = 88 vs 91   Real Diff = 00:14:36.3471392  Est. Diff = 00:12:40  Accuracy = 0,87
Percent = 88 vs 90   Real Diff = 00:09:50.8978378  Est. Diff = 00:08:27  Accuracy = 0,86
Percent = 88  Accuracy = 88,02%

Now we're seeing the discharge rate actually slower than the estimated rate. From 93% to 88% actually took 3 minutes longer than average, meaning the battery is discharging about 13% slower than average.

So, once BatteryBar has calculated this "accuracy" ratio, it multiplies the average time remaining by that ratio. So, if at a certain percentage there should be 6 hours remaining (360 minutes), that value gets changed to 410 minutes if your battery is discharging 12% slower than usual or 295 minutes if your battery is discharging 12% faster than normal. So, when your battery drops 1%, that's 5 minutes on average, but the ratio changes slightly, causing the difference between the last statement and the current one to show 10 minutes difference. Without that ratio, it would have shown 5 minutes, more or less.

The reason that you see the jump at around 92% is that BatteryBar doesn't calculate the GetAccuracy until there is at least 5% of discharge completed in order to make a better estimate. Before 92%, your discharge rate is actually over 20% faster than average, but the GetAccuracy method ignores that value until there is at least 5% of discharge data available, so you see a sudden jump at 92%.

Your battery profile will eventually adjust as this becomes the normal discharge rate. You can already see the profile adjusting. The log shows that from 95 to 94% took 180 seconds, but the battery profile has 248 seconds as the average time for that same percentage drop. The same for 94% to 93%, it took 185 seconds versus 243 seconds as ths stored average value. However, at 93 to 92%, it took 270 seconds versus 256 on average. Down at 88%, it took 295 seconds versus 259 on average.

Basically, this is all working as designed, but the results are far from optimal. I believe that part of the issues is that your battery only reports full percentage changes rather than smaller incremental changes (like mine shows 94.87%, then 94.73%, then 94.56%, etc...). So you're seeing big drops as a full percentage drops while I would only see a 1 minute drop as it gets down to the next incremental drop.

My question to you is, are those changes in discharge rates appropriate for the kind of work you were doing at the time? Were you doing something CPU or HDD intensive or had your screen brightness up on full for the first 10%, and then perhaps stopped those activities or brought your brightness down after 92%?

I can see two ways to address this.
1. Find a way to show the "GetAccuracy" value to the user, so they can see if the discharge rate is above or below average.
2. Add an option to turn off the accuracy method and always show the average time remaining no matter what.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-04-2010, 03:32 AM (This post was last modified: 04-04-2010 03:34 AM by Zyxmon.)
Post: #35
RE: Discharge Rate
I have expected that sort of explanation. ;D
Quote:My question to you is, are those changes in discharge rates appropriate for the kind of work you were doing at the time? Were you doing something CPU or HDD intensive or had your screen brightness up on full for the first 10%, and then perhaps stopped those activities or brought your brightness down after 92%?
Yes. I have already written, that "In the period 23:47-23:53 the CPU load was higher then usual. In fact I was watching a 6 minutes yuotube movie, that stressed my culv su7300 cpu running at 800 mhz when on battery. That occurred at Percent [94] and [93] according to the log. After the short 6 minutes movie the laptop usage was normal. In fact the power battery consumption was lower then normal after 92%. I have found a way to reduce it.
But the estimated time drop happened later at "Percent [92]" calculations when this usage was normal. The reason probably is
Quote:BatteryBar doesn't calculate the GetAccuracy until there is at least 5% of discharge completed in order to make a better estimate.
My battery has rather big "capacity granularity" as reported by ACPI and is shown in Linux. The shown charge increment is about 1%. "Basically, this is all working as designed, but the results are far from optimal." At least the results seem wiered for my battery in some cases. My battery profile will adjust to the current power consumption. But it will not change far from the current profile.
Quote:I can see two ways to address this.
1. Find a way to show the "GetAccuracy" value to the user, so they can see if the discharge rate is above or below average.
2. Add an option to turn off the accuracy method and always show the average time remaining no matter what.
I think "turn off the accuracy method" wolud be better for most users.
When finding the way to reduce battery consumption I turned on BB logging and was interested in the lines like
Code:
Percent [91] - Seconds Added = 290  Average = 253
That gave me information whether my laptop is consuming more or less power then before. I was not interested in "GetAccuracy" value for 5%. 1% discharge was enough for me. Probably there should be an option to calculate "GetAccuracy" value for user defined N% for not more then M seconds. As for me - I am more interested on the seconds used/avarage to drop my battery charge by 1%.
I have already posted a message in the topic on graphs. Showing the current (session) discharge over average discharge from profile will be a good feature in future.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-05-2010, 02:50 PM
Post: #36
RE: Discharge Rate
What you should be looking at is not the log of how many seconds that it lasted, but the DISCHARGE RATE. If your battery reports it, you will see "Discharge Rate:" and a number. That number is rate of drain on the battery. If that rate is higher, the computer is using more power. If it's lower, then it's using less. If your battery doesn't report that value, BatteryBar 3.3.3 includes a feature to estimate that discharge rate value (it'll show Estimated next to the value).

I think the point here is that BatteryBar is working as expected. Your computer was using much more power than usual, so the time remaining estimated was adjusted downward due to that. It takes a further 5% points before that effect is completely gone, so during that time, the estimated time remaining actually increases since now your battery is using less power than it was before. Basically the time remaining says, "If you continue to use your battery at this rate of discharge, your battery will last x hours and x minutes". So as your rate changes, so does the time remaining estimate.

I think that's proper and I don't see any reason at this time to change that behavior based on your comments. I may, however, look into adding an option to turn off that adjustment and always show the average time remaining.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-05-2010, 08:07 PM
Post: #37
RE: Discharge Rate
Quote:What you should be looking at is not the log of how many seconds that it lasted, but the DISCHARGE RATE.
AFAIR I have already written, that the discharge rate reported by my battery doesn't depend on screen brightness, CPU load, etc. The discharge rate reported by my battery is always 14208mW. The "Estimated" rate is not shown since the battery reports nonzero discharge rate value. The only way for me to investigate the influence of screen brightness, cpu load, wi-fi, bluetooth, etc... as was done in "In-depth review of Acer laptop power usage" - http://osirisdevelopment.com/forum/thread-81.html is to compare seconds to discharge my battery by 1%.
I think BB estimates remaining time as you designed and works for most batteries. At least you do not use polynomials for such estimates. At first I thought you use bad maths for estimates. If there were time graphs of CPU usage, estimated time, estimated discharge rate, getaccuracy it would be more obvious that the estimate made by BB are far from good.
If I had the source code of BB, I would adjust it for my needs and my battery.
BB has good GUI, nice looking bar. It would take a lot of time for me to program it. As for estimates (time, rate, graphs), I would easily make the program that is better just for me, not for all users.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-06-2010, 01:12 PM
Post: #38
RE: Discharge Rate
The next version will include an option to force the estimated discharge rates. Those values will be more reflexive of the actual use of your battery because it keeps track of the changes in capacity and times how long those take. On my development system, the estimate rates are fairly close to the actual rate reported by my battery. Obviously there are differences due to the granularity of it, but I think it'll be useful for people whose batteries don't report that data.

The current time estimate algorithm determines the time remaining based on a profile of your battery that is built as you use your battery. That provides an extremely accurate time estimate when you are using your battery in a consistent manner. For example, I use mine for email, web, and development, pretty much all the time. So I know my estimates are pretty accurate.

The HARD part is what to do about fluctuating power consumption. If you turn off statistical time estimation, you'll get a very simple calculation: Capacity / Discharge Rate. That's going to constantly fluctuate up and down as your discharge rate changes, so that's not accurate (because every time your rate changes, so does the time estimate, it's not consistent).

So I've tried to make a compromise by comparing if your battery is discharging faster or slower than estimated (average) and then adjust the time remaining according to that. I use 5% to smooth out the values which introduces some lag (if you stop your movie, your time remaining will take a few minutes to adjust to the fact that you're no longer watching a movie), but it also avoids wild dips and dives.

If you have a suggestion for a better mechanism to adjust the estimated time remaining based on certain criteria, I'd be happy to review your math and try to work it into the application if it's feasible. My goal has always been to make the most accurate battery meter I can.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-06-2010, 03:05 PM (This post was last modified: 04-06-2010 03:06 PM by Zyxmon.)
Post: #39
RE: Discharge Rate
Quote:The next version will include an option to force the estimated discharge rates.
Great! I am waiting for it.
Quote:The HARD part is what to do about fluctuating power consumption.
Sure! My first idea was to limit 5% to smooth fluctuations to the user defined value. 1% will give very simple calculations that would be more adequate in the previous case. If I'll have a better idea - I'll write.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




Real Time Web Analytics