![]() |
Estimating the charge time
Hello
I noticed that the N900 does not estimate how long it's going to take for the battery to get fully charged. Such an indication would be helpful to me and I can imagine that other people would be interested too. I'm trying to do this, but I'm not sure if the information provided by lshal is accurate enough for a decent estimation. To figure that out, I have to profile the charging process. I wrote a script to do that, but I'd like to obtain samples from other N900 users. This enables me to get more samples faster and I can cross-check my code with other charging profiles. If you want to help me out, use the following script: #/bin/sh FILE=$(date +%s|tr -d '\n').charge while true do date +%s|tr -d '\n' >> $FILE lshal|grep battery >> $FILE echo "-- " >> $FILE sleep 30 done Put this code into the file /home/user/profile.sh, then cd into that directory (cd /home/user) and run chmod 755 profile.sh. When you are going to charge your device, open a terminal and run ./profile.sh before attaching the charger. Quit the script (ctrl-c) after you detached the charger. The script will generate a file with a timestamp and the suffix charge, for example 1262531100.charge. (Note that the internal file browser does not display suffixes). Send me these files; you may remove them afterwards. Please only send in files of charging processes where the device was fully charged, and if possible, write me which charger (USB or power outlet) you used, if WLAN was active and whether the device was idle during charging process. I can't promise that the data will be accurate enough for a widget to predict charging time, but I promise I'll publish some graphs and analysis of the data if enough samples are returned. Best regards and thank you Matt EDIT: 1. send the files to weyland - a t - library.ethz.ch 2. I was asked whether the script has to be stopped right after the battery gets fully charged. This is not necessary, you can keep the script running and stop it after you come back from whatever you were doing in the meantime. But please don't stop the script before the battery gets full, so that I can use the log file to determine precisely when this happens. |
Re: Estimating the charge time
welcome to the forum! nice to have you here! i will see, what i can do. a widget with that function would be nice
edit: i've a problem: made that file chmod that file but after ./ it says permission denied... |
Re: Estimating the charge time
Hello
Quote:
Regards & thanks Matt |
Re: Estimating the charge time
-rw-r--r-- 1 user root 162 Jan 3 17:32 profile.sh
-sh: -/profile.sh: Permission denied my battery is low, so i must fix that soon... ;) |
Re: Estimating the charge time
Hi
Quote:
~ $ chmod 644 profile.sh ~ $ ls -lh profile.sh -rw-r--r-- 1 user users 152 Jan 3 16:56 profile.sh ~ $ chmod 755 profile.sh ~ $ ls -lh profile.sh -rwxr-xr-x 1 user users 152 Jan 3 16:56 profile.sh You can only execute the script if the executable bit (x) is set. Alternatively, you can also try sh ./profile.sh which does not require the executable bit. Thank you for your efforts Matt |
Re: Estimating the charge time
Email address to send .charge logfiles to?
|
Re: Estimating the charge time
Quote:
|
Re: Estimating the charge time
i can't get the file mark as executable^^ thats really strange. i've tried it in the mmc1 but also in .documents...
stays at -rw-r--r-- i've made a .txt in windows, with the content, renamed to profile.sh, transferred to my n900.. something i'm doing wrong... feeling stupid right now^^ |
Re: Estimating the charge time
You can't execute files on the VFAT partition. copy them to another partition.
|
Re: Estimating the charge time
Hm, it just popped into my mind that you may be trying on a filesystem that does not support modes (such as vfat). That would explain it. I'm trying in /home/user which is ext3. Anyway, sh ./profile.sh (or whatever the name of the file is) should work anyway, so just add a preceding 'sh' and you should be fine. I'll fix the first post in this thread.
Thanks, Matt |
Re: Estimating the charge time
Anyway, I don't see how the users output will help you to estimate the charge time... It's not easier to just calculate the time elapsed for a percent of charge, and estimate the remaining time based on that info ?
e.g. : starts charging at 15%, when the battery is 16% charged, 2 minutes have passed. So the remaining time is (100 - 16) * 2 = 168 min and each percent gained, you redo the thing, so when battery is 80% charged, you know that (80 - 15) = 65 percent takes 50min, so 20% left will take (20 * 50 / 65) = 15 minutes |
Re: Estimating the charge time
that was the mistake... profile.sh was sitting on a VFAT partition. running it in home/user does work.
thanks. |
Re: Estimating the charge time
Hello
Quote:
Thanks, Matt |
Re: Estimating the charge time
when you do a lshal | grep battery, when charging, the percentage of battery is not refreshed ? seems odd if it's not refreshed.
I'll do a test |
Re: Estimating the charge time
ok right the level of battery is not updated.
But you can rely on voltage.current and voltage.design to approximately determine the remaining time, with the same method as above. And better, you can check at the first launch of your program the voltage.current when battery is considered as full, to know what's the max level the battery can achieve. Because everyone can have a battery with a max voltage different, so once again I don't see how the results sent by users will help you. |
Re: Estimating the charge time
Hello
Quote:
Quote:
Second, it's just an easy way for me to get a large sample size. As I said, I charge my device once a day, so I can collect 7 profiles a week. I have a background in biostatistics and to make some reasonable predictions, I'm looking for n>20, which would take me a long time to collect. I'm also profiling the charging curves on my own device by the way. Best regards Matt |
Re: Estimating the charge time
I understand your approach, and the fact you need data to get the charging curve.
But there is a problem, how to be sure that the charging curve is constant in the time (and I'm pretty sure it won't, problem is N900 has been released since a month only), and how to be sure that there are not (or there won't be) different models of battery ? In addition to the data you'll get, the best is not to collect data on the phone where the application is installed at each charging, so the estimation will remain the closest of the reality ? |
Re: Estimating the charge time
Hi
Quote:
Quote:
Regards, Matt |
Re: Estimating the charge time
in addition to the curve you'll extrapolate to estimate the remaining charging time (e.g. starts charging with 35% @ 4040mAh equals 40 minutes remaining according to the charging curve) maybe you can collect data on the phone each time it's being charged, so that you'll generate a curve specific to the phone.
So you'll know that for this specific phone, 4040mAh equals 32 minutes remaining for this phone, instead of 40, because the last 10 chargings, on average, there was 32m remaining @ 4040mAh, 25m @ 4100, 15 @ 4150, 5 @ 4170. And because a battery degrade in time, and a new firmware can also improve - or not - battery duration, your program will always be accurate. I'm maybe wrong, but it's how I see the thing |
Re: Estimating the charge time
Quote:
Once I come up with that algorithm, I can simulate the prediction for each profile that was handed in and decide whether it's enough accurate for productive use. I believe that using some pre-computed parameter estimates based on the data from various devices within the actual program would not be very smart. (I think we agree on that point). The data is only for some early inspection, not to derive any actual numbers to be used in the program. Matt |
Re: Estimating the charge time
It'd be cool if your widget collected some of this data during charges, adjusting the profile on the fly, adapting to the user's battery. The battery will lose capacity and gain internal resistance over time, mostly related to the temperature it gets exposed to. This will make the charging reach 4200mV sooner, the constantt voltage stage, and this stage will take longer and longer time, relatively.
|
Re: Estimating the charge time
Alright, so I ran your script while charging. Curious about the result I couldn't resist peeking at the data. What I found was an imho weird behavior. Take a look at the graph. Is this normal?
http://farm5.static.flickr.com/4047/...c6157029_o.png |
Re: Estimating the charge time
Quote:
When you unplug the charger and type lshal | grep battery, what's the current voltage ? |
Re: Estimating the charge time
Trying to help...
a) Mine is near-linear, I can calculate percentage charge to within a few points (checked by removing charger). Fiddling with it is bad tho. b) It doesn't have to be by-the-second. Batteries in N900 are quite similar and charge current is 500 mA until such is the time to throttle it. Can't we just use a conversion table? Say, every 10 % or so, and guesstimate that a 30% battery will charge in 55-65 minutes? We'll call it "about 60 minutes". 40% would be "about 50 minutes", etc. Community could help with figures. c) Can't a software self-profile? When plugged in, it times the charge time from current level to full _assuming_no_interaction_ (if the user plays with it it's no longer fully charging). It should be able to do decent estimates after -say- 3 charges at 5, 30 and 60 percent? |
Re: Estimating the charge time
I like where you guys are going with this.
|
All times are GMT. The time now is 07:21. |
vBulletin® Version 3.8.8