yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] chowlala:
I missed it. But weird part now is. After learn. My full40 is 3000. Age is 100. But max capacity is 1492. I'm quite bogged. Is there a way to flush the battery memory? I'm sure there should be a way to restart all over again.
[Nexus One Android Development] temasek:
Okay I tell u what I actually did.

1. Received my new 1600mAh battery and found to be full40 1452mAh.

2. Retain the full40 1452mAh and performed a learn cycle using that.

3. Prepare for next test, ie capacity test (what I called it :) )

4. Maintain full40 1452mAh

5. Start learn cycle

6. Monitor the capacity in real-time when it capacity near 1400mAh

7. I saw my capacity exceeded 1452mAh and continued to climb till 2450++mAh (can't remember). It was at 99% charge.

8. When it hit 100% charge, learnf turned off and capacity drop from 2450++ to 1440 (+/- lol can't remember again).

So what I did was 2 learn cycle test.

- 1st let it performed a proper learn cycle

- 2nd test to monitor the capacity. For me I did a real-time monitoring, but I think you can use apps log to view the capacity.

When it hit 2450mAh, I reackon my real full40 should be around 2500mAh. So I perform another learn cycle with full40 2500mAh and BANG successful.

For your info.
[Nexus One Android Development] waylo:
I didn't find a way to flush the battery memory. Every time I switched batteries in and out, the same mAh would return. So I think you're stuck draining and recalibrating each time.
[Nexus One Android Development] temasek:
Nah, perhaps for now when switching batteries you have to manually change the registers like age, full40, AEv, min volt charge. No need to recalibrate if you still remember your battery register values.

I think Roger and dvgrhl have plans to incorporate options like remembering your batteries variables so that when changing batteries, you can use the battery app to just press a button and your battery is set for its correct registers.
[Nexus One Android Development] bimasakti85:
I've activated those 2 option just as you said in the tutorial.my current also at around -130.it's still above -200,didnt it?so,which part i'm missing?
[Nexus One Android Development] temasek:
To start learn cycle, draw current must be above 200mA, that means in the battery app it will show as -200mA. (negative sign). Charging current shows a positive sign. Draw current shows a negative sign.
[Nexus One Android Development] waylo:
Actually I meant the same mAh and full40 and batt age came back specific to each battery, which is usually great! Unless you have a horribly miscalibrated mAh and are trying to skip the full drain.
[Nexus One Android Development] fcisco13:
So has anyone gotten a true 1600 mAh battery?? If so from where??

N1
[Nexus One Android Development] temasek:
Ah ha! Now I understand. With my current great battery, I don't have a need to change battery so I haven't try switching battery. But if switching battery and the that correct battery registers remained then its wonderful.
[Nexus One Android Development] mtw4991:
you don't have enough current draw to hit learn mode. I keep pandora and wifi hotspot on and it does the trick every time, plus I get to listen to music and use my laptop at the same time ;-)
[Nexus One Android Development] waylo:
Outstanding explanation! Love it.
[Nexus One Android Development] temasek:
Agree. Outstanding explaination!

End result of our goal for battery calibration is to maximize the potential of each battery and to be able to use it from 100% down to 0%.
[Nexus One Android Development] mtw4991:
dang, got into learn mode again last night with airplane mode on and let it charge all night. Powered off/on and age was again reset to 94%, so learn failed. I was running running Fitsnugly's CM7 nightly alpha build, so I have to think that it has wakelock issues that haven't been addressed yet. Meh, back to CM6.2 and do it all again :p
[Nexus One Android Development] ExtraDas:
I'm unable to drain my battery to 3416mv for the LEARNF flag to come on. I've tried a few different kernels.

My phone runs out of juice in the 3500 range with the flag never popping up. Any suggestions?
[Nexus One Android Development] temasek:
Try again but this time turn on ACR in the battery app. It will pump some mAh for u to last till AEv.

Btw why don't u drop AEv to 3201mV?
[Nexus One Android Development] ExtraDas:
ACR is on and has been every time I've tried to do it. It still shuts off before the learn flag comes on. What would be the benefit of dropping the AEv to 3201mV? If the phone dies at 3500Ish Mv, how is it supposed to get to 3201? Am I misunderstanding something here?

Thanks
[Nexus One Android Development] temasek:
Hmm if ACR on and u can't bump up mAh automatically, maybe when its low on mAh just do a manual bump

0x10 03

- Gives u around 300 mAh.
[Nexus One Android Development] dvgrhl:
Is your capacity increasing at all before your phone shuts down? You should be getting a capacity bump above 200 mAh in that situation.
[Nexus One Android Development] mtw4991:
Is he using a compatible kernel or just trying to do it with the app alone? Sounds like he is just using the app and doesn't have the kernel with the driver hack available...won't work without it.
[Nexus One Android Development] ExtraDas:
I don't think I did get a capacity bump at all.

Currently using WM's kernel (I'm on MIUI) but I believe I've tried it with Pershoot's kernel as well.

Is neither of them compatible? Why was I under the assumption that both were? (question to self... :o)
[Nexus One Android Development] mtw4991:
WM and pershoots both work, not sure about the miui rom tho, need to ask roger or login about that, sry.
[Nexus One Android Development] dvgrhl:
Both of those kernels work fine. But I've never tested on MIUI, only on CM based roms. It shouldn't matter though. This is a situation where logging would be helpful, and unfortunately the way I approached implementing it has ended up being the wrong way entirely. Learned a lot though, but now I need to start from scratch on that front and try another (better) way. OSMonitor will give you the needed info though I believe.
[Nexus One Android Development] RogerPodacter:
superb explanation. i will add that registers b0 and b1 contain the hard coded gain value for reference in case you mess something up and need a reference to set it back to stock. those are read only. however everyone will see in their dumpreg that they show up as zeroes. they are not actually zero. but for some reason i am only able to pull those registers on a special kernel driver, and i have no idea why i cant get them to read correctly in our current kernel. its the strangest bug i've seen, i'm prob just not good enough coder to see the problem. i have a screenshot somewhere of the values when i did get it to read properly, we still havent actually tried setting different RSGain values. i've just been busy with other stuff. but anyway...

my hunch is that these are in fact close to 1600 batterries. like you said, since the current measurement across the sense resistor is variable, the only REAL way to know for sure is how long the device runs. from my unofficial tests, my 1600 battery seems to be significantly more powerful compared to my stock.

for example just this weekend i was able to hit 9 hours of unplugged time, but with 4.5 hours of constant screen-on time, and still had 30% left. this is nowhere close to what i could get with stock. and the voltage was still around 3.6 volts, so it had some juice left.

other things i notice is when charged fully, my 1600 battery will stay above 4 volts for a significant amount of time, like 2-3 hours after unplugged. my stock battery is into the 3.9 volt range after 40 minutes or even less.

so overall it just seems more robust holding voltage. maybe because its brand new, i dunno. but i'd definitely say its a worthwhile upgrade over stock.
[Nexus One Android Development] RogerPodacter:
as mentioned already, the only other thing i can think is to make sure at the precise instant you are coming to your empty volt, ensure the current is greater than -200mA. i just scroll the screen around and it keeps it usually at -280mA which is enough.

the capacity bump should be working if the ACR option is set. i guess it could still be possible to some how squeeze thru with the right circumstances to miss tripping the ACR write function, but i'm not sure. just let us know if you do happen to see it bump up automatically or not.

and i dont know about the MIUI ROM's. i think they should work since i thought that they use cyanogen ROM as a base ROM. as long as the edited ds2784 battery driver is being used, then our app should work on any ROM using it.
[Nexus One Android Development] RogerPodacter:
i was just about to give an update and say that dvgrhl and myself hit a snag. we were gonna try to bring the logging and graphing together where the graph can basically just pull the log info and display that data onto the graph.

the way the graphing is working now, i only have it pulling a few minutes worth of readings (in real time) and anything longer than that goes off screen and gone forever. i'm not sure what you guys all prefer. but the other snag i hit is that i attempted to turn this into a service so that it can run in the background. i got the service running but i keep getting a null pointer exception when trying to have the service paint the graph, and i have no idea why and i've been stuck on this. sorry for the delay, i know some of you are looking forward to logging.

aside from that, my problem is i wanted to add graphs for mAh and percent, but over a longer period (since they are slower updating). so i have volt/current updated every few seconds, and percent and mAh updating at a longer sample poll. need to get that sorted too.

but the good news is that the graphs at least do work well and is somewhat neat to use. we'll try to get it out ASAP.
[Nexus One Android Development] RogerPodacter:
sorry we've been saying it wrong. it needs to be more negative than -200mA, so technically needs to be LESS THAN -200 which would be -250 etc. since its negative, greater than means more positive, but that's not what we meant lol. basically just keep as high a draw as you can on it when nearing the empty volt. -300 would be fine. that is likely why learn flag did not turn on.
[Nexus One Android Development] fcisco13:
Anyone that got a 1600 mAh care to recomend where they got it from...ebay seller??

N1
[Nexus One Android Development] RogerPodacter:
got mine from htcrepairparts.com. earlier in this thread people posted the ebay links to some of the good ones, just gotta search thru the pages...
[Nexus One Android Development] fcisco13:
Thats what i feared lol guess i got homework then, thanx roger great work btw.

N1
[Nexus One Android Development] ExtraDas:
Got it now. Setreg was set to read only so it didn't take when I put the values in. Changed permissions and now i see ACR bumping capacity around 300ish. Now I'm just waiting for it to drain to 3201mV.

Thanks for the tips guys. Now I can finally have the phone die @ 0% and charge to 100%...lets hope
[Nexus One Android Development] infoschumi:
I have a question and I'm sorry if it was asked before but I couldn't find any answer.

This procedure must be repeated after each kernel install/only after ROM change/only on full wipe/or these "settings" are stored in another memory other than NAND?
[Nexus One Android Development] temasek:
The battery registers are saved in the battery itself. No need to repeat procedure but of cuz once in 3 months is a good gauge to recalibrate your battery cuz your battery age will drop due to freq charging.
[Nexus One Android Development] RogerPodacter:
yeah these values are in the chip inside the individual battery itself. so it will hold from ROM to ROM. but age seems to be tempermental and resets itself once in a while, so just manually enter your proper age value if you see its reset itself.
[Nexus One Android Development] ericjwill:
Car Dock Woes

After following the guide in post 3 my battery actually drops rather than charge while in the OEM car dock and running the GPS & Navi. Any suggestions?

Methinks the minimum charging voltage (20mA) needs to be higher when having such a drain. Could someone provide a hex value to bump it up to, or at minimum how to get it back to stock?

Thanks!
[Nexus One Android Development] RogerPodacter:
if you want to set the min charge current register back to stock value of <80mA, just use setreg:

setreg 0x65 12

but that register change you did is totally unrelated to current draw using the device. that only tells the battery when a complete charge occurs, nothing more. there's no setting to control how much power the phone pulls from the battery.

its been posted many times around the forum that while on the car dock, using GPS navigation has pulled in more power than the dock was able to supply, meaning it slowly lost percent even while charging. so its not new, you may have just never noticed it before. but this setting unfortunately isn't going to change anything for that.

it would be cool if when i get this graphing and dvgrhl's logging finished for you to take some tests during navigation and see just how much power is being used though. just for fun:)
[Nexus One Android Development] ericjwill:
Makes sense. I never heard of the battery draw via car dock issue until your comment. I'll try using setCPU to drop down the processor to try and offset things for now.

And you're right, this is the first I have noticed the issue!

Thanks!
[Nexus One Android Development] mcampbellsmith:
Before starting the Learn Prep, does it matter if the battery is fully charged or nearly empty? ie does it matter how long the detect learn mode is running before I get notified that I should plug in the charger?

Thanks. Hope that makes sense above!
[Nexus One Android Development] temasek:
Only 3 things matter

1. Age must be 100

2. Draw current must be more than 200mA (negative)

3. Your mAh must not die out before you hit AEv point.
[Nexus One Android Development] Breece:
Ok I am now at the point of recharging ;) Learning mode worked so far.. my battery age started out with 94%, so what should I expect as a result (cause it says in the how2 that learning did NOT work when the result is 100% or 94%)

