yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] dvgrhl:
Depending on who made your "2400" battery, you may or may not have a real 2400 battery. But no, this issue wouldn't affect your battery lasting longer. The issue with our specific battery is that it doesn't re-learn it's full capacity, so what it reports is untrue. That is why we get a sudden drop from 10% to phone turning off.
[Nexus One Android Development] RogerPodacter:
I've had my manual calibration value (age scalar) reset itself once too. But its not necessarily a reboot that does it cause my value has suck thru many reboots. I think worst case we have the app perform learn cycle, and once that particular value is known for that battery we can just manually setreg it back to what its supposed to be if it keeps resetting itself.

On related note the guy from the other thread has an extended battery for the nexus that jumps from 2600mAh down to stock value of 1363mAh when full charge happens. We should have him pull all his battery values, see what they are and if they make sense or not and then change them to 2600mAh see if it fixes it. Good test case.
[Nexus One Android Development] RogerPodacter:
Actually I think You have the same issue as the guy I just mentioned in my post above. My hunch is that these after market batt manufacturers used the proper ds2784 chip. But either there are wrong parameter values written in the battery, or something is forcing it back to stock value of 1360mAh. Yes this would cause your extended battery to only last as long as a stock battery if you think about it. When the phone reads 0 percent and 0 mAh it thinks its hit active empty point and shuts down. But really there's a ton of capacity left. We just need to get that correctly reported from the batt to the driver/phone.

Edit: to elaborate, my guess is the manufacturer has your full40 value set to that of a stock 1400mAh battery since that is what is used to tell what "full charge" is when charge termination flag is set upon a complete charge. I have no idea why this could happen though. You would expect after market battery manufacturers to correctly set the battery pack values. But we've seen from all those PDF documents what software would be provided to someone who wanted to program their own battery packs for sale. Maybe they were clueless and didn't understand what full40 meant so they just slapped in the stock value when setting up the ROM values.

Hell we see the exact thing happened in the palm pre thread. About half of the seido 1350 owners had false full 40 values entered in their battery. And the other half had false capacity batterys altogether. Seido was lying about what they were selling, and. This is how they found out.
[Nexus One Android Development] instigator008:
Thanks for your great answer! I suspect that it is not reporting the correct stats. Last night I drained it to auto shutdown, then booted into recovery. Its been in recovery for ten hours and counting! I am hoping that it'll properly calibrate once it is truly empty. Will report back.

Mine is Cameron Sino 2400 mAh btw.
[Nexus One Android Development] saltinbas:
..............
[Nexus One Android Development] RogerPodacter:
Yeah that makes sense, I'm very convinced your full 40 value is set incorrectly. Funny cause the other guy in the other thread bought a 2600 battery and has exact same issue. I'm very curious to pull your values and see what they are.

If your phone shuts down but still runs in recovery for that long, its definitely an incorrect stored number.
[Nexus One Android Development] instigator008:
Well, I am willing to be a guinea pig. Let me know what u need.
[Nexus One Android Development] theloginwithnoname:
Interesting idea, let us know how you got on.

Probably best to do so in the battery calibration thread, though... :)
[Nexus One Android Development] instigator008:
It looks like it did the trick! After draining the batt fully in recovery (12 hours!)I was able to charge to 2500 mah. Even though my phone's charging indicator was green, it continued charging until full. The phone was left on all night and has dropped to 2290 mah. The next test will be to see when it thinks it's empty and shuts off.
[Nexus One Android Development] tomsan84:
Not sure if kernel is stock. I am using 2.6.34.2-950mv-CFS-OC-monks-080610 root@monksdesktop#14

No modded version of CM
[Nexus One Android Development] temasek:
That's a pretty old kernel. I doubt it includes the battery drivers. Either u use back cm6.1.1 stock kernel or use wildmonks latest kernels for cm6.

Btw stock kernel means kernel that comes with the rom.
[Nexus One Android Development] Breece:
Just to inform you:

Received my replacement battery from Htcrepairparts...

has the same problem:

Capacity: 104856 mAh

Full40: 27306 mAh (cannot be changed..)

