yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] somline:
I have a question:

You do the bump at < 70mAh to e.g. 200mAh to get the calibration mode easily before shutdown. You also set AE to 3201mV.

Do you do this also on regular use to get some extra "reserve"?

Why would the device not shutdown early (on regular usage) because you set the AE to 3201mV?

I understand to set the top charging current to <20mA to get some extra mAh.

Thanks in advance
[Nexus One Android Development] RogerPodacter:
yes these are 2 seperate issues in a way. the first one you are correct, we do a setreg 0x10 03 at <70mAh because the nexus one shuts down if the mAh goes to zero. in addition let's propose the user is trying to hit learn flag, and they make a second attempt because the first try was unsuccessful. well now on this second attempt, the mAh gets reset and starts at zero. so it then becomes a race to drain to AEvolt and zero mAh. bumping up the ACR guarantees that only AEvolt will be reached and thus ensuring learn flag, where if zero mAh is reached the learn flag does not always turn on. hope i explained that well.

the second topic is lowering AEvolt down to 3201 simply to get some extra reserve juice, nothing more. we can just as easily stay at 3416 and hit learn mode just the same, but we tried to squeeze out some extra capacity. we first tried 3.006 volts as AE point, but it dropped so fast that there was no significant gains. so we split the difference and settled on a middle ground, about 3201 volts. EDIT: the reason we dont get shut down is because the nexus only shuts down upon AEvolt being reached. we do not have an additional power config utility like the palm pre does. so by lowering AEvolt we effectivley lower (expand) the battery range. we had one user (dvgrhl) go all the way down to 2.5 volts, but this is not safe and not recommended! it was an accident actually. the lowest i've gone during testing was 2.9 volts, and didn't want to try any lower. it goes too fast anyway at that point to be usable.

for the first topic, just think of it this way. when a user's battery dies early, like at 15%, it is typically very easy for them to hit learn flag because the AEvolt is ALWAYS reached prior to ever reaching zero mAh. artifically bumping up the ACR (reg 0x10) simulates a die-early condition, if that makes sense. just bump up the mAh gives a little breathing room to ensure AEvolt is definitely reached rather than empty mAh which would cause shut down but without the learn flag turning on.
[Nexus One Android Development] somline:
Thanks for the extreme fast response.

I understand how you make the calibration easier and more stable.

I think my question is "what is the sign for the OS to shutdown".

What I understand, on android it's the mAh go to 0 and has nothing to do with AEv?

So if your app is not running (regular usage) it makes no difference that you changed the AE to 3,2V?

I'm not sure how it is on webOS but will find out soon.
[Nexus One Android Development] temasek:
My limited understanding,

Either you hit AEv point or mAh almost 0, phone will auto shutdown. By performing a learn cycle, what I observed was we are trying to hit AEv about the time mAh almost 0. After a learn cycle it is achievable now. I am able to drain my battery from 100% to 0% with my mAh almost drained flat while hitting my AEv before it shutdown.
[Nexus One Android Development] RogerPodacter:
Actually the nexus shuts down when AEvolt is reached and also if zero mAh is reached, either one triggers shut down. It doesn't matter if our app is running at all, this is something the OS driver handles.

I've even set AEvolt to 3.9volts just to practice hitting the learn flag and then the phone shuts down there haha. Of course I change it right back.

I believe that the battery itself is sending a shut down message at AEvolt, but I'm not sure. All I know is there is no shut down point stored anywhere in the driver or phone. If we change AEvolt, the OS dynamically follows the battery's new point. And it happens instantly. My hunch is the battery sends a shut down message which triggers shut down to the OS.
[Nexus One Android Development] overground:
New 1600mAh

OK. I just got my 1600 from one of the links provided in this thread, so it's probably the same as many others here have purchased. I haven't opened it or put it in my phone yet. Any special steps to take with a new battery? What should I set my full40 at? Thanks, guys.
[Nexus One Android Development] waylo:
Thanks Roger for clarifying another aspect of this great app.