Bought my N1 half a year ago...
[Nexus One Android Development] temasek:
U should perform a learn cycle with age 100.
[Nexus One Android Development] Breece:
Ah sorry... I forgot to add one sentence:

"When I opened the battery app it said 94% and of course I changed it to 100% before starting with the learn cycle" :)

[edit]

And maybe a stupid question.. but the how2 tells me not to touch the phone in the end of the charging cycle. But how do I know when it is done? Am I supposed to leave the screen on? Turning the airplane mode on the during the whole charging cycle shouldnt be a problem, should it? Cause I dont plan on using the phone today and I thought it would charge a bit quicker :)
[Nexus One Android Development] temasek:
No way to check without risk of failing your learn cycle. For 1600mAh battery and below, 4-5 hrs is a good guide. But I suggest do a learn cycle before u sleep. Once u wake up all is good.
[Nexus One Android Development] Breece:
haha ok ^^

I will just wait as long as possible today :) Thanks for the advice!
[Nexus One Android Development] econwatch:
Batt Cal - Consumption (repost fr CPUStatusLED)

Repost below fr http://xdaforums.com/showpost.php?p=10354208&postcount=296 (not sure if im doing this right).

Response fr dev (rightly so) was knowing from where to get the appropriate data to graph it.

Q?: Any thoughts on a way to see consumption profiling by app to see what's eating up battery per day/week/charge cycle/etc.? eg. update RSS every 5 hours instead of 4 increases off-charge cycle by 10% holding all else constant. (so many variables is this even possible?)

