yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] waylo:
So I did a proper drain and charge with my new 1600 battery. Here are the logs from the beginning and end.

The mah and voltage were very miscalibrated from my first charge. I still "had" 976mah when the aevolt was hit.

12/26/2010 11:11:31 [INFORMATION] batt: 37%, 3346 mV, -308 mA (-479 avg), 27.3 C, 995 mA
12/26/2010 11:12:21 [INFORMATION] batt: 37%, 3337 mV, -252 mA (-262 avg), 27.3 C, 992 mA
12/26/2010 11:13:11 [INFORMATION] batt: 37%, 3317 mV, -268 mA (-266 avg), 27.3 C, 987 mA
12/26/2010 11:14:01 [INFORMATION] batt: 37%, 3273 mV, -262 mA (-244 avg), 27.3 C, 984 mA
12/26/2010 11:14:51 [INFORMATION] batt: 37%, 3268 mV, -234 mA (-254 avg), 27.3 C, 980 mA
12/26/2010 11:15:41 [INFORMATION] batt: 36%, 3234 mV, -255 mA (-262 avg), 27.3 C, 976 mA
12/26/2010 11:16:11 [INFORMATION] batt: charging FAST
12/26/2010 11:16:31 [INFORMATION] batt: 0%, 3449 mV, 881 mA (-260 avg), 27.8 C, 1 mAh
12/26/2010 11:17:21 [INFORMATION] batt: 0%, 3547 mV, 894 mA (848 avg), 28.3 C, 16 mAh
12/26/2010 11:18:12 [INFORMATION] batt: 1%, 3615 mV, 884 mA (870 avg), 28.6 C, 28 mAh
12/26/2010 11:19:02 [INFORMATION] batt: 2%, 3684 mV, 903 mA (896 avg), 28.8 C, 41 mAh
12/26/2010 11:19:52 [INFORMATION] batt: 2%, 3737 mV, 971 mA (924 avg), 28.8 C, 54 mAh
12/26/2010 11:20:42 [INFORMATION] batt: 2%, 3767 mV, 979 mA (977 avg), 28.8 C, 67 mAh
12/26/2010 11:21:32 [INFORMATION] batt: 3%, 3786 mV, 976 mA (979 avg), 29.0 C, 83 mAh
12/26/2010 11:22:22 [INFORMATION] batt: 4%, 3801 mV, 978 mA (978 avg), 29.1 C, 97 mAh
12/26/2010 11:23:12 [INFORMATION] batt: 4%, 3811 mV, 978 mA (978 avg), 29.2 C, 110 mA
12/26/2010 11:24:03 [INFORMATION] batt: 4%, 3791 mV, 659 mA (900 avg), 29.3 C, 124 mAh
12/26/2010 11:24:53 [INFORMATION] batt: 5%, 3815 mV, 919 mA (770 avg), 29.8 C, 134 mAh

At the end of the cycle:

12/26/2010 14:30:07 [INFORMATION] batt: 58%, 4192 mV, 25 mA (25 avg), 26.1 C, 1542 mA
12/26/2010 14:30:57 [INFORMATION] batt: 58%, 4192 mV, 23 mA (24 avg), 26.1 C, 1542 mA
12/26/2010 14:31:47 [INFORMATION] batt: 58%, 4192 mV, 24 mA (24 avg), 26.1 C, 1544 mA
12/26/2010 14:32:37 [INFORMATION] batt: 58%, 4192 mV, 23 mA (22 avg), 26.1 C, 1544 mA
12/26/2010 14:33:27 [INFORMATION] batt: 58%, 4192 mV, 23 mA (23 avg), 26.1 C, 1544 mA
12/26/2010 14:34:17 [INFORMATION] batt: 58%, 4192 mV, 22 mA (22 avg), 26.1 C, 1544 mA
12/26/2010 14:35:08 [INFORMATION] batt: 58%, 4192 mV, 22 mA (21 avg), 26.1 C, 1545 mA
12/26/2010 14:35:58 [INFORMATION] batt: 58%, 4182 mV, 20 mA (21 avg), 26.1 C, 1545 mA
12/26/2010 14:36:23 [INFORMATION] batt: Full40 mAh capacity is: 2700 mAh
12/26/2010 14:36:45 [INFORMATION] batt: Full40 mAh capacity is: 2700 mAh
12/26/2010 14:36:48 [INFORMATION] batt: 100%, 4187 mV, -11 mA (6 avg), 26.1 C, 2657 mAh
12/26/2010 14:36:48 [INFORMATION] batt: charging BATTOFF [FULL]