So its a problem with their batch they are selling right now...
[Nexus One Android Development] temasek:
Damn...... :(

Tell u what..............

Since you cannot make use of the battery drivers & app, I suggest u perform learn cycle in the good old ways.

- Drain your battery

- Plug-in your charger (Do not turn on power to charger yet)

- Once your phone shows dialog box "Powering Down", turn on power to your charger

- Wait for 4-6 hrs, longer the better just to be safe.

- Once done, turn on power and u are calibrated.

But u have to redo the old fashion way of learn cycle again if

1. Your phone auto shutdown

2. You perform power off charging

Still, its the best way to calibrate your battery, for now.
[Nexus One Android Development] Breece:
And I checked again with my original battery, everything works with that one...

Will send an email to the seller and see if they have an idea.

But yes, damn :(

Bright side: I now have two 1600mAh batteries... they go to the first 40% of battery reeeally quick and stay forever at 22%...
[Nexus One Android Development] temasek:
See my edited post for possible solution to your battery calibration.
[Nexus One Android Development] Breece:
Thanks :) I will do that!

Question though... Where do I actually turn off the phone? Cause in your last step I am supposed to turn it on :)

[edit].. aaah ^^ Ok when the phone shows "Powering down" thats what it possibly is doing ;)
[Nexus One Android Development] popophobia:
I finally managed to calibrate my battery yesterday, and got the battery age of 100% on a 1 year old battery (charged for 3 hours, used Flight Mode the entire time). I was quite happy with this.

Anyway, when I try to drain the battery to 1% today, it shut off around 15% and when the phone boots up, I get max capacity of 94% again (indicating that I will need to recalibrate it :( ). What am I doing wrong? Could it be the fact that I use flight mode while charging the battery, making the current too high (was ~700mA most of the time until it hit 80%) and the reading inaccurate?

Thanks the developers for their time and efforts.
[Nexus One Android Development] temasek:
One year old battery can never be at age 100%.

If u reboot after a learn cycle the age is 100%, pls try powering off / on and see if your age changes.

Also remember if your phone auto shutdown, it will revert to 94% which is incorrect age.
[Nexus One Android Development] temasek:
Yeah, immediately turn on your charger when u see "Powering down" dialog box. And remember, DO NOT ATTEMPT TO TURN ON YOUR PHONE for at least 4-6 hrs or preferably longer than that.
[Nexus One Android Development] mtw4991:
Unless your battery is brand new, if it evers shows 100% or 94% after a learn attempt, then the learn cycle failed at some point. Putting the phone into airplane mode as it approaches 80% or more while charging is the best way to insure that learn mode completes.

High current is normal as the battery is charging (mine can reach over 900mA) and will automatically reduce itself as capacity approaches 100%. The learn mode will complete when current drops to -19mA for 2 consecutive read cycles, or -39mA if you set it to 40mA fyi.

From your observation that it auto-shutsdown at about 15%, I'm guessing your true age is about 85%:p
[Nexus One Android Development] popophobia:
Thanks. That's what I figured. No way it's 100%. Anyway, I guess if I redo the calibration again and get 100% for some reason, I should reboot a few times?
[Nexus One Android Development] mtw4991:
Just make sure that learn mode completes itself, then reboot once and check age...should be around 85% for a 1 yr old battery. And remember, NO PEEKING after the 2.5 hour mark, lol! Wait at least 4 hours before checking.
[Nexus One Android Development] popophobia:
Thanks!

Is there a way to back up the battery setting after each calibration? It's quite inconvenient when I switch between ROMs.
[Nexus One Android Development] temasek:
*sigh* pls read replies for your post.

More of such users, I will just give up replying.

Info - Some need just a reboot , others require a power off / on. FYI
[Nexus One Android Development] popophobia:
Sorry, your post lagged to the last page. :D

Didn't know the strong support for this thread. Two replies in 5 minutes :D
[Nexus One Android Development] temasek:
Read it?

LOL, there is no competition here if u referring to that.

Myself & mtw4991 always here helping users perform correct calibration.
[Nexus One Android Development] mtw4991:
I LOVE YOU MAN!

j/k;)
[Nexus One Android Development] RogerPodacter:
the actual nexus one stock battery is rather cheap, for example the age register seems to be "stuck" at age 94% and we dont know why. i purchased the 1600 battery and this thing works correctly, much bettery qualty, age came correctly set to 100% and counts down like its supposed to.

