Design and Testing for longer battery life in Android and other Mobile Devices & Applications

  • 2,256 views
Uploaded on

Design and Testing for longer battery life …

Design and Testing for longer battery life
in Android and other Mobile Devices & Applications

More in: Business , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,256
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
109
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Design and Testing for longer battery life in Android Devices & ApplicationsMoe Tanabian
  • 2. Batteries in Mobile Devices – Why are they important? Battery life: second most important purchase decision factor for tablets Cost of the device 65% Battery Life 51% Operating System(Apple iOS, Android, Windows) 40% Compatibility with other eq. you own 32% Cost/Contract flexibility of 3G service 32% Large screen size (i.e. the size of an iPad) 31% Positive reviews (e.g. other users, CNET) 31% Weight 28% How it looks , feels 26% Number of available apps 23% The brand of manufacturer 22% Manufacturer’s tech support 21% Number of ports (e.g. USB, headphone jack, etc.) 19% Ability to play Adobe Flash content 19% Accessories available 16% Has camera(s) 15% Ability to watch HD video 13% Has slide-out keyboard 13% Ability to hold in one hand 12%Based on 3,835 US online customers who would consider buying a tablet(multiple responses accepted, Source: North American Technologies, Customer Technology Survey 01/2011 2
  • 3. Outline What influences Battery Life? Objective power consumption measurement Predictive methods to measure power consumption Areas to optimize power consumption Setting up a power measurement lab Hands-on Demo 3
  • 4. The 3 influencing elements on Battery Life – The Battery, The Hardware, and TheSoftware BATTERY HARDWARE SOFTWARE 1 2 3 4
  • 5. The Battery 1 Source: http://www.ifixit.com/ 5
  • 6. Batteries in Mobile Devices – Evaluating batteriesWhen we describe a battery and how appropriate it is for a particulardevice and application, we use three metrics to define the battery: n  Energy density (Power per weight unit, e.g. mA hour per Pound) n  Number of charging cycles the battery can take n  Charge rate n  Discharge rate 6
  • 7. Batteries in Mobile Devices – Battery ChemistryThere are three types of batteries that are extensively in use today, andeach provides certain strengths and weaknesses for different type ofdevices: n  Nickel Cadmium (NiCd): Strength: mature battery technology, has been around for long. Weakness: low energy density (Wh/Kg). Application: long battery life, high discharge rate and price economy are priority. n  Nickel Metal Hybrid (NiMH): Strength: more advanced Nickel based battery technology, compared to NiCd has higher energy density Weakness: shorter cycle life Application: Larger portable devices, Military 7
  • 8. Batteries in Mobile Devices – Battery Chemistry n  Lithium Ion (Li-ion): Strength: The newest and fastest growing battery technology. Li-ion batteries are smaller and lighter (higher energy density) Weakness: they are more expensive Application: the main type of battery used in mobile devices and handsets today - Li-ion battery with steady current within its dominated C can provide 700 charge Lithium Ion Polymer (Li-ion Polymer): A lower version of Li-ion battery with smaller profile and more simplified packaging. It has the same energy density as Li-ion batteries. 8
  • 9. Batteries in Mobile Devices – Battery Chemistry comparison chart NiCd NiMH Li-ion Li-ion polymer Gravimetric Energy 45-80 60-120 110-160 100-130 Density(Wh/kg) Internal Resistance 100 to 2001 200 to 3001 150 to 2501 200 to 3001 (includes peripheral 6V pack 6V pack 7.2V pack 7.2V pack circuits) in m Ω Cycle Life (to 80% of initial 15002 300 to 5002,3 500 to 10003 300 to 500 capacity) Fast Charge Time 1h typical 2-4h 2-4h 2-4h Overcharge Tolerance moderate low very low low Self-discharge / 20%4 30%4 10%5 ~10%5 Month (room tem perature) Cell Voltage (nom inal) 1.25V 6 1.25V 6 3.6V 3.6V Load Current - peak 20C 5C >2C >2C - best result 1C 0.5C or low er 1C or low er 1C or low er Operating -40 to -20 to -20 to 0 to Temperature (discharge only) 60°C 60°C 60°C 60°C Maintenance Requirement 30 to 60 days 60 to 90 days not req. not req. Commercial use since 1950 1990 1991 1999 Source: Batteries in a portable world by Isidor Buchmann 9
  • 10. Batteries in Mobile Devices – Discharge profiles of NiCd and NiMH batteries Source: Batteries in a portable world by Isidor Buchmann 10
  • 11. Batteries in Mobile Devices – Discharge characteristics of Li-ion batterySource: Batteries in a portable world by Isidor Buchmann 11
  • 12. Batteries in Mobile Devices – An electric model for a battery Ri Voc Cl Rl Voc: open circuit voltage Battery Ri : internal resistance Cl : load capacitance Rl : load resistance Source: Batteries in a portable world by Isidor Buchmann 12
  • 13. Batteries in Mobile Devices – Smart Battery packs Smart battery pack should be able to report: -  Battery’s State of Charge (SoC) -  State of Health -  Battery’s chemistry They come in different complexities: -  Single Wire Bus Terminal -  SMBus based on a bi-directional two wire I2C data communication Source: Batteries in a portable world by Isidor Buchmann 13
  • 14. The Hardware 2 Source: http://www.ifixit.com/ 14
  • 15. Power consumption measurement approaches – component, device level n  In this method, the device power consumption is the aggregate of measured power consumption of each subsystem Component level n  This method is more accurate, and the results are more reproducible; it is often used by device OEMs n  It take more effort and it is more expensive n  Detailed device HW and SW documentation is needed n  The power is measured at the aggregate point of battery connection in thisDevice (Application) method; power consumption is measured for different device use cases level n  This method is easier, and more practical for most cases; it is widely used by network operators n  Since the results may vary from run to run, it is necessary to repeat the test runs to achieve statistical significance and stability 15
  • 16. Power consumption measurement approaches – component level Power is measured at every important component: RF, Processors, Mem, Screen (An LTE device) RF Frontend Wi-Fi, for other Audio Magnetic RF Bluetooth globally Codec sensor supported Transceiver Transceivers bands (*assumed 10 GPS Accelerometer Gyroscope bands) Receiver 10* X Power Amp Bank 10 X LPF Baseband Application Bank Processor Memory FDD/TDD LTE 1X / EVDO (Flash, RAM) HSPA(+) RF Transceiver PowerAmp MDM 96XX LTE DC-HSPA, Graphics LPF Bank Display DOrB, EDGE Very High Power user High Power user Moderate Power user For component level measurement, power is measured in relevant device main states: Idle, Suspended and Active 16
  • 17. The Software 3 Source: http://www.ifixit.com/ 17
  • 18. Design for power efficiency – Android Power Management Applications Application 1 Application 2 Application 3 Wl = newWakeLock(…) Wl.acquire() Wl.release() POWER MANAGER APP Android.os.PowerManager Android.os.Power Framework Android.Server.PowerManagerService Libraries LIBRARIES /lib/hardware/power.c (User Space) Linux Kernel Linux Power Management Power Manager Source: http://www.kandroid.org/online-pdk/guide/power_management.html 18
  • 19. Android Power Manager states – Suspended, Idle, Active n  All device states written to RAM / Application processor is idle n  Communication processor on low level activity only to Suspended receive calls, SMS, etc n  Other components are tuned off by power manager n  A device spends significant amount of time in Idle state A modern mobile device can be in n  Device is fully awake but no application is active one of the three n  Main power consuming components in this state are:power consumption Idle Cellular radio, Graphics module, display and CPU states n  At least one application is running n  Device battery consumption depends on what usage Active scenario it is being used under (web browsing, email, voice call, etc) 19
  • 20. Outline What influences the battery life? Objective power consumption measurement Predictive methods to measure power consumption Areas to optimize power consumption Setting up a power measurement lab Hands-on Demo 20
  • 21. Power consumption profiling for different subsystems – test cases n  Measurement of backlight at minimum and maximum intensity in mW n  Complete WHITE screen Display subsystem n  Complete BLACK screen n  White noise screen for benchmarking different Graphics chip sets and LCDs n  A good test: Downloading a file with random data content via HTTP n  Shielded device test to benchmark effect of signal strength on power Network subsystem consumption and throughput - a 2mm think metal shielded box that can drop the signal strength by 10dBm for cellular and 2dBm drop for Wi-Fi n  A benchmark that causes a good spectrum of utilization of the CPU and the memory from highly CPU bound to highly memory bound e.g. SPEC CPU2000 CPU and RAM n  A series of READ and WRITE operations for measuring power impact of internal NAND flash and SD card. E.g. copying a file with random data n  Audio playback of a music file: e.g. a sample of 12.3MiB, for 10 minutes at 44.1 KHz MP3 file stored on internal NAND flash and SD card Audio subsystem n  Need to include cellular radio power into account since the device needs to be ready to receive calls, SMS n  Different scenarios: device Idle, device running a GPS app, Satellite acquisition, navigation and guidance GPS n  In smartphones, the GPS power consumption is minimal compared to other subsystems and can be skipped 21
  • 22. Power consumption profiling for different subsystems – test cases Test cases for Display component 22
  • 23. Measuring power consumption – multi-core devices Multi-core devices can be more power efficient than single core devices 23
  • 24. Video call test case: a capture all test for device level benchmarking Device (Application) levelpower consumption and benchmarking of several devices Multi-device benchmarking For multi device benchmarking, video call application utilizes many of important components of a mobile device, given that: n  Hardware specifications of the devices under test are similar n  Same application is used for video calling, or at least call features are close or identical such as video resolutions, bandwidth utilization, etc n  Test conditions need to be standardized and similar for every device to make the results reliable and reproducible 24
  • 25. Power consumption measurement approaches – device level Device (Application) level Number of tests runs required N = t x f x nt N : The total number of required power readings (Rule of thumb for stable test results N >= 10K) t : Duration of sample collection (min) f : number of samples collected per second nt : Number of test runs 25
  • 26. Power consumption measurement – the cloud effect Device (Application) level The cloud effect can hinder power consumption measurement accuracyIssue: Cloud services can change their behavior and these changes havesignificant implications on power consumption of the device: Example: whenplaying a YouTube™ video, the server often adjusts the resolution based onthe client’s capabilities and the connection throughputIssue: Many smartphone applications constantly and in an ad-hoc wayexchange data with backend servers that are not user driven or usercontrollable. Example: Google MapSolution: Re-create the use scenario in a controlled lab environmentIn Android: To recreate the input sequence of actions, while running the realcloud based test, use captured user input interactions traces: /dev/input/event*Android kernel can re-run the sequence by reading this information 26
  • 27. Outline What influences the battery life? Objective power consumption measurement Predictive methods to measure power consumption Areas to optimize power consumption Setting up a power measurement lab Hands-on Demo 27
  • 28. Predictive methods– Two Predictive methods are based on building mathematicalPower Consumption models for each major component of the device n  A formula is built to predict Device Power consumption as a function of power consumption of each component Models based on real device n  Through a series of measurements, power consumption factor of each component is determined and the model is calibrated measurements n  The model then can be used to estimate device power consumption of an application or task based on the time periods each component is “ON” n  The Discharge behavior of the battery is determined Models Training n  Each component’s power consumption factor is determined based on its the based on Battery % it decreases energy level of the battery for a period of time e.g. 15min – Discharge states and the model is calibrated based on this factor n  The model then can be used to estimate device power consumption of an application or task based on the time periods each component is “ON” 28
  • 29. Predictive methods– Model calibration based on real device measurement1.  Identify major components to be included in the model e.g. Display2.  Identify the System Variable (SV) Σ SV x βsv β: System Variable factor corresponding to each component SV: System Variable value e.g. screen brightness intensity3.  Build the device power consumption model as a function of all the SVs4.  In a series of measurements, isolate Current sensing resistor each major component and measure Battery / Power supply Stabilizing Capacitor the power consumption factor directly5.  Use the model to predict power consumption of the different use cases and tasks in your applications Device Source: Google, U. of Michigan 29
  • 30. Predictive methods– Model calibration based on battery Discharge State ∆1.  Identify major components to be included in the model e.g. Display2.  Identify the System Variable (SV) corresponding to each component e.g. screen intensity3.  Build the device power consumption model as a function of all the SVs4.  In a series of measurements, isolate (Delta E) each major component and determine the power consumption factor based on the battery SoC (vi) P x (t1-t2) = E x (SOC(V1) – SOC(V2))5.  Use the model to predict power P: AVG Power consumption in time t1-t2 consumption of the different use E: Rated battery energy capacity SOC(Vi): Battery State of Charge at voltage Vi cases and tasks in your applications Source: Google, U. of Michigan 30
  • 31. Outline What influences the battery life? Objective power consumption measurement Predictive methods to measure power consumption Areas to optimize power consumption Setting up a power measurement lab Hands-on Demo 31
  • 32. Design for power efficiency – GUI Making GUI more power efficientGUI facilitates most of the user interactions, and since itfully utilizes the screen, it’s a major power consumingpart of the device software.GUI provides INPUT, OUTPUT and HYBRID UIfunctions.Here are factors that design can take into consideration: n  Cognitive latency n  Perceptual capacity n  Hot keys n  User input cache n  Direct GUI power reduction n  Backlight control n  Frame buffer compression 32
  • 33. Design for power efficiency – GUI – Cognitive latency n Reducing Cognitive Latency makes GUI more power efficient: Cognitive n Cognitive latency is the time that the user needs to understand the Latency number of GUI elements present on the screen. If N is the number of element to choose, then: (Hick-Hayman Law) reaction time (sec) = a + b log2N (a, b constant) 33
  • 34. Design for power efficiency – GUI – Cognitive latency A very effective way to reduce cognitive latency is decreasing the number of options from which the user can make a selection. Split Cognitive menu is a good example of a GUI element with low cognitive latency. Latency Time taken to respond (sec) 3 Number of choices on screen 34
  • 35. Design for power efficiency – GUI – Perceptual capacity n Better visibility of the GUI elements being presented to the user lowers required user interaction time Perceptual Capacity n font type n font size n color, n GUI component size n color and optimal contrast ratio 35
  • 36. Design for power efficiency – GUI – other stuff n Hot keys Other stuff n User input cache n Direct GUI power reduction n Backlight control n Frame buffer compression 36
  • 37. Design for power efficiency – proper use of wakelock(), wifilock() PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLoc(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); wl.acquire(); ..screen will stay on during this section.. wl.release(); Flag value CPU Screen Keyboard PARTIAL_WAKE_LOCK On Off Off SCREEN_DIM_WAKE_LOCK On DIM Off SCREEN_BRIGHT_WAKE_LOCK On Bright Off FULL_WAKE_LOCK On Bright Bright ACQUIRE_CAUSES_WAKEUP Forces screen and/or KB to illuminate without waiting for user interaction ON_AFTER_RELEASE User activity timer will be reset. Screen, KB will stay ON a bit longer Source: http://developer.android.com/reference/android/os/PowerManager.html 37
  • 38. Design for power efficiency – proper use of wakelock(), wifilock() n wakelock() wakelock(), n Device battery life significantly affected by the use of wakelock() wifilock()use best practice n Do not acquire wakelock()s unless you ABSOLUTELY need them n When you acquire wakelock()s, use minimum level possible n Make sure you release the lock when you’re done n  wifilock() n  When syncing with the server, use longer periods (less frequent: 1 every hr instead of 1 every 5min) n  Release the lock when you’re done n  Example: A good justification for wifilock() is when downloading large files 38
  • 39. Outline What influences the battery life? Objective power consumption measurement Predictive methods to measure power consumption Areas to optimize power consumption Setting up a power measurement lab Hands-on Demo 39
  • 40. Setting up a power measurement lab – Lab functions n System to sample voltage, current and power at high Lab functions sampling frequency rates (1000 sample per second and above) n System to host simulated cloud services n Equipment to measure ambient light n Equipment to measure ambient noise 40
  • 41. Setting up a power measurement lab – Voltage, current & power measurement 41
  • 42. Setting up a power measurement lab – Voltage, current & power measurement Monsoon Power Monitor National Instrument LabView Software National Instrument USB-4065 USB DMM 42
  • 43. Setting up a power measurement lab – Measuring ambient light, noise Lux Meter Sound level Meter 43
  • 44. Setting up a power measurement lab – Connecting to the device Current sensing resistor Battery / Power supply Battery adapter Stabilizing Capacitor Copper Conductive adhesive tape 44
  • 45. Outline What influences the battery life? Objective power consumption measurement Predictive methods to measure power consumption Areas to optimize power consumption Setting up a power measurement lab Hands-on Demo 45
  • 46. Thank You!Moe Tanabian @motanabian 46