Profile cover photo
Profile photo
Prem Suraj
Science & Technology Geek
Science & Technology Geek

Prem's posts

Post has attachment Battered by climate change, shrinking Sagar Island in the Sundarbans struggles to stay afloat.

Post has attachment
Let the conspiracy theories begin

Awesome Doodle today Google

Post has shared content

Post has attachment
Temperatures that are 6 degrees higher than average, 10-20% reduction in monsoon, each year getting warmer than the previous, retreating galciers in the Himalayas..

We may not have much time left to save the world..

Firstpost: India is grossly unprepared for impending climate change and worsening monsoons.

Post has attachment
You see we are not so different from the apes. Humans are not special little snowflakes..

Post has attachment
Meanwhile we are still fighting GMO

"this feat was achieved by "silencing" polyphenol oxidase (PPO) expression. Apples, on the other hand, don't really have a need for it. "Apples produce very low levels of PPO, and only in very young fruit," the company writes. "Its presence is probably left over from apples of ages ago, playing no role in today's apples."

Post has attachment
As much as I hate to admit it, the USA and China control the majority of global economy. Anything that goes wrong there can lead to major trouble everywhere. After seeing this, I am fearful of a major economic collapse
Department of Energy that control's the nuclear arsenal being run by someone who didn't even know the department's actual job
Secretary of treasury who has no experience with economics
Secretary of Education who thinks schools should have more guns in them
Administrator of the Environmental Protection Agency who is opposed to any environmental protection acts or laws
National Security Adviser who is an islamophobe and conspiracy theorist
Senior Adviser who used to run a white nationalist web site

Post has shared content
Two days ago, I found myself stranded in the boonies in 35 degree weather because my car wouldn't start. I pulled over for a bite and had stopped for less than 5 minutes, but when I tried cranking, the battery voltage sagged. It couldn't turn the engine over -- let alone keep the cabin lit. It sucked. It was only thanks to my familiarity with how to preheat a battery (and the fact I use a tender) did I manage to get home.

Why do I mention this? I've been following people having sudden battery shutoff with their Nexus 6Ps. I did some experiments over Christmas showing it was related to the cold and sudden current loading. There were some other elements I was reluctant to discuss given my position as a +Google Top Contributor Program TC for Nexus/Pixel devices -- I intentionally avoided this topic since I want to avoid any semblance of COI. (Full disclosure: even my family member who also owns a Nexus 6P and does nothing "hackerish" with his phone was affected, and complains to me about it regularly. He's taken to carrying around a RavPower #USB #TypeC pack wherever he goes.)

However, having experienced the same crappy situation many other have been -- for very similar reasons -- I wanted to put this study out with the goal of helping users help themselves.

My main concerns are showing you guys what the potential issues are and (a) what aspects of it you can benefit from being aware of, (b) how to avoid them, and (c) discuss possible avenues for Google to fix. Again, I am out of the loop, and the below is independent experimentation and data. My conclusions may be wildly incorrect. All data is shared at the drive link below. Use it for what you will.

[Processed data and Linux scripts]

The following was conducted on an Angler Nexus 6P running 7.1.1 NMF26F.

[My previous experiments replicating:]

[Associated reading]

Charge Nexus 6P to 100%. Place on ice packs over a towel to maintain a constant core battery temperature (manually) while discharging to avoid thermal throttling. Use wireless ADB logging scripts to dump battery system data. Disable BatterySaver mode. Engage airplane mode, turn on WiFi (for wifi ADB).

Use battery waster app and/or flashlight to drain to shutoff with a constant load. (This is important.) Use "tail f" to monitor log and adjust phone on ice packs as needed to maintain constant temperature and monitor for errors.

Results and Disussion:
See the attached excel image. Findings of note:

(1) The "battery level" indicator on the Nexus 6P is wildly miscalibrated. Notice how it gets "stuck" at 10% level for over an hour despite the constant drain. Also consult the "Level + Charge counter" and "Charge counter vs level" graphs.

I am aware some CPU throttling may be going on. But consult the "Current now" graph. There was clearly at least 1A of load, and the battery level stayed flat at 10% throughout. This indicates a significant level determination error.

(2) The Nexus shut off abruptly (Level transition from 4% to 0% in under 30s) when the Voltage reached 3.300 volts exactly. The Charge counter still indicated 795691 Coulombs (?) available.

(3) The Coulomb counter sensor becomes highly inaccurate after the threshold "battery saver" should kick on. I disabled it immediately, but you can see from the "Charge counter" graph the level gets "stuck" at certain levels and becomes highly inaccurate.

(Edit: only the ADB dumpsys battery counter gets frozen, the dumpsys batteryproperties remains linear!!!)

