Stephen W. Moore

July 30, 2009

iPhone Lithium-Ion Charger Hardware

Filed under: Uncategorized — Moors @ 2:30 pm

In my last post, we looked at the iPhone’s lithium-ion battery technology and chemistry to understand how to maximize lifetime. This time, we’ll look at the battery charging interface hardware. The iPhone’s input power regulation and battery charging is controlled by a Linear-Technology LTC 4066 USB Power Controller.  This chip (highlighted in the red box below) performs the power routing from the USB port, to and from the battery, and to the device (source: tzywen).

iPhone Circuit Board with LTC 4066

iPhone Circuit Board with LTC 4066

This chip is somewhat programmable. Some input pins are provided to specify charging current, detect a wall adapter, and toggle high/low charging current. These pins have very weak pull-down resistors so the chip operates in “low current mode” unless some pull-up voltages are applied to these pins.  It appears the USB data lines (D+ and D-) have enough idle voltage to pull-up HPWR (high power select) and WALL (wall adapter present). This engages “high current mode”, which I measured 830mA on my phone. If these pins are left unconnected, the LTC4066 defaults to “low current mode”, which I’ve been measuring at about 85mA with my iPhone. The LTC4066 datasheet specifies low current mode is 20% of high current mode, but my iPhone’s ratio is about 85mA t0 830mA (about 10%).

LTC4066

There is still a possibility of software-controlled charging, depending on how the LTC4066 is connected. The iPhone receives SOC information (“gas gauge”) from pin 19 and 24 (POL and Istat). These are analog signals and require an analog to digital converter (ADC). Binary signals are output by the ACPR (wall adapter present) and CHRG (charge status) pins. The iPhone probably reads all of these pins, along with a fifth measurement of directly reading the battery’s voltage with an ADC. I would love to find these registers and see the LTC4066 status real-time!

Charge current thresholds are set by the CLPROG (pin 22) and PROG (pin 23). These are supposed to be permanently tied to ground with a resistor, whose value “programs” the chip. For the CLPROG pin, smaller the resistor values result in larger input-to-output current limits. The minimum resistor is 2.1k, corresponding to 0.476A. It is possible the iPhone either measures voltage at these pins, or even actively alters the behavior by injecting voltage into one of these pins.

When the 5 Ohms resistor is inserted in the USB power path, input current and voltage drops when the USB line sags. This forces the CHRG pin to trigger because the charge current has dropped below a set threshold. The iPhone detects the CHRG pin status, drops the LTC4066 into low current mode, and displays a message:

iPhone Warning

Can custom charging be done with software? If the input and output registers were known, software could measure the battery voltage, current, and wall adapter status. Three cheers for open-source kernels and shame on Apple. When the desired battery condition is reached (i.e. 50% SOC), software could change from high current mode to low current mode. The software could include hysteresis, so that if the battery drops below 40% SOC, it switches back to high current mode again. Depending on which pins are connected in hardware, software could use a number of strategies, using any of the SUSP, HPWR, or CLDIS pins or the PROG/CLPROG pins if they are connected.

How much heat would be generated by toggling the LTC4066 into low-current mode? I measured 5.21V on my USB (+) power wire. The battery (at 50% SOC) is about 3.7V. This means the LTC4066 has to drop 1.5 Volts. Drawing 85mA (low current mode), this means the LTC4066 is burning 0.125 watts. This amount of heat can easily be dissipated by the part.

Until we have access to the LTC4066-related kernel registers, I am keeping my existing arrangement. Using a short USB extension cable, I snipped the red wire (USB power) and inserted 5 Ohms of resistance. This bumps the charge current down to “low mode” in the LTC4066, while keeping the data lines connected functioning. I’d love to directly control the LTC4066 low/high mode with software, and stop playing silly games with the USB cable hardware. Until either someone decompiles the kernel and creates a kernal variable list, or Apple decides to release some internal kernal information (pigs can fly), software battery charging control isn’t an option.

Advertisements

July 21, 2009

iPhone 3GS Lithium-Ion Battery Life

Filed under: Uncategorized — Moors @ 1:53 am

In this post, we investigate the longevity of the Apple iPhone 3GC Lithium-Ion battery by looking at the battery’s constituent materials, characteristic curves, and the iPhone’s operating behavior. Is keeping the iPhone cradled all day when at the office a good idea to maximize life?

After a long history of using Palm, Treo, and Smartphone devices, I bought an iPhone. I was a little self-conscious when buying it – I’m not a “Mac Guy” – but I took the plunge. Now I understand there are only two kinds of phones:  the iPhone, and everything else. Most importantly, it runs Linux and it’s hackable! I was afraid the Apple overlords were so freakishly controlling that the device would be boring, but the hacker community has risen to the challenge. History doesn’t look kindly upon tyrants. People are too creative and inventive.