i look at the battery driver for every new phone that comes out, and so far the only other phone that is somewhat similar is the SE X1 i believe, it uses the ds2746 chip which means the same read/write functions and edits to the driver could be made like we did for the nexus one.

and i think some HTC phones like the evo MAY use the similar chip, but we just cant get to the important part of the code for whatever reason. it seems HTC keeps some of this stuff out of sight.

the nexus s is completely different and seems to be be based off voltage table to determine SoC (battery percent), so its out of the question too.

the nexus one battery chip seems to be a rather high end all-in-one battery monitor/fuel gauge/solution that not all phones use. the nexus s for example has a really low cost cheap battery chip that only has 5 registers, it has no algorithm or anything fancy inside the chip, and all the stuff seems to happen on the system board max8998 power controller.

so we kinda struck a "perfect situation" with this app and the driver edits. at least so far. of course the palm pre started this all as it has the same ds2784 battery chip that our phone has, so at least its one other out there...
[Nexus One Android Development] Bryce2010:
Getting a bit frustrated here, I'm following all the instructions but my phone always shuts down before 'learn' mode can be activated...

Any simpler way to just make the device not shut down before the battery gets to zero?
[Nexus One Android Development] RogerPodacter:
i guess the ACR adjustment option is not functioning correctly for you. when you get down low, close to empty, manually bump up the mAh which will stop the phone from shutting down early. just do:

echo 0x10 03

or use the app advanced option to register 0x10 of value 03. that will let you get down to the empty volt without shutting down early.
[Nexus One Android Development] schizophrenia:
after a couple of days, here are my observations:

- last time the phone auto shut down at 0%. I restarted it and set at 85% as you instructed.

- Phone went up to 100%, and auto shutted down at 13% while I was playing Angry bird.

- So I started it up again and set 85% and fully charged it.

- Today the batt went down to 20% or something so I charged it up to 80% and I went out.

- The phone lasted until 9% so I charged it again.

- Right now the phone is at 99% (Cap 1208mAh, Aged cap 1393mAh, Batt Age 85%) and discharging (negative amount).

1. So I supposed, even if the phone auto shut down again, I fully charge it, it will still deplete to 0%. But that is with the exception of large battery draw use such as Angry Bird (thats how I explained it shutted down at 13%).

2. question, why is my battery not fully charged now? it stopped at 1217 100% while the max capacity should be 1393? Anyway to fully charge it? Or is it already fully charged? Because it quickly dropped to 98% or so within 5 minutes or something

Comments and answers/explanation welcomed.
[Nexus One Android Development] Bryce2010:
Eeek! Ok I did this, my battery was about at 80% before, now it says it is at about at 20%. How will I know when it is full? Don't want it to explode or something...

I think this is all a bit too complicated for me... How can I just put it back the way it was before? Think I'll just put up with the annoyance of having it shut down before battery shows completely empty...
[Nexus One Android Development] mtw4991:
1) if your phone auto-shutsdown, you may have to redo the learn cycle as it may have gotten reset to 94%, that's why it shut down at 13% (which is roughly equal to 85-86% age). Shouldn't have anything to do with Angry Birds...Angry Battery Gods maybe, but not birds:D

2) it is fully charged. Your Capacity(mAh) is approximately 1220mAh, not 1393. 1393mAh(Aged Capa) is a measure of fast/slow the battery ages, it has nothing to do with how much juice it can hold...that's your Capacity(mAh). Two seperate things that sound the same.
[Nexus One Android Development] schizophrenia:
1) But according to:

Originally Posted by temasek

No need to redo learn cycle. Just set back your battery age and u are good. - irregardless of when u do it.

i always thought those games do draw a lot of battery and thats why the phone shutted down itself earlier than its supposed to be or something.

Can you confirm which one is correct? Relearn? Or?

If I have to relearn again, that means, everytime if the phone shut downs itself, I have to do another relearn? There is no memory or something?

One more, actually are we tweaking the phone battery register? or the battery itself? or both?

2)Understood. I try to not care it.

