yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] RogerPodacter:
ahh ok so you hit the other condition which was not prepared for, which i brought this up yesterday but was unsure how to capture this condition. we can certainly bump it up to 0.3 for sure but i dont know if that would capture all conditions. i'll have to think on it some more but we'll make that change at least.
[Nexus One Android Development] mtw4991:
cutting it close doesn't describe it accurately....how about "I ain't got no hair left on my balls!!!" lmfao:D:D:D

Seriously, .3 would be a good place to start cuz I was one poll short of shutdown. Also, 3500mV would account for people who may have mV draining faster than mAh, thus solving both problems at the same time, right?
[Nexus One Android Development] RogerPodacter:
well i think we need an additional condition as a check. so the first one is if you are draining and you hit 70mAh and your voltage is < 0.2 away, bump it up. but there could be a second scenario like you hit which is if you are < 70mAh but your voltage is NOT yet within 0.2, you still are running out of capacity but we are not checking for that. so maybe we need to add an OR statement in the conditional check as well.

i'm trying to think how this situation could arise. maybe you have a super low full40 value set, and you try to drain down but you are running out of mAh yet still at a very high voltage.

so how would we check both?
[Nexus One Android Development] mtw4991:
mAh's don't drain that fast so I'm thinking it has to be an "OR" condition such as:

if mAh are less than 40 and mV is <=3401, bump mAh +200 OR

if mV are less than 3300 and mAh is <=25, bump mAh +200 ELSE

do nothing

All we are really trying to do is prevent mAh from getting below 10-12mAh before mV reaches 3201 anyway. Also, I was wrong in my first assumption that <20mAh would trigger shutdown...I was thinking about the <20mV charge current and was confused lol, so we may not need to do anything as I can routinely get down to 9-10mAh remaining without auto shutdown, but once it gets below 9mAh, bam! its toast.

Also, my deliberate "no learn mode" test from yesterday was a success. I let it drain to shutdown, no learn, then charged to 100% and rebooted. Age was reset to 94% but I changed it to 86% and today it went into learn mode at 20mAh @ 3.201mV...success!
[Nexus One Android Development] triciopa:
Well, gave up after ten times of plugging the charger the exact moment the flag comes on.... Then the phone turns off. Good work but maybe my battery just hates the idea of being calibrated.
[Nexus One Android Development] mtw4991:
Are you seeing the learnf button light up on the app and does the popup prompt you to plug in your charger now? Is your charger plugged into the wall, not a usb? Do you have some apps running that are keeping the current draw above 200mV which is required? What are all of your setting?
[Nexus One Android Development] RogerPodacter:
Wait a minute, I think I'm a maroon. Dvgrhl, I think I have the equality sign backwards. We want to check <70 and volt difference is GREATER than 0.2, then bump it up. I think that is how we should have it set up.

Is that make sense? I think that will cover all conditions...

Yeah I'm pretty sure that is the correct way which will capture all conditions and would have fixed you right up. Of course what about the inverse of that, when you get <70 and your voltage is NOT greater than 0.2? Then its a race between the 2 and still possible for you to run out. So perhaps check both conditions.
[Nexus One Android Development] mtw4991:
<<<getting a headache trying to rationalize this equation to cover everything. ;)

If you use the <70mAh condition with >0.2, you could lower the mAh so that it isn't tripped prematurely thus cutting it in half to 35-40mAh and still be safe, I would assume.

The inverse is where the OR condition comes into play like...if mAh is less than 30 and mV <=3.201 + 0.2, bump up?
[Nexus One Android Development] starfarer:
How's the normal daily use? better than stock?? I'm tempted now.
[Nexus One Android Development] RogerPodacter:
sure we could cut the mAh in half and still be safe i think. i think we just chose some numbers as a starting point to be tested, and adjust them if necessary. i dont think the danger area starts until <20mAh or so before worrying about shut off.
[Nexus One Android Development] mtw4991:
agreed...I don't start getting edgy until <15mAh now lol.
[Nexus One Android Development] triciopa:
Yes to all of them, and my settings are the ones on the guide. I followed it step by step.
[Nexus One Android Development] mtw4991:
Roger/Login, not sure if something is wrong with the app or what. Hit learn mode and charge until <20mV and was at 87% when it crossed over the <20mVx2 and status register showed 0x81, learn mode completed successfully. App showed 4192mV, 100%, full40 1452, aEv 3201, capacity 1434, etc, etc. NP, so far so good.

