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.
Related
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.
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.
This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
Root access with adb (a.k.a. insecure)
Charger is modified to stop charging at 4000mV and > 80%, and start charging again at 3990mV or < 80%.
Rationales:
Stock kernel: I value compatibility and stability. While the various mods and new features are undoubtedly very useful for many people, some of them are not well tested which results in lower stability. That is not to say stock Android is extremely stable (it is not), adding new features on top of which very often increases the likelyhood of crashes.
Limited charging: As a developer, my phone is virtually plugged in the computer all the time. As many of you are aware, leaving the phone charged greatly reduces battery life (Ref). This kernel frees you from having to unplugging and plugging in the phone repeatedly in fear of destroying your precious battery.
Visible differences:
Charging percentage will not increase after the phone is charged to 80% or more.
The phone never reports full charge, even if it's charged while being turned off. That means battery stats can accumulate which, after a while, makes it practically useless as the diagram is too compressed. This is a plus to me as I can see how I manage the battery over time, although I can make an alternate version which reports full charge whenever the phone stops charging under requests.
Perhaps I'm the only one who is paranoid about keeping battery charge between 10-90%, I wouldn't be surprised if no one is interested it this at all.
The kernel can be flashed using Odin or fastboot. If someone wants a CWM-flashable zip let me know.
Cheers.
You could have simply used my BLX mod.
Ezekeel said:
You could have simply used my BLX mod.
Click to expand...
Click to collapse
Glad to know I'm not the only one. When I was using the SGS2 I spent quite a bit of time looking for such mod to no avail. Searching for "android|galaxy nexus limit charging voltage" turned up lots of posts about changing kernel voltage which wasn't what I wanted.
I like to keep the kernel close to stock, but thanks anyway .
Hey, an idea to you devs: what about a apk that schedules the charge limit? for example, if you use to charge your phone at night and you wake up at 7 that app could charge the phone @ 60% and at 6 start charging'till it reaches the 100%
With ezekeel BLX mod it should be easy to schedule modifying the file, but i have no idea on programming nor cron
Guzmanus said:
Hey, an idea to you devs: what about a apk that schedules the charge limit? for example, if you use to charge your phone at night and you wake up at 7 that app could charge the phone @ 60% and at 6 start charging'till it reaches the 100%
With ezekeel BLX mod it should be easy to schedule modifying the file, but i have no idea on programming nor cron
Click to expand...
Click to collapse
You can do that with Tasker, it is a bit on the heavy side but saves having another service running in the background while leaves the possibility to do a lot more. I'm not aware of other light-weight but user friendly solutions for managing scripts, perhaps others could chime in.
Ezekeel said:
You could have simply used my BLX mod.
Click to expand...
Click to collapse
agree with ezekieel...his Battery Life eXtender (BLX)do the same thing(via file /sys/class/misc/batterylifeextender/charging_limit default 100),without give up at all the tweaks,oc,color control etc. try that if you want.anyway thanks for the work,personally it not interest me,but certainly someone will find it usefull!
fnf said:
This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
Root access with adb (a.k.a. insecure)
Charger is modified to stop charging at 4000mAh and > 80%, and start charging again at 3990mAh or < 80%.
Rationales:
Stock kernel: I value compatibility and stability. While the various mods and new features are undoubtedly very useful for many people, some of them are not well tested which results in lower stability. That is not to say stock Android is extremely stable (it is not), adding new features on top of which very often increases the likelyhood of crashes.
Limited charging: As a developer, my phone is virtually plugged in the computer all the time. As many of you are aware, leaving the phone charged greatly reduces battery life (Ref). This kernel frees you from having to unplugging and plugging in the phone repeatedly in fear of destroying your precious battery.
Visible differences:
Charging percentage will not increase after the phone is charged to 80% or more.
The phone never reports full charge, even if it's charged while being turned off. That means battery stats can accumulate which, after a while, makes it practically useless as the diagram is too compressed. This is a plus to me as I can see how I manage the battery over time, although I can make an alternate version which reports full charge whenever the phone stops charging under requests.
Perhaps I'm the only one who is paranoid about keeping battery charge between 10-90%, I wouldn't be surprised if no one is interested it this at all.
The kernel can be flashed using Odin or fastboot. If someone wants a CWM-flashable zip let me know.
Cheers.
Click to expand...
Click to collapse
Source code?? It has to have a link.
Since you modified the kernel
Mikey said:
Source code?? It has to have a link.
Since you modified the kernel
Click to expand...
Click to collapse
Not much to speak of tbh. Here is the patch. You can build it from the stock branch 4.0.3_r1 . I changed the compilation flags so it better matches Cortex A9 but I'm sure there are rooms for performance improvements.
GLaDOS kernel has this value configurable as well so aside from being stable, this kernel is worse all around .
I assume you meant 4000 mV, not 4000 mAh? Considering that not even extended batteries I've seen exceed 3500 mAh?
Entropy512 said:
I assume you meant 4000 mV, not 4000 mAh? Considering that not even extended batteries I've seen exceed 3500 mAh?
Click to expand...
Click to collapse
Post amended, thanks .
fnf said:
This is a stock kernel for GSM Galaxy Nexus 4.0.3 with the following properties:
Root access with adb (a.k.a. insecure)
Charger is modified to stop charging at 4000mV and > 80%, and start charging again at 3990mV or < 80%.
Click to expand...
Click to collapse
Ezekeel said:
You could have simply used my BLX mod.
Click to expand...
Click to collapse
Greetings gentlemen! I've been testing wireless charging with Galaxy Nexus and Nexus 5, and while I like the technology, I'm not comfortable with two side-effects: higher battery temperature, and higher average battery charge voltage. I'd like to work around this by limiting the charge capacity to 80% / 4.0v.
I think the lost battery capacity will work for me because the way I'm using the wireless chargers is keeping the batteries topped up all day. By keeping wireless chargers by the bed and the main work space, the phones hardly ever run down! But this also keeps the battery at 100% constantly. Thus my 5-year-old bright idea to limit the voltage!
What's the state of the art of this problem solution? Should I ask a kernel developer to include https://github.com/Ezekeel/GLaDOS-nexus-s/tree/blx ?
everyday when I use the galaxy nexus my routine is.
before I sleep, I plug my phone to my phone charger and I pull it out after I wake up. so its basically charging for about 5-7 hours on average.
is this decreasing my battery life? because ever since I had the nexus, I did this and I have never had battery life compared to what people post on xda despite trying out roms/kernels.
so that was my first question.
my second question is, is flashing like getting a new device? after I flash, is the battery life suppose to be bad?
I constantly flash almost every other day and I'm not sure if this is the reason my battery life is so bad.
am I suppose to use my phone for couple weeks before I get good battery life?
btw. I have a cdma galaxy nexus .thanks
Sent from my Galaxy Nexus using XDA App
1°) Is battery life reduced after long charging? This is a good question. I have no proof on that point but I think so. Continuing to keep current going through the battery once fully charged does not improve the battery capacity. The analysis I made on several smartphones shows that some of them stop the current while fully charged ( for example HTC touch Cruise) but most of them keep a charging current.
Samsung smartphones are difficult to analyse because they do not give any data on the current going through the battery
2°) Battery calibration will not improve the battery capacity: Once the battery capacity has been reduced, this is due to chemical changes in the battery, there are no way to repair it. What we could expect is to remove the battery shutdown artefact by adjusting internal parameters of the battery control circuit, so that the state of charge calculus will be more accurate again.
Some more details are given here: http://78michel.unblog.fr/htc-desire-battery-shutdown-analysis/ and in some other pages on this blog
7_michel said:
1°) Is battery life reduced after long charging? This is a good question. I have no proof on that point but I think so. Continuing to keep current going through the battery once fully charged does not improve the battery capacity. The analysis I made on several smartphones shows that some of them stop the current while fully charged ( for example HTC touch Cruise) but most of them keep a charging current.
Samsung smartphones are difficult to analyse because they do not give any data on the current going through the battery
2°) Battery calibration will not improve the battery capacity: Once the battery capacity has been reduced, this is due to chemical changes in the battery, there are no way to repair it. What we could expect is to remove the battery shutdown artefact by adjusting internal parameters of the battery control circuit, so that the state of charge calculus will be more accurate again.
Some more details are given here: http://78michel.unblog.fr/htc-desire-battery-shutdown-analysis/ and in some other pages on this blog
Click to expand...
Click to collapse
thanks for the answer to questions1.
but I think I may have written question number 2 in a bad way which was not what I intended. I did not mean to ask if battery calibration increased battery life.
most people already know that it does not.
what I am asking is if battery life is suppose to be calibrated(?) right after you flash a new rom or kernel.
I asked this because I flash a lot and don't get good battery life. I'm not sure if its my device that is the problem or the constant flashing that causes this.
I have currently stopped flashing for 2 days now so I will report back if that was the problem.
anyways thank you for the reply
Sent from my Galaxy Nexus using XDA App
To answer question 2, you do not need to calibrate the battery and flashing roms does not consider your battery bad. The community here does have different opinions on calibration but it wasn't too long ago I read an article where google devs came out and told everyone this isn't really needed.
I have had a droid incredible and now the gnex, and have flashed numerous roms. I have never calibrated my battery and typically experience pretty good battery life AFTER I have played with the phone and set it up and stopped turning on the screen ever 2 minutes
To answer question #1:
The battery is a Lithium Ion battery. Lithium Ion batteries like to be charged. You should keep them above 10% as often as possible and ideally plugged when ever you can. These types of batteries last longer with a constant charge than with out, the full "Drains" kill Lithium Ion batteries faster and should only be done when you are calibrating the device (on the first charge or two).
The confusion comes from the old rechargeable Nickel Cadmium batteries which lasted longer if you did a full charge and discharge as these had a "memory".
As far as question #2 goes that is personal preference. I have flashed my GNex 6 or so times now and have had no issues when I didn't re-calibrate it.
x942 said:
To answer question #1:
The battery is a Lithium Ion battery. Lithium Ion batteries like to be charged. You should keep them above 10% as often as possible and ideally plugged when ever you can. These types of batteries last longer with a constant charge than with out, the full "Drains" kill Lithium Ion batteries faster and should only be done when you are calibrating the device (on the first charge or two).
The confusion comes from the old rechargeable Nickel Cadmium batteries which lasted longer if you did a full charge and discharge as these had a "memory".
As far as question #2 goes that is personal preference. I have flashed my GNex 6 or so times now and have had no issues when I didn't re-calibrate it.
Click to expand...
Click to collapse
so are you saying that its good to keep my phone plugged in while I sleep?
Sent from my Galaxy Nexus using XDA App
bluemoon1221 said:
so are you saying that its good to keep my phone plugged in while I sleep?
Sent from my Galaxy Nexus using XDA App
Click to expand...
Click to collapse
Yes. Because of the way it the chemical reaction works it is better to keep it charged (plugged in at night).
x942 said:
Yes. Because of the way it the chemical reaction works it is better to keep it charged (plugged in at night).
Click to expand...
Click to collapse
ok thanks for the explanation
Sent from my Galaxy Nexus using XDA App
Li-ion batteries decreases in capacity over time NO MATTER WHAT YOU DO. (even if you don't use it)This is the down side in exchange for easy maintenance and high energy density.
In short, just use it normal, charge it when it gets low and stop worrying about the battery life.
bluemoon1221 said:
what I am asking is if battery life is suppose to be calibrated(?) right after you flash a new rom or kernel.
I asked this because I flash a lot and don't get good battery life. I'm not sure if its my device that is the problem or the constant flashing that causes this.
Click to expand...
Click to collapse
I am not so clever with my English so I have not fully understood your 2nd question.
Flashing a new rom involve only the smartphone. Calibrating the battery is changing data stored inside the battery IC's memory.
These are two ''independant'' processes. The only relationship between them is that the some roms allows you to write in the battery memory and some others doesn't
What's average battery life you guys are getting with mod use ( variable term)?
x942 said:
To answer question #1:
The battery is a Lithium Ion battery. Lithium Ion batteries like to be charged. You should keep them above 10% as often as possible and ideally plugged when ever you can. These types of batteries last longer with a constant charge than with out, the full "Drains" kill Lithium Ion batteries faster and should only be done when you are calibrating the device (on the first charge or two).
The confusion comes from the old rechargeable Nickel Cadmium batteries which lasted longer if you did a full charge and discharge as these had a "memory".
As far as question #2 goes that is personal preference. I have flashed my GNex 6 or so times now and have had no issues when I didn't re-calibrate it.
Click to expand...
Click to collapse
remember 10% is not 10% displayed charge. 0% is about 25% as manufacturers take into consideration battery technologies when designing them. it is also quite dangerous to charge from 0-20% on a Lion battery as the chemical reaction has to be reactivated. and over charging can cause a fire.
All calibrating does is make the battery indicator more accurate, it doesn't increase the charge, the supplied chargers and phone tech will not allow overcharging, and the phone will not discharge a battery to below 25% as battery discharge below 25% will damage the cells.
if you are interested look into Lion charging in the RC world. we need balancing boards with controllers when charging multiple cells, and we have to put them in fire bag just in case. it will give you a greater understanding of how lion and charging works.
monkeypaws said:
What's average battery life you guys are getting with mod use ( variable term)?
Click to expand...
Click to collapse
Mine is pretty bad. I max out at 10 hours I'm trying Apex rom now hoping it will be better. Something tells me I need an extended battery.
7_michel said:
I am not so clever with my English so I have not fully understood your 2nd question.
Flashing a new rom involve only the smartphone. Calibrating the battery is changing data stored inside the battery IC's memory.
These are two ''independant'' processes. The only relationship between them is that the some roms allows you to write in the battery memory and some others doesn't
Click to expand...
Click to collapse
Exactly right. And our nexus does not give us any access to the chip inside the battery, so there is no need to do any type of calibration with this phone. No roms can change this either due to the max17040 fuel gauge chip inside our batteries.
bluemoon1221 said:
what I am asking is if battery life is suppose to be calibrated(?) right after you flash a new rom or kernel.
I asked this because I flash a lot and don't get good battery life. I'm not sure if its my device that is the problem or the constant flashing that causes this.
Sent from my Galaxy Nexus using XDA App
Click to expand...
Click to collapse
You got confused here. You are not calibrating the battery but how the OS interprets the battery data. The battery itself DOESN'T get calibrated. (And you cannot break a battery by flashing ROMs)
There's really nothing much you can do about the capacity of the battery itself as a normal user once it's been made in the factory.
monkeypaws said:
What's average battery life you guys are getting with mod use ( variable term)?
Click to expand...
Click to collapse
my battery seems to be only capable of 2 hours of screen time despite using 3g/wifi, no nfc, no bluetooth, no sync, etc.
but I can still live with it.
Sent from my Galaxy Nexus using XDA App
diablous said:
remember 10% is not 10% displayed charge. 0% is about 25% as manufacturers take into consideration battery technologies when designing them. it is also quite dangerous to charge from 0-20% on a Lion battery as the chemical reaction has to be reactivated. and over charging can cause a fire.
All calibrating does is make the battery indicator more accurate, it doesn't increase the charge, the supplied chargers and phone tech will not allow overcharging, and the phone will not discharge a battery to below 25% as battery discharge below 25% will damage the cells.
if you are interested look into Lion charging in the RC world. we need balancing boards with controllers when charging multiple cells, and we have to put them in fire bag just in case. it will give you a greater understanding of how lion and charging works.
Click to expand...
Click to collapse
Thanks for that! Didn't know it displayed it differently. I only know how the chemical reaction works and such.
NP fella, thing is Lion is new tech and people still see it by the standards of older battery tech so it's taken for granted that 0% is 0%, and 100% is 100%. where this wouldn't be possible as too many issues would crop up. in RC racing we basically learn it inside out, as Battery types are better for different things. Endurance racing needs Ni-Cad as i prefers a sustained drain and will slow the car near the end of the charge, but keep going with reduced acceleration, while Ni-MH batteries are good, as they have better acceleration due to there properties, but suffer from being fine and suddenly suffering poor acceleration, you have no warning like the last lap. While Li-on are brilliant for one and off acceleration like sprints, or twisty tracks, but run at max power right til the end then just stop dead.
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).