So if I calibrated without changing the aevolt, but now changed it down to the recommended value, my calibration would have to be redone?
[Nexus One Android Development] mtw4991:
Considering that many who have gotten the 1600mAh battery are getting somewhere around 2500mAh out of it, I would set full40 to 2700 and see if it charges that high. If it shuts off charging at, say 2450, and jumps to 100% then you can adjust full40 to 2500mAh. It it goes past 2700mAh, then just bump up the full40 along the way.

Edit: still waiting on my 1600 from Hong Kong...said it shipped on the 9th/10th and to allow 5-14 days not counting weekends :-(
[Nexus One Android Development] mtw4991:
Yep, for your next learn cycle. We recommend doing a couple of learn cycles just to make sure. I just leave full40 to 1452 and AEv to 3201 for my stock battery.
[Nexus One Android Development] proplaya422:
I'm having issues with the setreg part. I'm using ES file explorer. I get to setreg and click open as text, click es note editor, and then I get this message: "Error occured when getting file content: setreg" Any ideas on what I'm doing wrong?
[Nexus One Android Development] temasek:
I don't use ES file explorer so cannot comment. You can try Root Explorer, a commonly used tool for root users.
[Nexus One Android Development] RogerPodacter:
I don't know about that file explorer. Setreg will be empty so perhaps it does not handle that situation well?
[Nexus One Android Development] RogerPodacter:
I would take a copy screen shot of your dumpreg stock before changing any values just so you have a record. Then look for full charging going up to 2400mAh or so. If it ones then you may have a similar one that we have. Post your findings...
[Nexus One Android Development] theloginwithnoname:
Correct, it's in one of the data sheets. The terminology is something like: the battery raises an event to the "host" that shutdown needs to occur.
[Nexus One Android Development] Microwave.:
Trying to do my calibration now, just one bit of confusion about this line...

f. you can use the phone normally until charging current drops to <100mA, then put phone into airplane mode so that you don’t get unexpected current draw near the full point and prematurely end the learn cycle

Which is the setting that shows the charging current?

Or is it best to put the phone into airplane mode and leave it for 4 hours as soon as you've plugged the charger in?
[Nexus One Android Development] temasek:
Current (mA)

For starters just turn on airplane mode and go to sleep. :)
[Nexus One Android Development] RogerPodacter:
That is just the regular current mA draw. What happens is near full charge if you place a heavy load on the phone it can briefly drop current to negative which can possibly turn off the learn flag. So It's just good to leave the phone alone once it gets in the high 90's close to finishing full charge.
[Nexus One Android Development] waylo:
Thanks to all the long time posters on this thread, and the app authors, who have been so patient with so many users posting very similar questions.

My experience:

I initially had a successful learn cycle (I think) before the app came out, by simply plugging in the charger right when it was shutting down. Ended up with 85% age.

Then, as a true XDA-er will do, the promise of better things solely from the battery app made me want to tinker more and more!

So as suggested by everyone here, I changed the minimal charge current to <20, changed empty volt to 3.201, changed age back to 100%. Caught the learnflag and plugged it in, and went into airplane mode. Left it alone for 4+ hours.

My first calibration attempt 2 nights ago looked like the first attached screenshot from juiceplotter. Looks like it gets to 89%, then jumps to 100% (I think juiceplotter only polls every so often so that might explain the straight line jump in the graph). Foolishly, I didn't look at any logs. When it was done, also, maybe a big error here, I did not unplug when I manually powered down and back up again. Battery age after this maneuver went back to 94%.

Thinking it'd failed, I tried it again last night. The second attachment is the juiceplotter screen. Looks like the same thing happened, up to 89%, then jumps to 100%. CHGTF was on, battery status registers were 0x81. I did actually look at the logs this time.

I didn't capture the log unfortunately, but it looked essentially like this (copied from another user way back):