So it looks like I can get about 1545mA out of this battery, which is what I think we'd expect out of the 1600 advertised.

I'm setting the full40 to 1600 and my battery age to ~97%, might do a real learn cycle later. (The learnflag was on during this run, but I stupidly changed the battery stats before thinking to power on/off. Oh well).
[Nexus One Android Development] RogerPodacter:
Nice that looks pretty good. I'm actually interested in seeing if I can adjust my 1600 to read properly. Could you post a screen shot of your dumpreg and I'll try to use your settings and see how it goes? Thanks:-)
[Nexus One Android Development] Microwave.:
Did my first learn cycle yesterday, I thought it had worked because the battery age showed 100% but then it died at 14% and showed 94% battery age on the reboot :(

Now I'm trying to do it again. It gets to 3200mv then dies, BEFORE showing the learn mode message.

Is it possible to activate learn mode without the message showing up? By pressing the LEARNF button?

Thanks

(I made all the necessary changes to the setreg file).
[Nexus One Android Development] mtw4991:
just got my 1600mAh battery from HK like Temasek....FINALLY! Took almost 3 weeks but charging now...it arrived with just enough juice for 1 boot, lol. Hope it's as good as the others:)
[Nexus One Android Development] mtw4991:
Make sure you have ACR Adjustment box checked in settings and have enough apps in use to keep current above -200mA or learn mode won't be triggered. Pressing the LearnF button does nothing to start learn mode.
[Nexus One Android Development] chowlala:
Alright. Just got my battery from Hong Kong. :)

Will do my setup tonight.

Any additional advice? :)
[Nexus One Android Development] temasek:
Pray its an under-rated one :D
[Nexus One Android Development] chowlala:
3200 mAh!!! w00t!!!
[Nexus One Android Development] temasek:
WTF ???!!!!????

temasek - 2500mAh

Roger - 2550mAh

chowlala - 3200mAH

ARRRRGGGGGGGGGGGGGGGGGGGG :mad::mad::mad:
[Nexus One Android Development] mtw4991:
I charged my new battery using 2500 as the full 40 and it got to 2452 but jumped from 73%>100% which means somewhere around 1825mAh. Gonna drain and do a proper learn cycle and see what this sucker really has in it.!

EDIT: changed the full40 to 3500 to see if it would take more...charged to 2396@70% then jumped to 100%...so is it a 2400mAh or what, lol. Gotta drain completely and do a learn...got confused, lol
[Nexus One Android Development] waylo:
Yeah gotta drain completely and then do the learn. But you already know that :)

My mAh was miscalibrated each time I had the Full40 set too high. And unless a full drain is done it just gets compounded.

After a couple of tries mine ended up with 1545 mAh. Meh. So much for subverting of the laws of thermodynamics.
[Nexus One Android Development] chowlala:
HahHAHAHAhahAHAHa.

I'm just kidding. LAWLLLLLLLL!

I just plugged in the battery.

Currently shows:

Full40 = 1452 mAh

Age = 94% (I turned on the phone without plugging in and when it booted it died, rofl)

Empty Volt = 3.416

I should do a plain charge up is it?

Edit:

Ok, just decided to set Full40 at 3000, AEvolt at 3201, Age at 100%. Here we go. =) Learnmode GOGOGO!
[Nexus One Android Development] RogerPodacter:
Yeah just do a regular charge and pay attention near the top to see if its gonna blow by your full40 or if it looks to be near completion. That's how I did it, and kept bumping up my full40 bit by bit.