Rebooted for the app to set the age at it didn't reset it to 87%, it stayed at 100% through 3 different reboots. Not sure what that is all about, but I had to manually reset the age to 87%. Thought I'd let you know...
[Nexus One Android Development] tech338:
I have the same issue with v0.87 beta. Drained the battery, got the learn flag. Charged until full (didn't notice when it jumped to 100%). Rebooted and age is stuck at 100%.

Using the latest PureFroyo kernel if that matters.
[Nexus One Android Development] RogerPodacter:
I'm not sure what could be happening here. Just make sure the learn flag is on the entire time, it could be failing right near the end. We can add in messages to track the learn cycle to tell the user if and when its passed or failed. For now we just have to visually monitor that the flag stays on...
[Nexus One Android Development] Annihlist:
Completed a successful learn cycle after following mtw4991 guide. Battery age now shows 87%.

Missed my first attempt and batter reset to 94%. I used the bump method 0x10 04 to increase capacity artificially.
[Nexus One Android Development] oaf_tobark:
I just found that after it prompted with the LEARNF, i plug in and press OK. Then the Capa.(mAh): goes to 0...

Then a message saying the progrom did something (missed the message).

Then the LEARNF light goes off...

This all happens within 15 sec or so...

Is this happening because im turning Airplane mode on? or what... I have no idea...

Using the latest beta 0.8.7
[Nexus One Android Development] RogerPodacter:
Ok this may be a bug, not necessarily something you did wrong. I'll test the app more tonight. But its normal for mAh to get set to zero when learn is hit, that's just the way the battery works. What I'm curious about is if you saw the super user message then pop up for an acr write, which shouldn't happen at that point, or if you just saw the learn message appear quickly then disappear when the flag went off...
[Nexus One Android Development] mtw4991:
My guess would be the aged capacity value which is a static reference point anyway right? So why is it even needed?
[Nexus One Android Development] oaf_tobark:
i think it was a super user message because it showed up as just text overlay.

im on pershoots's 12/03/11 kernal.

i just relized that i was using USB for power so i switched over to ac adapter...

i just went to ur previous beta and its in learnf mode right now without any message...

soo... i made 2 changes so trouble shooting is not clear. sorry m8
[Nexus One Android Development] RogerPodacter:
Well its only static till I fix the code tonight. Then it will pull your actual value. We prob want to see different after market batteries each value for that register. But yes all stock batteries will have the same value. What I wanna test is what happens if we change it.
[Nexus One Android Development] RogerPodacter:
I can almost guarantee the usb charging caused the failure. Wall charger is much better to use as its higher current output makes a difference.
[Nexus One Android Development] dvgrhl:
So here is my short list of things to put in the app for next release or two:

Add in 2 ACR options, one for if remaining_volt - empty_volt < = 0.3, one for >= 0.3. This will be for testing purposes only to see which method produces desired results.

Prompt for super user permission when the ACR check box is checked in the settings menu, rather than at the time we acutally want to write the ACR. This will prevent the permission request from popping up at a critical time.

Create setting to automatically switch phone to airplane mode when learn flag is enabled.

Revisit GPS polling option to keep drain above -200mAh.

Probably some UI and layout refinements if the above gets done.

Is there anything else that anyone sees missing or would like added?

By the way I decided to play with my phone tonight and ended up wiping it and installing CM 6.1 Final from a clean install, so I won't get to any programming until tomorrow morning on the bus. Sorry.
[Nexus One Android Development] mtw4991:
Sounds good to me,,i will test tomorrow when u put it up...nite all..my human batt just crapped out
[Nexus One Android Development] erikiksaz:
when you guys say higher than -200 draw, do you mean higher as in more negative? or less negative?
[Nexus One Android Development] dvgrhl:
More...negative...lol

That still doesn't sound correct, but yeah we want there to be more of a drain. Above 200mAh drain is good. So -200mAh is good, -250mAh is better, etc...
[Nexus One Android Development] djn541:
ok, i just had a successful learn cycle. it says 100% with a capacity of 1439. aged capacity 1393. this is after a reboot! AWESOME!:D

EDIT: sorry, it was 1427! still good though right????
[Nexus One Android Development] chowlala:
Btw guys. I think there should be some extra safety (paranoia/ocd) mentions in the methods in mtw's guide.

Basically, once you hit learn, turn off all the apps, and get dunked into airplane mode, one SHOULD NOT screen on the phone for whatever reasons. As well all well know, the screen absorb huge amounts of power, especially with auto backlight adjustment, full screen brightness, etc.

I turned my screen on last night at about 80+ % and the current draw dipped into negative.

We should set a safe time frame before one should screen on to check. Lol.

Well, you get the idea. :)
[Nexus One Android Development] dvgrhl:
That's a good point. I'll add that info to the README.md file. By the way, this is a good time to talk about that. I threw together a README.md file on the bus this morning very quickly for the project on github, but it's basically all just information from out of here and I left out a lot of people who have been helping with this whole thing (sorry chowlala, I hadn't had my coffee). theloginwithnoname had a great idea for anyone to fork that file and make their contributions to it. It would really help with instructions for using the app, technical information and background, etc... Even if just to add your name because you've helped out it is great. I really want this to be community owned and properly represented. We can use that file in the app for info, as well as to link to it for new users.
[Nexus One Android Development] gxh:
I think there is something wrong when the Battery age is 100% after the reboot.