12/07/2010 01:20:27 [INFORMATION] batt: 88%, 4197 mV, 21 mA (21 avg), 28.7 C, 1265 mAh
12/07/2010 01:21:18 [INFORMATION] batt: 88%, 4197 mV, 21 mA (20 avg), 28.6 C, 1265 mAh
12/07/2010 01:22:08 [INFORMATION] batt: 88%, 4197 mV, 21 mA (20 avg), 28.6 C, 1265 mAh
12/07/2010 01:22:58 [INFORMATION] batt: 88%, 4197 mV, 20 mA (20 avg), 28.6 C, 1265 mAh
12/07/2010 01:23:48 [INFORMATION] batt: 88%, 4197 mV, 17 mA (20 avg), 28.6 C, 1265 mAh
12/07/2010 01:24:38 [INFORMATION] batt: 88%, 4197 mV, 19 mA (20 avg), 28.6 C, 1265 mAh
12/07/2010 01:25:28 [INFORMATION] batt: 88%, 4197 mV, 19 mA (19 avg), 28.6 C, 1267 mAh
12/07/2010 01:26:18 [INFORMATION] batt: 100%, 4197 mV, 19 mA (19 avg), 28.6 C, 1433 mAh
12/07/2010 01:26:18 [INFORMATION] batt: charging BATTOFF [FULL]

Except you replace the 88% with the 89% I had. This time, I unplugged, and powered down/up. Only the battery age didn't change. Still at 100%.

1. So is this jump normal with a successful learn? Or is this jump exactly what you don't want, what you see with a failed cycle?

2. If this jump is normal, and even though the battery failed to properly set its age after the power down/up, is my age then 89%? Or does the % of battery charge when it jumps have nothing to do with the age?

3. Or did I just have 2 failed cycles?

Thanks.
[Nexus One Android Development] RogerPodacter:
it basically means you failed for both of your learn cycles. the first time when you did it during shut down seems like it worked since age changed to 85%. but anytime the cycle fails it resets to 94%. the jump to full from 88 to 100 is what happens when you NEED to perform a calibration. and once you do the learn cycle the jump to full should no longer happen.

you can approximate your age using the jump to full point, many people have done it. so jumping at 88% roughly means an age of 88%. its not quite exactly correct but a good approximation. you could just try another learn cycle that actually passes, or go ahead and use your age you already know.

start from full charge and drain the battery as much as possible. then when getting close make sure learn detect is on and try for the learn flag. good luck.
[Nexus One Android Development] waylo:
Thanks so much!

Not sure what I can do differently to get it to learn properly (I think I'm following every recommendation I've read on this thread), so I may stick with my approximate learn age of 89% for now =)

Anyone with Wildmonks kernel get their learn to work properly?
[Nexus One Android Development] Nighthound:
Hi, I have a request for the next version of the battery calibrator app. Is it possible to add some fields to do setreg directly from the app? That way we don't need to fiddle with Root Explorer and editing the text file.
[Nexus One Android Development] waylo:
Just received my 1600 battery from HK, probably the same one you ordered off ebay. Ordered 12/16. Arrived a lot quicker than I thought... was supposed to arrive in another 1.5 weeks or so! Hope you're lucky too.

Screenshots are the exact specs when I popped it in. Looks like it's underprovisioned, as has been noted before.

I bumped the full40 to 2700, min charge <20, and plugged in the charger. Let's see what happens...
[Nexus One Android Development] RogerPodacter:
Hope you get good performance out of it. One thing with my 1600 is it came with age set to 100 by default, and it has not once ever changed or set itself to 94 like the stock battery does all the time. So it prob doesn't have that defect. I notice your age is 94 though.
[Nexus One Android Development] RogerPodacter:
We talked about this before so we can perhaps add in the other commonly set registers so we don't have to mess with setreg as much. Let's see what dvgrhl thinks after the break.
[Nexus One Android Development] waylo:
Okay, looks like it finished charging, so here's some data. Screenshots of when it finished are attached. No attempts at learn cycle yet.

Here's the jump after the first charge (no learn attempted):

