Battery level vs raw battery level - One (M8) Q&A, Help & Troubleshooting

Hi dev community,
I was just digging a bit into androids handling of batteries (as it is acting really weird, currently. It only changes the battery level on reboots, I think) and saw, that htc differentiates between a battery level and a raw battery level.
I could find this in the following places:
Code:
grep Percentage /sys/class/power/power_supply/battery/batt_attr_text
Code:
grep level_raw arch/arm/mach-msm/htc_battery_8960.c
in xboxfanj's kernel (BTW yes, I know, it is a bit awkward that this is only in the htc_battery_8960.c and not in the htc_battery.c file. But the raw percentage gets definitely printed out on my device)
The raw percentage seems to be a bit lower than the percentage. What are the differences between them and is there some UI utility to show these battery infos?

I'm not familiar with the data contained in those files. But what I do know, is that the battery "percentage" shown by the phone is correlated roughly at best to actual battery voltage. Reason being, is that Li ion batteries are not "full" or "zero" voltage types of things. Full charge is around is around 4.2V, while shutoff is around 3.0V. You can't actually discharge much further than that, otherwise the battery can't be recharged. So try to explain that to the normal person, and they won't get it. People just want to see "full" and "empty" like on the fuel gauge of their car, roughly where they fall in that spectrum, and when they should fill it up again.

Related

Kaiser-Increasing battery life-easy fix