I honestly think we all just have different offset values which is why some of us have super high mAh readings. Since I added graphing you will truly see this as your current draw will hit up over 1200mA, but with properly set offset you will only see highest 800mA.

And dvgrhl added some logging so I think we can bring these 2 together into a nice utility. I'm looking into turning it into a service today, so it can be a running monitor type utility. But will have to test how CPU and battery performance is with it. From running similar apps like CPUstatusled, that doesn't seem to cause any problems, so we should be good to go.
[Nexus One Android Development] gxh:
I found a kernel under GB that has the required changes. So I did another learn cycle - again ended up with 96% with a Full40 of 1600mAh.

This is my dumpreg. Maybe you can figure out from there if we have different offset values.

bash-3.2# cat dumpreg

00: 4f 07 02 e7 02 f1 4e 4e f9 eb 1f c0 65 20 f8 93
10: 0e 55 ad d0 7b 7a 7f ee 01 94 00 48 ff ff ff 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 42 ff 0d 11 d2 0c a4 0f 07 43 0f 00 01 0d 0c 3a
70: 0a 0d 1d 19 04 07 04 06 04 0a 00 ed 1e 14 0a 1d
b0: 00 00

I am really looking forward to the graphing and logging included into the the Calibration app. I am using Battery Monitor Widget Pro at the moment, but it is missing some information.
[Nexus One Android Development] RogerPodacter:
Yeah I bought that widget too, its the closest out there but missing some things. So we can add whatever you guys request to display the graph. I think we should do two, one real time, and one long term, volt, current and mAh.

So the offset idea I'm looking at either reg 0x78/79, or 0x7a or 0x7b. I think one or all of these make some kind of difference in how fast current is measured thru the resistor, but I don't know what yet exactly.

Yours for example is 04/1a, 00 and ed. But mine is 04/09, 00 and ea.

That's good that ginger bread ROMs still work. No reason not to long as the driver hasn't changed.
[Nexus One Android Development] chowlala:
Ok.

So first charge up. Max was at 1453 mAh.

Meh.

And having a real tough time draining this battery! Won't dip below 3500 mV!!
[Nexus One Android Development] RogerPodacter:
That's exactly how mine was. Took forever to drain below 3.5volts.

So what was your full40? Seems strange you didn't at least hit 1600.
[Nexus One Android Development] chowlala:
I never hit learn mode.

Will try tonight. But seems my battery is 1450 capacity. Just hit 1452 mAh and jumped to 100% again. Sigh. Looks like me battery is just regular stock. Not even 1600! Wtf.
[Nexus One Android Development] mtw4991:
I did a proper learn overnight last nite from "dead" 0%. Charged a bit, got into learn mode. fyi, Set full40 to 2550(just in case:p), AEv to 3201, age to 100%, min charge current <20mA. Started charging at 12:45am at 2% learnf set. Finished charging at 4:50am after running 2 consecutive current readings of 19mA. Jumped from 61% to 100%.

