yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] RogerPodacter:
well its possible that you may have in fact increased your capacity since you say normally your phone makes it all the way down to 1%, correct? if so, then the stock value of 94% may have been artificially capping your battery. the only way to know is set age to 100%, use your phone normally from a full charge and see where the battery dies. if it makes it all the way down to 1% still with your new age value of 100%, then you just regained some capacity that you didnt have before. hope that makes sense.

the way it works is a brand new battery out of the box has age set to 100%. and the age counts down at 1.7% every 300 full charge cycles. so as battery gets older, it loses capacity. BUT that is just a guesstimation by the battery chip. your actual capacity may not have lost as much, so really your age could go back higher. its all dependent on each specific battery and how you used it. a learn cycle figures out your exact age and adjusts it accordingly.

the catch is that the nexus one is defaulted to 94%, and we dont yet know why. other phones like the palm pre, it comes out of the box at 100% like the manufacturer says it should. then it counts down over the charge cycles. so for me personally i leave my age set to 100% even though i know my learn cycle already told me that my battery age is 80%, cause its the old original battery from beginning of this year.

so just think of age at 100% as having your battery be set to brand new condition, which means at full charge your battery should be around 1440mAh or so. that's the theoretical maximum capacity you can get. and run that down to empty and see how far you make it. if all the way, then you gained some capa.
[Nexus One Android Development] rootbox00:
First sorry i can't read the whole big thread.

I have a relative new Nexus One (3 Weeks old) and my Battery drains extremly fast.

So what should i do?

The mod on the setreg or just callibrate my battery? (and what is the best way to callibrate my battery?)

thanks.
[Nexus One Android Development] difrnt:
I have the Mugen 3200mAh extended battery for the Nexus One.

http://www.mugenpowerbatteries.info/epages/es109514.sf/en_US/?ObjectPath=/Shops/es109514_es120302495377/Products/HLI-NEXUS1XL

The battery always dies when it reaches 25%, regardless of clearing battery stats, while at 0 or 100% battery charging while phone off or on, kind of annoying as when you see 26% battery life you think you have a while left but as soon as you hit 25% the phone shuts off and doesn't even have enough power to power back on until at least 2 minutes of charging has been done.

Any help would be greatly appreciated.

Custom ROM: RoDrIgUeZsTyLe MIUIMOD V1.7.3 (Have also used CM6 - same results)

Kernel: Wildmonk´s Kernel 2635.7
[Nexus One Android Development] RogerPodacter:
you will have to do a learn cycle as well. but in the mean time, maybe if you have some free time, flash pershoot's latest kernel, and read the dumpreg file and post back with what it shows. your battery sounds like it has just aged a bit which there's not much to do except update your age value by doing learn cycle. but pull the dumpreg values anyway if you get a chance.
[Nexus One Android Development] RogerPodacter:
since your nexus is pretty new, i would set the age to 100% first and see if you can drain it all the way to empty, or if it dies early. a "new" battery should get the full capacity.

but to answer your question, the only other things we've been experimenting with is squeezing a little extra out of the top end of the battery by lowering the charge current down to <20mA. for me this gives like an extra 50mAh or so on the top end, and increases full voltage up to 4.182 or so. and then at the bottom end, which is more risky and still being tested, we are lowering the empty voltage from 3.4 maybe down to 3.3, or 3.2 or however low we can get it but in a safe way. and see if it can still power the device and if the battery is ok doing it. so this adds to the lower end.

so those might be some things that will increase your battery life, which can be done with setreg just the same. but we havent tested those enough, so maybe just sit tight for now. and set your age to 100% because thaty will in fact bump up your capacity to 1440mAh. the question will be if it makes it all the way down to 0%, which it should since its new. therefore you just gained some capacity that you didnt have before. its worth a shot.

age to 100%:

echo 0x14 80 > setreg

to go back to your stock age value:

echo 0x14 79 > setreg
[Nexus One Android Development] Booker-T:
My battery only has 1296mAh:eek:

How can I fix it?
[Nexus One Android Development] difrnt:
As in this? - BTW thanks for your help. :)
[Nexus One Android Development] RogerPodacter:
Ok your full value is correct. It shows 3560mAh and you can check by opening your getfull40 file. Some others had wrong value so I wanted to check.

