yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] temasek:
If u completed a learn cycle, you can unplug and perform a manual reboot. For some reason, few users find rebooting not refreshing the correct battery age. So for some, they have to perform manual power off and on.
[Nexus One Android Development] gramoz:
Hi,

first of all thank you for this app.

Ive been following mtw's instructions exactly as written, but im getting strange results. After first learn cycle i hit 93% bat age with 0x81 register. After reboot it still showed 93% bat age. Puzzled i do the learn cycle again, this time hitting 92% bat age, again with 0x81 register. After reboot i still got 92%. Im not sure what to make of these results. Did the learn cycle not work or do i just have a better stock battery than everyone else here reporting 86-89% after learn mode?

Right now im trying to discharge the battery down to 1%, just to see if i can.

Edit: It did go all the way down to 1%, with about 8-9 mAh left before it automatically powered off. Upon powering on batt age is set to 94. :confused:

What do you mean by 'turning off the data connection'? Simply disabling data through the widget or some other obscure method im not aware of? I have data disabled nearly all the time and yet i dont get anything like your results.

But your theory sounds interesting, ive heard others blame the radio as a major battery hog.
[Nexus One Android Development] ellesshoo:
Is there an eta on an app update where it would allow us to store our learned values for different batteries and be able to push those settings to the battery whenever we notice the age got reset to 94?

I'm starting to build up quite a collection of batteries at this point so swapping them around I have lots of reesets and all.

Also, do batteries have any kind of unique identifier on the chip such that the app would be able to know which particular battery was in the phone? Kinda like a MAC address for batteries is what im thinking.
[Nexus One Android Development] ellesshoo:
How do I set my charging current to <40mA? I can't seem to find the code anymore. I have it set to 20mA but id like to raise it but not all the way up to stock value.
[Nexus One Android Development] temasek:
Setreg ....... 0x65 0c
[Nexus One Android Development] chowlala:
I'm absolutely sure there was something wrong with the battery I ordered.

One very simple example would be when it hits full charge. The battery doesn't "disconnect" from use. Instead, it loses -1 mV all the way at full charge. Until some point the battery sees the % as 98% and then begins to recharge it.

This doesn't happen with the stock battery. When the stock hits 100%. It's maintained at 0 mV loss and never draws charge into the battery.

I've sent mine back to Hong Kong for an exchange. Will see what happens.
[Nexus One Android Development] ellesshoo:
What full 40 value should I set for learn mode with a 1600mA Seidio battery?
[Nexus One Android Development] temasek:
What's your full40 now with the Seidio battery?
[Nexus One Android Development] ellesshoo:
It says 1603 as the full40.
[Nexus One Android Development] ellesshoo:
Sorry, here's the current screen cap I meant to post.
[Nexus One Android Development] temasek:
Okay my recommended steps

1. Maintain full40 1603

2. Set age to 100

3. Change Empty Voltage (AEv) to 3201mV using setreg ...... 0x66 a4

4. Perform a learn cycle

5. Once learn cycle done, reboot or power off/on.

6. Prepare for another learn cycle.

7. This time is what I call a capacity test.

8. Perform another learn cycle.

9. Once cycle completed do not reboot. Check your battery log using app like os monitor. See your highest achieved capacity at 99-100% before it completed its charge. The capacity should drop below your full40. Read the log properly. The highest achieved capacity before it drop below your full40 will be your new full40 value.

10. With your new full40 value, perform yet another learn cycle. :)

11. Enjoy your new calibrated battery!

For your reference.
[Nexus One Android Development] RogerPodacter:
honestly i think you just have a really good battery, not sure how. but you did 3 learn cycles with very similar results, so it doesnt get much more clear than that.

by turning off data all i mean is the regular mobile data connection which is a shortcut on the power widget in cyanogen ROM. just as a test to see how well the phone does, and it blew me away yesterday to be honest. i finished a work day with 75% battery life left, where normally i'd be at about 30% at the end of the day. obviously no syncing is happening, so i understand. but in my opinion the always-on data connection is the killer on all android phones and what really makes these phones not last long. so i was trying to test that.

