AN960 New Components and Design Methods Bring Intelligence to Battery Charger Applications Author: Terry Cleveland and Catherine Vannicola, Microchip Technology Inc. INTRODUCTION New design methods and components bring high intelligence to battery charger and power-management applications. When developing intelligent power management systems, very complex and cumbersome analog-only solutions are now old school. When combining low-cost microcontroller’s with analog-attach, high-speed Pulse Width Modulators (PWMs), the benefits of a mixed signal design can be realized. In the past, a complex power-management system was developed using a high-speed analog PWM combined with logic and specialty analog-only circuits. In some cases, non-flexible, off-the-shelf solutions are available for a price. For most applications, they have neither the features, nor the capability, to meet any special requirements. With the addition of a microcontroller, the new design method can adapt to almost any system command, environmental conditions or system-level fault. With the combination of a microcontroller and a highspeed analog PWM, the designer can enjoy the benefits of programmability with the peace of mind that the power train is being controlled and protected by a reliable high-speed analog loop. When external conditions warrant a change in output, the digital microcontroller can adjust the output of the supply, the switching frequency of the supply, the minimum off time of the power train switch, power-up soft start, take action in the event of a system-level fault, etc. With the broad range of Microchip’s PICmicro® microcontroller product line, the microcontroller can be sized for the job. In many applications, a microcontroller is already resident. By adding the MCP1630 analog, high-speed PWM, a power train can be easily added to the design. This application note will describe a typical intelligent battery charger power system application. As with most real life applications, there are many demands made on the power system designer to protect the system in the case of battery removal, plugging the battery in backwards, reverse polarity at the input, a battery shorting and even more unimaginable situations. A complete battery charger, fuel gauge system design will be presented as an example of the mixed signal 2004 Microchip Technology Inc. design method. Battery reference material and basic switchmode power supply converter trade-offs are covered in the beginning of this application note. BATTERY BACKGROUND Definitions: The anode of a cell during discharge is the negative electrode. During charge, the anode is the positive electrode. The anode supplies electrons to the load. The C rate is the battery’s charge or discharge current expressed as a multiple of the capacity. For example, if a battery has a capacity of 500 mAhr, a charge rate (or “C” rate) of 2C would imply a charge current of 1A. Capacity is measured in units of Amp-hours and can be described as the discharge current necessary to reach the end voltage after one hour. The cathode of a cell during discharge is the positive electrode. During charge, the cathode is the negative electrode. The cathode accepts electrons from the load. Charge acceptance is the ability of a battery to accept charge by converting provided electrical energy into stored chemical energy. The electrolyte conducts ions inside the cell between the anode and the cathode. The electrolyte must be a good ionic conductor but not be electrically conductive, since this would cause short-circuiting. Most electrolytes are liquids, although some are solids. Memory effect is a temporary failure of a battery due to repeated incomplete discharge. This causes the battery to lose capacity. Capacity can be restored by a few repeated cycles of full discharge and charge. Self-discharge is the loss of charge of an unloaded cell due to internal chemical reactions. The service life of a secondary battery is defined as the length of useful performance in years, called float life, or the number of times it can be usefully charged and discharged, called cycle life. Trickle charge is a low charge rate used to maintain a battery in a fully charged condition. DS00960A-page 1 AN960 Figure 1 shows the basic battery cell during charge and discharge. The anode and cathode are electrically isolated by a mechanical separator to prevent short circuiting. The electrolyte surrounds the anode and the cathode and can permeate the separator. During the discharge cycle, positive ions flow from the anode to the cathode, while negative ions flow from the cathode to the anode. Electrons flow through the external load from the anode to the cathode. During the charge cycle, this process is reversed. Discharge Load Electrolyte Electrons Negative Ions (–) Anode (+) Cathode Overall reaction: Pb + PbO2 + 2H2 SO 4 → 2PbSO 4 + 2H 2 O The lead acid battery is low in cost and available in large quantities. Lead acid batteries also come in a variety of sizes and designs. They have good high-rate performance, reasonably good low/high temperature performance and have over 70% efficiency. They have good charge retention and, since they are sealed, are maintenance-free. The lead acid battery’s main disadvantages are its lowcycle life (typically between 50 and 500 cycles), its limited energy density (30-40 Wh/kg) and its weight. Lead acid batteries should not be stored for long periods of time in a discharged state that can lead to irreversible polarization of the electrodes. The evolution of hydrogen in some designs can be an explosion hazard, while the evolution of stibene and arsine in other designs can be a health hazard. Positive Ions SEALED NICKEL CADMIUM Separator FIGURE 1: Battery Cell. The sealed nickel cadmium cell has a metallic cadmium negative electrode and a positive electrode made from nickel oxyhydroxide, with potassium hydroxide as the electrolyte. As the cell is discharged, the positive plate reduces to nickel hydroxide and the negative plate oxidizes to cadmium hydroxide. Negative electrode: Chemistries There are a number of different battery chemistries available to choose from when selecting a rechargeable cell. Three of these choices are: sealed lead acid, nickel cadmium and nickel metal hydride. Each battery chemistry has advantages and disadvantages, with each having different charging requirements. The sealed lead acid battery uses lead dioxide in the positive electrode and metallic lead in the negative electrode. The electrolyte is a sulfuric acid solution. During discharge, both the positive and negative electrodes convert to lead sulfate and water is generated. During charge, the process is reversed. If the cell is overcharged, hydrogen and oxygen gas are produced and there is a loss of water, resulting in a loss of capacity. The chemical processes during discharge are shown below. Negative electrode: Pb → Pb Pb + Positive electrode: NiOOH + H2 O + e → Ni ( OH )2 + OH - Overall reaction: Cd + 2NiOOH + 2H 2 O → Cd ( OH ) 2 + 2Ni ( OH ) 2 SEALED LEAD ACID 2+ Cd + 2OH → Cd ( OH )2 + 2e SO 42- 2+ + 2e → PbSO 4 The sealed nickel cadmium battery has a long cycle life, good low-temperature and high-rate performance capability, rapid recharge capability and a long shelf life in any state of charge. The sealed design has features to prevent a build-up of pressure if overcharge should occur. It requires no maintenance, with the exception of recharging. Sealed nickel cadmium batteries are subject to the memory effect. They have a higher cost than lead acid batteries and are outperformed by the lead acid battery at high temperatures. They have poor charge retention and have a lower capacity than other competitive batteries. There are also environmental concerns due to the use of cadmium, a heavy metal. Positive electrode: + PbO 2 + 4H + 2e → Pb Pb DS00960A-page 2 2+ + SO 42- 2+ + 2H 2 O → PbSO 4 2004 Microchip Technology Inc. AN960 SEALED NICKEL METAL HYDRIDE The nickel metal hydride cell employs nickel oxyhydroxide in the positive electrode and a metal hydride rather than cadmium in the negative electrode. The electrolyte is potassium hydroxide. During discharge, the nickel oxyhydroxide of the positive electrode is reduced to nickel hydroxide and the metal hydride of the negative electrode is oxidized to the metal alloy (M). Negative electrode: - MH – OH → M + H 2 O + e Positive electrode: NiOOH + H2 O + e → Ni ( OH ) 2 + OH Table 1 shows comparisons between properties of different battery chemistries. TABLE 1: BATTERY TECHNOLOGY COMPARISONS Electrochemistry PbAcid Ni-Cd NiMH Nominal Cell Voltage V/cell 2.0 1.2 1.2 End of Life Voltage V/cell 1.7 1.0 1.0 Energy Density W-hr/kg W-hr/Itr 35 80 50 100 60 130 Self-Discharge Rate %/month 2 15 30 - Overall reaction: relevant MH + NiOOH → M – Ni ( OH ) 2 Cycle Life 25% dischrg 100% dischrg 1200 300 2000 500 500 500 The metal alloy used in nickel metal hydride batteries must be stable over a large number of charge/ discharge cycles. It also must be able to store hydrogen to obtain high energy density and battery capacity. The metal alloy must have high electrochemical reactivity, good kinetic properties for high-rate performance, high oxidation resistance and must be stable in an alkaline electrolyte. Two common types of metallic alloys are: rare earth alloys based on lanthanum nickel and alloys of titanium and zirconium. There are other possible substitutes that can be used to improve certain aspects of the alloy’s performance. Cost/W-hr $/W-hr 0.50 1.00 1.50 Nickel metal hydride batteries have higher capacity than the nickel cadmium batteries. There is minimal environmental concern because they are cadmiumfree. They have a long shelf life in any state of charge and are much smaller and lighter than the nickel cadmium. They also have less susceptibility to the memory effect. The high-rate performance of the nickel metal hydride battery is not as good as that of the nickel cadmium battery. The negative electrodes of the nickel metal hydride battery are more expensive. There is also less capacity to deliver high peak currents, greater risk of damage due to overcharging and they have a higher self-discharge rate. 2004 Microchip Technology Inc. Recommended Charging for NiMH Panasonic® recommends that its nickel metal hydride batteries be rapidly charged between 0°C and +40°C with a maximum current of 1 CmA. Rapid charge should be between 0.5 CmA and 1 CmA. Charging batteries above 1 CmA could cause the safety vents to be activated due to a rise in the internal pressure of batteries. If the battery is outside the recommended temperature range, it must be trickle charged. Rapid charge current may be applied when the voltage-percell is between 0.8V and 1.8V. Outside of this range, trickle charge must be applied. If too high a charge current is applied to deeply discharged batteries, the full capacity of the batteries may not be achieved during charge. Trickle charge should be between 0.033 and 0.05 CmA to avoid a harmful temperature rise. After trickle charge, a transition current before rapid charge of 0.2~0.3 CmA must be applied. Rapid charge must end and trickle charge must be reapplied when the voltage drops 5 to 10 mV/cell during charge. This drop in voltage means that the battery is fully charged. Also, rapid charge must be stopped and trickle charge applied, if the battery voltage exceeds 1.8V/cell, or if the temperature rises 1 to 2°C/min. The temperature of a charging nickel metal hydride battery must not exceed 55°C for A, AA and D-sized batteries, 50°C for QA, AAA and prismatic sizes, and 60°C for L-A, L-fatA and SC sizes. Any time the temperature rises above these prescribed values, the charge must be switched to trickle to avoid impairing cycle life. DS00960A-page 3 AN960 In order to measure the correct change in voltage, there must be at least a 10 minute delay after the initiation of rapid charge and the beginning of voltage detection. This is done to avoid measuring voltage swings when rapid charge is commenced. Even extensive trickle charge can lead to harmful overcharging, causing deterioration of the battery. Therefore, the total time the battery spends being charged should be limited to between 10 and 20 hours. Stage 1: Trickel Charge Stage 2: Fast Charge VCELL 0.8V VCELL(V) ICH(A) T(°C) 1.0C Stage 3: End Fast Charge Power Topology Options BUCK CONVERTER The buck converter or step-down converter can only step the voltage down from a higher voltage level to a lower voltage level. In this application, this may or may not be acceptable. The minimum input voltage is 8V, while the maximum output voltage is 6.4V, plus current sense voltage and voltage drop across any protection switch used to disconnect the battery in the event of an over-discharge condition. Stage 4: Overcharge Buck Converter -∆V Body Diode Path L +12V Input ICH +VBATT C 0.2C T (Cell Temperature) 0.05C 1hr FIGURE 2: 4 NiMH Batteries 1.5hr Charge Stages. Chopped Input Current Figure 2 shows the stages that a charging nickel metal hydride battery goes through and what the battery temperature, current and voltage characteristics are. The charge termination method can be any one of the above or a combination. Battery manufacturers recommend using this combination method of termination to maximize the life and capacity of the NiMH battery. FB ISENSE FIGURE 3: SELECTING THE BEST POWER TRAIN TOPOLOGY The most important decision when developing a power management system is selecting the “best” topology. In most applications, there are several alternatives and they should all be considered prior to making the final selection. This decision is based on total system cost and performance. Some topologies add complexity, but this may result in savings that are beneficial to a specific application. DS00960A-page 4 Buck Converter. When compared to other topologies, the buck converter is considered low in complexity. It requires a single switch, single inductor and diode (in addition to input filter and output capacitor). When looking at the buck converter for charging applications, there are a couple of key drawbacks to consider. • There is a path from the battery back to the input through the buck switch body diode (when using a MOSFET switch). This is resolved by either adding a blocking diode at the input or, preferably, at the output of the buck regulator. • The input current is discontinuous or pulsing. This can lead to another filtering stage at the input of the converter to meet system-level EMI specifications. This filtering stage typically consists of an inductor and capacitor to filter the pulsed input current. • In the event of a shorted buck switch (high-side), there is no way to limit the current into the battery. This situation is hazardous and should be avoided by using a protection device (fuse). 2004 Microchip Technology Inc. AN960 BUCK-BOOST CONVERTER FLYBACK CONVERTER The buck-boost converter can be configured several different ways. In order to keep the input polarity the same as the output polarity, a minimum of two switches and two diodes are used. One of the switches is in the high-side (similar to the buck converter), while one switch is in the low-side (similar to the boost regulator). This increases the cost and complexity of the buckboost topology when compared to most other solutions. A flyback converter utilizes a coupled or two winding inductor. The flyback converter can provide true galvanic isolation from input to output for applications that have hazardous input voltages. This is commonly used in off-line applications (for relatively low power converters and battery chargers). Flyback Converter +VBATT +12V Input Buck - Boost Converter CIN 1 COUT 1 +VBATT +12V Input COUT CIN L Chopped Input Current EXT Blocking Diode Blocking Diode 4 NiMH Batteries CS 0.15Ω 4 NiMH Batteries Chopped Input Current FB ISENSE FB ISENSE FIGURE 5: Flyback Converter. Advantages of the Flyback Converter: FIGURE 4: Buck-Boost Regulator. Advantages of the Buck-Boost Converter: • Step-up and step-down capability. • The output stage rectifier diode can be used as the reverse blocking diode. Disadvantages of the Buck-Boost Converter: • Discontinuous or chopping input current typically requires additional input filtering. • In the event of a shorted high-side switch, there is no way to limit the current into the battery (similar to buck converter). This situation is hazardous and should be avoided by using a protection device (fuse). • Two switches and two diodes necessary for buckboost capability without inverting output polarity. 2004 Microchip Technology Inc. • Input voltage can be greater or less than the output voltage. The flyback has the same transfer function as the buck-boost converter (1:1 turns ratio coupled inductor). • Low-side switch and low-side current sense simplify the drive scheme and peak current sense circuitry. • The blocking diode necessary for battery charger applications is inherent in the flyback topology. • Additional output voltages are easily added using additional winding on the coupled inductor. By adjusting the turn ratio of the secondary windings, a large step-up or step-down ratio can be accomplished. Disadvantages of the Flyback Converter: • The main disadvantage of the flyback converter is related to the leakage inductance of the coupled inductor. Every magnetic device that has more than one winding will have a leakage inductance from one winding to the other. When the Flyback low side switch turns off, this leakage inductance is not clamped. This unclamped inductance requires the addition of a snubber or damping circuit. For low-power, low-cost applications, this snubber tends to be dissipative and requires additional components. DS00960A-page 5 AN960 • The peak voltage observed on the drain of the low-side switch (when off) is equal to: VIN + (NP/NS) * VOUT + VLK for a coupled inductor where NP = # of primary turns and NS = # of secondary turns. The higher the leakage inductance between the primary and secondary windings, the more energy available to develop voltage overshoot. To a certain degree, this can be suppressed using a dissipative snubber which is detrimental to converter efficiency. • The flyback converter uses an inductor with two windings. For some applications, this can lead to a custom magnetic design. For applications where a 1:1 turn ratio can be used, there are many magnetic suppliers that offer standard off the shelf products. SEPIC CONVERTER The Single-Ended Primary Inductive Converter (SEPIC) was developed primarily to have step-up and step-down capability without inverting the polarity of the regulated output. The main difference between the SEPIC converter and the previously mentioned topologies is the addition of another energy storage element. The SEPIC uses a coupling capacitor to store and transfer energy. SEPIC Converter C1 Coupling Capacitor +12V Input CIN 1 Blocking Diode +VBATT COUT 1 EXT CS Input Current 0.15Ω 4 NiMH Batteries FB ISENSE FIGURE 6: SEPIC Converter. Advantages of the SEPIC converter: • Low-side switch and low-side current sense simplify the drive scheme and peak current sense circuitry. • The blocking diode necessary for battery charger applications is inherent in the SEPIC topology (similar to the flyback). • Input voltage can be greater or less than the output voltage. • The input current to the SEPIC converter is continuous, similar to a boost regulator. For topologies having continuous input current, the input EMI filtering can be significantly reduced (or is not even necessary). The amount of noise generated at the input of the SEPIC is much lower than in the case of the buck, buck-boost or even the flyback converter. In applications where noise reflected back to the input from the switching regulator is a concern, a SEPIC converter has a distinct advantage. DS00960A-page 6 2004 Microchip Technology Inc. AN960 • The SEPIC converter provides capacitive primaryto-secondary isolation. In the event of a main switch short, the output voltage is not shorted to the input voltage, similar to the case of the buck converter. This provides a level of protection for the load. In the case of battery chargers, even with the reverse-current blocking diode, there is no protection in the event of a short circuit. • The coupling capacitor clamps the winding leakage inductance energy; no snubber circuit is necessary. Selecting Topology After careful consideration, the SEPIC converter was chosen for this 12V nominal input and four NiMH cell battery load (500 mA fast charge current). The technical advantages of the SEPIC converter outweigh the disadvantages for this low-voltage, low-power application. The SEPIC input is designed to have low ripple current so an additional input filter may not be necessary. The SEPIC rectifying diode is also used as the battery reverse current blocking diode. The main disadvantages of the SEPIC converter are the higher switch current and the addition of the coupling capacitor. For lower voltage applications (sub 100V switch), new MOSFET technology has lower onresistance while keeping switch capacitance low. There have also been significant improvements in lower voltage (sub 50V) ceramic capacitor technology. In this example, a SOT23 85 milli-ohm switch rated for 30V and 0805 1 µF 25V ceramic capacitor was used. For high-voltage, high-power applications, the higher switch current and additional energy storage coupling capacitor is both a technical, as well as cost, concern. 2004 Microchip Technology Inc. DS00960A-page 7 AN960 4-CELL NIMH BATTERY CHARGER APPLICATION EXAMPLE Application Description Complete system to charge four series NiMH rechargeable batteries at 500 mA. Additional features include: • Charge batteries to manufacturer’s recommended profile. (This can change from manufacturer to manufacturer and should be adhered to for maximum battery performance. Many off-the-shelf switching battery chargers set the trickle charge current as a ratio of fast charge current not fully optimizing the battery life.) • Terminate charge current based off change in voltage versus time and/or change in battery temperature versus time or a maximum length of time. • Minimize size and cost of power system used to charge batteries. • Maintain high-power conversion efficiency. • Minimize quiescent current draw on the battery during power outages. • Provide visual indication of state of charge. • Protect the battery and circuitry from: - battery disconnect - battery short circuit - overcharge - overdischarge • Soft start the power train during startup or recovery from a fault mode. • Integrate battery energy used to provide “fuel gauge” to system for display. • Provide I2C™ standard communications to host system. • Minimize EMI and noise on the input source of the battery charger. A list of requirements on the power management system is not an uncommon situation. All of the features and functions listed above are necessary to provide an efficient and safe solution to charging NiMH batteries. DS00960A-page 8 Battery Charger Design Specifications • Input Voltage Range: - 8V to 15V • Charge Current: - Fast Charge = 0.5C to 1C or 500 mA - Trickle Charge = 0.1C or 50 mA - Top off Charge = 0.05C or 25 mA • NiMH Cell Voltage Charge Range: - 0V to 0.8V per Cell Trickle Charge Only - 0.8V to 1.6V per cell Fast Charge • Charge Termination Method: - Based on termination voltage (-dV/dt) - Based on temperature (+dT/dt) - Based on charge cycle elapsed time - Based on total charge cycle time The charge termination method can be any one of the above, or a combination. Battery manufacturer’s recommend using this combination method of termination to maximize the life and capacity of the NiMH battery. • Low quiescent current draw on battery during input power failure, typically 29 µA. • Charge mode indication using LED. • Failure mode indication using LED. • Capability to sense discharge current and provide I2C communication to host for remaining capacity information. • Minimum of 80% efficiency. • Minimize board area and height. • Overvoltage protection in the event of an open battery. • Overcharge protection to prevent the battery from becoming dangerously overcharged. • Overcurrent protection in the event of a shorted battery. • Overtemperature protection to prevent the battery from reaching too high a temperature during charge. • Soft-start capability by holding the reference voltage low during power-up. • A simple fuel gauge that has a dual MCP6042 amplifier, a 1-channel sense voltage and a 1-channel sense current. • Flexibility to optimize the charging algorithm for new battery technology and add proprietary features by coding the microcontroller. • Ability to adapt to environmental effects, such as ambient temperature. • The output voltage range, input voltage range and output power can be scaled using different external component set. 2004 Microchip Technology Inc. AN960 Power Train Design W1 A IW1 + C1 + D Q1 VIN W2 IW2 W1 B + IW1 W2 IW2 W1 + VIN + ICHARGE + C1 VIN C COUT COUT + ICHARGE C + 1 IW1 W2 IW2 COUT + ICHARGE Sum of Winding Currents IW2 Diode Current Switch Current IW1+IW2 IOUT (Average) IOUT x (VOUT/VIN) IW1 IIN (AVERAGE) tON FIGURE 7: tOFF tON tOFF tON tOFF SEPIC Converter Inductor, Switch and Diode Currents. 2004 Microchip Technology Inc. DS00960A-page 9 AN960 POWER TRAIN CALCULATIONS SEPIC Converter +12V Input CIN ICHARGE +VBATT L IW1 W1 C1 W2 ICOUT COUT IC1 Q1 ISW 4 NiMH Batteries IW1+ IW2 FB VC1/L2 (VOUT) / L2 ISENSE IW2 VIN/L1 (+VC1 + VOUT - VIN)/L1 stant fixed frequency switching. This will eliminate the variable pulse skipping that can occur while minimizing the ripple current at high load. This reduces the reflected input ripple current without adding extra filtering. The SEPIC switch (Q1) is turned on at the start of the cycle (Figure 7B). As shown in Figure 7B, the ISW1 current will ramp up at a rate of VIN / L1 (where L1 is the inductance of the W1 winding of the coupled inductor). The current in winding 2 (W2) ramps at VC1/L2. In the case of the 1:1 coupled inductor, L1 = L2. It will be shown that for the SEPIC converter topology, the DC voltage across VC1 is equal to VIN. For the case of the coupled inductor, ∆IW1 = ∆IW2. The switch current (Q1) is equal to the sum of IW1 and IW2 during the switch on time. The input current is continuous (and equal to IW1), minimizing the input ripple current when compared to other topology choices for the constant current battery charger. When Q1 turns off, the path for current flow changes (Figure 7C). IW1 SEPIC Converter ICOUT tON tOFF CIN FIGURE 8: C1 The power train switching frequency is adapted to the charge current using the PICmicro® microcontroller and MCP1630 architecture. This adaptation provides the best switching frequency for both operating conditions. For example, when the charging current is 500 mA, the SEPIC converter operates at 1 MHz and minimizes the ripple current seen at the input of the converter. This will reduce, or even eliminate the need for additional input filtering, depending on the application. When the converter changes charge current to trickle charge, the input sensed current used to terminate the duty cycle is very small, making it difficult to maintain a fixed frequency. Under these conditions, pulse-skipping can occur. By adapting the switching frequency to 400 kHz, the sensed current ramp is increased and the SEPIC converter will maintain a con- +VBATT IW1 ICOUT W2 COUT IW2 4 NiMH Batteries IW1 + IW2 FB Switching Frequency: - Fast Charge FSW = 1 MHz - Trickle Charge FSW = 400 kHz ICHARGE L W1 SEPIC Switch ON. To design a SEPIC converter or any switching power converter, it is best to visualize the switching waveforms. For the SEPIC converter, there can be many modes of operation depending on the continuity of the inductor current. For this application, a coupled inductor is used, eliminating several of the discontinuous modes of inductor current operation. Since the windings are coupled, they are either operating in the Continuous Inductor Current mode or the Discontinuous Inductor Current mode. DS00960A-page 10 IW1 + IW2 +12V Input VC1/L2 (VOUT) / L2 ISENSE IW2 VIN/L1 (+VC1 + VOUT - VIN)/L1 IW1 ICOUT tON tOFF FIGURE 9: SEPIC Switch OFF. With Q1 off, the path for current is now from the input, through winding 1 (W1) and the coupling cap (C1) to the output. Another path for current flow exists through winding 2 (W2) to the output. The sum of W1 and W2 currents flow to the output. During the switch off time, the sum of W1 and W2 current must also replenish COUT (output capacitor). Looking at the ICOUT waveform, it can be seen that the output current of the SEPIC converter is discontinuous and pulsed. This may require additional filtering for low output ripple 2004 Microchip Technology Inc. AN960 voltage applications. Typically the output ripple is not a concern for battery charger or constant current lighting applications. The transfer function for the SEPIC converter is derived in a similar fashion as other switching power topologies. Like all switching systems operating in the steady state, the volt-time product of the magnetic device(s) must be balanced and the charge-time product on all capacitor(s) must be balanced (what goes in must equal what comes out over a switching cycle during steady-state operation). Looking closer at the SEPIC topology, the input components (W1, Q1) look like a standard boost converter input stage. The output components, (W2, D and COUT) look like an inverted buck-boost converter. The goal is to determine the volt-time product on the magnetic devices during the switch on time and set that equal to the volt-time product on the magnetics during the switch off time. Using this premise, the transfer function can be derived. T SW = 1 ⁄ FSW TSW = Switching Period FSW = Switching Frequency Switch on time = tON Switch off time = tOFF Duty Cycle (D) = tON / TSW Balance the inductor volt-time product in the boost stage (W1). Q1 Turned on (+ Slope). ∆I W1 ⁄ tON = V IN ⁄ L W1 Q1 Turned off (- Slope). ∆I W1 ⁄ t OFF Q1 Turned on (+ Slope). ∆IW2 V C1 ------------ = --------t ON L W2 Q1 Turned off (- Slope). ∆I W2 V OUT ------------ = ------------t OFF L W2 Inductor slope’s must me equal for volt-time balance. VC1 V OUT t ON × ---------- = t OFF × ------------L W2 L W2 Multiply both sides by 1/(tON + tOFF). VC1 × D = VOUT × ( 1 – D ) Solving for VC1. 1–D VC1 = VOUT × ------------- D Basic Definitions: - For the second stage, the inductor slopes must also be equal. VC1 + VOUT – VIN = -------------------------------------------L W1 Inductor slope’s must be equal for volt-time balance. V IN VC1 + V OUT – V IN t ON × ---------- = tOFF × -------------------------------------------L W1 L W1 Set VC1 = VC1 for both the Boost stage and the BuckBoost stage. 1 1–D VC1 = V IN × ------------- – V OUT = VOUT × ------------- 1 – D D Solving for VOUT/VIN. V OUT D ------------- = ------------- 1 – D VIN Looking back, if D/(1-D) X VIN is substituted for VOUT, it is shown that VC1 = VIN. This is true if C1 is sufficiency large enough that the ripple voltage on C1 is low. Now that the duty cycle is known as a VOUT/VIN relationship, the duty cycle can be calculated for any input output condition. Remember, this transfer function is dependent upon the fact that inductor current is continuous or never reached zero. If it does reach zero, this transfer function is no longer true and there is another state added to the operation. Multiply both sides by 1/(tON + tOFF). VIN × D = ( V C1 + VOUT – VIN ) × ( 1 – D ) Solve for VC1. 1 V C1 = VIN × ------------- – V OUT 1 – D 2004 Microchip Technology Inc. DS00960A-page 11 AN960 Inductor Winding Current Calculation The first step to calculating the inductor winding current is to know the maximum output power. For this constant current battery charger application, the output power is simply the maximum output voltage times the charge current. P OUT = V OUT × I CHARGE Maximum output voltage is equal to 6.4V (4 batteries @ 1.5V + VSENSE + margin). POUT =6.4V x 500 mA or 3.2 Watts. Since energy is conserved, the input power is equal to the output power (assuming 100% efficiency). An efficiency estimate can be used to closer approximate the input current. PIN = P OUT ⁄ ( Efficiency ) PIN = 3.2 Watts / 85%; 85% used as a typical efficiency estimate. PIN = 3.77 Watts I IN ( AVG ) ) = P IN ⁄ V IN IINAVG = 3.77 Watts/12V (Nominal) IINAVG = 314 mA. (Typical average input current) The peak-to-peak W1 inductor current ripple calculation was shown earlier. Given the derived transfer function and the maximum voltage on the output of the converter to be 6.4V, the switch on time is estimated. Switch On Time V OUT ⁄ ( V OUT + V IN ) t ON = ---------------------------------------------------FSW For the 12V input and 6.4V output case, the on time of the switch is estimated to be approximately 348 ns. (1 MHz switching frequency). The input peak to peak ripple current can be calculated. LW1 = LW2 = 20 µH Input Peak-to-Peak Ripple Current (W1) ∆IL(W1) = (12V / 20 µH) x tON = 208 mA IL(W1)PK = IINAVG +1/2 x ∆IL(W1) IL(W1)PK = 418 mA for winding 1 (W1) IL(W1)MIN = IINAVG -1/2 x ∆IL(W1) IL(W1)MIN = 210 mA for winding 1 (W1) DS00960A-page 12 W2 Peak-to-Peak Ripple Current ∆IL(W2) = (12V / 20 µH) x tON = 208 mA IL(W2)PK = IOUTAVG +1/2 x ∆IL(W2) IL(W2)PK = 604 mA for winding 2 (W2) IL(W2)MIN = IOUTAVG -1/2 x ∆IL(W2) IL(W2)MIN = 396 mA for winding 1 (W2) Note: In the case of VIN = VOUT, the current in W1 = W2 (ripple and average). The coupled inductor winding currents calculated above are used to determine the size of the inductor necessary. High switching frequency has several advantages, smaller ripple current, lower peak and RMS current and lower volt-time product on the inductor core. This leads to a small, low-cost solution. SEPIC Switch Current and Voltage Calculations The average input current is equal to the input power divided by the input voltage. GIVEN: The ripple current in winding (W2) is calculated in a similar fashion. The main difference is that the average current in W2 is equal to IOUT or 500 mA in this application. The switch current (IQ1) is equal to the combination of the winding currents during the switch on time. When the switch is turned on, it conducts the current in W1 and W2. ISW = IW1 + IW2 = 814 mA (Average) ISWPK = 418 mA + 604 mA = 1.12 A The minimum switch current is equal to: ISWMIN = 210 mA + 396 mA = 606 mA RMS of a Trapezoidal waveform 2 I SWRMS = 2 IA + IA × IB + IB D × --------------------------------------- 3 IA = 606 mA = Minimum, IB = 1.12 A = Maximum The RMS value of the switch current is approximately 516 mA. The peak switch voltage is equal to VIN + VOUT for the SEPIC converter. Any leakage inductance voltage spike is clamped through the output diode by the output capacitor. A switch voltage rating for this application should be a minimum of VIN(MAX) + VOUT(MAX). VSW = 15V +6.4V VSW = 21.4V A 30V, 80 milli-ohm, logic-level switch is selected. MOSFET switching losses should also be considered when selecting the MOSFET switch. Low on resistance switches tend to have high capacitance and will switch slower, increasing switching losses. The lowest RDSON MOSFET is not necessarily the best choice. When using the SOT23 package for a 30V MOSFET, there are many choices available. 2004 Microchip Technology Inc. AN960 SEPIC Diode Voltage and Current Calculations A schottky diode is recommended for low-voltage applications. For battery charger applications, the SEPIC diode will block current flow from the battery back to the input. The reverse leakage current of the selected schottky diode can be a critical parameter, if low battery drain is desired. Low schottky diode forward drop is also a key parameter; the low drop improves converter efficiency. The maximum reverse voltage across the SEPIC diode occurs during the switch on time. The cathode of the schottky diode is connected to VOUT, the anode of the schottky diode is connected to the SEPIC coupling capacitor. The voltage across the coupling capacitor voltage is equal to VIN; the voltage across the diode is equal to VOUT - (-VIN) or VOUT + VIN. The peak SEPIC diode current occurs when the switch is turned off. The peak diode current is equal to the peak current in W2, plus the peak current in W1 or 1.12A. The average diode current is equal to the output current (IOUT), typical of all topologies with a series diode in the path of the output. SEPIC Coupling Capacitor (C1) RMS Current Calculations and Voltage Rating The RMS current in the SEPIC coupling capacitor is mainly dependant upon output power with some influence by inductor ripple current. As output power increases, the capacitor ripple current will increase as well. As shown in Figure 7 (during the switch on time), the current in winding 2 (output current) is flowing through the coupling capacitor C1. During the switch off time, the C1 current is equal to the current in winding number 1 (W1). As previously discussed, the W1 current is equal to the average input current. Therefore, the worst case or maximum RMS current in the coupling capacitor will occur at maximum output power and minimum input voltage. To estimate size for the coupling capacitor, the capacitor derivative equation can be used. dV I C = C × ------dt In this example, there is an average of 500 mA flowing through the capacitor during the off time of the switch. The switch off time is approximately 65% or 0.65 x 1 µs or 650 ns. For a 5% capacitor voltage change at 8V, minimum input (400 mV), the capacitance necessary for C1 is equal to (500 mA)/(400 mV/650 ns) or 677 nF. For this application, a standard 1 µF X7R 25V ceramic capacitor was used. + IW2 IW2 IW1 0 IC1 - IW1 Note: Area above 0 equals the area below zero. FIGURE 10: C1 Ripple Current. As shown in Figure 10, the coupling capacitor ripple current is largely dependent upon output power and input voltage. As the input voltage decreases, the current in W1 increases. During the switch on time, the current flowing in W2 is equal to the current flowing in C1. When the switch turns off, the current quickly changes magnitude and direction so that the current flowing in C1 is equal to the current in W1, magnitude and direction. As an approximation, the RMS current in C1: IC1 ( RMS ) = IOUT × VOUT ⁄ VIN For worst-case situations, the RMS current in the C1 coupling capacitor is equal to 500 mA x (6.4V / 8V)1/2 or 447 mA. The current rating for small multi-layer ceramic capacitors is typically much higher than 500 mA. For higher power applications, it may be necessary to use multiple capacitors in parallel to keep the RMS current within ratings. The rate of change of voltage across the capacitor is related to the amount of current through the capacitor and the size or energy storage capability of the capacitor. For the SEPIC converter coupling capacitor, the voltage is approximated to be a DC value when deriving the duty cycle. The ripple voltage should be no more than a few percent of the voltage across the capacitor or the input voltage. In this example, the minimum input voltage and C1 DC voltage is 8V, so there should be no more than 5% or 40 mV of ripple on the coupling capacitor. 2004 Microchip Technology Inc. DS00960A-page 13 AN960 Features This section describes how several of the NiMH battery charger board features were implemented using the combination of the MCP1630 and the PIC16LF818. INPUT POWER AND BIAS The input power to the NiMH charger is a single +12V nominal input. For normal operation, this input source can vary from +8V to +15V. Any devices powered when the +12V nominal input is removed must have low quiescent current. When the +12V nominal source is provided, a +5V bias is generated using a standard high voltage linear regulator (U1). There is nothing special about U1, it can be a lowcost bipolar or CMOS. If the +12V input is removed, the input source to this regulator is removed. This +5V output is used to power components that are only necessary for charging. In this diagram, the +5V powers U2 (MCP1630 high-speed PWM) and U4 Overvoltage (OV) comparator. The +5V rail also is used to provide bias power to U5, U6 and U7. U5 is a low IQ low dropout CMOS LDO (MCP1700). U6 is a PICmicro MCU and U7 is a dual amplifier (MCP6042) used to condition the A/D input signals. All of these devices are powered even when the input source is removed by the battery. Low quiescent current operation is necessary to minimize the discharge of the battery during power outage. This architecture allows the partitioning of the high speed charging circuit bias and the low IQ battery monitoring and fuel gauge bias. U3 is used as a hardware disconnect to prevent deeply discharging the NiMH batteries. If the battery voltage ever dips below the TC54 threshold (2.9V) the output of the TC54 disconnects the battery from the load. Normal charging will resume when the input power is applied. The total IQ drain on the battery was measured at 29 µA for this architecture. Input Power Architecture Total I Q = 29 µA +VBATT +12V Input 10 µA +VBATT_SENSE +5V Bias U1 U2 U3 Linear Reg 1 µA VIN OV U4 OSC IN U5 MCP1700 VDD +VBATT 1 µA TC54 – + MCP1630 PWM 15 µA VDD VDD A/D A/D +VBATT_SENSE 1 µA + – PIC16F818 U6 1 µA – + 1/2 MCP6042 U7 Fuel Gauge 1/2 MCP6042 U7 FIGURE 11: DS00960A-page 14 Input Power Diagram. 2004 Microchip Technology Inc. AN960 CHARGING PROFILE Battery Charger Architecture +VBATT +12V Input U2 U4 + VREF MCP 1630 – Comparator +VBATT_SENSE VBATT Disconnect Pulse ON and OFF (50% = Trickle) U6 VREF = 625 mV 16 kΩ 1 kΩ 61.9 kΩ 22 pF OSC Temp Sensor Bias TC1047A U8 107 kΩ 0.39Ω 61.9 kΩ +5V Bias PIC16F818 Battery Temperature Sensor Trickle Charge L = Fast Charge High-Impedance = Top Off Charge FIGURE 12: Charging Diagram. The MCP1630 is used to generate a cycle-by-cycle 1 MHz pulse width that is used to regulate the battery current. The MCP1630 receives the fundamental switching frequency from the microcontroller. This signal not only sets the SEPIC converter switching frequency, it also sets the maximum duty cycle for the converter. The SEPIC switching frequency is 1 MHz during fast charge and 400 kHz for slow charge. Before connecting to the MCP1630, this clock signal is connected to the input of a general purpose comparator (U4) (faster than 1 µs). If the non-inverting input of U4 is high (indicating an overvoltage condition on the charger output (open battery)), the oscillator signal generated by the PICmicro microcontroller does not get to the MCP1630, providing fast OV protection. If a bat- 2004 Microchip Technology Inc. tery is disconnected or open, the converter output voltage will rise to the maximum OV setting. The MCP1630 will act like a hysteretic ripple regulator until the microcontroller shuts the oscillator off and automatically attempts to restart the converter. If the OV condition persists (9 attempts), the microcontroller declares an OV and provides a slow blinking red LED as indication. By using the general purpose I/O output of the microcontroller, the charging current can be controlled using the firmware. A single I/O can adjust the charge current from a typical 500 mA fast charge to a typical trickle charge current of 50 mA. To generate a lower top-off charge current, the microcontroller can turn the 50 mA trickle charge on and off at a 50% duty cycle to provide DS00960A-page 15 AN960 an average charge current of 25 mA. In addition to controlling the magnitude of the charge current, the amount of time can be set and adjusted using the microcontroller firmware. In the case of the NiMH charger, the charge cycle always begins with a 2 minute, 50 mA trickle charge. The fast charge begins (and is terminated) using any one of three conditions. A negative change in the battery voltage over time, a positive change in battery temperature over time or by timing out a maximum fast charge timer. After fast charge, the NiMH charger will trickle charge for a fixed amount of time and finish with a top-off charge of 25 mA for a fixed amount of time. Once the charge is removed, the battery voltage will begin to drop as a result of self-discharge. Once the battery voltage reaches a predetermined voltage, the charger will automatically initiate a new charge cycle. The typical battery charge cycle is shown below. NiMH Charge Cycle @ 0.5C Rate Battery Voltage Temperature Output Current 6.5 600 6 500 5.5 400 5 300 4.5 200 4 100 Current / Temperature (mA / °C) Voltage (V) Output Voltage Pulsed Charge 25 mA Average 3.5 0 25 50 75 100 125 150 175 200 225 0 250 Time (Minutes) FIGURE 13: DS00960A-page 16 4-Cell Charge Profile. 2004 Microchip Technology Inc. AN960 CHARGER EFFICIENCY By using the MCP1630, the battery charger switching frequency was set to 1 MHz. In addition to small size, high converter efficiency is desired to minimize power dissipation during the charging process. The typical charger efficiency with +12V nominal applied is approximately 85% at maximum output power (6.4V). 86.0% ICharge = 500 mA VBATT = 6.4V Efficiency (%) 85.0% 84.0% VBATT = 5.7V 83.0% 82.0% 81.0% VBATT = 3.8V 80.0% 79.0% 8 FIGURE 14: 9 10 11 12 VIN (Volts) 13 14 15 4-Cell NiMH (Typical) Charger Efficiency. CONCLUSION For applications that require intelligent power management solutions like battery chargers, the combination of a microcontroller and MCP1630 high-speed PWM is very powerful. It brings the programmability benefits of the microcontroller and adds the performance of a high-speed analog PWM. The analog PWM will respond to changes in input voltage and output current very quickly. No code or execution time is necessary to regulate or protect the circuit. The microcontroller is used for programmability, establishing charge profile conditions and monitoring the circuit for fault conditions and taking the appropriate action, in the event of a specific fault. 2004 Microchip Technology Inc. DS00960A-page 17 AN960 NOTES: DS00960A-page 18 2004 Microchip Technology Inc. Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip’s products as critical components in life support systems is not authorized except with express written approval by Microchip. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel and Total Endurance are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2004, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received ISO/TS-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona and Mountain View, California in October 2003. The Company’s quality system processes and procedures are for its PICmicro® 8-bit MCUs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified. DS00960A-page 19 2004 Microchip Technology Inc. WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.com Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 India - Bangalore Tel: 91-80-2229-0061 Fax: 91-80-2229-0062 China - Beijing Tel: 86-10-8528-2100 Fax: 86-10-8528-2104 India - New Delhi Tel: 91-11-5160-8631 Fax: 91-11-5160-8632 Austria - Weis Tel: 43-7242-2244-399 Fax: 43-7242-2244-393 Denmark - Ballerup Tel: 45-4450-2828 Fax: 45-4485-2829 China - Chengdu Tel: 86-28-8676-6200 Fax: 86-28-8676-6599 Japan - Kanagawa Tel: 81-45-471- 6166 Fax: 81-45-471-6122 France - Massy Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 China - Fuzhou Tel: 86-591-8750-3506 Fax: 86-591-8750-3521 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 Germany - Ismaning Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Atlanta Alpharetta, GA Tel: 770-640-0034 Fax: 770-640-0307 Boston Westford, MA Tel: 978-692-3848 Fax: 978-692-3821 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Farmington Hills, MI Tel: 248-538-2250 Fax: 248-538-2260 Kokomo Kokomo, IN Tel: 765-864-8360 Fax: 765-864-8387 China - Hong Kong SAR Tel: 852-2401-1200 Fax: 852-2401-3431 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 China - Shenzhen Tel: 86-755-8203-2660 Fax: 86-755-8203-1760 China - Shunde Tel: 86-757-2839-5507 Fax: 86-757-2839-5571 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 England - Berkshire Tel: 44-118-921-5869 Fax: 44-118-921-5820 Taiwan - Hsinchu Tel: 886-3-572-9526 Fax: 886-3-572-6459 China - Qingdao Tel: 86-532-502-7355 Fax: 86-532-502-7205 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 San Jose Mountain View, CA Tel: 650-215-1444 Fax: 650-961-0286 Toronto Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509 10/20/04 DS00960A-page 20 2004 Microchip Technology Inc.