Related
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 bit of reading but if you have the time it's worth it. Basically what it's showing is deep sleep doesn't save battery power, neither do lower voltages. There's a trove of information in this post and the spreadsheet.
If I understand amps, watts, and voltage correctly it makes sense that lower voltages would do nothing to save battery since wattage is what really drains a battery. Not saying we should all go and crank up the voltage in our kernels carelessly, that still creates problems but if your device is having stability issues then try upping the voltage a bit. It seems it won't effect battery life.
The post
The spreadsheet
I take no credit for the research or anything to do with it. Just merely reposting it here for you to read.
That doesn't make much sense to me. Watts is voltage x amperage. The only explanation I can think of to back that up is that maybe our processors pull more amps if we lower the voltage to make up for it.
Sent from my SPH-D710 using XDA App
That's a possibility. So maybe the phone is demanding a higher flow of the current per unit of time since the current itself doesn't have enough 'pressure'. Either way, the results are showing something interesting going on that negates the usefulness of lower voltages.
Basic Electricity.
Direct Current:
Amperage does not change in Volts DC, no matter what it should remain the same at every component in a device.
I*E=W (Amps * Voltage = Watts).
Alternating Current
Voltage does not change in Volts AC, no matter what it should remain the same at every component of a device.
I*E=W
So the only way to decrease Watts in real life is to decrease Volts DC, or Amps in AC.
The only other thing that may help decrease power consumption is heat and transmission delays.
Reference:
Check out this web page... I love HowStuffWorks!!!
http://computer.howstuffworks.com/question307.htm
I question the Advanced Electronics of a ARM proccessor. Maybe when we are talking GHz (Frequency) we may be talking about a controlled AC signal. In this case, we may have to change our view of basic electronics by looking at a fixed Voltage (Voltage does not change) but Amperage can be changed. By this I mean no matter what change in voltage we try to apply through software, the hardware does not allow us to change it due to physics or basic OHM's law for AC circuits. That would be the only reason I could see for under-clocking not affecting power consumption.
I am not sure of what goes on electrically in our phones so can only read, research and take an educated guess. I may be wrong. BTW I don't have battery problems so I don't really care about them at the moment.... but who knows in the future. I do love electronics though, so if someone does know more about this topic, I would love to understand more about how ARM processors electronically work.
I am an electrical engineer, and putting any device in a low power "sleep" mode where only a "lookout" stays awake so that it can wake everything else up as needed saves power and therefore increases battery. The article is wrong. That is all.
Sent from my SPH-D710 using Tapatalk
kingsway8605 said:
I am an electrical engineer, and putting any device in a low power "sleep" mode where only a "lookout" stays awake so that it can wake everything else up as needed saves power and therefore increases battery. The article is wrong. That is all.
Sent from my SPH-D710 using Tapatalk
Click to expand...
Click to collapse
AGREED MY BROTHERIN
Sent From My Epic Touch 3g
So is the testing method wrong or are the results wrong, or both? Not disagreeing with you, I'd just like to know since it all seems pretty legit and there was a decent amount of time put into the testing.
I understand the point of deep sleep but if the processor is still on, isn't it still going to pull the same current regardless? According to the results it's pulling the same current regardless of the actual voltage so wouldn't the same be true for deep sleep?
EDIT: Just to add to that. Our phones are never really 'asleep'. There is no true sleep mode given the fact that there's always something going on in the background under normal conditions. Updates, push notifications, sync notifications, communication between the towers/wifi and our baseband, logging, apps doing things. To me that doesn't sound like a sleep mode - at least not the same as what I think about when I put my computer to sleep. The only thing a computer does in sleep mode is wait for your input or for wake timers.
KCRic said:
That's a possibility. So maybe the phone is demanding a higher flow of the current per unit of time since the current itself doesn't have enough 'pressure'. Either way, the results are showing something interesting going on that negates the usefulness of lower voltages.
Click to expand...
Click to collapse
I have privately asked this question several times. Does the phone have to work harder in certain instances when voltage is lower therefore bumping up to the next frequency? I gave never undervolt. I tried it undervolting by -25 on my OG Epic and my phone didn't like it and I haven't tried it since. Just thinking out loud...edit...big thanks to odub for my custom script!!
Sent from my Nexus S 4G using xda premium
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 ?
Hey, has anyone noticed their battery meter saying a low percentage and then seeing it increase after not touching the phone for a while? ive noticed my phone will say 2% for example and ill let it sit for a while and when i check it again its all the way up to 10%. I have calibrated the battery but it doesn't affect it and it still happens?
lol yea my battey is solar powered.. lol jkjk.. but naw its because when your screen is on it adjusts tye percentage based off how your using it.. if its asleep for a while tye battery percentage will increase because its not being used make sense?
Sent from my SPH-D710 using XDA
elliwigy said:
lol yea my battey is solar powered.. lol jkjk.. but naw its because when your screen is on it adjusts tye percentage based off how your using it.. if its asleep for a while tye battery percentage will increase because its not being used make sense?
Sent from my SPH-D710 using XDA
Click to expand...
Click to collapse
Nope, it actually doesn't make sense.
You're gas gauge in your car doesn't go up when your car isn't being used. Percentages shouldn't increase without charging no matter what.
FWIW, I've experienced this a few times. My battery has increased as much as 5% without being charged and that's in one string. For example, my battery may go down to 50%, then over the next 20 minutes go to 55%, then an hour later 42% and rise up to 45% and so on. Not sharp spikes either, steady gradual increases.
elliwigy said:
lol yea my battey is solar powered.. lol jkjk.. but naw its because when your screen is on it adjusts tye percentage based off how your using it.. if its asleep for a while tye battery percentage will increase because its not being used make sense?
Sent from my SPH-D710 using XDA
Click to expand...
Click to collapse
No, it does not work like that.
Battery app re-calculates the remaining battery based on the battery power currently being used (mV) and history. That's why we are doing the calibration to correctly measure the current battery status and range of it.
In most case, battery power (mV), it goes down from the top and it usually up & down within a small range but for overall, it goes down.
But sometimes, the current mV is goes up and it's caused by
1. Battery usage forecast was wrong or
2. Battery is recovering its power again - for example, after CPU intensive task, the voltage could goes up
3. the remaining percentage goes up if the battery usage is slower than the expectation (it's not going up because it's not being used. Even the screen is off, the battery is still being used). In this case battery app recalculate the percentage based on the current mV and trend that how fast battery mV is decreasing. If mV is increasing, then battery app will show like it's being charged...
There are couple of more things that we also consider in here but I think this is enough information to know.
Update: Let me add a couple of more.
From OP's screenshot, it shows that there's big drop in battery percentage. Usually, big drop happens (battery power is decreasing so fast), it's really hard to calculate the exact remaining percentage because battery shows some irregular pattern after that kind of fast drop. So, some point of time, battery app recalculate the percentage based on current voltage. That's why it's showing going up.
One more case is, the pattern change. After big drop and/or voltage is about the same (stay almost same), then battery app also adjust the remaining battery level indicator.
Simple example) Just like Human. I just finished eating and fully charged. After a meal, I worked so hard and almost exhausted. No power left. But after a little break, I could recover my power a little more.
This example is not exactly same but it would be more easier to understand.
I have noticed this. Could it be that after the battery runs out the phone puts itself in a low consumption mode, thus the battery cools down, increasing the efficiency of delivering power, thus increasing the apparent voltage available? This would be similar to putting the battery in the fridge to get a litte bit of extra juice...
Sent from my SGT10.1 using XDA Premium
Its just the phone reading the voltage wrong, the calibration is outta wack.
qwerty12601 said:
Nope, it actually doesn't make sense.
Click to expand...
Click to collapse
Makes complete sense. There is no accurate way to judge the potential energy stored within a battery. Changes in temperature are one of many things that effect the chemical availability of energy.
Little shifts in measured overall capacity and current charge change all the time on every device you own. Most of them do not update to reflect this, some dont update in the wrongest way. My ASUS gaming laptop doesnt report new full charge capacities to windows and now more than ever with the battery being half shot i can hit 150% but it always did this from new sometimes would show it had stopped charging at 98% when it reached full capacity or 101%.
I can explain the software aspects of the problem. But you will need an electrical engineer, chemical analyst to help you go over the batteries end of it. I of course am not familiar with Android in particular but Portable PC's Sony's PSP etc seen it everywhere.
Its due to a flaw in Samsung phones where it does not correctly read the battery. Sometimes a phone reboot will show as much as a 70% (from my experience) in battery but then my battery will start to "charge" itself as the phone reads the voltage better. I've seen this happen on our phones and the captivate
Sent from my SPH-D710 using Tapatalk
qwerty12601 said:
Nope, it actually doesn't make sense.
You're gas gauge in your car doesn't go up when your car isn't being used. Percentages shouldn't increase without charging no matter what.
Click to expand...
Click to collapse
you have no idea how mechanical measuring works, do you? here is an example of how gas is measured; a floating ball attached to an arm changes the voltage of the signal depending on the amount of fuel in the tank. Higher the ball, higher the voltage, and thus higher the gas gauge.
Consequently, you will notice fuel gauges reading higher going uphill and lower when going down, because gas doesnt just sit in one place. The gauge is usually calibrated for when the car is standing still.
Now that you have an idea how mechanical measurement works, can you apply this to battery chemistry? NO, because they are completely different!
Battery life is measured using a formula, not a mechanical device. It is, in essence, a best guess. Some formulas are better than others, but they are all still estimates. And you will notice fluctuations.
Sent from my SPH-D710 using Tapatalk 2
rianbechtold said:
Hey, has anyone noticed their battery meter saying a low percentage and then seeing it increase after not touching the phone for a while? ive noticed my phone will say 2% for example and ill let it sit for a while and when i check it again its all the way up to 10%. I have calibrated the battery but it doesn't affect it and it still happens?
Click to expand...
Click to collapse
i had the same thing happened to me, and i have the pic somewhere.. where the battery just dropped from like 80% to 30% in less then 5 min.. i was using it, and had the screen off, and had it on again.. and it went down like crazy.. and afterwards.. it started to go up, as if i was charging the phone..
some one said that, its a bug by samsung, where if you charge your phone not quiet to 100% and use the phone, this can happen..
concerning what some other guy said about turning the phone off and on, can boost batery power.. that was hilarious sad..
likkkkkke thisssss?
first one is recent.. second one is from one of the initial ics leaks..
Or this freak
Sent from my SPH-D710 using Tapatalk
Somairotevoli said:
Or this freak
Click to expand...
Click to collapse
Um or not lol. Considering you have charging in there
RainMotorsports said:
Um or not lol. Considering you have charging in there
Click to expand...
Click to collapse
Or yes as you can see it clearly (or in your case, not so clearly) going up at points it's not being changed
Sent from my SPH-D710 using Tapatalk
Somairotevoli said:
Or yes as you can see it clearly (or in your case, not so clearly) going up at points it's not being changed
Sent from my SPH-D710 using Tapatalk
Click to expand...
Click to collapse
However very much expected. You have created a circumstance where accuracy was guaranteed to be off. Making sure that multiple corrections were a reality.
I would hope that in a 2 day period you had 3 to 4 hours to sleep where this phone could have reached 100% twice and only been on the charger about 4 times. Obviously a couple very busy days for you. I could guess any number of occupations that might have done this to you
Sent from my SPH-D710 using Tapatalk
That looks almost as if to suggest the sampling did not occur at all while the phone was sleeping.
turbomeister said:
you have no idea how mechanical measuring works, do you? here is an example of how gas is measured; a floating ball attached to an arm changes the voltage of the signal depending on the amount of fuel in the tank. Higher the ball, higher the voltage, and thus higher the gas gauge.
Consequently, you will notice fuel gauges reading higher going uphill and lower when going down, because gas doesnt just sit in one place. The gauge is usually calibrated for when the car is standing still.
Now that you have an idea how mechanical measurement works, can you apply this to battery chemistry? NO, because they are completely different!
Battery life is measured using a formula, not a mechanical device. It is, in essence, a best guess. Some formulas are better than others, but they are all still estimates. And you will notice fluctuations.
Sent from my SPH-D710 using Tapatalk 2
Click to expand...
Click to collapse
Now that you've got that out of your system, let me explain it a little more simply so you understand.
It was an analogy. I never said that battery percentage was calculated the same way as fuel capacity. But it's an analogy to help you relate.
Batter percentage is a measure of volume of power left in the battery. It should never fluctuate UP without being charged, unless something is wrong with the battery/phone. 55% is 55%, no matter what temperature, usage time, current usage is. If the battery is 1800 mah, then 50% battery level means there's 900 mah left. It's not a calculation of anything else. Just like if your fuel tank hold 16gal, and the needle is at 1/2 (stationary of course, not parked/driving up or downhill as you needlessly pointed out), you have 8 gal left. There's no mathematical calculation needed there.
Just for reference, I own no other electronic device that magically increases in battery percentage. My laptop goes down unless it's being charged. It's a quirk/flaw with the system in the phone. Plain and simple.
BTW, no apology needed. I'm just happy to educate you!
Didn't you know? Our device's covering is actually made of solar panels
Sent from my SPH-D710 using xda premium
qwerty12601 said:
Nope, it actually doesn't make sense.
You're gas gauge in your car doesn't go up when your car isn't being used. Percentages shouldn't increase without charging no matter what.
FWIW, I've experienced this a few times. My battery has increased as much as 5% without being charged and that's in one string. For example, my battery may go down to 50%, then over the next 20 minutes go to 55%, then an hour later 42% and rise up to 45% and so on. Not sharp spikes either, steady gradual increases.
Click to expand...
Click to collapse
My gas guage goes up when i park uphill.
Currently I am using Battery Monitor Widget to view how many mA my phone is draining at any moment. But I'm not sure how accurate it is. For example, after browsing on my phone for two minutes, it shows -80 mA. It polls/measures every minute, so that would mean that my phone uses only 80 mA with the screen on, which is impossible. When I turn the screen off, the recorded values will continue to drop for a few minutes, to 70 mA and 60 mA. If I leave the screen off, it usually continues to very slowly drop to 40 mA on some days, or to less than 10 mA on other days, or anything in between. Sometimes it does show realistic screen-on values, like -250 or -400 mA or so.
Any idea why it does this? What does it mean? My battery life is generally fine, about what I would expect based on what I read.
Do you know of an accurate battery-drain meter for the Galaxy Nexus, one that updates fairly quickly (like every minute)?
The nexus cannot output current mA readings due to the fuel gauge used. So those are just guesses from battery monitor widget. No app can help you, its a hardware limitation . Many HTC phones do this though.
RogerPodacter said:
The nexus cannot output current mA readings due to the fuel gauge used. So those are just guesses from battery monitor widget. No app can help you, its a hardware limitation . Many HTC phones do this though.
Click to expand...
Click to collapse
A little bit late, but thank you for the information! At least now I know it isn't possible.