i just wish we could change android OS so that it kept data off and then only opened the connection when you did something that needed it, like open the browser for example. i realize juice defender does similar things, but i never really liked it.
[Nexus One Android Development] RogerPodacter:
honestly i'm STILL stuck on the stupid service not working, so i think dvgrhl is gonna review and help me out if possible. i've never been stuck this long without being able to solve it with tutorials or searches, so its been frustrating. i'll switch gears and look to store the values this week, i've been caught up on the graph running all this time. but no, i'm not aware of any way to identify the battery by any software means. the closest we could do is maybe pick a register that is unique, and doesnt reset itself, like full40, and just track the battery by that value. so it sets up the correct age for it etc.
[Nexus One Android Development] RogerPodacter:
i see that but with the current on my new battery. once its full, it shows -0.333mA. but that is really just what we're "supposed" to see because the offset value is so much higher that i assumed it was just reading minor readings that didn't appear on stock with the lower offset value. either way my new battery stays at 100% once charged, so its all good.
[Nexus One Android Development] RogerPodacter:
where did you buy this battery? anyway to add on to what temask said, i just drained until i hit the learn flag with the app. then immediately plugged in and charge, and periodically checked to see what mAh the battery was at. as it got close to the full40 value it was easy to see if it was starting to slow down charge, or if it was gonna blow right by the full40 setting. so i kept increasing the full40 each time it got close because the current was still at +500mA when nearing the full40, so it wasnt even close to full charge yet.

but temesk's method is much more official way to do it:)
[Nexus One Android Development] ellesshoo:
Its a 1600mAh seidio battery I bought sometime in September or October I believe. Why, does something in my screen cap standout?
[Nexus One Android Development] temasek:
Could you post your dumpreg? I wanna do some of my own comparisons.
[Nexus One Android Development] Breece:
Isnt that what apps like JuiceDefender (which I can highly recommend ;)) try to help with?
[Nexus One Android Development] ellesshoo:
You mean this?
[Nexus One Android Development] ellesshoo:
I was under the impression that most high end cell phones use Li-Pol batteries. Due to the limited size, using traditional Li ion cells would leave valuable gaps between the cylindrical cells. Usually you see traditional Li ion cells in laptops (often why laptop batteries will have a rounded back edge or a rounded protrusion on the bottom). These days though even laptops show up with lithium ion polymer, the ultrabay battery on my work lenovo laptop is lithium ion polymer, I believe all macbooks are polymer run, and of course the iphone / ipod use polymer. It didn't even cross my mind that the N1 might not be. Are you certain its not?
[Nexus One Android Development] RogerPodacter:
I only know of very few phones that use lithium polymer batteries, the iPhone is one, and the the Nokia 1500mAh that they've used in the e71 and a few other models. Those are the only ones I've seen. All others like the nexus one are straight lithium ion. Lithium polymer as I understand it is more robust and performs a bit better, but is more expensive to produce, and also can be made in unique shapes. where lithium ion is cheaper to produce, but less performance, and can only be made in standard box shaped cells. That was my understanding anyway.
[Nexus One Android Development] ellesshoo:
Well, you could arrange traditional cylindrical cells such that its not a box but yes, Li ion polymer would still be better no matter the shape. Li ion polymer does show up in box shapes though, its not reserved for odd shaped batteries. What's somewhat annoying is that technically polymer is Li ion based and sometimes polymer batteries will be labeled as Li Poly and sometimes Li ion so you can't just go by label. Maybe ill take a saw to one of mine at some point and find out for sure.
[Nexus One Android Development] ellesshoo:
Looks like I won't need to use a saw. According to this it is a polymer battery. http://www.htc.com/www/product/nexusone/specification.html
[Nexus One Android Development] ellesshoo:
What program will log dmesg during learn mode? OS monitor seems to delete older messages and has messed up time stamps while the screen is off. How would I be able to see my current jump if the screen is off?
[Nexus One Android Development] temasek:
After your "capacity test" completed, do not reboot yet. Read the log immediately.
[Nexus One Android Development] ellesshoo:
But isn't their the issue of 1) does os monitor log while sleeping? 2) os monitor only seems to keep a short time frame log and 3) wouldn't you need to check very soon after charge full yet we still have no way of knowing when that is without waking the phone at a time most likely to screw up the learn cycle.