12/25/2010 16:14:44 [INFORMATION] batt: 28%, 4172 mV, -31 mA (-28 avg), 29.5 C, 715 mAh
12/25/2010 16:15:34 [INFORMATION] batt: 28%, 4177 mV, 24 mA (-9 avg), 29.6 C, 715 mAh
12/25/2010 16:16:24 [INFORMATION] batt: 28%, 4177 mV, 40 mA (30 avg), 29.6 C, 716 mAh
12/25/2010 16:17:14 [INFORMATION] batt: 28%, 4177 mV, 37 mA (31 avg), 29.6 C, 716 mAh
12/25/2010 16:18:04 [INFORMATION] batt: 28%, 4177 mV, 9 mA (19 avg), 29.6 C, 716 mAh
12/25/2010 16:18:54 [INFORMATION] batt: 100%, 4182 mV, 66 mA (10 avg), 29.8 C, 2523 mAh
12/25/2010 16:18:54 [INFORMATION] batt: charging BATTOFF [FULL]
12/25/2010 16:19:44 [INFORMATION] batt: 100%, 4172 mV, -1 mA (-1 avg), 29.6 C, 2523 mAh
12/25/2010 16:20:35 [INFORMATION] batt: 100%, 4172 mV, -1 mA (-1 avg), 29.6 C, 2523 mAh
12/25/2010 16:20:55 [INFORMATION] batt: Full40 mAh capacity is: 2700 mAh
12/25/2010 16:21:07 [INFORMATION] batt: Full40 mAh capacity is: 2700 mAh
12/25/2010 16:21:25 [INFORMATION] batt: 100%, 4172 mV, -1 mA (-1 avg), 29.8 C, 2523 mAh
12/25/2010 16:21:44 [INFORMATION] batt: Full40 mAh capacity is: 2700 mAh
12/25/2010 16:22:15 [INFORMATION] batt: 100%, 4172 mV, -1 mA (-1 avg), 29.8 C, 2523 mAh

So more basic questions:

1. I obviously am missing a very basic point here--so a battery cannot accurately report true mAh until after it's fully charged? Or calibrated? Or does it assume the full mah = age*full40, whether or not that's true?

2. Interestingly, UVF and PORF registers are ON. I read some info about that from the other battery calibration thread. Any significance?

3. To do a proper learn, I should change age to 100%, THEN CHARGE FULLY, then drain? If the charging fully part is key, I think that may be where I've been failing, whereas previously I changed age to 100% on a half full battery and then drained.

HAPPY HOLIDAYS ALL!
[Nexus One Android Development] RogerPodacter:
from your log you posted, it looks like you may not have one of the super high 1600 batteries. but its hard to tell without the full log. you made it to about 28% and then it jumped. the question is how far down did you drain it before this charge.

what needs to be done is drain it and it has to hit AEvolt. this is the only way to ensure it starts at the absolute bottom, and then from there charge to full and look for the jump. the only reason i say this is because i dont know if when you started your full charge, was mAh at or near zero? cause it looks like you only got 710mAh in that battery before it jumped and hit full charge. that doesnt seem right.

so i would actually use the app, turn on learn detect, and drain it empty. let the ACR write function do its thing if necessary, and when the learn flag turns on, plug in and start your charge. it doesnt matter if you complete the learn cycle or not, so dont worry if it turns off or fails half way. you just need it to help you hit your absolute empty point.

then see where it jumps to full from there.

but also yes to answer one of your questions, its ok to change age at any point. but when you changed it at 50%, then drained to empty, it caused your mAh and voltage to become misaligned, which is normal but needs to be fixed. hitting either full point or empty volt re-aligns them, but i think that is what threw off your logs. so just do the drain to empty thing, use the app, then charge and take logs once in a while. at the beginning, then at near the end.
[Nexus One Android Development] waylo:
Thanks again. I think it was essentially completely drained when i put the battery in because the phone booted and then essentially shut down right away.

But then again I hadn't changed the aevolt. So you're right, I did end up changing a lot of parameters right in the middle of the charge.

I was a bit concerned about the really low 700mah before the jump, but as you said there's no telling until I get it drained and charged. I'd be somewhat upset though if my max capability was in that range.

Will post the updates.
[Nexus One Android Development] RogerPodacter:
i've been experimenting with the app and was wondering if anyone thinks it would be helpful to have any type of either statistics or graphing? here are some screen shots of some graphs that i managed to get working. obviously a work in progress, but i'm not sure how useful they would be. these are real time about every 2 seconds. so it would need to be turned into a service to run in the background to be more useful. we could maybe have one real time graph function, then one long term graph function, i.e. hours or days polling maybe once every few minutes or longer.