So, 61% of 2550mAh is equal to 1555mAh:(, not even 1600.

The funny thing is after reviewing the above stats, I changed the full40 to 2395 and age to 65%(lowest available). This should equal 1557mAh and reset the Percent(%) indicator I think. After rebooting, it is still at 100% after 3.5 hours and Capacity(mAh) shows 2227mAh with Voltage(mV) at 3977. I don't know why the % is still at 100% even though capacity is much less than that??
[Nexus One Android Development] temasek:
I believe your battery will die very early, possibly at high 30s%

You may have yourself a real 1600mAh rated battery.
[Nexus One Android Development] waylo:
I think he and I have the same battery from the same seller. I have 1545 mAh. Too bad most of the time you get what you pay for!
[Nexus One Android Development] mtw4991:
I agree with both...meh, but it's better than my stock battery gets at 1275mAh:) Not too shabby for $14 from HK, lol.
[Nexus One Android Development] harunjo:
I tried with my backup battery yoobao (1350 mah) set it to 2000 mAh full..but it only last for 10 hours with moderate use..

got an idea to try momax battery..last time i have a momax battery the performance was poor on my moto milestone..

is it momax battery worth to try or not? Please advice..

how about sedio 1600 mAh?

or mugen 1600 mAh?

http://www.mugen-power-batteries.co...one-1600mah-extended-replacement-battery.html

http://cgi.ebay.com/SEIDIO-EXTENDED...543705?pt=PDA_Accessories&hash=item5d2c7ffc59

http://shop.momax.net/index.php?p=6&id=3330&new=&cat2=439&cat1=1&cat0=1&lang=en
[Nexus One Android Development] RogerPodacter:
That seems strange. So if you got a jump to full to 1452 then wouldn't that mean your actual capacity is LESS than 1452? Seems like that would be even worse. I don't get it.

Oh I see see, it jumped to your full40 point AT 1452. Damn dude I dunno.
[Nexus One Android Development] RogerPodacter:
I was just about to say the same thing, its still better than stock since the best we've seen with stock is 1300mAh.

But still, my gut says that we all have the same 1600 capacity, and if you guys were to setreg our identical values to your battery, you would get the same over inflated capacity readings.

It's actually giving me a dilemma on how to release our graphing in the app. Cause if I use stock battery, the y axis range never goes above 800mA. But with my inflated 1600, the y axis goes to 1200mA. So I want to make the same y axis range for everybody to maximize the view. But these discrepancies are making it difficult. I'll have to see about making the y axis range variable.
[Nexus One Android Development] RogerPodacter:
Yeah I'd like to see either of those batteries. I don't think we've seen a seido or mugen 1600 yet, have we?
[Nexus One Android Development] gxh:
So if I understand you correctly, you are saying that batteries can be programmed with the wrong offset value. If I remember that correctly this was a value that defines the measurement resistor in the battery.

So for batteries that have the resistor set at the correct value, the mA reading will be correct. If you set that value to the wrong value, the mA reading will be always higher (or lower) by that factor. Consequently the mAh reading achieved during a learn cycle is much higher (or lower). It is obviously possible t

hat the battery manufacturer really use different resistors and that the offset value needs to be set differently - but for the same load on the phone, both batteries should show the same mA reading then.

That means the achieved mAh value is basically meaningless to compare if the offset values are wrong.

So I think it would be a good idea to show that offset value in the calibration application, so we can easily compare that value between people with different batteries.

I have posted my dumpreg of my htcreparparts 1600mAh battery in post #887:

http://xdaforums.com/showpost.php?p=10142515&postcount=887

Did you manage to compare yours with mine?

I really need to compare the stock battery with my 1600mAh battery. It should be possible to find a certain load and then see if the mAh reading between the two batteries is the same.

So the important thing seems to be that we find a reliable way to compare batteries. I never quite believed the claim of 2400mAh real capacity in a stock housing - the laws of physics seem to get in the way here. Wrongly programmed batteries make much more sense :-)

Maybe the loading current is actually a good indicator - with the stock power supply the loading current right at the start of the charging cycle on an empty battery should be roughly the same between batteries, right?

When you have implemented logging and graphing in the calibration application it starts to be easier for people to compare the results...
[Nexus One Android Development] mtw4991:
during my learn mode while charging, the charging current had a high of 960mA starting at 6%-32% then declined from there, fwiw.
[Nexus One Android Development] RogerPodacter:
Yeah that is about dead on correct for what its supposed to be for stock batteries from everything we've seen.
[Nexus One Android Development] RogerPodacter:
Yeah you're basically right on. It's not so much deception by them using the wrong offset values, I think its just extra testing that needs to be done to the specific packs upon initial setup. And some companies just don't have the equipment to do it, or just don't care to do it, i e cheaper companies have less resources etc.

I compared your hex numbers to mine. But I didn't crunch the actual equations, so all we know is that our numbers are different. I'm out of the office all week so I've been lazy. But the pdf called storing fuel gauge parameters for the ds2784 has the info. Towards the end, reg 0x78/79, 7a and 7b. These are the ones in question in my opinion.

In the end it really doesn't matter, as long as we use the maximum capacity regardless of how current is measured thru the sense resistor. If my offset inflates readings to 2400mAh, but with higher current readings. That's equivalent to 1600 with lower current readings. It equals out just as long as we use the full range. Though it would be nice to standardize everything.