Am I missing something?
[Nexus One Android Development] temasek:
Capacity test objective is not really to achieve a successful learn cycle. Its objective is actually to determine what is the highest possible capacity. Thus u do not sleep over it, at least not now. - Until dvgrhl's latest commits that enable logging in the app.

For me I did a real time monitoring of the capacity while it is above 95%. Capacity continued to climb beyond my old full40 and when it reached 99% and current (mA) turned negative, battery 100% and I failed learn cycle. The capacity dropped to a value below my old full40 value. But I saw my highest capacity value which was close to 2500mAh.

1. For now U can estimate when your battery gonna hit 100%. So once u hit that, turn on your os monitor and see the log.

2. Or, u can real time monitor your highest achieved capacity when your battery is about 99%-100%

3. Or wait for latest battery calibrator app with logging by dvgrhl.

Good Luck!
[Nexus One Android Development] dvgrhl:
Good news, I just committed code that enables logging in the app, which persists between reboots. I noticed something that I want to look into with it while I was playing around with it on my flight, but in the next day or so there should be a market update for this.
[Nexus One Android Development] temasek:
Great! That is very helpful for performing a capacity test. :D
[Nexus One Android Development] temasek:
Your new release, in the log the mAh reading is it correct? Seems like need to divide by 1000 if it is an mAh reading.

Also u removed the register tab? Its rather handy for looking at the dumpreg .....

Possible to have option to enable / disable logging cuz I am worried abt draining battery. Or will it drain at all?
[Nexus One Android Development] dvgrhl:
OK, the market has been updated. The internal log writes every 30 seconds, and keeps the last 100 log messages. If we need to expand that we can, but I think that will be good for most people. As always, let me know if there are any issues.
[Nexus One Android Development] temasek:
See my post above yours.
[Nexus One Android Development] mtw4991:
(1) when I monitor with battery monitor widget and/or os monitor after a successful learn cycle, I see the % increase to usually 97% for several minutes (or sometimes even 98%) before charge current drops below -19mA and learn stops. At that point, I reboot and age is getting set at 96% which is usually 1-2% less than the jump point. Any clue why it doesn't reset to 97/98%???

(2) Also, I'm getting mAh's down to 10-12mAh near empty before auto-power off, but still have 3350-3425mV left according to the app. Should I raise or lower age to compensate for this?
[Nexus One Android Development] dvgrhl:
Sorry, missed this last night when I posted. You're correct about dividing by 1000. I fixed that as well as added in a line for current. I'll update market soon.

As far as the Register tab, well I didn't really think it was useful enough to be it's own tab. Roger has some good ideas for graphing to add in, and that seems like a good spot for it. If viewing the dumpreg is really important to people, I can add it in somewhere else that makes sense.

As far as battery drain, it really should be negligible overall. The logging service is just a timer that writes down battery information every 30 seconds, then sleeps, and all of that is being done in the background. Compared to everything else going on in the program, that's really minor.
[Nexus One Android Development] dvgrhl:
(1) Roger would have a better idea on this, but that might not be incorrect behavior. However, if you suspect it really should be a bit higher you could set it manually for now. I plan to have an advanced option in the app to allow it to start up at boot time and write the age that you will have set in the settings. Hopefully that will get us past the jump to 94% that seems to happen to a lot of people.

(2) You could try, but from my own experience when you get to the lower end of the mV range things can really start to drop quickly. But, given that you think your age is skewed a little low to begin with, that might be a good idea to bump it up a little and see how it goes when it drains down. This is exactly the type of situation where (hopefully) the app can help you identify what setting you need to get every last bit of juice out of the battery.
[Nexus One Android Development] mtw4991:
that makes sense thanks
[Nexus One Android Development] martinl1030:
ugh so i just tried to calibrate it and my phone shut off before i could plug it in to charge. now when i power it back on to try again it autoshuts off at like 3550mV so should i just leave it to charge fully and try again tomorrow night?
[Nexus One Android Development] temasek:
Did u turn on ACR adjustments in the Battery Calibrator under Settings? Turn it on to prevent your mAh die before your AEv (Empty Voltage value).

Also if u fail again, just charge for a couple of mins and try again. No need to fully charge.

Adhere to 3 simple rules when u preparing to perform learn cycle

1. Battery age set to 100

2. mAh must not die before AEv