Off topic: how come my N1 running on a CM7 built having Quadrant score of only 1100 or so? Why are you having over 1800? Any secret?
[Nexus One Android Development] RogerPodacter:
haha no worries, you sent that command while you were at 80% charge? dont worry, just let it charge to full and the chip will auto correct the percent when it reaches full charge. no worries you will not blow up your battery or over charge it or anything. the chip handles it all. when the battery reaches minimum charge current <40mA (or whatever you have that set to) it will re-align everything.

i would just use that command when you get down low like 15% and are afraid it will shut down early. the app should do this automatically but sometimes it doesnt always work.
[Nexus One Android Development] RogerPodacter:
1. yes i've mentioned before that you can place a large enough load on the battery, like playing a game for a while, which will pull down the voltage faster than the current depletes, and it dies early. ideally under normal usage, both decrease linearly. but its not perfect as you have just demonstrated.

the age is very accurate for normal to heavy usage. use the phone and place a load on the battery, then it sits idle for a while, allowing the voltage to reach "relaxed state" and level out. but it can be hammered so hard that it never catches up. this is the inherent problem with "coloumb counting" battery methods like the ds2784 uses. sometimes pure voltage readings would make things easier.

2. your new full point is now 1217 mAh because your battery has aged to 85%. so that is all that your battery can hold now. the full40 is the full point to look at, the maximum capacity that the battery can hold when brand new and at 40 celcius. but with an age of 85%, that full point is much lower now.

the batt algorithm takes full40 * age = full point. so you get 1217mAh (dependent on the current temperature at the time too).
[Nexus One Android Development] Bryce2010:
Ok thanks very much! I'm at work, it would be rather embarrassing if my phone blew up on my desk!
[Nexus One Android Development] RogerPodacter:
you do not have to do another learn cycle. you know your age now, its 85%, so you just set that back manually anytime it resets itself. after a month, or a couple months, you can do another learn cycle to see how much more your battery has aged.

these values are all inside the registers in the battery itself, inside the memory chip in each individual battery. so when you set your age value, register 0x14, that is the age for your specific battery. if you have 2 batteries, you'd have 2 different age values in each battery.

if you look back thru the thread ffrom early on, we practiced changing many other registers to see how to squeeze out performance, or just experiment and screw around. our app basically is "hacking" your battery chip to do what you want with it.

the ds2784 chip just happens to contain a "learn cycle" out of the box, but its something google never gave us access to. so we had to learn how to enable it ourselves.

read the data sheet. its actually very interesting once you've played with the battery. you will get insight into it all...
[Nexus One Android Development] rmc112:
Here is my current situation.

I got the 1600mAh battery maybe a month ago. When i first tried the battery calibrator, I'm pretty sure I got it to charge to to around 2400mAh. Only thing is I wasnt doing the learn cycle right in the beginning(the learn flag never turned on because it was dying with 0mAh@3.6v, also the learnf button was never on). So I just set the full40 to 2500 and age to 100% and charged away, and it eventually got to around 2400. Now I am doing it the right way and everything looks good while doing the learn cycle, but its topping out at 1550 or so. I am doing my second learn cycle as i type and it looks the same as the first, going to top out at around 1500-1600 even though my full40 is still at 2400.

Was my first run without the learnf button on, starting the charge at 3.6V really getting up to 2400mAh? Was this a fluke and not really 2400mAh like it was saying it was because I the learn flag/learnf button never came on? Why is it maxing at 1600 now and not 2400? I could also be wrong about it getting up that high the first time, but I really think it did.

Sorry for so many questions, but does this mean my battery isn't one of the good ones that goes up to 2500mAh?
[Nexus One Android Development] temasek:
1. When you auto shutdown, upon next reboot age will reset itself to 94%. It is confirm you do NOT require a new learn cycle. Just set your age back and u are good but only upon full charge then u can discharge till 0%.

2. When you manually shutdown, upon next reboot age will remain unchanged.

That's the difference.

Possibly someone may have to create an FAQ for these.
[Nexus One Android Development] mempf:
Thanks for the detailed response.
[Nexus One Android Development] dvgrhl:
I uploaded an update to the market for the app. I made a couple of changes. First, ACR writes should happen sooner if needed. Hopefully this takes care of conditions where some people had the phone shut down before learn mode was able to be reached. I also fixed an issue with the logging service that was affecting a couple of users. And I added back in the registers, which you can get to from a menu item.