The biggest complaint I’ve heard about the iPhone is battery runtime. After owning an iPhone for a week, I can confirm the rumors to be true. The Apple website details how they tested runtime and some characteristic curves, which are very helpful. The also give tips on how to maximize battery runtime, which amount to “turn off all features that make the iPhone and iPhone.”

Before we start:  Runtime is how long the battery can operate on a single charge, which depends on the load. Lifetime is how long the battery remains usable before needing replacement, ideally measured in years. Using the runtime figures from the Apple website, I created some estimates of power consumption by dividing the battery’s ampere-hour capacity by the number of hours of runtime (consumption estimated at 3.7V average battery voltage):

Current Draw Chart

To confirm some data, I left the phone on Standby at 50% battery as per the Apple test conditions for 8 hours and measured a 5% drop in the battery, which corresponds to 6.8mA battery draw. Compared with Apple’s 4mA, my 6.8mA is ballpark – my cellular reception, WiFi reception, and other factors could have made my standby current measurement more substantial.

The stock iPhone doesn’t have many analytical tools to understand its energy consumption behavior. I had to jailbreak my iPhone and do some hacking to harvest useful data (more on this later). A typical day for my iPhone looks like this (data snapshot from BatteryLog). You can easily spot the heavy usage and when the phone was cradled. Also apparent is nighttime, where the phone was left on standby with no features enabled (2300h to 0700h).

Typical iPhone Day

Battery Usage over a day (0800h to 2200h)

Obviously, runtime is dominated by how many features are being used, which add to higher power consumption. What about overall lifetime? Does frequent charging damage life? Let’s take a look at the battery, and understand what contributes to lifetime.  The battery is specified as 3.7V and 4.51Wh, presumably at the C/5 rate. Dividing this for columbic capacity, it is 1219mAh.  The Apple website states the battery can be used for 400 cycles and lose 20% of its performance, with each cycle being defined as moving (in a single or separate piece) one whole unit of the battery’s capacity.

Apple Charge Stages

Apple Charge Stages

This is called “columbic throughput”, a measurement of the total amount of charge cumulatively measured in and out of the battery. I think we can get much more than 400 cycles of columbic throughput if done correctly.

Analysis