3. Draw current must be above 200mA (negative)
[Nexus One Android Development] martinl1030:
hmmm its still shutting off even with acr on. what program should i be editing setreg with? maybe its not saving right when im changing the aev to 3201
[Nexus One Android Development] temasek:
Hmm it should not fail to bump up your mAh if u turn on ACR. U can bump up mAh manually in setreg if required as follows:

0x10 01 ..... for 100mAh

0x10 02 ..... for 200mAh

0x10 03 ..... for 300mAh

Etc

Got it?
[Nexus One Android Development] martinl1030:
thanks for the quick replies im about to throw my phone against the wall lol. ill try flashing a cm nightly build to see if it changes anything before i manually change it. im on miui right now
[Nexus One Android Development] temasek:
Anytime. :)

Anyway battery calibration kinda frustrating at first. Need patience. Its more challenging to play with non-stocked battery. :D
[Nexus One Android Development] martinl1030:
so i flashed cm6 nightly and my phone still shuts itself off before reaching 3201mAh for some reason. when i bump the mAh manually do i increase it so it will push the phone past 3201 or decrease it?
[Nexus One Android Development] temasek:
AEv aka Empty Voltage value is measured as mV. I believe urs is 3201mV.

If u feel that your mAh is finishing soon you can manually bump up your mAh with eg, 0x10 03 for additional 300mAh to drain. If still not enough, continue to bump up your mAh so that u can hit 3201mV to start your learn cycle.

Edit: Your objective is to drain your voltage to your Empty Voltage value (AEv) of 3201mV before you finish mAh with draw current above 200mA (negative )
[Nexus One Android Development] martinl1030:
i think i know whats going on. im not using root explorer to edit the setreg so its not saving correctly. is there another program that can overwrite root files that are free? I wouldnt mind it it was $1 but $3.97s pretty steep for an app ill only use once a few months
[Nexus One Android Development] temasek:
Use terminal and push the value to setreg

eg,

echo 10 03 > setreg
[Nexus One Android Development] temasek:
Dvgrhl / Roger,

Request - Can the current in the battery calibrator log be reflected as mA instead of mAh to be in line with the app's first tab which show current as mA?
[Nexus One Android Development] RogerPodacter:
The percent it jumps to full and the age value are not one to one relationship, so they will not necessarily be the same. It depends on the temperature and each breakpoint of the 4 different slopes of each. Your jump looks pretty normal to me, maybe slightly off as there should be no jump at all, but yours did at 98%. Not a big deal there.

So you are running out of mAh before reaching empty volt, so you could bump up your age value or your full40, just a tad. Age prob makes more sense in that situation. Again seems pretty normal to me, there will always be a tiny bit of misalignment depending on how hard or soft you drained the battery in that particular drain cycle.
[Nexus One Android Development] waylo:
Hi Roger,

So if we bump up the age to help the mah last until the voltage drops to our assigned empty, does that require another learn cycle?

Or does the fact that it jumps at the end of our charge cycle "align" the mah with the voltage already?
[Nexus One Android Development] dvgrhl:
Oops, the log saying "mAh" is a typo, should say "mA". The actual value is the same as what is reported on the General tab, I just put the wrong unit at the end. Thanks for the catch. I'll fix that and update the market.
[Nexus One Android Development] temasek:
Thanks for your hard work!
[Nexus One Android Development] Lazat:
Is it just for me that Battery Calibrator have started to show up in batterylogs and such?

When the program log, does it use wakelocks :S ?

could you please add in an option to disable logging when i dont need it? i dont like to have a service running when using the phone normaly.

thanks alot for your hard work guys!
[Nexus One Android Development] RogerPodacter:
No you don't have to do another learn cycle. Once you know your age value you're pretty good for a while till you feel you need to do another. You can always slightly adjust your age manually if you feel the need for whatever reason.
[Nexus One Android Development] RogerPodacter:
Just to give an update, I had graphing working well, but got stuck running it in the background as a service. Dvgrhl just made a significant change to the code repo, so I will re sync tonight and see if I can get the graph pulling from his service. My hope is that I won't get the null pointer exception error now with the new code. Let's hope cause I'm dying to get graphs into this thing finally.
[Nexus One Android Development] martinl1030:
thanks a bunch. i got into a learn cycle but i guess something interupted the learning process and when i rebooted my phone it showed my battery age at 89 lol. guess ill just retry tonight
[Nexus One Android Development] XZQ't:
My Nexus One happens to shutdown at 15% for months so I did the calibration yesterday, everything went good. When it fully charged (Status show 0x81) I shut the phone down and start it again.