I feel bad for the general public who aren't in this loop and are using broken batteries technically. Across other devices too.
[Nexus One Android Development] gxh:
I completely agree with you - if you have done a learn cycle your battery percentage will be accurate. But what I assumed until now is that I can trust the mA readings and that I can compare the mAh readings between batteries. It looks like that we can not. If the measurement resistor is calibrated wrongly, all these mAh values are just wrong. So comparing batteries between manufactures based on what we see in the mAh reading could be just misleading.

I had another look at the dumpreg output:

This is my new 1600mAh battery:

00: 4f 07 01 79 01 81 27 28 1e ef 25 c0 63 c0 1d 34
10: 01 66 64 40 7b 7a 7f f2 01 6c 00 38 ff ff ff 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 42 ff 0d 11 d2 0c a4 0f 07 43 0f 00 01 0d 0c 3a
70: 0a 0d 1d 19 04 07 04 06 04 0a 00 ed 1e 14 0a 1d
b0: 00 00

And this is my stock battery:

00: 0f 01 03 11 03 19 5c 5c f5 1d 21 e0 69 a0 f6 b0
10: 0b f7 9f 90 79 78 7f f0 01 80 00 40 ff ff ff 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 42 ff 0d 10 d2 06 a4 0f 07 43 0d 9d 01 0e 0c 3a
70: 0a 0d 1d 1a 04 08 05 07 04 16 03 fd 1e 14 0a 1d
b0: 00 00

So I think the relevant registers for the current measurement are:

Current Offset Bias (COB) in register 7Bh:

The highest level bit is the sign:

new: 0xed = 11101101 that is -109uV

stock: 0xfd = 11111101 that is -125uV

Current Measurement Calibration in register 78h/79h

The value needs to multiplied by 2^-10=0.000976562

new: 0x040a that gives a gain of 1.00967

stock: 0x0416 that gives a gain of 1.02148

Sense Resistor Temperature Compensation in register 7Ah:

Needs to be multiplied by 30.5ppm/degC

new: 0x00

stock: 0x03

I don't think that would make a relevant difference.

Would be interesting to compare these values to other batteries.

I have tried to find a reliable way to compare my two batteries and see if the report the same mA readings for the same load. I have not really found a way to do that yet. I guess they are close enough. My guess is that your >2400mAh battery should show a significant difference.

So for now it looks like you have to treat each battery differently when you are planning to log and graph the data. It would be nice to be able to detect which battery is in the device and record that somehow in the log file.
[Nexus One Android Development] RogerPodacter:
yeah nice work, you got the important equations there. i too dont think the temperature compensation matters for what we're looking at.

for a baseline of current draw, i've tried various scenarios. for example i've taken log exports of long periods of device idle time, taken logs of charging on wall power, a full white screen, full black screen, etc. after a while you see basic trends, averages really, which is the closest we'll probably get. but really there is no way we can be sure. we could just set offset to stock value for all our batteries all the time no matter what...

my hunch is that the seido and mugen batteries are probably more legitimately setup vs the no name ones we've been buying. but i'd bet that both actual cells are just as good physically/chemically. just the setup gone into the big brands has more accuracy.

the only problem right now with the graphing in the app is its not yet running in the background. tonight i started a service to run in the background but i'm still trying set it up. it would definitely help you to go do a few different tasks, and see the power used for each task and get an average. for now (probably only temporary) i have a text field where you can enter any number you want as the sample poll for updating the graph. so you can enter 2 seconds, 5 seconds, any number you want really based on how you want it to poll. but this probably isnt a good approach to release in a final version. it was more for testing.

maybe i should add in your offset registers into the first tab so we see for each battery what the gain, offset, etc values are. also we should probably add in a few more setreg commands to the second tab since some requested that we dont have to mess with setreg. and finally maybe i should add a third graph for mAh depletion to see how fast we burn thru mAh. i think dvgrhl's logging is really gonna be key for this stuff too.
[Nexus One Android Development] chowlala:
Here's what's even weirder, this morning on my third charge, the charging didn't hit any jumps. And it went all the way up to 1590 mAh this time. No jumps or hops. So now I'm pretty confused.