Bluesky thought - would like to set a batt consumption limit to correlate to a service time. understand that perf will suffer but knocking out high cost apps would be a start).

***

Thank you for this great app (CPUStatusLEDv1.0) - am enjoying the clean interface and CPU profiling. No issues running on N1 w/ GB.

TIL - Have recently discovered the joys of battery calibration (N1 Battery Calibrator) and battery longevity re Current(mA) flow. Trying to get more than 6hrs b/w charges.

Read somewhere that GB reduced mA consumption overall but not seeing remarkable improvements so being able to view consumption on an app level would help narrow down the suspects. Currently at 140-160mA (min brightness, 2G, 2-3% CPU load).

Wondering if there's any traction for graphing mA per service through this app (or is there one avail already)?

N1 - update-cm-7.0.0-RC0-signed_010411_190413

a2sd - apps, dalvik
[Nexus One Android Development] chowlala:
Ok. Back from MIA.

Here's what I've observed.

OS Monitor and our current Battery Calibrator or possible drivers doesn't seem to be reading the custom batteries right. I'm probably wrong on this. It's hard to say. But from what I see, I've set my full40 at 1452.

When I charge the battery, it fluctuates near the top.

EG: It hits 4192mV at about 1435 mAh. mV ceases to fill up of course, but the mAh at times rises up to about 1513 mAh at times! Other times, it only goes to 14xx mAh. But I've observed multiple times, after hitting 99%/100% the mAh continues to rise for several hours.