My history:

The fist time I did not change any parameters. I tried to hit learn, but the system did shut down. But I did plug in the charger right when it was shutting down. Apparently I got lucky, because after I powered the phone back up in the morning the battery age was set to 85%.

I then tried to verify that by using the application. I hit the learn flag three times and every time the battery age was 100% after a reboot.

To clarify that: I am using CM nighties 273. So I was using the reboot option in the shutdown menu. I was never powering the phone off and powering it up again. I believe now that there is a difference.

The second time I drained the phone, and as expected the phone did shut down at >10%.

The last time, before I reset the phone I captured the dmesg:

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]

So as expected the battery charged not to 100%, but to 88%. Then it jumped to 100% when it it dropped under 20mA.

I think I did everything right during this learn cycle - the phone was in airplane mode and no applications were running. There is also no jump in the loading current, a very smooth curve.

I then reset the phone but the battery age stayed at 100%. But then I thought maybe powering off the phone will be different. So I powered off the phone and the battery age was set to 94% after it was back up... Also not quite what I expected.

I then set the battery age manually to 88%. Looks like I gained three percent from the initial learn :-)

So the next time I will try to power the phone off to see if that makes the difference.

Edit:

I have finished another learn cycle and this time powered off. After I powered it back up the battery age was set to 89%. So my guess based on the log file the last time was pretty correct. This confirms: it makes a difference if you reboot or power down/up!

But for a stock battery I would doubt the result if you get a battery age of 100%. The test is obviously if your battery dies earlier then 0%
[Nexus One Android Development] chowlala:
Haha, sure thing! Let me know how I can get connected and stuff and I'll see how I can help with whatever. =) I'm a noob at github and stuff. Lol.
[Nexus One Android Development] zdiamant:
Well I think I finally did it.. entered LEARN mode last night and charged without timeout til morning (updated to new kernel.. thanks for the suggestion).

I have a 2400mAh extended battery in, and this is my log at the end of charging--

12/07/2010 05:38:32 [INFORMATION] batt: 100%, 4197 mV, 20 mA (20 avg), 23.6 C, 2896 mAh

12/07/2010 05:39:22 [INFORMATION] batt: 100%, 4197 mV, 19 mA (20 avg), 23.6 C, 2896 mAh

12/07/2010 05:40:12 [INFORMATION] batt: 100%, 4197 mV, 19 mA (19 avg), 23.6 C, 2352 mAh

12/07/2010 05:40:12 [INFORMATION] batt: charging BATTOFF [FULL]