Not sure if it's due to the lack of learn, or if this steady climb all the way without jump is already DUE to the jump prior to this?
[Nexus One Android Development] bimasakti85:
I cant find setreg in my d2.....battery folder. Somebody knows about this ?
[Nexus One Android Development] dvgrhl:
What do you mean by "d2"? What kernel are you running?
[Nexus One Android Development] mtw4991:
on my new 1600mAh battery, I got into learn mode and status register showed 0x77 with learnf on and popup. After 30-40 minutes, the learnf flag turned off and the status register shows 0x07...did learn mode kick out or is it still in learn mode?

don't want to charge for another 2 hours if it's not in learn mode:(
[Nexus One Android Development] dvgrhl:
Unfortunately if the learn flag turns off then learn mode failed. Have to give it another shot.
[Nexus One Android Development] chowlala:
Ok.

Now I'm mega confused.

This morning, I set my Full40 at 1600.

During the charging, it jumped at 1450. This would be the actual max capacity.

Middle of the day, I decide to do a mid charge. The charging goes all the way up to 1600 progressively. Meaning, the phone should die at with approximately 150 mAh left. Roughly.

But when I saw the charging move up all the way to 1600. I bumped it to 1750 for some reason which I don't understand why I did so.

Phone jumped at about 1600. Which means, phone should die at approximately 250 mAh.

I'm not sure what happened. But I was draining the battery to get to Learn Mode.

I pushed it all the way till 200 mAh before hitting Learn Mode.

Now I'm not sure what the battery is rated at. It's a tough nut I'll give you that for sure. Battery is harder to drain than stock from what I see. I mean I played like 6 hours worth of games non stop to drain it from 40% > Learn Mode. That's nuts.

I emailed the seller though, complaining the battery isn't 1600 mAh rated. Let's see what the Learn Mode says. I set Full40 at 3000 so that it'll be easier for me to calculate. 1450 mAh means my battery age should be 49 or 50 by the time morning comes.
[Nexus One Android Development] RogerPodacter:
I forgot this, when you did your first charge to determine your full40, did you make sure You hit the learn flag before starting the charge? That is key cause remember you want to start at the lowest possible point where empty volt and mAh turn to zero, which is learn flag.

It doesn't matter that the learn flag stays on after that, you're not doing a learn a cycle per se. You just are trying to determine your full40.

If you don't hit learn flag to do this, then your mAh won't be lined up correctly to discover your true full40. Hope this makes sense.
[Nexus One Android Development] mtw4991:
So does the learnf flag have to stay on the entire time or not? :confused:
[Nexus One Android Development] RogerPodacter:
Yes nor you, if you are doing a learn cycle then the flag must stay on the whole time for it to work. But for chow, he just needs to determine his full40 manually but to do that his full charge must start at true empty point, and the only way to truly get there is to hit the learn flag. Once he does that, for his purposes, he can just charge to full watching his mAh near the top. It doesn't matter if the flag stays on for his unique scenario.
[Nexus One Android Development] mtw4991:
Ok, that's what I thought also. Guess I lost learn, but just now finished charging on USB (slow as hell, took 6 hrs!) and went from learnf on (absolute zero) to 1582mAh or 99%. Upon pwrOFF/pwrON, age reset to 94%. Will remember my wall charger tomorrow and do airplane mode like I normally do for my next learn cycle. New 1600mAh batt, btw.
[Nexus One Android Development] bimasakti85:
Changed my kernel to the latest wildmonks. I've started the app, and said waiting to reach 3201 mv. But, the learnf toggle never turn on, even when it already reach 3201 or below it,and after that my phone would shut down. Could somebody assist me ?
[Nexus One Android Development] RogerPodacter:
Did you make sure to enable acr adjustment in the settings menu first? Give it another shot with that.
[Nexus One Android Development] mtw4991:
^^what roger said plus make sure you have enough apps open and running to keep current above -200mA or else learnf won't turn on.