Then proceeds to sit at -1 mA as long as it is plugged in.

The second I unplug though, it shoots up to -400 to -500 mA drain for a while.

With my previous stock battery. I could unplug, and replug and it would immediately begin charging again.

With the current 1600 mAh battery, if I set the full40 at say 3000 mAh... if I unplug, and replug at some points around 90%-99% (more often around 95%>) the battery won't charge. In fact, OS Monitor doesn't even show BATTOFF [FULL] and the battery continues to discharge to a point where it can once again begin receiving charge.

I've contacted the seller, who has tested both OS Monitor and Battery Calibrator, and he says the following which is a copy paste from my email:

So it seems, the battery should be able to go above 4.2v - but somehow, something is preventing this from happening.

Again, unsure about many things - just all my observations with the 1600 mAh battery and apps.
[Nexus One Android Development] RogerPodacter:
the reason to not touch the phone towards the end of the cycle is because near the top charge, the current draw is very low because its slowing down near completiong. and any sudden load on the battery, such as the screen coming on, can actually dip the current negative and possibly throw off your learn flag.

i've found that i can in fact do quick screen checks near the top, where i'll turn it on, check for a few seconds, then black out the screen pretty quickly. so you can check it, but that is the reasoning behind it. i've seen the current go negative many times near the top though.