12/07/2010 05:41:03 [INFORMATION] batt: 100%, 4197 mV, 0 mA (0 avg), 23.6 C, 2352 mAh

12/07/2010 05:41:53 [INFORMATION] batt: 100%, 4197 mV, 0 mA (0 avg), 23.6 C, 2352 mAh

Other info to know.. I routinely run out of mAh before I hit empty voltage (I had to write to 0x10 frequently to get LEARN mode), and this battery has only been in use for less than a week.

So my question is... what Full40 value should I use? and is there anything else I need to do to get maximum use from this battery.

Thanks
[Nexus One Android Development] temasek:
You should set full40 to 3000. Seeing your log it charged to capacity of 2896mAh before settling down at 2352mAh due to your full40 limitation.

You are currently under using your battery potential. Raise your full40 and perform another learn cycle.
[Nexus One Android Development] temasek:
For those who has non-stocked batteries.

During your learn cycle charging period, you may notice that your current capacity has overshot your full40 and still increasing before it settle down to a modest figure lower than your current full40. This is probably due to your full40 was incorrect and you should set your full40 near to your maximum capacity that was reported during your learn cycle. With that you can maximize your battery potential.

For your general info.
[Nexus One Android Development] chowlala:
Ok. Am in LEARN mode round 2.

Phone in airplane mode, and this time I won't friggin touch it till the morning. Lol.

Just to double check, do I need to reboot or something at the end?

Or will my alarm clock fubar my LEARN flag?

Btw, I think I know the issue.

We're using ONDEMAND kernels which are OC-ed (Pershoots and WM)

Whenever we screen on we cause the mV's to shoot to the top end of the processing limit (1k+ghz) = 1200++ mV are injected into the system.

We're using the WRONG mV's on the kernels! Hence, when we screen on, the phone needs more juice, so it grabs the power from the battery and the charging line. And near the higher end of the charging spectrum, this causes the negative voltage and shorts out the LEARN flag.

Makes sense right?!
[Nexus One Android Development] temasek:
I have done on/off screen many times during learn cycle and it does not impact in its process.
[Nexus One Android Development] triciopa:
Maybe changing the governor or frequency range in setCPU?
[Nexus One Android Development] mtw4991:
Your alarm might fubar learn unless learn has completed already then np. Yes once learn is done you need to reboot but dont be suprised if age is reset to 100. I think there is a glitch in the app. Just check your jump point where mA dropped below <20mA and reset age manually.

Never even thought about oc/ondemand interaction but you may be on to something. That might account for getting kicked out of learn right at the end. Maybe the instructions should advise to setcpu to stock or lower and use powersave/conservative governor?
[Nexus One Android Development] chowlala:
I've currently put setcpu at 576 where the power draw is much less than usual. I've even managed to turn on the phone, turn on bluetooth, transfer a file, returned to airplane mode, installed a file and all this whilst maintaining 500+ charge.

We'll see what happens by the morning.

And yes, the alarm clock will ring in... 7 hours. The phone should be charged by then I hope. Lol.
[Nexus One Android Development] mtw4991:
Its only when the charging current drops down to around 100mA or less that apps become an issue
[Nexus One Android Development] RogerPodacter:
yeah if age did not update, the learn must have failed at the end for some reason. it should not stay at 100. and if it goes to 94 that means the battery reset itself to stock.

notice your jump happens around 88% as well. how come not one person with a stock nexus battery has ever got close to 100, or even in the 90's on a learn cycle, even with a brand new battery!? i think these batteries are just cheap.
[Nexus One Android Development] RogerPodacter:
damn dude, another person with a battery that is actually under provisioned! you bought a mugen 2400 battery, yet it looks from your logs like your full40 is set too low, limiting your full range of usage. so are these after market batteries just high quality, or are they buying in bulk and labeling one 2400, another 3200, another 3400, and just selling them at different prices? i cant imagine how so much extra capacity is there not being used...
[Nexus One Android Development] RogerPodacter:
yeah i'm thinking that all you guys who are seeing the learn cycle complete, but the age not updating at the end, perhaps near the top, maybe when you go to check the progress, since the current is so low near the top it is easy to dip it negative for a split second while turning the screen on etc which could be failing the cycle at the very top end.