I'm going to go back to looking at a setting to help with battery drain during learn mode to stay below -200mA, most likely using gps polling. My idea is to have this shut off instantly when learn mode is detected, the same time that you need to insert the power source. I'd also like to have an option to put the phone in airplane mode automatically when learn mode is detected, for anyone that wants to enable that.

Edit: oh yeah, totally forgot but I fixed it so that proper hex values can be entered via the advanced option for learn prep.
[Nexus One Android Development] schizophrenia:
Thanks dvgrhl, temasek and theloginwithnoname and RogerPodcaster all the great app and the instruction and the help.

I think I am 90% fixed with that problem, if not 100%.

Good to learn more.
[Nexus One Android Development] Smokeaire:
Thanks for the heads up to the update. For some reason "My Apps" in the Market doesn't show all of my installed apps and didn't show there is a update for this app.

I like the changes.
[Nexus One Android Development] temasek:
Use TB to wipe your market data and u should be able to see all your installed apps again.
[Nexus One Android Development] Smokeaire:
Thanks, that worked. I never used TB for that before.
[Nexus One Android Development] temasek:
Yw.

U cannot clear market data from applications in GB now so u nid TB to do it.
[Nexus One Android Development] britoso:
What does this message mean ? (learn mode tab, after turning learn mode on)

My LEARNF flag is already on (white) in the battery status register. (only UVF is off/black)

Background: I'm trying to calibrate a new N1 replacement battery off ebay. No Idea what the mAh is for it. (full40 says 27306 !!)
[Nexus One Android Development] mtw4991:
The Good News:

It means that once your mAh's or mV's run out, just before dying, the learnf tab will turn on (white is not "on") and a popup will tell you that learn mode is now active and to plug in your charger into the phone quickly! The learnf tab will turn yellow I think.

The Bad News:

Your ebay battery can't be calibrated using the app as it has the wrong values coded into it and they can't be changed according to others who have gotten the same battery. Unfortunately. However, you can do it the old way which is when your phone auto-shutsdown as soon as the popup appears plug the charger in quickly and hope it achieves learn mode.
[Nexus One Android Development] Bryce2010:
Ok thought I'd try again today...

-downloaded latest app from the market

-did the 0x10 value 03 under advanced options

Phone shut down before learn mode could be achieved :-(
[Nexus One Android Development] dvgrhl:
Updated app to add in GPS polling option to help drain the batter during a learn mode attempt. Only works when learn mode detect is enabled and you are on the Learn Mode tab. Also added in an option to automatically enable airplane mode when learn mode is reached.
[Nexus One Android Development] popophobia:
OK, I tried to calibrate the battery 3 times already. Same error still occurs (batt shows 100% after a few restarts, shut down before reaching 0%). I followed the direction to the letters. I'm using MIUI 1.2.4 with original kernel. Could this be the reason?
[Nexus One Android Development] mtw4991:
I don't think miui rom has the modified kernel. Try flashing wildmonk's or pershoots kernel over it
[Nexus One Android Development] theloginwithnoname:
nice work fella!
[Nexus One Android Development] Bryce2010:
Tried again today, updated to latest app but phone always shuts down at around 13% before learn mode can be activated...
[Nexus One Android Development] mysaturdayself:
just a quick question: when did you guys start the learning mode. I assume it's better to start at low battery like 15%? it seems to take too long to get that target learning mode.
[Nexus One Android Development] mtw4991:
dang, had to re-do calibration today and used the new app version. Everything worked great, but the airplane mode turned off a couple of times when I turned the phone on to check some things. Must have done it close to the end because it seems learn mode failed as I rebooted and age was still 100%, powered off/on and it age was set to 94%.

Funny thing is, that using the log it jumped from 96% at 1515mAh to 100% at 1580mAh, but mA correctly displayed 19mA twice in a row prior to stop charging flag, so it seems learn completed correctly? If so, why the jump to 1580mAh? gets confusing sometimes:confused:
[Nexus One Android Development] mtw4991:
Learn mode begins when the phone either runs out of mAh or mV and current draw is greater than -200mA