This suggests some sensor hardware is being turned off or not working at low battery, including critical battery monitoring sensor hardware. Which seems weird.

(4) The temperature sensor hardware apparently also wigs out at low battery. Notice how abrupt the temperature sensor transitions become, and are almost discrete states.

Despite my best efforts to reposition the Nexus 6P on the cooling pad as necessary to maintain a constant temperature, because it became "stuck" at certain levels, I over/undershot - hence the jerkiness in the graph. It was by feel at that point. (Again, I'm marginally employed/broke, unfunded, and working out of a basement. I lack a peltier thermoelectric heatsink.)

It's important to maintain the battery at an isotherm to avoid affecting Voltage readout due to the battery's internal resistance.

(5) Voltage and Charge counter does not appear to have a direct relationship to battery level. It is likely indirect, or based off a sensor I cannot monitor.

There must be some algorithm abstracting multiple metrics to get the "Level". Unfortunately I am not skilled enough in AOSP code to determine what it is.

(6) It seems at 35:14 mm:ss into the run is when everything went tits-up. Sensors stopped working as they should, and despite disabling battery saver things still went awry.

(Edit: This is when the Charge counter from ADB dumpsys battery starts significantly diverging from ADB dumpsys batteryproperties. It repeats values -- first intermittently, then a lot. This suggests Battery Saver is partly to blame, and it does it by killing critical sensor processes!)

This is the exact moment "15%" battery level was reached. This suggests some internal threshold was triggered. Likely Battery Saver.

So in summary, I've identified and replicated two, possibly three different factors causing this. There are a few more I speculate at.

[Core findings]
(1) Per my first experiment, I've determined when subjected to cold, battery voltage drops SIGNIFICANTLY more than normal when loaded. [Such as by firing up camera, or running Pokemon Go/sensors.]

This sudden drop of voltage is apparently considered an "emergency crash" by the phone and it shuts off into some safe mode -- where you must hook it to a charger to turn back on. This suggests bootloader voltage protection safeties are kicking on inappropriately.

(2) Per this current experiment, there is a clear battery charge miscalculation problem. The level displayed does not accurately represent the electrical capacity remaining in the battery pack.

It appears the Coulomb counter is the closest approximation to the ACTUAL linear capacity of the battery. However see (3) for a caveat regarding this sensor:

(3) There is some Android code problem with battery saver mode, or some low-voltage hardware issue, causing critical sensors to fail to operate at low charge. This lack of feedback is causing other more complex problems I cannot fully identify.

(4) Physical heatsinking characteristics of the phone itself and efficiency of powersave modes may be contributing to this problem.

This one is trickier, and is related to battery pre-heating. Two goals oppose heat retention: (1) phone bodies are built to have a low "k" (thermal resistance) value to dissipate as much heat into the environment as possible. However, this also means they cool down to ambient excessively as well. (2) Android doze, energy saver, low power, etc. mean less power is going through circuits to keep them warm during long sleep states. Then when they are abruptly brought online, it is causing the physical battery hardware to be overload due to thermal effects. (Think of Apollo 13 where they had to carefully bring the equipment online slowly in a specific order so as to not overtax the cold batteries.) This is related to the Thevenin Equivalent Circuit of a battery.

So by being too efficient, we essentially are running into a new class of physical/thermal hardware failures. At least, that is my opinion.

[How you can protect yourself:]
(a) Please keep your phone as warm as possible when carrying it in the cold. Use an insulated pouch, keep it in your inside jacket, use a case that RETAINS heat like silicone. (Fight that low k value.)

(b) If you must travel in the cold exposed, please keep a small portable battery pack and A-to-C cable with you to "jump start" your phone in an emergency. Again, this is not ideal advice, but it is practical until a software calibration solution is found.

(c) If there is any software fix to this "hardware" problem, YOU MUST BE PATIENT. Fudging with core  power circuit calibration code is very delicate, and potentially dangerous if done inappropriately. So Google is likely being careful. Everything will likely need to be validated and tested 6 ways from Sunday.

Also keep in mind Google didn't write most of the power IC code -- Qualcomm did. At least, that's what the comments in the code say, and the committers e-mails on AOSP say. So now you have two companies having to play ball.

(d) General Winter always wins.

(e) - try disabling Battery Saver! It seems it is disturbing some critical battery voltage monitoring processes, exacerbating the problem!

I plan to do another post following up this one, explaining more clearly using a purely synthetic model (graphs and curves).

[Plus] Analyses 6P Shutoff Level
11 Photos - View album

Post has attachment
America and guns!! A guy shot into a car because it was going slow, and killed a 3 year old toddler..
Wait while more posts are being loaded