we need a message or beep to occur when cycle is complete so you know for sure. next version maybe...

i've definitely had my phone plugged in charging, its close to finished pulling 60mA, and i do something and it goes negative. the top is just a sensitive portion as the current goes so low, not much we can do i dont think.
[Nexus One Android Development] mtw4991:
I still think it's the application from 1205 I'm going to switch back to the 1203 application and test that as I am now at 18 percent
[Nexus One Android Development] gxh:
I just did another learn cycle and this time I did power off and powered back up. Only then the battery age was reset correctly (in my case to 89%). It looks like when you just reboot the battery age stays at 100%. So I think the instructions need to change and specifically say that you need to power off!

My theory would be that even when you cause the charging current to drop below 20mA it should be just interpreted as a full battery. So you might end up with a battery that is not completely charged to it's maximum. But when you then power off the corresponding age should be set.

Maybe you can capture the dmesg output after a learn cycle and before you power off the device:

OSMonitor:

Settings->View Log set to dmesg

I am using a filter, but you can just capture everything and grep later:

Settings>Enable Filtering

Settings>Tag Filter set to the text batt

To capture the logs, go to the Message tab:

Menu->Export Log

choose a file name. The file will be in the root of your sdcard.

With that information it could be easier to figure out what is happening.
[Nexus One Android Development] houzuoguo:
hey guys :)

I did a calibration, learn flag turned on, and I turned off everything possible, went to bed.

This morning I got up and saw charge-to-full flag turned on, so I unplugged charger.

as result of calibration:

Batt age 100

Full40 1452 (i'm using stock battery)

Min Chg Curr 20, Min Chg Volt 4099

Empty Curr 200, Empty Volt 3.201

Capacity 1288, Aged Capacity 1393

is that a successful calibration? Seems like although capacity is updated to real capacity but batery age stayed at 100%...

by the way, what does aged capacity mean?

Thanks a lot for any help :)
[Nexus One Android Development] mtw4991:
Ok this time I kept the 1205 app and completed learn the same way I always have. Rebooted and age was still set to 100. Usually, if you reboot, age is reset and if you manually power off, you get reset to 94%. Not sure at this point what the issue is, but tomorrow I'm going to test again with the 1203 app and see if things change.

Edit: see above post, something is up??? Hou, did you reboot and it still showed 100?
[Nexus One Android Development] chowlala:
No. He didn't do a reboot.

My learn mode is successful too. Got up just now, phone fully charged, age capacity 86. Did a hot boot and changes are in.

Anyone else trying to limit the setcpu power draw? Mine seemed to work flawlessly.
[Nexus One Android Development] RogerPodacter:
I'm not sure there were any changes in the last few versions that would change the way learn gets completed. But there certainly seems to be a trend lately of failing cycles. All I can do is test again tonight and see if o find anything.

The age will not still show 100 after a successful learn cycle. And a reboot is typically required afterwards to show the updated age.
[Nexus One Android Development] chowlala:
I'm using the latest battery app. So far I don't think I've bumped into any bugs with learn mode. This morning age showed 100 on the learnprep screen. But in the first tab it was 86. A hot boot did the trick updating the values.
[Nexus One Android Development] mtw4991:
Umm...I wonder if installing the GB keyboard after uninstalling the stock one might have changed anything? idk, maybe learn just appears to be completed? At least I know mt age is 86-87% lol.
[Nexus One Android Development] temasek:
I've done many learn cycles and in no situation where turning off/on screen booted the LEARNF. I am oc at 1133mhz with a sleep of 128/998 conservative. Main profile 1133/128 on-demand. In fact last cycle I played with my phone surfing and replying emails and still LEARNF was intact.

There may be other factors that booted the LEARNF.
[Nexus One Android Development] houzuoguo:
Oh this is quite interesting :D

I rebooted my phone after a little while, now battery age is 90%. I think it is correct :)

by the way, could anyone please tell me what does "aged capacity" mean?
[Nexus One Android Development] temasek:
Quote from Roger,