we still could add a "learn complete" alarm into the app. just so much to do still..
[Nexus One Android Development] RogerPodacter:
yeah that would be great. i feel bad you guys waiting for the graph stuff, the only thing i could do is release an off-market apk. but unfortunately i still didnt sort the service issue, so the graph will run in the app but pause if you send it to the background. not sure how useful that would be. i know dvgrhl wants his logging included too.

that would be damn sweet if they added current draw to the cpu app though. that's one of my favorite little utilities...
[Nexus One Android Development] Breece:
Yes that alarm would be reeeeally great :)

Has been on charger with airplane mode on since the beginning at around 2 pm... 4 hours... 1452mAh

Green light is on... and I dont know if I should check it or not ;) Dont want to ruin it :(

[€dit]

Well I did take a look now.. and the battery status register is 0x83 Curr. (mA):0.201 Capa. 1436 "CHGTF is set battery is full charged"

What does that mean?
[Nexus One Android Development] RogerPodacter:
so you are complete, reboot the phone and see what your age updates to.
[Nexus One Android Development] mtw4991:
FINALLY got the stars & moon to align, so I could do a proper learn on my new 1600mAh battery from ebay. Learn completed(using CM7-GB #crackflasher rom) and powered off/on this morning and age was set to 97%. First learn cycle was 98% and this one was 97%....pretty good imho, however, kinda ticked that it doesn't get the full 1600mAh as advertised. Maybe I got cheated out of my $13?:D:D;)
[Nexus One Android Development] waylo:
Any tips on how to do a proper power on/power off? Aside from "turn it off. Then turn it on." Is the power plug in or out when you power cycle?

I'm getting this ridiculous 7-vibrate error alarm when I try to boot up again. I think it's an error code, though no one really knows what it's related to. Fixes with a battery pull, power discharge (hitting power button a few times). Then I get no battery age update.
[Nexus One Android Development] RogerPodacter:
i've only used quickboot since forever, so i suggest using that app. this way you avoid ever having to touch the power button anyway (we know they break). just use the reboot option.

no idea about your vibrate error. but i will say that your battery will surely reset the age when doing the battery pull. its just a glitch. manually enter your proper age value afterwards and you shoudl be good to go.
[Nexus One Android Development] Breece:
My Batt Age is now 100% (Aged Capa 1393 though last charge went up to 1432)
[Nexus One Android Development] RogerPodacter:
knowing what we know about how this chip controls the battery. i wonder why no after market company has produced a lithium polymer battery for the nexus one? (or other phones for that matter). people would gladly pay for the increased performance of li-po. and since the chip handles everything, it kinda seems like an easy thing to manufacture like-for-like and pop it in the phone.
[Nexus One Android Development] RogerPodacter:
so the age didnt update itself with a reboot, and instead stayed the same at 100%? maybe the learn cycle didnt complete. this is why we need to add tracking to the learn flag during the cycle, so if it goes off the user can be notified.
[Nexus One Android Development] Breece:
Well I did not get the 0x81 but instead 0x83... and as I stated before I started out with a Batt age of 94... maybe 100 is correct? Phone isnt that old?

Should I try again??
[Nexus One Android Development] zdiamant:
Ok.. I got my seidio 3200mAh battery today!. Of course it died immediately upon putting into the phone.. As you can see, the battery still had plenty of voltage, just ran out of amps. I set 0x10 to 04, and am getting the voltage down so I can set the learn flag and charge the battery.. I also set the Full40 to 3600, just in case this battery has more capacity. I'll let you guys know tomorrow morning how it went. I also editted the min charge to 20mAh. @Roger, could you guys add the set min chg curr and the set reg of 0x10 to the battery calibrator? I think it would help getting to the learn mode. For some reason, even though I have the ACR adjustment set on, it does not automatically set it all the time. Thanks.
[Nexus One Android Development] RogerPodacter:
Nice. Shows again that the big name battery companies program their batteries correctly. So that is where the higher price is worth it. Thank goodness we got this app going to learn this stuff:-). And the palm pre guys too:-).
[Nexus One Android Development] zdiamant:
So, it is now 2 and 1/2 hours later.. I finally used my battery up and got into learn mode. We'll see in the morning what capacity this battery really has!