To fix your battery from turning off at 25% you should set your age value. Drain your battery till it dies. Then charge it to full, and watch in OS monitor and when the mAh jumps from some number to full 100%, take note of that mAh number it jumped from. Then post that. Then you set your age to match that value, and your phone won't die at 25% anymore, it will use the full range.

That is the manual way of doing the learn cycle. As soon as we finish this app that will let you do the learn mode the correct way for you. Until then the manual way is your fix.
[Nexus One Android Development] RogerPodacter:
How do you know its only 1296mAh? What battery do you have? Does your battery die early and have you set your age to 100%?
[Nexus One Android Development] RogerPodacter:
thanks for posting your dumpreg, its interesting when comparing to our stock battery.

Stock Nexus 1400mAh

Empty volt: 3.416 V

Full volt: 4.099 V

Full40: 1452 mAh

Mugen 3200

Empty volt: 3.006 V <--- look how low they take their voltage.

Full volt: 4.1577 V

Full40: 3560 mAh

i am very curious if i lowered the volt down to match yours how much extra capacity i could squeeze out of our stock battery. i mean that is a huge difference, so imagine if it works, we could really add some capacity to the stock battery. i purchased a second battery so i can test my old one. maybe i'll give it a shot.

also the full volt is interesting.
[Nexus One Android Development] Booker-T:
It is now 13xx, as I charge it longer

I set age to 100 but it stop charging when 96%.

Besides, after a reboot the age reset to stock
[Nexus One Android Development] RogerPodacter:
that's funny cause loginwithnoname has his age reset a lot with a reboot as well. but when i reboot my age does not reset. it has reset a few times when i have pulled the battery though, but not lately.

do you mean it stops charging at 96% and jumps right to 100% and says its full at that point? regardless it sounds like your battery is better than some of ours and mine, cause i know mine only has like 1180mAh left. it stops charging at 88% and jjumps right to 100%. my age is 80%.
[Nexus One Android Development] Booker-T:
I am not using pershoot's kernel, I uese WM's kernel

It stop charging at 96now, never jump to 100
[Nexus One Android Development] RogerPodacter:
oh i see, so you do not yet have the battery additions in pershoot's kernel. that is a bug in the old driver that makes it stop charging sometimes i think, but it is fixed in the latest driver we just did. unless its a totally different issue than what i am thinking. has it always done this? if you flash to pershoot's latest, or wait till WM incorporates the latest changes, it will be fixed. and you can also check your batt values at that point as well.
[Nexus One Android Development] overground:
Wildmonk's 11/11-12 commits:

2.6.35 kernels:
(Tested on Cyanogenmod 6.1.0 RC1)
-Changes since 111110
-Merged in commits related to 2.6.35.8 (from IR's Github)
-Merged from Pershoot's Github, RogerPodactor's and loginwithnoname's ds2784 battery driver
-Switched to Tiny Preempt RCU with RCU boost.
-Update (11/12/10). Fixed a potential bug with phone not charging under certain conditions (mainly affected Stock Froyo for some reason). Making a new set labeled 111110b
-Update (11/12/10). Restored condition when percentage falls below 99%, it will start charging.
[Nexus One Android Development] Booker-T:
Thanks for your help.

I just find that if I hit "shut down" to reboot the phone, the age will be reset.

However, if I hit "reboot" to reboot the phone, the age will remain the value.
[Nexus One Android Development] ram130:
Hey, what do you guys suggest for the Vibrant? I'm having issues..need some help. :(
[Nexus One Android Development] RogerPodacter:
Thanks for this. I just checked the driver and sure enough a line of code got cut off in the final version I submitted which could cause charging to stop in certain conditions. Damn. I re submitted the fixed version so should be updated soon. Wildmonk fixed it in his version. Sucks doing this stuff its so time consuming:-)
[Nexus One Android Development] RogerPodacter:
Well what issues? I've not looked at the vibrant driver to see what's going on and what could be done. Is It released yet?
[Nexus One Android Development] Booker-T:
My battery sticks at 138x for several hours and it is hard to go up one more mAh.