The 3.7V nominal and voltage curves indicate a Graphite anode and an LCO (Lithium Cobalt Oxide) cathode. The battery probably uses a standard EC:PC:EMC:DMC cyclic/non-cyclic electrolyte solvent and LiPF6 electrolyte salt (with trace additives such as VC and GPL to aid anode SEI formation), with a polymer or a monomer that is cured after assembly. The battery is charged to 4.1V or 4.15V at the 1C (1 hour) rate according to the Apple website (http://www.apple.com/batteries/). The graph is small and hard to read precisely.

Apple Charge Graph

Cathode

Lithium Cobalt Oxide is fully “discharged” when fully intercalated (meaning its crystal structure is packed full of Lithium Ions). Another way of saying this is “fully lithiated”. When you charge the battery, Lithium Ions leave the cathode and travel to the anode. LCO is usually considered fully “charged” when half of its Lithium Ions are removed. When more than half of the ions are removed, this is called “overcharged”, and the LCO becomes unstable and can break down or catch on fire. The LCO voltage with 50% of ions removed (fully charged) is 4.18V, which is a reasonable assumption of where iPhone charges the battery. Remember, this is only the cathode voltage. To get the battery voltage, we’ll need to find the difference between cathode and anode. The graph below shows the LCO cathode voltage by itself (not including the anode). The x-axis is the “delithiation”, or what percent of Lithium Ions remain in the cathode. When the cathode is fully discharged (100% of ions remain in the cathode), the cathode voltage is 3.825V. When 50% of ions remain in the LCO, the cathode is 4.18V. Anything over this is overcharging, and is dangerous.

Cathode Voltage Curve

Charged <----- Cathode Voltage Curve -----> Discharged

Notice the voltage curve has a short flat profile between 80% and 90% lithiation, which corresponds to the cathode being between 20% and 40% state of charge (SOC). Steep voltage curves or changes – “knees” – often indicate phase changes or other thermodynamic instabilities to be avoided.

Now let’s examine the entropy of the cell. Naturally, we’ll want to operate the cell at the best thermodynamic stability to achieve longest possible lifetime. This region is where columbic throughput (charging and discharging) damages/ages the cathode the least:

Cathode Entropy Curve

Charged <----- Cathode Entropy Curve -----> Discharged

Notice the large Entropic peak when the cathode is delithiated more than 60% (left side). This correlates to charging that battery over 80% state of charge (SOC). The small spike at high lithiation (right side) isn’t big enough to worry about. The conclusion is the cathode’s highest stability is a narrow window between 10% and 40% SOC for optimized lifetime.

Anode

What about the anode? The characteristic curve for the graphite anode looks like this:

Anode Voltage Curve

Discharged <----- Anode Voltage Curve -----> Charged

The anode is opposite that of the cathode: the anode is at 0 Volts and fully charged when full of Lithium-Ions. Since a lithium cell is manufactured with excess anodic graphite, the anode is never “fully” charged (lithiated) to 0V, rather, to a about 0.1V. If a graphite anode gets fully lithiated and drops to 0V, subsequent lithium ions can accumulate on the surface and form highly reactive (and very dangerous) metallic lithium.

Notice the dramatic voltage change below 20% state-of-charge. This is when most of the easily accessible lithium-ions have been extracted, and the cell is working hard to remove the last few deeply embedded ions. The cell’s impedance rises dramatically, which causes internal heating (more on this later). You’ll want to avoid discharging the cell below 20% SOC.

Full Cell

Consider a full cell (cathode and anode together) and the cathode is charged to 50% delithiation, which is 4.18V. The graphite absorbs the lithium-ions to about 90% lithiation to 0.08V (the graphite’s remaining 10% lithiation is headroom, and is never used). The full cell (difference between cathode and anode) works out to about (4.18 – 0.08) = 4.10V. This is on the very edge of safety, because any more charge will push the cathode beyond 50% delithiation (thermal instability) and the graphite all the way to 0V (Lithium plating). The battery becomes much more likely to catch on fire.

The cell demonstrates characteristic impedance. When fully charged (or nearby), the battery has a high “charge acceptance” impedance, meaning the battery wants to reject charging because it’s full. Fast charging during this phase can generate internal heat, which prematurely ages the battery and decays overall lifetime. Apple does a fast charge until about 4.1V and then switches to a trickle charge. This is convenient to charge the battery rapidly when you really need it, but for everyday use, probably leads to internal heating and accelerated decay – by the time the battery reaches 4.1V, the fast charge has already triggered the highest entropy region while simultaneously generating internal heat. It would be better to switch to trickle charge sooner, but this would be inconvenient to users charging on the run (i.e. in airports).

Apple Charge Graph

When the battery it low, it has high “discharge impedance”, which means the battery wants to reject further discharge because it’s empty. The cathode is nearly 100% lithiated, and doesn’t want any more ions. The graphite anode is nearly empty, and the few leftover ions are more tightly bound. This is the common experience when batteries get “run down” and need to be charged. The internal impedance is increasing, sagging the battery’s output (note: never continue to use a cordless power tool after you notice the battery “sag”. Trying to get one or two more screws finished after the battery starts sagging can cause significant lifetime damage to the battery.) The droop causes internal heating, which degrades battery life. An example of cell impedance is shown below. Pay attention that the impedance increases at the ends (fully charged or fully discharged), and is the lowest in the middle. This graph is probably representative to the iPhone’s battery. The lowest impedance is between 20% and 70% state of charge. Interesting how that same operating range keeps cropping up.

Cell Impedance Curve

Discharged <----- Cell Impedance Curve -----> Charged

The lesson is the iPhone battery will have the longest possible lifespan if operated to minimize entropic activity and avoid increased impedance (i.e. internal heat generation).

Proposed Solution

The “sweet spot” of the iPhone battery is cycling between roughly 20% – 70%, with 40% being the best operating point. This obviously isn’t a good solution when traveling, because you probably want a full charge. But for daily sitting at your desk, the optimized solution is to idle your phone all day at 40% SOC instead of keeping your iPhone cradled at 100% SOC. Read my lips:  keeping your iPhone battery cradled continuously at 100% will degrade life just as fast as cycling it, or maybe faster. Your battery is aging due to entropic activity in the cradle, even if you’re not using it. There are not many things worse for lifetime than continuously floating a lithium battery at 100% (temperature exposure would be the worst, i.e. a hot car or a black phone exposed to direct sunlight.)

My solution was to create a custom USB cable that would deliver just enough current to power the iPhone all day without charging the battery (very much). The cable maintains the battery SOC within the 20% – 70% window throughout the day and doesn’t expose the battery to the entropic zones. I figure my battery life will be double that of average using this cable. Naturally, when I travel, I take the standard charger and keep my iPhone topped off throughout the trip. Back at home, I use the custom cable.

Standard USB charging draws about 800mA (I measured anywhere between 766mA to 830mA). This corresponds to about 1.5C-rate fast charge. This will certainly generate some internal resistance heating and degrade life! If your iPhone gets warm while charging, especially once the battery approaches full charge, your battery’s lifetime is draining away before your eyes.

What I needed was equilibrium between my daily iPhone usage and battery charging. I didn’t want the battery to either charge or discharge, but remain at 40% all day long. I didn’t want to mess with the hassle of unplugging and plugging wires to manually manipulate battery charge.

I disassembled an USB extension cable and inserted a 4.1 Ohm resistor in series with the power wire (red). The dropped the charge current available through the USB port to 80mA. Now we’re talking! This is an order of magnitude lower than the stock USB cable. If left on standby (6.8mA), 80mA would take 16 hours to charge the iPhone battery. However, during normal usage (i.e. using the phone), the battery doesn’t get much opportunity to charge, and everything balances in equilibrium.

When I plug in the USB cable, the iPhone gets upset and flashes a warning notification. The phone still synchronizes through the USB data wires. Despite the iPhone’s warning, I noticed the battery accepting a very slow charge over a period of hours.

iPhone Warning

Natrually, the best solution would be software for programmable battery charging that stops (“float charge”) the cell at 40% SOC (or some other arbitrary setpoint). I haven’t found the software secrets to control this yet. When traveling, the software could be set to allow the battery to fast charge to 100%.

Results

I installed BatteryLog from the App Store. This application automatically logs the battery state (in 5% increments) every 30 minutes (other intervals are also available). However, it must be running to collect data. I did not want to leave the battery logger running all the time. I jailbroke my phone and installed backgrounder with Cydia. Backgrounder allows iPhone applications to run as background processes. I made BatteryLog to run continuously in the background, collecting battery percent data every thirty minutes. This used 15.46 seconds of CPU time over 22 hours, or 0.017% CPU utilization (I used top to view CPU time over an OpenSSH console). Running as a background process, BatteryLog doesn’t use enough CPU time to effect power consumption (maybe a few mWh over a day).

CPU Load Top

The new USB cable is working fabulously. The battery SOC stays within the designated window. I can now leave my iPhone plugged in all day and not worry about overcycling or degrading battery life. The battery doesn’t drift more than 10% all day and all night. My usage included a few hour-long teleconferences and normal miscellaneous calls (and playing a few apps). The 10% jump at 1030h occurred when I was working with the USB cable assembly and temporarily removed the resistor, and charging ran at full power.

Battery Activity

Battery Activity

Just in case, I also purchased an i.Sound backup battery. In combination with a car charger and an AC charger in my carry-on luggage, I won’t be left without juice for my iPhone, even on long international flights.

Big thanks to the Dev-Team (jailbreak), Saurik (Cydia), and gaizin (backgrounder) for your contibutions to the iPhone community!

July 13, 2009

Outdoor Dipole Audio

Filed under: Uncategorized — Moors @ 8:15 pm

I was put in charge of providing audio at a local estate party. I thought this was a good opportunity to test some dipole systems I’ve been considering. My home audio system consists of the Linkwitz Phoenix system, which is the DIY version of the Audio Artistry systems.  Home Hi-Fi is not appropriate for outdoor PA usage (“sound reinforcement”) – they have incompatible goals:

  • H-Fi (Home Audio):  accurate presentation, tonal purity, flat frequency response, very low bass response
  • Sound Reinforcement (Pro Audio):  high efficiency, maximum decibels, ruggedness, durability

However, I’ve seen the Linkwitz dipole arrangement used successfully as a PA system. I put together a system using Bose monitors to cover the frequency range above 150Hz and some modified Linkwitz dipole Phoenix woofers for reproduction from 35Hz to 150Hz.  I used the stock Phoenix crossover circuit board with few modifications (resistor values).  The woofer modules used Lambda 12″ woofers (no longer in production, but their descendants can be found here). The Bose monitors were mounted on tripods for the correct height.

Dipole Woofer with Bose Monitor Dipole Woofer with Bose Monitor

The electronics package was transported in an old WWII CY-573 military carrying case for oscilloscope and testing equipment. The case is very rugged, has a waterproof seal, and is generally very cool. The electronics included:

  • Carver TFM-45 Amplifier for the woofer modules
  • Audio Control Richter Scale III crossover module (for Bose monitors)
  • Linkwitz Phoenix crossover and dipole compensation module
  • Numark 4 channel mixer
  • Alesis Compressor/Limiter
  • iPod Nano
  • Hewlett Packard iPaq with WinamPAQ

Electronics

The sound was very good – clear with very rich bass and tone. The dipole woofers functioned beautifully in the outdoors environment. Their “figure 8” radiation pattern was clearly evident, with null nodes at the sides and full bass response directly in front and back. I noticed several partygoers taking advantage of the null nodes for private conversations, and the buffet tables were also placed in the  null node on the other side.

The equipment broke down rapidly for easy transport.
Equipment Transport

With the tremendous success of the dipole woofers, I’m now considering a full system with dipole midranges and tweeters using the Linkwitz Pheonix crossover. Hats off to Linkwitz for sharing his knowledge and talents with us.

Create a free website or blog at WordPress.com.