Additional information I have gained through personal experience:
If you KNOW your battery is good, you can increase the battery capacity to 1500mAH without failure, and increase your usage rate somewhat.
I cannot guarantee this will work for everyone, but in the past I have had no issues running either of my good batteries with 2400 units.
I unplugged my phone this morning at around 5:30AM and only used it for one phone call, some facebooking and some market searching ("Waze"). I am currently at 47% battery with 1156 of 2400 units as of 8:45PM.
Again, I wouldn't try this with a bad battery as increasing this number lowers the actual mAH number that the phone needs to properly display the "please charge your phone" message when the battery falls below 15%. I learned this by watching the phone drop to 0% and stay there an estimated 2 hours and 45 minutes with light use and a good battery. The marked bad battery would say fully charged for a couple hours and suddenly drop to 15% and last maybe 30 minutes in this state before finally dying out. And that was with a standard 2150 units marker. Increasing the number of units increases the "span" of usable power from the baseline of 4.2 volts to below the 3.7 volt limit.
Hope my explanation wasn't too boring and someone has good luck doing this as I have...
Actually, changing the number of units has absolutely no effect on how long the battery lasts. It just makes the meter more or less accurate. Check out this old thread where I worked with several others to figure out how the battery meter works, and how to make it as accurate as possible.
If you are having a hard time believing me, please try measuring the time between unplugging with a full charge and the phone dying: with various high and low numbers of units. You'll find that although the meter changes dramatically, the actually battery life does not. But don't do that unless you really need to be convinced, because such 100% to 0% cycles are really bad for your battery.
I use the standard 1350mAH setting for my battery, which is 2170 units roughly. The please charge your battery appears at 10% everytime, and will drain to 0% and hold for about 10 minutes before dying.
So yes, n2rjt is correct. Changing to mAH has 0 effect on the battery life, but how the battery meter is displaying the current charge.
So the matrix at which the battery charge is displayed is adjusted by the amount of "units" displayed under a "FN-Left Softkey" screen. I understand that the battery is only good for 1350MAh, but that does not explain the findings I have on 2 almost identical Kaisers, which is the shut-off on 2150-2170 units comes much sooner than if set to 2350 or 2400.
Is it possible that, with the newer .32.9 kernels, the processor/radio/GPS/etc. or something else is not drawing as much power with my different unit settings?
I can reflash a new kernel with the standard 2150 unit setting, install a clean Froyo on both and pull the sim and SD cards in an attempt to test my theory if needed, but I find it strange that the actual "daily use" battery levels had increased after using 2400 as a blueprint for the battery.
I trust y'alls judgement on this, and I'm not trying to throw stones in a glass house, I'm just sharing my experience.
Testing is done on both phones. The phones were both set up identically with the only difference being the amount of units used for battery status.
Both phones had no sim card installed, radio 1.70.19.09, 2.6.32.9 kernel flashed theough RUU, identical Samsung 1350mah KAIS160 batteries, and identical 256mb Sandisk microSD cards. No other files were placed on the SD cards other than what would be needed to install Android and updates through replimenu 0.9.
(Luckily I had a spare phone or I wouldn't have been able to do this.)
Parameters for the testing were:
1. Flash L1q1d kernel on both phones, one set to 2150 units, the other at 2400.
2. Install Froyo through replimenu and recharge phones
3. remove both phones from their chargers at the same time and see which dies first.
(2 cheap "PW-1BGT" chargers used and swapped between phones).
Under the circumstances, I did find the 2400 phone to last longer, albeit only a short period (2 hours and 20 minutes average)... Not enough to prove a real leap in battery performance.
It took me almost a week to perform this test but the results were less than great, even after the first result of 3 hours and 10 minutes difference came through. I think one phone may have a better charging system as the results varied more than 1 hour across 2 phones. Once the batteries were swapped I noticed a slightly longer charge time on one phone that swapping chargers did not fix.
All-in-all this was an experience to say the least. I will say that there is a variance in the charging ability of one of the phones in that it seems to provide a slower charge, which could be why it seems to last longer. Although I flashed both phones with the unit count swapped, the "older" Kaiser seemed to be the winner in battery life. There was only a slight (30-45 minute) difference between them in both scenarios, and I don't think this difference would show up had the radios been on.
On a last note, IBM wrote a supplement for their Thinkpad series of notebook computers
www-307.ibm.com/pc/support/site.wss/PFAN-3QNQJN.html
In this document is stated that Ni-MH batteries should be deep-cycled but not Li-Ion. Our phones never pull the battery down below the 2.8 volt threshold as the phone won't stay on or even start in this condition.
In closing, I think the difference is in what the phone "sees" as a battery voltage and afixes a place marker for when the shutdown should occur. I've had the phone sit at 0% for a couple hours on 2150 units, but not with the 2400 setting; 0% only lasts 45 minutes to an hour @ 2400 units with radio, GPS and data on.
After about 2 weeks of continued use, I have noticed a trend... a good one, I think.
The amount of units displayed to Android through the kernel has increased, apparently on it's own.
I started with 2400 units almost 2 weeks ago; I am now just over 2510 adjusted, with no outside influence by me. I have not changed anything about what I do with the phone on a daily basis.
I noticed this after not paying it much attention because each day of the week is almost exactly the same (up at 4am, phone off charger at 4:45, use it at work and home, plug it back in at 10pm).
Anyone want to bite into this one, or y'all just think I'm full of it?
(I almost wish I could take screenies of the "Fn-left soft key" screen)...
You're too new on this matter. The Kernel, last i remember, was altered to try and detect if the battery is in a better state (or bigger than the stock) than originaly thought. So, it is increasing the units to compensate the max mah it detects when the charging start to get really low.
Go read some threads! you'll find it rejuvenating
daedric said:
You're too new on this matter. The Kernel, last i remember, was altered to try and detect if the battery is in a better state (or bigger than the stock) than originaly thought. So, it is increasing the units to compensate the max mah it detects when the charging start to get really low.
Go read some threads! you'll find it rejuvenating
Click to expand...
Click to collapse
Agreed! Try entering that larger amount next time you edit your kernel, and you might find it to be more accurate. That's why it adjusts over time. It does NOT remember the recalibrated number across reboots, because there are too many reasons the auto-calibration can be wrong.
Weird
Well thats weird,
I have Kaiser with uptime for more than 350 hours and my adjusted value is now 3091.
And it last for two days.
Battery is standard 1350mAh
frantisek.sobota said:
Well thats weird,
I have Kaiser with uptime for more than 350 hours and my adjusted value is now 3091.
And it last for two days.
Battery is standard 1350mAh
Click to expand...
Click to collapse
n2rjt said:
It does NOT remember the recalibrated number across reboots, because there are too many reasons the auto-calibration can be wrong.
Click to expand...
Click to collapse
And you've probably found one of them.
I'm lucky to get a day's worth, lol. Granted I'm running an experimental Kernel that I'm working on for boosting battery life while phone is in use.
Battery info via Spare Parts battery information page:
level 83
scale 100
health good
voltage 4018
temp (always) 36.8º
tech Li-ion
time since boot 2:19:45
I can't remember what the values were with a 1350 setting, but this seems to be working somewhat to my favor at 1500mAH.
2 weeks later and still going well into the 2400s'. 2482 to be exact with one adjusted rate being 2517...
Only difference noted is that the battery light only goes red at 9% or lower remaining.
Battery status update 7/22/11
Phone taken off charger at 5:40am... Facebook, Google+, texting and one 3 minute call so far today.
Currently @ 1:15pm...
70% remaining
3.923v
Battery counter at 2632, does NOT hold across reboots but Scoot's kernel keeps reboots to a minimum.
If anyone cares...lol.

Things You Should Know About Lithium Ion Battery

Too many people I’ve met have misconceptions, wrong understanding or simply no idea at all about how to maintain the batteries inside their new spanking new electronic gadgets. More often than not, it will be one of those nifty, super-slim lithium-ion variants. So I decided to write this little primer to help you, erm, I mean, your techno-phobic friends along.
Note that my recommendations are catered along the lines of practical convenience as well as pure battery maintenance facts alone. As with everything, there is often more than a way to skin a cat. I do try to explain my rationale behind my recommendations, so do try to read on before clobbering me on the head with your PhD in advanced materials science.
Tip #1: Lithium-ion batteries are limited by their life-spans
Found an e-bay offer for a lithium-ion battery pack for your ageing notebook or PDA at bargain prices? Or saw that battery pack for your gadget in its dusty sealed package at the corner store of the flea market? Before you jump and snap it up, be sure to first check the manufacturer date.
We all know that all batteries are limited by a finite number of charging “cycles”. However, it is a little publicized fact that the lifespan of lithium-ion batteries are also limited by their manufacture date.
Your lithium-ion battery starts dying the moment it leaves the factory
The fact is, your lithium-ion battery starts dying the moment it leaves the factory! Of course, the actual life-span of an unused lithium-ion battery can vary by a fair amount based on its internal charge as well as the external temperature. But suffice to say that you can expect to irreversibly lose 20% of a lithium-ion battery’s charge every year from its original date of manufacture.
PDA came with more than one spare battery? Take it out of its shrink-wrap and use it interchangeably – today. Thinking of buying a “spare” battery for use in future? Well, just save the money and buy it only when you are ready to use it.
Tip #2: Avoid allowing your device to discharge completely
Every wondered why your modern phone, PDA or iPod is able to cheerfully tell you that “Your battery is now exhausted” for several seconds on its brightly-lid LCD screen before switching off? The reason is simple; there is an artificial circuit that shuts off the device when the charge in the battery is too low.
This extraneous circuit is built to protect from the damage that could result if the charge of your lithium ion battery falls too low. If you still don’t get it: if the charge of your lithium ion battery falls too low, the battery can get irreversibly and permanently damaged. So since Lithium Ion has no “memory effect”, it is better to simply charge your portable device as and when you can or remember.
To set your mind at ease, a “charge cycle” means a single iteration of depleting followed by a re-charge until 100% of battery charge. If you consume 50% of your iPod’s battery on day 1, recharge to 100% at night, and do the same thing on day 2, then you would have just finished up one charge cycle of its battery life.
Constantly recharging a lithium ion battery does not shorten the battery life more than normal usage would
Hence constantly recharging a lithium ion battery does not shorten the battery life more than normal usage would. Avoid letting it sit on empty for too long; instead, keep it charged-up if you can.
Tip #3: Take the battery out of your notebook computer when connected to AC helps… not!
Well ok, actually, taking out the battery from your notebook computer might help, but the reason it does is not really what you think it is.
It is not because of over-charging as most people might believe. There are some really smart circuits monitoring your lithium ion battery (See reason #2 above), and these circuits also ensure that your precious lithium ion never gets overcharged.
However, if there is another killer of lithium ion batteries other than old-age, then it would be heat. Long term exposure of a lithium ion battery to temperatures higher than 40 degrees Celsius permanently reduces its total charge capacity by noticeable percentages chunks per year. Having said that, I would hazard that modern processor like the Centrino Duo runs quite coolly overall.
On the other hand, it is really painful to see someone plug their AC adapter to their laptop, carefully remove the battery and put it aside, then finally sit down and switch on their laptop. Then have someone trip over their AC adapter an hour into an unsaved document. Ouch.
Unless you are setting up the laptop at Wal-Mart or Carrefour to run practically 24/7 until its time to sell it off at “display unit” pricing, my recommendation would be to save yourself the trouble and just leave the battery in. Actually, I think the real motivation to take the battery out of shop display units is to prevent theft. Really, why make it so inconvenient for yourself when the battery will be literally unusable in a few years time.
Source: http://www.articlesbase.com/laptops...w-about-your-lithium-ion-battery-4346670.html
-----------------------------------------------------------------------------
NEW ADDON:
Some also claimed that we should minimize the duration of the battery remain at high voltage (e.g. 4.2v / 100%). This is spoil the battery because the corrosion activities are relatively high when the battery is in high voltage/ full charge.
Put it short, after fully charge your battery, please use it ASAP. It won't give birth little baby battery if you leave it there with full charge
One way of Storing Battery for Long time
If you were to store your battery for a long time, discharge it to 40%. Keep it in a dry and cool place.
For me, my engineer friend teach me a way to keep battery, and i have tried this myself for last few years.
I put the battery into the industrial grade vacuum bag and vacuum it (almost no air in the package), then i store it in my refrigerator (around 0 -3 Celsius). I do this if i want to keep the battery there to sit few months.
NOTE: Make sure it is really a vacuum bag. Else the air in the bag will become moist and may spoil your battery. Careful
<<< Please click on "Thanks" if you found this information helpful.>>
Please DO NOT reply to just to say thanks or Quote the main thread again when reply.
You're welcome to reply/post if you have any QUESTION/ SUGGESTION / COMMENT
We much appreciated your cooperation to make this thread CLEAN
Thanks for your understanding ​
Other Interesting Thread
Looking for specific tricks to save battery on your android devices?
Feel free to look at this thread
http://forum.xda-developers.com/showthread.php?t=1189755
Speed up your GPS fixing speed like Thunder (99.9% works unless your hardware broke)
http://forum.xda-developers.com/showthread.php?t=1239713
### for li-po battery http://www.rcgroups.com/forums/showthread.php?t=209187
brilliant post.
nice! Didnt know about the battery cycles!
Sent from my GT-i9100 with MIUI 1.7.8 - xda premium app
Cheers for the info. Knew a few things but still did Tip #3
thanks for tip #2.
have to change the habit.
thanx
everyday i learn something new. Brilliant post.
Thx for the lesson
Sent from my HTC Desire using XDA App
Original Here >> www . techatplay . com /?p=61
April 7th, 2007
Author: Paul Mah
This is a lot of very useful information. I can guarantee that I have always been misinformed on two out of three of these tips. Though really do hardly ever let my batteries discharge completely, and only remove my batter from my laptop when absolutely necessary. Still, nice to know so I know what not to do anymore!
Very good post and you are absolutely right about everything. Leaving the battery in a laptop for long periods of time with the computer being on generates an enormous amount of heat and kills cells within the battery. One thing I'd like to mention, however, is that you should always leave a lithium-ion based battery between 40-60% to have the longest battery life; 20-80% is a realistic range you should keep the battery in and is the next best thing. You never want to fully charge a battery, just like you should not let the battery die (cycling the battery would be something that should happen though if you are not getting the best of your battery life). Again, try not to have your battery passed 80% and not below 20%.
Another good tip is to not let your lithium-ion based devices (such as a GPS) in your car when it is hot out (or at all) because it will get hotter in your car than outside, your device's battery will be outside of its operating temperature and it will have cells that die out which will decrease the lifespan of your device's battery.
Reign255 said:
20-80% is a realistic range you should keep the battery in and is the next best thing. You never want to fully charge a battery, just like you should not let the battery die (cycling the battery would be something that should happen though if you are not getting the best of your battery life). Again, try not to have your battery passed 80% and not below 20%.
Click to expand...
Click to collapse
Thanks for the sharing guy. That means u never charge ur phone until full? u plug off middle of charging (when it about to reach 80%)? This is true, but i hardly implement it because normally i leave it charged overnight. But the best time i can do is to minimize the time my battery will remain at high percentage (90 - 100%).
Good advice but it's hard to be diligent, and like most people my phone charges overnight.
nice info mang.
nice info. many people didnt know this
Xenova said:
Thanks for the sharing guy. That means u never charge ur phone until full? u plug off middle of charging (when it about to reach 80%)? This is true, but i hardly implement it because normally i leave it charged overnight. But the best time i can do is to minimize the time my battery will remain at high percentage (90 - 100%).
Click to expand...
Click to collapse
That's correct; I TRY not to charge my phone passed 80%, but that's obviously hard to do when you need your battery to last all day with use anyway. I try not to ever charge it overnight either.
Excellent reading, thank you for your time and effort in posting this.
Sent from my HTC Desire using XDA Premium App
Reign255 said:
Very good post and you are absolutely right about everything. Leaving the battery in a laptop for long periods of time with the computer being on generates an enormous amount of heat and kills cells within the battery. One thing I'd like to mention, however, is that you should always leave a lithium-ion based battery between 40-60% to have the longest battery life; 20-80% is a realistic range you should keep the battery in and is the next best thing. You never want to fully charge a battery, just like you should not let the battery die (cycling the battery would be something that should happen though if you are not getting the best of your battery life). Again, try not to have your battery passed 80% and not below 20%.
Another good tip is to not let your lithium-ion based devices (such as a GPS) in your car when it is hot out (or at all) because it will get hotter in your car than outside, your device's battery will be outside of its operating temperature and it will have cells that die out which will decrease the lifespan of your device's battery.
Click to expand...
Click to collapse
good info. this is the first time i read this. where did you find this info? any reference links?
informative post & I assumed draining battery fully helped in longer battery life.
It actually seems like a rip-off afer reading thiss post XD
Thank you for the information.

Battery "calibration" knowledge, gleaned from the Nexus One

This is not a thread about best battery tips, etc. And I'm hoping it is not another standard thread about how to calibrate our batteries.
There is a lot of information flying around regarding battery calibration. A lot of it involves draining the battery, plugging it in at certain time, removing the battery, erasing batterystats.bin, etc. etc. etc.
Some feel the batterystats.bin file is key, and others believe it is completely unrelated to how the battery performs--just a log of stats.
How can this be reconciled?
UPDATE: Deleting batterystats.bin to "recalibrate" a battery is total and utter nonsense
http://forum.xda-developers.com/showthread.php?t=1442989
https://plus.google.com/u/0/105051985738280261832/posts/FV3LVtdVxPT
Over on the Nexus One forum, there was/is an extensive discussion, with REAL data gleaned from reading the technical datasheets of the battery itself, and the DS2784 chip within. The key to the Nexus calibration program was the ability to reprogram values on the battery chip.
http://forum.xda-developers.com/showthread.php?t=765609
I don't know if much of anything is going to be the same on the GNex battery, since the N1 was a HTC product. However, if the charging algorithms are all dictated by the Android OS, instead of hardware specific, then it could provide useful precedent. (I am not going to go through all the Samsung forums to look for valid battery calibration threads--if you know of some, for say, the Nexus S or Galaxy S2 (predecessor and comparable cousin, let's call them) please comment).
Here's a primer for all I learned that was used on the Nexus One battery calibration program. Full credit to those fine users who took the reins and made that happen, and to the fine users who continue to provide user support to the newcomers who don't know/refuse to acknowledge the existence of a search function.
My hopes are that this will lead to more rational battery life discussions and maximization for the Galaxy Nexus.
(I am not an engineer, so if any of you out there would like to tighten the language used here, please let me know).
What are the important values in battery/calibration?
1. mV = voltage
2. mAh = milliamp hours, a measure of capacity. This is how much 'juice' your battery has left/stored.
3. mA = milliamps, a measure of current. This is how much 'battery power' your phone is drawing/using at a set time. GPS/bright screen means large mA usage.
Apparently, Samsung (and Motorola phones) do NOT have mA readings in their battery drivers. This poses a problem. Apps that measure current (such as the excellent and free "current widget") cannot give a readout.
How is the battery life % calculated?
Present mAh / "full" capacity mAh (more on "full" later)
When does a phone shut down?
1. When mAh = 0
OR
2. When mV < 3416, which is coded on the battery as the "empty voltage"
Whichever occurs first.
If mAh = 0, then batt % = 0. However if condition 2 occurs, batt % could be anything.
I have found the empty voltage on the GNex to be the same, 3416 mV.
I have found the maximum voltage on the stock GSM battery to be 4197 mV.
Through experimentation, it was found that reprogramming the "empty voltage" down to 3201mv could provide extended battery life. The voltage was found to drop very quickly any lower than that, providing minimal gain afterwards.
What is the full capacity of a battery?
On the N1 battery, it is coded into a chip on the battery itself. This can be reprogrammed with the calibration utility. The stock value was ~1400mah. This is called the Full40 value (the mAh at 40oC). A value called "battery age %" is used to adjust how close the real capacity is to the full, which decreases with use and age. By multiplying (batt age * full40), you get the real assigned capacity.
Some non-OEM batteries, however, had miscoded capacities, usually LOWER than what was advertised. This led to very disappointed users who had purchased extended batteries that lasted no longer than stock, due to wrong mAh coding. (See below how this could be corrected).
Other low-end crappy non-OEM batteries had a crap chip which was coded with nonsensical values. This also led to unreliable battery life. These chips were not reprogrammable.
The very interesting thing is whenever the battery thinks it was completely charged, the mAh becomes SET to this number. mAh is NOT an independent value. Also, you could set it whatever you wanted, whenever you wanted, whether it was accurate or not. % battery left was basically calculated as present mAh / (full40 mAh*batt age). So you could get false values of either too little or too much battery left.
Why does this matter? If that was falsely low, the phone would cut out at 0% battery life, but you would still have usable battery left. If it was falsely high, it would cut out at 10% or whatever, since voltage would hit 3416 faster than mAh hit 0.
How does the battery know/think it is full?
When connected to a charger, the phone draws +mA. It can start around 1000mA (depending on the charger), and drops as the battery becomes more and more charged.
Another coded value, the "minimum charge current," tells the battery when to stop drawing current. This is set at default to +80mA.
Another coded value, the "minimum charge voltage," tells the battery that as long as the voltage is less than this #, it should continue to charge. At default, this is 4099mV.
An important concept is that once the charge amperage drops below minimum charge current (and the voltage is > the minimum charge voltage), the battery thinks it is done. Again, that state becomes 100%. Again, the capacity mAh is SET to the full capacity, no matter what is at that time. The actual mAh doesn't matter--it BECOMES whatever is coded as the (age % * full capacity).
As with other values in the battery chip, minimum charge current can be changed. It can be made to 40mA, or 20mA, or whatever you wish. By doing this, the battery will continue to draw current, and thus charge more and longer, until the minimum charge current is met.
Speaking of charging amperage, this can be an issue when using a non-OEM crap car charger when using your smartphone as a GPS. If the DC adapter is NOT truly giving 1A, the phone will use more current than it is receiving, and the battery will continue to LOSE current despite being hooked to a charger. Upgrade your car DC adapter! They are not all made the same.
How does 'bump' charging relate to all this?
Bump charging is essentially a way to trick the battery to continue charging despite the current draw being < the minimum charge current.
There is a problem with this "full" battery detection method:
If you draw enough current from the battery, while it is charging, after the minimum charge volt is reached, you can PREMATURELY fool the battery into thinking it is done.
Say the charging mA is at +200mA. If you turn on your smartphone, start GPS, turn the lights on, stream Pandora, etc., the mA will easily drop from +200 to a lesser value, negative even. The phone will think the charge is complete, since it is <80ma. THAT state becomes 100%, because the mAh get set to full capacity. Falsely.
However, this should only happen when the charge is ~90% or greater (when mv >4099). So, it may not play a huge significant role in battery time, basically missing out on 10% or so of battery life. Also, at the next recharge cycle, provided you don't fool it again, the mAh will be RESET to the more appropriate designated value.
If mAh can be set to whatever value whenever, how do we get it PROPERLY set/calibrated?
There are 2 times when mAh is automatically set. Upon draining the battery to empty (3416mv by default, 3201 preferably), when the phone shuts down, the mAh will be properly set = 0. This is good. We want mAh = 0 when mV = empty voltage.
The other time is when the battery thinks it's full, when minimum charge current is met--this is often not accurately set, not good.
If we start charging when the battery is empty, the mAh rises as the battery is charged. However, the MAXIMUM mAh needs to be watched. The mAh could be HIGHER than the programmed full mAh. Or far lower. Finding this maximum mAh, and reprogramming the battery accordingly, is the key.
Once again, when the battery hits the minimum charge current, the mAh will either jump up to the set battery capacity value (so the battery will die sooner than expected), or less commonly, drop down.
The goal is to get an accurate mAh capacity of the battery, for the voltage range between min + max, and have this set every time the battery is charged to capacity.
If we know the maximum mAh the battery reaches when charging, provided it started from 0, we want to reprogram the battery so that this value is set each time it completes charge.
There is a "learn mode" on the Nexus battery. Provided this was activated, through a series of very specific events, the battery would give itself a "battery age %". This is used to give the accurate (battery age % * full40) = true capacity. On the Nexus, the default battery age was 94%. So, mAh was set at every full charge to 94% of the full40 capacity. Obviously, this is not true for every battery forever.
Once again, why errors can and do occur:
mAh and mV are not directly linked. If mA falls to 0, or mV is less than the cutoff empty voltage, the phone will shutdown, even if the other value is still sufficient.
1. mAh is falsely high. The battery won't last as long as we think it will. Battery % is falsely high. Phone won't get to 0%.
2. mAh is falsely low. The voltage is adequate, but the mAh isn't correct. The battery % is falsely low. Phone gets to 0% too quickly. Perceived loss of battery life duration.
Why use mAh at all? Seems like mV is the only important thing?
I don't know. Why is mAh capacity important in telling the phone to shutdown? Someone enlighten me.
I think one reason is that voltage can and does fluctuate up. So using this to calculate battery % life would be extremely erratic and confusing.
What does this teach us, overall?
I'd have thought there would be much better technology built into battery calibration. Seriously. This is one big mess of poor design.
This is a bunch of technical mumbo jumbo. How does this help me?
On the N1, you can give yourself more battery life!
1. Set your 'empty voltage' lower
2. Set your minimum charge current lower
3. Calibrate the maximum mAh to a higher value to accomodate the new 'empty voltage' and 'minimum charge current' values
4. Don't play with the phone too much when it is >90% charging or it will prematurely end its charge cycle, give you a falsely higher charge %, resulting in the battery dying before you think it should.
5. Profit.
(On an extended 3200mAh battery from Seideo, after lowering the empty voltage and minimum charge current, I found >3900mAh (!) as my new maximum mAh. That's a heck of a lot of free juice).
On other phones? I'm hoping real programmers here can figure out how to do the same.
So, for the Nexus One, there is ABSOLUTELY NO correlation between battery calibration and the battery stats file. NONE. The values on the battery chip determine everything.
So, please comment on how battery calibration tech has changed over the past 2 Nexus generations. If it has.
ADDENDUM:
RogerPodacter, the xda guru/user who was instrumental in creating the N1 battery calibration app, has been looking into the GNex battery quite intently.
I just stumbled across some useful info about our battery fuel gauge from the sgs2 forum. Basically the result is there is not much we can do with our fuel gauge. But they do talk about how to truly calibrate it. And they discuss the improved version max17042 which is used on tbe sgs2 and has all the bells and whistles.
Heres the topic.
http://forum.xda-developers.com/show....php?t=1312273
Click to expand...
Click to collapse
(If you found this info useful, please click the THANKS button!)
Somebody is looking at this already. That same somebody who made the nexus one battery app. This chip doesnt supply amperage either. After i told him my battery seems to only charge to about 4.15v and that on discharging/charging my voltage is everwhere so it is hard to ascertain how accurate my % is. He finally got a chance to look over some stuff and we both think the nexus only allows charging to 4.15v. And. I think the battery shutdowns at 3.6v this go around. From initial observation he led me to believe everyrhing seems to be fine and we might not be able to do much. He might be able to get 4.2v and 3.4v for the voltage cycle. This is partly my speculation but we did agree that samsung may have done this intentionally for longevity of the battery. We will have to wait and see because he is still tinkering with his phone and deciding how to initially proceed. Might be a few days though. I am getting the extended battery soon so i would like to see what changes there are from the 250mah difference.
Sent from my Galaxy Nexus using xda premium
To gleam is to shine or sparkle... to glean is to learn or become knowledgeable about.
FrayAdjacent said:
To gleam is to shine or sparkle... to glean is to learn or become knowledgeable about.
Click to expand...
Click to collapse
..wow, just wow.
To the OP thank you for all this compiled information.
Sent from my Galaxy Nexus using XDA App
FrayAdjacent said:
To gleam is to shine or sparkle... to glean is to learn or become knowledgeable about.
Click to expand...
Click to collapse
I thought the same thing but possible typo. N and m are next to each other. But if op ends up giving us something tangible positively foe the nexus he will have gleamed. Lol.
Sent from my Galaxy Nexus using xda premium
Agggh. I suppose gleam could be appropriate here. But yes, glean was the original intent.
Due to my grammar OCD-ness, it has been edited. =P
@rbiter said:
Somebody is looking at this already. That same somebody who made the nexus one battery app. This chip doesnt supply amperage either. After i told him my battery seems to only charge to about 4.15v and that on discharging/charging my voltage is everwhere so it is hard to ascertain how accurate my % is. He finally got a chance to look over some stuff and we both think the nexus only allows charging to 4.15v. And. I think the battery shutdowns at 3.6v this go around. From initial observation he led me to believe everyrhing seems to be fine and we might not be able to do much. He might be able to get 4.2v and 3.4v for the voltage cycle. This is partly my speculation but we did agree that samsung may have done this intentionally for longevity of the battery. We will have to wait and see because he is still tinkering with his phone and deciding how to initially proceed. Might be a few days though. I am getting the extended battery soon so i would like to see what changes there are from the 250mah difference.
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
Great to hear! Is that on this forum or rootzwiki, or a private communication?
I have noticed that shut down is usually at 3.6 or so. I drained it completely one time with multiple reboot attempts, and I got battery monitor widget to log a 3.417 or so that ONE time, but yes, the battery prefers to quit more around 3.6.
Battery monitor widget outputs an 'estimated' mA, but that's the closest thing I could find.
Wow you brought up the nexus one battery project. I was actually the one who re-wrote that battery driver for the n1 linked in the thread in the first post. Then I wrote the apk with dvghl. I even got my altered battery driver officially merged into the cyan kernel repo for the n1.
Anyway my point is that I learned an ENORMOUS amount about how these fuel gauge chips work, specifically the ds2784 chip in the n1. The bad news is our galaxy nexus chip max17040 doesn't have all the cool features that I cracked open on the ds2784 chip. But still worth trying a few things. Specifically I'm curious what the rcomp register does in our battery driver.
Also the other bad news is our galaxy nexus max17040 cannot give current mA readings. It can only be estimated using battery monitor widget for example.
Unfortunately we don't have a learn mode or age register like we did in the n1, so we can't get too deep into the chip like we did in that project. Kinda unfortunate. Seems the max17040 only has about 7 memory registers, where the n1 ds2784 had about 30 or so registers we could hack into and tweak.
RogerP, so good to see you here! Hope my summary gave some hint as to the enormous amount of effort your project took, and the huge leap in battery charging knowledge it provided.
waylo said:
RogerP, so good to see you here! Hope my summary gave some hint as to the enormous amount of effort your project took, and the huge leap in battery charging knowledge it provided.
Click to expand...
Click to collapse
Hey man, you did a near perfect job with the write up. That project was a one of a kind opportunity in the sense that the ds2784 chip, and the tech sheet and hacks we did, all lined up to be the perfect storm of what we can learn and do with these batteries. So much knowledge was extracted from that effort.
The bad news is that Samsung phones don't typically use the ds2XXX fuel gauge chips, instead they use max1704X chips. These chips use voltage to determine SOC along with their "secret" algorithm that they don't publish. In the end there isn't as much ability to do anything with our fuel gauge like we did with the n1. There are 7 registers or so, SOC, mode, volt, rcomp, but no current and no mAh. The rcomp is the one I was curious about tweaking.
This weekend I was thinking of setting up Ubuntu build environment and attempting to play arount with this new driver and see if we can learn anything more. I'm sure there are more capable devs who maybe already know about this fuel gauge cause the nexus s and other Samsung phones use similar chip. It'd be another fun project if so!
Thanks OP. Very helpful.
Glad to spread the word!
Don't forget to click the THANKS button if I helped!
thanks!! helps alot more knowledgeable now about batteries
I bought the spare battery kit that comes with an external charger. I run my battery to near empty or empty then swap it out. Do the external chargers behave the same way?
Sent from my Galaxy Nexus using Tapatalk
Very happy to see the same crew from the N1 battery calibration days on the GN. I was pretty disappointed when I got the NS and there was little discussion or attention given to the battery at such a detailed level. By the time I picked up the GN I had mostly accepted that the N1 situation and battery related dev/testing/discussion was unique in that it was both possible to tinker with and we had some dedicated fellas, especially you RP, that were willing/able to tackle the task.
As with the N1 battery testing, I'm all in to test and help whenever possible to break some ground with the GN.
This topic made me reminisce about my old N1, wish I hadn't sold it on eBay. I sold it to a Canadian, cost me a bloody fortune to ship to him bc of restrictions on amount of lithium cells/customs regulations. The guy was probably wondering if he bought it from some nut job when it arrived with like 7 batteries of many different manufacture/capacity and spare battery chargers. I half expect that US/CAN Customs put me on some kind of list when they inspected the shipment.
ellesshoo said:
As with the N1 battery testing, I'm all in to test and help whenever possible to break some ground with the GN.
Click to expand...
Click to collapse
I'd also be willing to contribute to these efforts.
Sent from my Galaxy Nexus using Tapatalk
deekjx said:
I bought the spare battery kit that comes with an external charger. I run my battery to near empty or empty then swap it out. Do the external chargers behave the same way?
Click to expand...
Click to collapse
That's an excellent question I don't know the answer to. I'm not sure what kind of charging algorithm the external chargers would use, except to stop charging once the current reaches a certain low level.
As RogerP described above, most of the GNex battery algorithms are a mystery at this point, with some proprietary methods that won't ever be voluntarily revealed =P.
There is probably not a whole lot that can be done with the nexus battery. Yall gotta remember there was a bugnor bad programming revealed and that is why so much time was devoted to that. Roger already found that the battery stops around 4.15 volts. Changing it 4.2 will not make a big difference here and im sure it is intentional to extend charging cycles.
My grandma beat me down and took my nexus. Sent from a jitterbug with beats by dre.
well i dont think this project is "dead". i still plan to compile a kernel with a few batt driver tweaks and see if we can extract what the "rcomp" register is, what values it contains, and if we can tweak it at all. same with the "mode" register. also if you guys browse the source, there is a different driver called max10742 and it has all the extra options including "age". if only samsung had given us that one.
the other thing i want to do, or someone here could do, is map the voltage readings to the batt percentages. we did this way back in the beginning on the n1, except we mapped percentage vs mAh. but here we dont have mAh readings, only volts. what we can learn from this is if the percentage is calculated precisely from the voltage, how linear the mapping is, or if it's loosely estimated based on their modelgauge algorithm or whatever they call it at maxim.
i think it would be easy to just use battery monitor widget and export a full day's worth of your logs. maybe i'll install it and give it a shot.
I already have weeks of mv vs. batt % if you need that, specifically from battery monitor widget.
Graph 1: All data from the start. 5000 data points.
Graph 2: ~600 data points, starting from after I ran the battery down to 0 completely, plugged in with phone off, and charged to 100%.
Not sure why all the data gives 2 distinctly different patterns. The lower data plots seems more favorable, with higher % at lower mV.

Defy battery drops explained

Recently many users of the Motorola Defy phone have encountered sudden drops in battery charge after installing a new ROM. Such as, drops from 67% to 49%, from 34% to 19%, from 7% to 4%, etc.
I also have encountered such problem when installed CM7.2 after being used stock Froyo ROM for more than an year. I had searched forums for possible fix, but no method has helped.
Finally, I have made some tests with my phone and found interesting points about Defy battery that explain battery percentage drops.
Our Defy have very simple battery controller (it is referred as cpcap by Motorola). The controller does not calculate and provide battery percentage. It provides only a battery voltage and a current. The battd daemon do the battery percentage estimation. It seems some overcomplicated estimation algorithm is used to do that (I've seen the Coulomb counter technique is mentioned in the battd sources).
There are several battery percentage checkpoints at 5%, 20%, 50%, 80%, 100%. It seems the battd daemon have a voltage-percentage mapping table for these checkpoints. When a battery voltage reaches a checkpoint value then the percentage is immediately set to a corresponding value. All other intermediate percentage values are estimated by the battd daemon. The estimation is based on a battery capacity (requested from the battery itself) and the active current. A stock battery reports 1500 capacity. A 1700mAh Chinese battery, I also have, reports only 1200 capacity :laugh: battd stores the last calculated battery percentage and voltage in the /data/battd/cc_data file. Data from the /data/battd/cc_data file is read on start-up and the percentage from this file is used as base and reported to the system. When battery is drained, the percentage is decremented. When you delete the cc_data and reboot, battd uses the current voltage and looks for the nearest checkpoint voltage value and sets the percentage accordingly.
How have I found the checkpoint values above?
Assume we have a brand new original Defy battery and it shows 25% of charge.
If you delete the cc_data file and then reboot the phone, battd will recreate the file and request the battery controller(?) for the current battery status. The controller will return 50% and battd show 49% to you (not 49% not 50%, due to rounding to the lowest integer). But the real charge is 25%! Now let the battery discharge. It will show to you 48%, 47%, 46%, etc. Great! But at 40-44% you get the instant drop to 19%, since the battery controller had reported real 20% charge at that point and battd has been forced to sync its estimated charge value to the real charge value.
When a battery is wearing its actual capacity is decreased. For example, it may be 1300 mAh after an year of usage. But battery still reports it have 1500 capacity and battd uses this capacity for its calculations. battd should decrement percentage a bit faster for this worn battery, but it still use the same decrement speed as for a new 1500 battery. When battery voltage reaches a check point value, battd updates percentage to corresponding checkpoint value and you register a drop.
battd has some battery information and correction data in the /pds/public/battd folder. This data helps battd to estimate battery charge more correctly. This folder contain 3 files:
Code:
batt_offset_data
batt_phasing_data
batt_tuning_data
Without this correction data you may encounter slight drops even on a new stock battery,
For Defy there at least 2 versions of battd. (Defy+ uses a different battd) Let's name them as old and new ones. To find out which version you have, check the size of the /data/battd/cc_data file.
cc_data = 16 bytes - old battd,
cc_data = 24 bytes - new battd.
Early stock Froyo ROMs have the old battd, newer stock ROMs have the new battd. CM7.2 is bundled with the new battd.
Is the battd version makes any difference in the battery readings? YES. The difference is in a user account which is used to run a battd daemon.
The old battd uses the mot_accy user account, The new battd uses the system account. The corresponding owner and group should be set for the /pds/public/battd folder and files inside it. Otherwise battd will not be able to read battery data from the /pds/public/battd folder and defaults will be used, which cause inaccurate estimations.
If you have used stock old Froyo ROM or old custom ROM, you had the old battd. The /pds/public/battd folder has permissions for the mot_accy user account only.
You install the CM7.2 ROM with the new battd and it can not read battery data from the /pds/public/battd folder, since battd is run under the system user account. You have inaccurate battery estimation and percentage drops even on a brand new battery.
That's why installing the old battd (and its companion lib libbattd.so) on CM7.2 resolves battery drops issue for some users.
If you are using CM7.2 or any newer CM you can just change the owner and group for the /pds/public/battd folder and files inside it. Set both owner and group to system and the new battd will be able to read battery data files.
If you still have battery drops then your battery is worn to some degree and battd can not estimate its charge properly between checkpoints.
Is it possible to correct this? Probably yes.
I was able to adjust checkpoint voltage values and eliminate drops on checkpoints. BUT the discharging speed is still the same and I have good discharge without drops from 100% to 10% and phone is turned off on 10% since a battery reaches critical voltage of 3.050V.
To adjust checkpoints it is needed to change the /pds/public/battd/batt_offset_data file. I have changed the last 3 bytes to 0xA0. It offsets voltage value for checkpoints on 50%, 20% and 5%.
The batt_phasing_data file have not helped at all in my tests. It contains correction values for displayed voltage, temperature, current.
The batt_tuning_data file is total mystery atm.
So the goal is to find a way to force battd to decrement percents faster for worn batteries. The simplest way is to patch the battd with hardcoded capacity value (e.g. 1300) instead of reading this value from the battery.
The other (better) option is to create a custom battery driver and use a very simple mapping from current voltage to percentage. Such method is used to display battery status in touch boot menu. Also Quarx started a custom battery driver some time ago in his git repository.
Important:
The battery calibration is a myth! The /data/system/batterystats.bin file is not related to battery charge/life/status (exactly as Google devs stated earlier).
In case of our Defy, charge the battery to 100% and keep charging for few hours after that. Then disconnect it battd will display correct 99%. That's all you need when changing ROMs or batteries! Do not waste your time on "battery calibration"!
Conclusion:
Find out which version of battd you are using.
Check owner and permissions for the /pds/public/battd folder and files inside it. Correct owner/permissions if needed.
Charge your battery to 100% and keep charging for few hours more.
If you still have battery percentage drops after that, your battery is worn to some degree. The sum of dropped percents indicates how bad is your battery (-10%, -15% etc, compared to a new battery). There is no way to magically increase real life for this battery. Drops just a display issue due to crappy cheap battery controller in our Defy and weak battd estimation logic. That's why stock ROMs have 10% steps for battery charge - to hide such issues.
nice investigation, indeed great job.
however, i would not agree to this:
jusid said:
Conclusion:
If you have battery percentage drops after single full battery charge, your battery is worn. The sum of dropped percents indicates how bad is your battery.
Click to expand...
Click to collapse
there's also hoop while charging which "compensates" the drop. moreover, there are no sudden voltage drops or so which would mean the battery is just fine, only the readings fail.
i wonder if can it be fixed or so by our devs?
MarcinRN said:
there's also hoop while charging which "compensates" the drop. moreover, there are no sudden voltage drops or so which would mean the battery is just fine, only the readings fail.
i wonder if can it be fixed or so by our devs?
Click to expand...
Click to collapse
Slightly worn battery does not have voltage drops, it just discharges faster due to lower capacity. battd expects slower discharging speed (as in a new battery) while making calculations. That's why the drops occurs when the real charge got from the controller. Drops are just a display issue, but your battery is worn to some degree (-10%, -15%, etc)
This thread should be stickied, or the info added to the all in one defy beginner guide
jusid said:
Slightly worn battery does not have voltage drops, it just discharges faster due to lower capacity. battd expects slower discharging speed (as in a new battery) while making calculations. That's why the drops occurs when the real charge got from the controller. Drops are just a display issue, but your battery is worn to some degree (-10%, -15%, etc)
Click to expand...
Click to collapse
Thanks I get it now. But the question is can anything be done to make it more accurate?
Great round up!
Would you mind supporting your findings with sources? Helps against criticism, trolling and so on...
Thanks a lot for sharing.
MarcinRN said:
Thanks I get it now. But the question is can anything be done to make it more accurate?
Click to expand...
Click to collapse
As I mentioned before, possibly battd has some auto-adjusting logic, bat I'm not sure about that. The solution is to create some proxy between battd and the system with a better estimation logic or create a new battd. But both are quite hard to implement.
As for me, I am going to purchase a new non-stock battery. Then I test how its controller behaves.
measel said:
Great round up!
Would you mind supporting your findings with sources? Helps against criticism, trolling and so on...
Thanks a lot for sharing.
Click to expand...
Click to collapse
These findings are based on simple tests. One of them is described in the OP.
For example, discharge your battery to 51%, then delete files in the /data/battd folder. Reboot the phone. You will get 79% of charge, since the controller reports 80% and the nearest lower step is 50% and it is not reached yet. Then the phone will show 78%, 77%, etc for some short time and then suddenly drops to 49% when the battery controller report the real charge to the system.
Using such method I have found all possible values which are reported by the controller of the stock Defy battery - 0%, 5%, 20%, 50%, 80%, 100%...
Excelent work... I've notice that it was a system behavior instead of a bug, but the test you've made everything very clear.
I'm waiting to buy a new battery on a official reseller, the one I've bought is not genuine and showed the same behavior.
Sadly, I replaced my battery with a new one, the drop still show up, this disprove some of your points. But still thanks for the useful information.
for me is working this fix made by me for my DEFY+ bl7 (files from stock ROM)
Sent from my MB526 using xda app-developers app
If you have DEFY+ try this http://forum.xda-developers.com/showpost.php?p=28893630&postcount=150 and you will see
Sent from my MB526 using xda app-developers app
Sent from my MB526 using xda app-developers app
it's there a difference between ur stock battd file from bl7 ROM and the other battd files? maybe it's better programmed from moto ^^
Defy mit Android 4.0.4 CM9 RockZ
Chelsea888 said:
Sadly, I replaced my battery with a new one, the drop still show up, this disprove some of your points. But still thanks for the useful information.
Click to expand...
Click to collapse
There are several battd versions are floating around. Maybe some of them is better for your battery.
Also if you have purchased a stock moto battery on ebay, it may be not new, but already used...
I have found that battd has references to the following files in the /pds/public/battd folder:
batt_phasing_data
batt_tuning_data
batt_offset_data
Probably they contain some tuning parameters to prevent drops for worn batteries...
Something is missing here... because when I flash cm9 for the first time in my 1 month defy, suffer the battery drops in a really weird way (67 to 30, 30-19, 19-4) in just 10 mins. So, this happen even in a new battery.
Enviado desde mi MB525 usando Tapatalk 2
this indeed is a very helpful insight into the how and why of charge drop on our defy...i had observed this shoot ups on reboot and drops imminently afterwards also but couldn't pin onto it due to my lack of expertise...you made it all so clear...a big thanks...and certainly Moto is a bad implementer of good hardware as has been evident with their Defy with robust cpu/gpu...camera hardware...etc...maybe that is also a reason why they do not provide support for their older models for software upgrades as well
espaciosalter20 said:
Something is missing here... because when I flash cm9 for the first time in my 1 month defy, suffer the battery drops in a really weird way (67 to 30, 30-19, 19-4) in just 10 mins. So, this happen even in a new battery.
Enviado desde mi MB525 usando Tapatalk 2
Click to expand...
Click to collapse
You need to charge the battery to 100% just after installing a new ROM. After that the battd will be synced with the real battery charge. After that if the battery is OK there should be no drops.
But battd auto-adjustments and different battd versions need to be investigated...
As walter79 once said, after the total battery charge, keep the phone to charge more for an hour!
For me it worked on any rom I tested!
jusid said:
Conclusion:
If you have battery percentage drops after single full battery charge, your battery is worn to some degree. The sum of dropped percents indicates how bad is your battery (-10%, -15% etc, compared to a new battery). There is no way to magically increase life for this battery. Drops just a display issue due to crappy cheap controller in Defy batteries and weak battd estimation logic. That's why stock ROMs have 10% steps for battery charge - to hide such issues.
And finally:
The battery calibration is a myth! The /data/system/batterystats.bin file is not related to battery charge/life/status (exactly as Google devs stated earlier).
In case of our Defy, real battery status is synced with the battd status when you charge to 100%. That's all you need when changing ROMs or batteries!
Click to expand...
Click to collapse
I'm glad someone addressed this problem, but when I first flashed CM7.1.0 waaay back a month after I got my phone, it had this problem. Battery worn? I don't think so.
Anyways, this discussion seems to make sense, but it would really be nice if you could cite some sources. Thanks again.

[DISCUSSION] Use stock ROM for your battery's health

Hello everybody.
I just want to share with you guys what I found out.
I've been using custom ROMs and custom kernels for LG V30, and I faced a lot of issues. The most common issue is overheating, especially on charging or using mobile data.
I use Anker's adapter that supports Quick Charge 3.0, and an Anker USB-C to USB-3.0 cable. I use Ampere app to see how the battery is charge.
On custom ROMs, the ampere number (mA) changes every few seconds, jumps up and down with big gap, and the phone gets very hot.
On stock ROM (US99820H) in my case, mA number is very stable. It increases or decreases slowly and doesn't jump up and down. On plugging in, min and max mA are equal. The phone is just a little bit hotter than before plugging in.
So I just wanted to share my own experience with you guys. If you want you phone to last long, use Stock ROMs, disable bloatwares and useless system apps.
I'm going to purchase the battery and change it myself for better battery life. I wanted to change to another phone but for now, this is the best phone for music.
Please discuss if you disagree with me or have a solution for custom ROMs.
minhntp said:
Hello everybody.
I just want to share with you guys what I found out.
I've been using custom ROMs and custom kernels for LG V30, and I faced a lot of issues. The most common issue is overheating, especially on charging or using mobile data.
I use Anker's adapter that supports Quick Charge 3.0, and an Anker USB-C to USB-3.0 cable. I use Ampere app to see how the battery is charge.
On custom ROMs, the ampere number (mA) changes every few seconds, jumps up and down with big gap, and the phone gets very hot.
On stock ROM (US99820H) in my case, mA number is very stable. It increases or decreases slowly and doesn't jump up and down. On plugging in, min and max mA are equal. The phone is just a little bit hotter than before plugging in.
So I just wanted to share my own experience with you guys. If you want you phone to last long, use Stock ROMs, disable bloatwares and useless system apps.
I'm going to purchase the battery and change it myself for better battery life. I wanted to change to another phone but for now, this is the best phone for music.
Please discuss if you disagree with me or have a solution for custom ROMs.
Click to expand...
Click to collapse
I also felt the same...Though the charging speed on custom roms is higher...in terms of stability of current, Stock Rom is the best.
minhntp said:
Hello everybody.
I just want to share with you guys what I found out.
I've been using custom ROMs and custom kernels for LG V30, and I faced a lot of issues. The most common issue is overheating, especially on charging or using mobile data.
I use Anker's adapter that supports Quick Charge 3.0, and an Anker USB-C to USB-3.0 cable. I use Ampere app to see how the battery is charge.
On custom ROMs, the ampere number (mA) changes every few seconds, jumps up and down with big gap, and the phone gets very hot.
On stock ROM (US99820H) in my case, mA number is very stable. It increases or decreases slowly and doesn't jump up and down. On plugging in, min and max mA are equal. The phone is just a little bit hotter than before plugging in.
So I just wanted to share my own experience with you guys. If you want you phone to last long, use Stock ROMs, disable bloatwares and useless system apps.
I'm going to purchase the battery and change it myself for better battery life. I wanted to change to another phone but for now, this is the best phone for music.
Please discuss if you disagree with me or have a solution for custom ROMs.
Click to expand...
Click to collapse
In terms of stability, I have different results, when I charge using a custom rom the phone tends to stay cool, but when I used the stock rom the phone got a lot hotter then before charging.
Custom ROMs may not be utilizing QC properly. QC 2.0 has few discrete voltage/current steps, while QC 3.0 has many (200mA increments iirc) designed to strike a balance between charging speed and heat. Maybe it's getting stuck in QC 2.0 mode and the temperature feedback isn't working properly?
You could just use a non-fast-charging wireless charger, if you're only charging up at night. 5v/~1A is pretty much harmless, it's just on the slow side of things.
fyi, battery capacity (as tracked by the charging controller driver, I guess) is stored at sys/class/power_supply/bms/charge_full; it defaults to design capacity until a full charge cycle has been completed* and then I suppose is revised each time the driver tracks less energy has been stored after a complete charge. Cycle count, cell resistance and a couple other things are also stored here. I think all values are persistent until the battery is physically disconnected.
Might be worth doing a full discharge+charge (to 100%, then let it sit for a few hours to saturate) to see if your battery is worn enough to warrant pulling the phone apart. Accubattery does seem to be more or less accurate, so you charge while it's on you can get a real-time idea of how much has gone in.
* a full charge might be from 1% to 100%. It might be from 5% to 100%. Who knows! I've charged from 2% to 100% a couple times and not had cycle_count increase.
Also, if you do go shopping, beware of undersized batteries. I bought an "OE spec" battery a while ago that was obviously thinner and lighter than the original; it weighed some 12.5% less and only took a 3000mah charge, more or less lining up with the reduced weight. The seller was "tele*cell", and I very much doubt they're the only ones pulling this crap. Record the contents of power_supply/bms if they're important to you, too, as they zero out upon battery disconnect.
edit: hmm, thinking about it...bms = Battery Management System? (not this one specifically, of course)
Septfox said:
Also, if you do go shopping, beware of undersized batteries. I bought an "OE spec" battery a while ago that was obviously thinner and lighter than the original; it weighed some 12.5% less and only took a 3000mah charge, more or less lining up with the reduced weight. The seller was "tele*cell", and I very much doubt they're the only ones pulling this crap. Record the contents of power_supply/bms if they're important to you, too, as they zero out upon battery disconnect.
Click to expand...
Click to collapse
It is possible that you bought a smaller battery - but you should know that the capacity of Li** batteries increases within the first couple of cycles. Also usually the nominal capacity might be different from the real (typical) capacity. So you would need to meassure a.new original battery against your replacement battery (not take the value LG tells us for.granted)
daniu said:
It is possible that you bought a smaller battery - but you should know that the capacity of Li** batteries increases within the first couple of cycles. Also usually the nominal capacity might be different from the real (typical) capacity. So you would need to meassure a.new original battery against your replacement battery (not take the value LG tells us for.granted)
Click to expand...
Click to collapse
Li-po capacity hasn't really gone anywhere in a while, and I wouldn't expect cheap eBay batteries to be using the newest and best chemistry. It was definitely undersize/weight; I attached some pictures.
Because I wanted to be absolutely sure before I called the seller on it, I purposefully ran it four full cycles, then built up another two during normal use. The best capacity that the BMS ever rated it for was 2980mah, while Accubattery put in something like...3060mah once with subsequent charges in the 2900-3000 range.
While I get what you're saying, I find it unlikely that the BMS would set to the expected design capacity if they were using undersize batteries from the factory.
The reason being that at a guess, the battery "fuel gauge" is probably based on capacity_full, which = capacity_full_design until set. With a new phone that isn't charged to 100% (thus setting capacity_full), if using the phone down to 1% you'd risk either a) the phone suddenly shutting down at ~10% or b) overdischarge damage if the battery is actually less than the phone's design capacity.
Kind of a corner case though, I'll admit, since this would only be on the first run.
Last, I submit my own OEM battery for consideration: prior to taking it out, it had accumulated 537 cycles and had a recorded capacity of 2485mah. That's about what I'd expect from a 3300mah battery that was almost certainly used "normally" e.g. discharged daily, charged nightly and left on the tap at full charge for hours on end.
Like you said, though, the only way to know for sure would be testing a new OEM battery, and we've been fresh out of those for a year and a half now. Maybe someone could nab one from one of their newer models and test for science? I already have too many spare lipo cells laying around.
Septfox said:
Custom ROMs may not be utilizing QC properly. QC 2.0 has few discrete voltage/current steps, while QC 3.0 has many (200mA increments iirc) designed to strike a balance between charging speed and heat. Maybe it's getting stuck in QC 2.0 mode and the temperature feedback isn't working properly?
You could just use a non-fast-charging wireless charger, if you're only charging up at night. 5v/~1A is pretty much harmless, it's just on the slow side of things.
fyi, battery capacity (as tracked by the charging controller driver, I guess) is stored at sys/class/power_supply/bms/charge_full; it defaults to design capacity until a full charge cycle has been completed* and then I suppose is revised each time the driver tracks less energy has been stored after a complete charge. Cycle count, cell resistance and a couple other things are also stored here. I think all values are persistent until the battery is physically disconnected.
Might be worth doing a full discharge+charge (to 100%, then let it sit for a few hours to saturate) to see if your battery is worn enough to warrant pulling the phone apart. Accubattery does seem to be more or less accurate, so you charge while it's on you can get a real-time idea of how much has gone in.
* a full charge might be from 1% to 100%. It might be from 5% to 100%. Who knows! I've charged from 2% to 100% a couple times and not had cycle_count increase.
Also, if you do go shopping, beware of undersized batteries. I bought an "OE spec" battery a while ago that was obviously thinner and lighter than the original; it weighed some 12.5% less and only took a 3000mah charge, more or less lining up with the reduced weight. The seller was "tele*cell", and I very much doubt they're the only ones pulling this crap. Record the contents of power_supply/bms if they're important to you, too, as they zero out upon battery disconnect.
edit: hmm, thinking about it...bms = Battery Management System? (not this one specifically, of course)
Click to expand...
Click to collapse
Do you have sleep problem after changing the battery? After changing the battery, my phone doesn't go to sleep when the screen is off, so the battery just keeps draining. I'm using stock ROM. I don't know if this is a software of hardware issue.
minhntp said:
Do you have sleep problem after changing the battery? After changing the battery, my phone doesn't go to sleep when the screen is off, so the battery just keeps draining. I'm using stock ROM. I don't know if this is a software of hardware issue.
Click to expand...
Click to collapse
The only thing notable that happened was the battery stats getting wiped. Otherwise the phone behaved normally.
Try getting BetterBatteryStats, second post has the newest apk attached (2.3 iirc).
Start it up to get it established, Set Custom Ref. from the menu, shut the screen off for...ehh...20min.
Turn it back on, select Custom in the left drop-down menu and Current in the right drop-down menu.
Check Kernel Wakelocks and Partial Wakelocks using the top drop-down menu to see if anything sticks out.
Septfox said:
Li-po capacity hasn't really gone anywhere in a while, and I wouldn't expect cheap eBay batteries to be using the newest and best chemistry. It was definitely undersize/weight; I attached some pictures.
Because I wanted to be absolutely sure before I called the seller on it, I purposefully ran it four full cycles, then built up another two during normal use. The best capacity that the BMS ever rated it for was 2980mah, while Accubattery put in something like...3060mah once with subsequent charges in the 2900-3000 range.
While I get what you're saying, I find it unlikely that the BMS would set to the expected design capacity if they were using undersize batteries from the factory.
The reason being that at a guess, the battery "fuel gauge" is probably based on capacity_full, which = capacity_full_design until set. With a new phone that isn't charged to 100% (thus setting capacity_full), if using the phone down to 1% you'd risk either a) the phone suddenly shutting down at ~10% or b) overdischarge damage if the battery is actually less than the phone's design capacity.
Kind of a corner case though, I'll admit, since this would only be on the first run.
Last, I submit my own OEM battery for consideration: prior to taking it out, it had accumulated 537 cycles and had a recorded capacity of 2485mah. That's about what I'd expect from a 3300mah battery that was almost certainly used "normally" e.g. discharged daily, charged nightly and left on the tap at full charge for hours on end.
Like you said, though, the only way to know for sure would be testing a new OEM battery, and we've been fresh out of those for a year and a half now. Maybe someone could nab one from one of their newer models and test for science? I already have too many spare lipo cells laying around.
Click to expand...
Click to collapse
What is the full capacity when you put those 2 battery in?
I just bought a battery. This new one has 6 symbols each line (like the one you bought) and 2 lines of manufactured date. The old (original) one has 5 symbols each line and also 2 lines of manufatured date.
When I check "charge_full" after full charging, it shows 3312000 for the original battery and 3230000 for the new one, while the "charge_full_design" being 3312000 for both battery.
minhntp said:
What is the full capacity when you put those 2 battery in?
I just bought a battery. This new one has 6 symbols each line (like the one you bought) and 2 lines of manufactured date. The old (original) one has 5 symbols each line and also 2 lines of manufatured date.
When I check "charge_full" after full charging, it shows 3312000 for the original battery and 3230000 for the new one, while the "charge_full_design" being 3312000 for both battery.
Click to expand...
Click to collapse
All three batteries I've had showed the same 3312000 charge_full_design. But I'm not sure if this is relevant to us, aside from as a reference to compare to.
Out of curiosity and so I don't purposely give outright bad information, I went and looked at the kernel (up on github courtesy of lunar-kernels).
3300mah design capacity is set when the kernel is built (BLT34 battery profile, which is grabbed by the power manager).
I'm not sure where the number "3312000" specifically is coming from. I can't read the source for the BMS well enough to tell why it's coming up with that number, aside from it's a calculated result based on more than just the design capacity.
Based on the above and other behavior, I don't think any permanent information is stored with or retrieved from the battery itself; design parameters are set in the BLT34 profile and then the BMS amends certain things as it takes measurements. It assumes that whatever attached battery is actually 3300/3312mah until proven otherwise (calibrated with sufficient cycling).
Said measurements are stored ~somewhere~ outside of the ROM, recovery and download mode - mine persisted through the LAFsploit process and TWRP on both partitions - and cleared when power is lost. Maybe they're stored in RAM somewhere? Maybe the BMS notices the discontinuity in power and assumes a battery change, resetting everything? I'll try making sense of the kernel source to see...
The labeling difference is curious, and something I hadn't really given thought to. The newer ones have NOM and NYCE marks, which are Mexican safety approval things. It's interesting that the originals don't have them; maybe because LG doesn't make phones for the Mexican market and thus saw no need? I doubt these third-party manufacturers have gone out of their way to actually obtain said approval...probably just stuck them there to satisfy customs.
I bought a battery from another seller and installed it this weekend; it uses the 12-symbol style as well, has date+date code like the original (dated a rather shiny 2019.09.08!), and weighs the expected 48g/has an OE-style "stepped" back making it thicker.
Seems to charge fully and otherwise work as expected. charge_full still = charge_full_design, I'm not sure if this is because the BMS has determined that it's an OEM-capacity battery, or it hasn't cycled sufficiently to update. Gonna keep an eye on it. Pictures attached.
Edit: battery listing on ebay. Note if anyone else buys it: the suction cup that came with mine was 100% useless. Plan accordingly.
-
A further note on the smaller battery I bought: it did perform admirably. It had no issues when using the phone as a power supply (~2.5A sustained output), right down to where I stopped it at 5%, which is rather abusive for cells in this form-factor. It was just...well...smaller. It certainly wasn't a bad battery at all, it was just misrepresented. Lighter/slightly-smaller batteries would make great travel batteries, if the V30 were swap-friendly...
-
@Septfox
I hope you bought a good one.
The battery I bought lasts long, but also takes long to charge (about 2 hours). The phone shows fast-charging but when I check battery log in Hidden menu, it shows only Quick charge 2.0.
I found a way to reset the battery information, hopefully sellers don't use this to reset the cycle count.
There's a thread on xda that shows a method to reset battery information on HTC phones. That is holding down 2 volume buttons + power button (volume down + power for LG V30) in 2 minutes while the phone is being charged, let the phone restart as many times it takes in 2 minutes. And then charge the phone to full.
I did that and when I check in Hidden menu, the battery information was resetted to 3312000 full capacity and 0 cycle count.
minhntp said:
@Septfox
The battery I bought lasts long, but also takes long to charge (about 2 hours). The phone shows fast-charging but when I check battery log in Hidden menu, it shows only Quick charge 2.0.
Click to expand...
Click to collapse
QC 3.0 wouldn't outright increase the speed any; it exists to help reduce heat and provide more consistent charging.
If it makes you feel any better, mine is also getting stuck on QC 2.0. Judging by the way the Parallel Charging status flickers on and off as I move the cable and put pressure on the connector, I could probably stand to get a new charging port...
This is why wireless charging is a good idea. But now that I think about it, replacement boards are cheap on ebay ($5), so replacing it each time the battery is changed might be a good bit of cheap maintenance to do :good:
Have you tried a different cable and/or charger to see if your charging improves? Maybe you need a new port, too.
minhntp said:
I found a way to reset the battery information, hopefully sellers don't use this to reset the cycle count.
There's a thread on xda that shows a method to reset battery information on HTC phones. That is holding down 2 volume buttons + power button (volume down + power for LG V30) in 2 minutes while the phone is being charged, let the phone restart as many times it takes in 2 minutes. And then charge the phone to full.
I did that and when I check in Hidden menu, the battery information was resetted to 3312000 full capacity and 0 cycle count.
Click to expand...
Click to collapse
I find this slightly alarming, actually...
The normal button combination to hard-reset the phone is power+vol down. This might just be what's happening, and by making the phone do it repeatedly, the firmware might be interpreting it as a bootloop condition caused by something in memory and completely disconnecting power in an attempt to mitigate it (clearing the battery stats in the process). Probably harmless though.
Dunno that a seller would bother trying it, though. What do they get out of it, other than a seemingly-new battery with less capacity than it should have? It would just recalibrate when charged and show the real capacity in the hidden menu, and the game would be up :v
Septfox said:
QC 3.0 wouldn't outright increase the speed any; it exists to help reduce heat and provide more consistent charging.
If it makes you feel any better, mine is also getting stuck on QC 2.0
Click to expand...
Click to collapse
All V30 always show QuickCharge 2.0 in Nougat as well as Oreo. Not sure about Pie.
Speculation was it was a script error, that it was really 3.0 -- but falsely shows 2.0.
Can't remember if it was ever proven one way or the other.
I do remember people say it now charges slower on Pie. Again speculative because LG knows batteries are older?
I'm still on rooted Oreo, so I don't care.
ChazzMatt said:
I do remember people say it now charges slower on Pie. Again speculative because LG knows batteries are older?
Click to expand...
Click to collapse
I don't notice my phone charging any different. Even when using wired.
Sent from my LG-H932 using XDA Labs
ChazzMatt said:
All V30 always show QuickCharge 2.0 in Nougat as well as Oreo. Not sure about Pie.
Speculation was it was a script error, that it was really 3.0 -- but falsely shows 2.0.
Can't remember if it was ever proven one way or the other.
Click to expand...
Click to collapse
I read "the display may not be correct, so you should totally use this as an excuse to get a newer charger-doctor that supports QC".
...and you're completely right, I'm gonna go do that :v
ChazzMatt said:
I do remember people say it now charges slower on Pie. Again speculative because LG knows batteries are older?
Click to expand...
Click to collapse
Or to mitigate further aging by reducing internal heat. I also remember seeing somewhere that it was limited to 12w or 13w, now that you mention it, though that might have been for 15w wireless which has a reputation for slow-cooking the battery (in any phone, not just the V30).

Categories

Resources