also i thought it might be good to track rate of mAh depletion, like how fast your mAh drops doing certain things. but to all the engineers out there, isn't rate of mAh basically just mA? so mA-hour/hour just cancels out to mA, doesnt it? i'm not quite sure.

any suggestions on what would be good to graph and/or track? attached is just voltage and current, real time 2 second polling. i think dvgrhl has some logging going. perhaps we could use his logged data somehow...
[Nexus One Android Development] RogerPodacter:
oh ok, so basically you got the new battery and immediately did the charge to full? so you popped it in, it was very low and shut down on its own. that still may have been a false shut down, so try the stuff i said in previous post.

one thing i've noticed, when i charge my battery full and then take it out of the phone for backup. if i dont use it for a few weeks, then pop it in the phone, the volt is still around 4 volt, but the mAh somehow dropped by near half. no idea why. so its possible your first shut down from the new battery was because mAh was artificially low from sitting around for weeks or months. you'll see soon enough from your drain with the app, which should ensure you dont run out of mAh and hit AEvolt (with the ACR setting on).
[Nexus One Android Development] djn541:
I am just now doing my first learn cycle with the new 1600 battery. I haven't read the thread in a couple weeks. I see that some are getting 2500 out of it? I will do another learn cycle tomorrow with higher expectations and report back. Good work devs!:D
[Nexus One Android Development] waylo:
Hmm, that does look pretty useful, if nothing else for troubleshooting these learn cycles. The only thing I've seen that resembles that is juiceplotter, and that logs only batt%, not the more useful stats like mA or voltage. Maybe a log that begins with the learn cycle so that it can be checked afterwards? Though wouldn't that logging potentially trip a higher mA usage in the >80-90% part of the cycle and potentially kill the learn flag?
[Nexus One Android Development] gxh:
I got my 1600mAh battery from htcrepairparts and I finished two learn cycles. First I was optimistic and set the Full40 mAh to 2400, but left the min charge current and empty volt the default. I ended up with 1472mAh. I then changed the Full40 to 1600, reduced the empty volt slightly and min charge current to 40mA and ended up with 1515mAh and 96% age. Better then the stock battery, but no where near the 2400mAh.

I am running now with Gingerbread and I don't have a kernel with the battery modifications. So no more learn cycles for now. But looking at the current the phone uses during standby I expect much better runtime. It is around 10mA now, before with CM 6 it was around 50mA. So I am staying with GB for now.
[Nexus One Android Development] RogerPodacter:
hmmm thats where i got my 1600 from; they must have different ones for sale. my theory on the 2400 is that it is only a current calibration issue showing higher mAh, but really its the same capacity. too bad you're on a diffreent kernel but next time take a screen shot of your dumpreg and we can look at the offset registers to compare and see if its calibrated differently. regardless i definitely see increased usable capacity with these 1600 batteries over stock. so i absolutely think its worth it especially considering it fits with the stock cover.
[Nexus One Android Development] RogerPodacter:
that's just it, i've been looking for months for something that graphs volt vs current vs mAh, and have not found anything that does it. the closest i've got is purchasing battery monitor widget from the market which does show current and volt, but its not quite what i wanted as it shows days at a time. be nice to narrow in to see at a closer scale.

its cool to see it working actually. for example if i have my wifi on and then leave the area, when it switches over to 3g you can see the current spike very high during the transfer/connection. and even more interesting is that when i'm out during the day on 3g, with the phone idle, you can see high spikes all the time when an email comes in or some data task takes place in the background. these things spike the current draw very high. but at home on wifi, its dead flat the whole time, even when you receive the same email etc.

its kinda cool but not sure how useful it would really be? would be nice if i set it up so you can set your poll time to whatever you want. so enter 5 seconds in the box and it polls that fast for troubleshooting stuff. then enter like 10 minutes and let it go for long term usage capture.

you're right for learn mode we'd have to test how much CPU strain it puts on the phone. so far it doesnt seem to bad, but maybe i'll run some tests...