It seems this is the maximum capacity for my battery.
[Nexus One Android Development] flak0:
@Roger I need ur help. I have the latest 111110b wm kernel and I attempted a learn mode cycle. I first changed the age to 100 before it was showing 0x14 79 now it shows 80. Weird thing is it died at 19%. I plugged in right when it was shutting down statusreg file shows 0x01 that means learn mode right . Anyways here is the weird part. Osmonitor dmesg shows at 1% battery 3.710mv I know that's not right please help. Ill post my dumpreg below. Thanks.

Edit: I noticed its back to 79(94%).

Dumpreg:
[Nexus One Android Development] mtw4991:
I've been playing with this for a couple of days now. I set my reg to 0x14 80 and it shows 100% with 1452mAh capacity. If I charge it while the phone is on it gets to around 1430'ish mAh pretty consistently. If I then turn the phone off and do a bump charge, I can get over 1480mAh. I wonder if this will be just extra high-end capacity or if the phone will die sooner than reaching the 10%ish mark. Gonna run it down today and report later to test and get a learn cycle in:)

EDIT: 2nd 30 minute bump charge and it's up to 1491mAh...I wonder if it will blow up? :-)
[Nexus One Android Development] difrnt:
I still have my stock, if there is anything I can do to help, let me know.
[Nexus One Android Development] kalinusa:
I have been wanted to ask you guys, how do you get the mAmper readings. I only see the mV in the OS Monitor or the Spare PArts?

What is the formula?
[Nexus One Android Development] mtw4991:
In OS monitor, go to Menu>Options>Filter(dmesg)>Enable Filtering(check box)>Tag Filter (batt)
[Nexus One Android Development] kalinusa:
I still dont understand where do i find the mAmper reading. I only see Voltage 4172mV and nothing more. I did the filter thing but where do i look.

EDIT: OK GOT IT!!!

Thanks.
[Nexus One Android Development] RogerPodacter:
Ok this post first. We can set a register to do the equivalent of This bump charge without having to turn the phone off. I've been testing it. Right now when you charge with the phone on, one of the registers is set to stop charging when current hits <80mA. But, when you charge with the phone off, bump charge, this register is ignored and it squeezes that last bit of charge into the battery.

So I have set my charge current down to <20mA which let's the battery charge for longer and take in more usable capacity. There's no harm doing this, but it does add about 40min of charging time. But you do gain about 50mAh extra capacity me thinks.
[Nexus One Android Development] mtw4991:
Which file do I edit and how, to change the 80mA to <20mA? This is a great feature as I got 2 hours, 25 minutes before I went down to 99% after bump charging with light usage.
[Nexus One Android Development] RogerPodacter:
Ok so It's normal that when you Set your age to 100% it now dies earlier as all our batteries are older now and have lost capacity. So when your battery is about to die the status register will change to 0x71. This is the magic number for learn mode. The problem is this happens very quickly, you sometimes only have a few seconds to plug in and you have to be quick. You need a script or some way to repeatedly cat the status register until you see it flip, Then plug in. This is why we're making the app to do this for you guys so you can hit learn mode.

Your dumpreg file shows that you did in fact hit learn mode because its showing 0x21 which is common, but it lost it for some reason. The status register format is this:

0111 0001 - that third 1 is the learn flag, so learn goes from 0 to 1 means learn is active. Also the previous 2 bits will also turn from 0 to 1 at the same time because one is the empty volt flag and the other is the standby flag. So the result in binary is 0x71 is what the status register has always shown every time I hit learn mode.

The reason why after shut down your phone now shows 1% at 3.7volts is that the battery EEPROM resets, or starts over, at empty point, which you hit when it shut down. That's just the way this battery works, it uses 2 points as a reference, empty and full point. It's hard to explain but in the data sheet it explains that anytime empty volt is reached that the percent meter is reset.
[Nexus One Android Development] RogerPodacter:
Well if you really want to try with your stock battery I can give you the command to lower your stock voltage down to match your mugen voltage. I tried this last night but I chickened out when it hit 3.2 volts, even though everything I've read says lithium ion batteries danger point is 2.5-2.8volts, with a cut off at 3.0volts. So it should be ok, but who knows. If our stock battery does in fact go down that low, then we now have a bunch of extra usable capacity we can squeeze out of our stock battery.
[Nexus One Android Development] RogerPodacter:
Ok the command for <20mA is:

Echo 0x65 06 > setreg

Back to stock <80mA is:

echo 0x65 18 > setreg