then I open Battery Calibrator ..but the Age show 94% just like before.

I'm confused , How can I know I successfully perform learn mode ?
[Nexus One Android Development] temasek:
If its 89% and a stock battery, you might just succeeded learn cycle. Try discharge your battery and see.if it will use till 0%. If yes its SUCCESS!!!
[Nexus One Android Development] temasek:
Did u peep during almost complete charge? Its possible that u failed learn cycle at the critical time, at 99%-100% period.
[Nexus One Android Development] XZQ't:
No I didn't.

What I did was start the learn cycle, when battery almost die and the program pop-up tell me to charge it and i did it on time.

Then I close all program I opened to make the discharge rate more than -200 which are

Torch - turn off torch

CPU Benchmark - stop stress test

Sykpe - Sign Out and Close

Then I put a phone into airplane mode + turn off the screen

then went to bed.. around 5 hours

When I woke up it's fully charged and the status say 0x81

So I shut the phone down and turn it back on.

BTW, I 'm using MicroMod-CM7 Gingerbread V.03 with kernel 2.6.37-cyanogenmod+shade@toxygene#1
[Nexus One Android Development] temasek:
Fyi

For some unknown reasons, one may fail learn cycle even if one does everything right. Its a possible bug. You may have to try again.

But if u want for sure maybe ask Roger to comment.
[Nexus One Android Development] XZQ't:
Hmm... Thanks. FYI , I'm using Battery Calibrator v1.02, today i already update to 1.03. I can give it a try again.

So if the learn cycle is success I should see Battery Age change from 94% to 100% ? right?
[Nexus One Android Development] temasek:
If its non-stocked battery you may get 100% age even after a success learn cycle. But for stock battery, u nvr get 100 age.
[Nexus One Android Development] ExtraDas:
The new version of Battery Calibrator (v.1.0.3) might have a memory leak or an issue as it keeps popping up in Watchdog for high CPU usage.

I know part of the code has been reworked and a logger has been implemented. Is the logging code at fault? Maybe a possibility to enable/disable logging might be useful.

Still great software, great idea and great work. My battery has never been more honest with me :P
[Nexus One Android Development] ellesshoo:
So I just attempted a learn cycle with my 1600 mAh battery. Here are some of my results.

The last one is from after restarting. So do I set my full 40 to the highest mAh I reached (1622)? I guess I still don't quite understand if my learn cycle was successful, if my battery age is correctly set, if I need to fix my full 40 (it was originally 1602 but it looked like I was going to reach that before <20mA current so I manually bumped it to 1650), and what value shows my true capacity (I imagine its not the "aged capacity" bc that looks pretty low.).
[Nexus One Android Development] temasek:
I don't have high cpu usage using the battery calibrator. Fyi
[Nexus One Android Development] temasek:
Try drain battery till 0%. If u can u are good. I suggest min charge < 40mA is good enough. Lower than that is not really worth the extra time to pump just a tiny juice.
[Nexus One Android Development] RogerPodacter:
Just to let you guys know, my 1600 battery is working correctly when stock does not. My age value started counting down by itselflike its supposed to. It just flipped from 100% to 99% over the last month of charging and draining. That's the correct functionality, so our stock batteries are definitely broken in some way, purposely or accidental.
[Nexus One Android Development] ellesshoo:
Should I change my full 40 value to 1622 though?
[Nexus One Android Development] dvgrhl:
I haven't seen any high usage in my testing either, but I'll work on making the logging service optional. I have a couple other updates I hope to get out quickly for some new features I'd like to add, but I'll work on this first.
[Nexus One Android Development] temasek:
Maybe a 1650mAh. But if u change full40 u nid to redo learn cycle.
[Nexus One Android Development] mtw4991:
my month old 1600mAh battery was at 97/98% upon learn but is now at 95/96% after 1 month...never got to 99/100%, meh, but better than stock!