But one thing, there is a difference. When you bump charge with the phone off, you are only tricking the battery meter into thinking it stayed above 100% for all that extra time. By setting the above command in the register you are now incorporating that extra capacity into the percent meter. So what this means is that you will see your percent drop normally, not like it does during a bump charge where it stays above 100 for a long time. Instead you've now included that extra capacity into your percent meter, but you're now starting from a higher voltage, so your battery is lasting longer with the extra capacity, its just not tricking your meter anymore. Make sense? I hope so..you're adding that additional capacity into your percent meter as it calculates it in real time. And your full voltage will now be up higher around 4.187 volts rather than the usual 4.15volts. So you're getting more from the top end. Hope that makes sense...
[Nexus One Android Development] mtw4991:
Roger, can I just issue 0x65 06 in setreg using root explorer, just like 0x14 80 for the 100% change? echo 0x65 06 > setreg didn't work in terminal emulator:confused: not real good with terminal yet, lol.
[Nexus One Android Development] RogerPodacter:
Yes just use root explorer like the age command. In terminal you probably did not type su first for super user access.
[Nexus One Android Development] mtw4991:
Yeah, used root explorer but I did do su first. is there a space between 06 > setreg or is it >setreg, for future ref.?
[Nexus One Android Development] RogerPodacter:
I always use root explorer too. But I've always kept a space when doing it in terminal so just use a space...never tried it without one.
[Nexus One Android Development] mtw4991:
umm... tried it again and it just says "cannot create setreg: read-only file system", but root explorer works :D
[Nexus One Android Development] RogerPodacter:
You probably are not in the battery folder where the setreg file is located. You have to navigate there first.
[Nexus One Android Development] Booker-T:
I wonder if this method safe enough?

Besides, I would like to ask is 1441 the maximum capacity for a stock battery?
[Nexus One Android Development] RogerPodacter:
It's safe, the manufacturer just sets a nice round number to make the charge time 2.5hours. But we see other phones like in the HTC driver where they use <10mA. That setting will put your charge time a little over 3 hours. I've been using it for almost 2 months so far and haven't seen any problems. But I guess I should say use at your own risk. If you want a happy medium that pershoot put into his kernel a few months ago then use:

<40mA is:

0x65 0c
[Nexus One Android Development] Booker-T:
Thanks, I will use <20mA as my N1 still under warranty:p

I am trying hard to make it out of order in a "normal" way:D
[Nexus One Android Development] theloginwithnoname:
I've just charged mine ON for the first time in a LONG while, and I think RogerP might be interested in this: it went from 4172mV 93% (1257mAh) straight to 100% (1360). I have no idea how it can work like this! Going to raise a bug report with Google... :o
[Nexus One Android Development] Marine6680:
Read some of my posts, it explains why charging powered off takes longer and charges better. Long story short, the way Li-ion batteries charge and safety reasons, make it impossible to actually charge to a true 100% when the phone is powered on.

The battery bar only has a few animations, I believe the 50% green is shown until the battery gets down to 25% or something, and then it goes to yellow, and red shows at 15% as far as I can tell.

Yes this is why it is good to re-calibrate the battery every so often.
[Nexus One Android Development] rohandhruva:
Thank you Marine6680, I was worried that it's a problem specific to my phone.
[Nexus One Android Development] RogerPodacter:
well 4.172 volts is exactly where my nexus hits 100% too. but yes sometimes i've seen it charge to 94% and then jump right up to 100% in an instant. my question to you is how are you determining the mAh numbers? is it an app? and it seems that youre only at 1360mAh at full charge rather than the rated 1400 mah, which makes sense. i think i have similar as i am always about 10% off with my battery, ie it dies at 8-10% everytime. like this sicne new, and re-calibration does not fix this.
[Nexus One Android Development] Marine6680:
I am curious as well, the app would need to be able to monitor the amount of power going to the battery while charging to do that, and it would be inaccurate unless the charge was done from 0% state. Plus the problem that you can not charge the battery to a true 100% when the phone is on, means that it can not read the peak charge capacity. This is also complicated by the fact that these phones have a min operating voltage that is in the middle of the Li-ion discharge curve meaning the 0% baseline is variable depending on a number of conditions. That also means that the app would report a lower overall charge capacity because it is measuring charge from a point that is not the true 3v 0% of Li-ion. Unless of course that HTC uses 3.4v as its 0% mark for measuring the capacity of the batteries for these phones. That would reduce the overall specs for the battery and marketing would not like that idea. (meaning that these batteries had 1600mah if discharged to 3v, this is also why I am wary of 3rd party "extended" batteries that are "OEM size and fit in battery compartments without MODs or new back covers")
[Nexus One Android Development] jettrue:
I've got to stop reading these battery posts. :)

First they get my anal about my battery charging rate, then about how long before my phone will quit, then about what rate I'm updating facebook posts, and whether or not to keep GPS on, what Juice Defender settings are best, etc. etc. And then after I go nuts looking at my battery info page, I ask myself, WHY?:confused: It's really not necessary for my daily life when I'm surrounded by electrical outlets. I just charge it whenever I'm near a plug and I don't need to have my phone in my pocket or in my hand. I sync my data as often as I want, have the widgets I want, and get on with my life. It's an OCD person's nightmare. :D

If I go somewhere where I'll need extended battery life, I'll just turn down brightness, disable some options, and perhaps use the stock launcher with no widgets.

If my battery dies in 6 months to a year because I've done something wrong to it, I'll buy a new one. :cool:

And I'm not going to leave my phone off for a day or two to calibrate it. If it was dying in 6 hours or less, that's another story... but the 12 or so hours is fine with me.

I will not get sucked in this time, LOL.
[Nexus One Android Development] theloginwithnoname:
would be interested in hearing what chowlala and andycr15 have.

certainly is - OS Monitor (under Messages tab). Filter dmesg on "batt" if you get too many messages.

can you and others check, and report here, please?

+1 :rolleyes:
[Nexus One Android Development] theloginwithnoname:
Not if it was simply reading the dmesg log (that Android OS writes) ;) See above post.

Have a read of a few of my recent posts and you'll see why I posted on-charge mV and mAh values - (hint: they are generally better than off-charge). Weird, huh?
[Nexus One Android Development] RogerPodacter:
Nice I never knew OS monitor had that info. I filtered for those battery messages but I'm not sure what I'm looking at. I see the voltage and percentage, but not sure what the average means exactly, and also what the negative number in parentheses means. Gonna play around with this more.

And I'll charge up to full and post my mah value.
[Nexus One Android Development] RogerPodacter:
Well I only got up to 94% charging then had to go to a meeting. But I'm at 1276 mah at 94%, and 4.089 volts.
[Nexus One Android Development] Marine6680:
So where does Android get the info for the log? :p

And I'm not sure how much I would trust the software's reporting of the battery info/stats. I know how Li-ion batteries work and charge, so I know that anything other than direct monitoring of the power flow in and out is just a best guess.

Li-ion batteries are really amazing things, once you realize the amount of power stored in them. I have a set of 2 cell 5000mah packs that can output 120 amps constant and bursts of over 150 amps without problems. If one was to explode from over charge, it would be bad. I have seen the power dumped from a damaged cell first hand, it was pretty spectacular.
[Nexus One Android Development] jtz100:
I have the same problem my nexusone is dieing at around 10%/15% and yes it is a good idear to drain the battery But some of us do not have the time to do that or its just inconvenient the last few months my phone has been dieing around 1am after a full day of work this piss me off due to some nights i will be finishing work at 4/5am all depends on how long the club is open so we all nead to find a way to solve this problem cos the only phone out atm that has good battery life is iphone **** THat
[Nexus One Android Development] chowlala:
I hit 100% at about 4.136 or something like that when it's plugged in.

But if I turn off the phone, it's gone up to 4.172 sortish. I haven't really recorded any figures, but will do so over the next few days and report back here.

OS Monitor logs how much battery is being used and I think the avg reported is the avg discharge rate over "x since unplugged". So it tells you how much you're using the phone, but not what is eating it up.

It would be a good way for us to report how we use our phones though instead of the OWOW light/medium/heavy, etc. Haha. Like when we report, we can just say what's the avg I guess? That'd give us some figures to play with perhaps.
[Nexus One Android Development] DarkDvr:
Yep, we need a standardized test. Something that's easy to perform, something that has the least amount of variables (independent of widgets/os build/calls/signal strength).... some kind of a specially-build recovery-mode with battery meter?