- Provide power to USB bus, up to 2 A at Vbus = 5 +/-0.1V (therefore with effective Rbus = 2.5 𝛀), when Vbat = 12.6 V.
- Provide power to USB bus, 3 A at Vbus = 20 V (therefore with effective Rbus = 6.7 𝛀), when Vbat = 9.6 V.
- Charge the battery pack (which is at Vbat = 11.1 V) from the USB bus, drawing up to 3 A at 20 V. Since Rbat = 50 m𝛀 and we want 3A going to the battery, the supply side should be higher than Vbat by 150 mV, so we need D Vbus = 11.1 + 0.150 = 11.25, so D = 11.25 / 20 = 0.56.
I used Omni Graffle for idea sketch, and LTSpice IV for the schematic capture and simulation (after reading this book on LTSpice).
Switch designSince the battery voltage will be higher than the 5 V (the output voltage in mode 1) but lower than 20 V (the output voltage in mode 2), neither the pure step down (buck) nor step-up (boost) converter will do the job alone; I need a buck-boost converter, which will work like the buck converter if Vbat > Vbus, but like the boost converter when Vbat < Vbus, as you can see below.
- Buck mode: Vout = D Vin
- Boost mode: Vout = Vin / D'
- Charge mode: Vin = D' Vout
Ignoring losses, in the buck converter mode, the inductor current ripple 𝚫iL ≈ (Vbat - Vbus) D Ts / 2L. Using the given operating point values in this mode (operating point 1 in the intro),
And again ignoring losses, in the boost converter mode:
𝚫iL ≈ (12.6 - 5) 0.4 / (2 100k L) ≈ 15E-6 / LAnother way to look at this is to compare against the average inductor current, which must equal the average current to the load: iL ≈ 2 A. The ripple percentage is then 𝚫iL / IL ≈ 15E-6 / L / 2 = 0.75 E-6 / L. To hold 𝚫iL within say 10% of the steady-state current then, L must be greater than 0.75 E-6 / 10% = 7.5 𝛍H.
And again ignoring losses, in the boost converter mode:
- The voltage ripple at the the output of the converter 𝚫v = Vbus D Ts / (2 Rbus C), where C is the capacitance in series with the load. If we want 𝚫v < 0.1 V, then C must be larger than Vbus D Ts / (2 Rbus 𝚫v) = ibus D Ts / (2 𝚫v) = (3 A) (0.52) (10 𝛍s) / (2 * 0.1) = 78 𝛍F.
- 𝚫iL ≈ Vbat D Ts / L which for 10% ripple target means the inductance must be larger than Vbat D Ts / (10% 3 A) = 166 𝛍H.
In charging mode, Sboost is actually working like a buck switch, so the current ripple analysis can be repeated with voltages flipped numbers: 𝚫iL ≈ (Vbus - Vbat) D' Ts / 2L. Note that the duty cycle is the complement of the usual buck converter duty cycle, because I am using Sboost as the buck converter. For operating point 3, the ratio of the inductor current ripple 𝚫iL/IL then work out to (20 V - 11.1 V) 0.555 / (2 10% 100k L). To keep this down below 10% requires L greater than (20 - 11.1) 0.555 / 20k = 247 𝛍H! The inductor is getting bigger and bigger!
(Solid state) switch designTo implement this schematic with the usual power electronics semiconductor devices, I need the devices Q1~Q4:
|The "Q" just means some kind of semiconductor device, rather than a transistor necessarily.|
|Current flow and voltage across the switches during the D Ts and D' Ts phase of the buck mode|
|Current flow and voltage across the switches during the D Ts and D' Ts phase of the boost mode|
|Current flow and voltage across the switches during the D Ts and D' Ts phase of the charging mode|
- Q1: active +/passive- current, but only + voltage ==> MOSFET in parallel with a diode
- Q2: passive - current, but only + voltage ==> diode
- Q3: active +/passive - current, but only - voltage ==> MOSFET in parallel with a diode
- Q4: active +/passive - current, but only + voltage ==> MOSFET in parallel with a diode
I choose Infineon BSC100N03MS as the MOSFET, because it was used in the instructor given examples. According to the data sheet, the drain to source voltage (the blocking voltage) is 30 V, which is sufficient for the maximum of expected 20 V applied on the USB bus end. It is capable of conducting 44 A nominally, and 176 in a pulse. My expected gate-source voltage is 20 V, which is much larger than Vin (which is 12.6 V max). In short, it has adequate voltage and current margin for the problem at hand.
Sbuck implementation using diodes (and a MOSFET)
Q1-Q2 pair that comprises Sbuck has only 1 active element (MOSFET) between them, so the control is rather straight-forward (at first), like this:
But since the MOSFET is not grounded, the gate will be floating, so we need a floating gate driver to supply enough current to the gate (to turn it on, or AKA close it) when commanded (c_buck in the schematic below). The floating gate driver in turn needs floating (i.e. isolated) power supply. In this class, a low power isolated unregulated DC-DC converter is recommended for use.
|Sbuck, with MOSFET gate driver powered by a floating unregulated DC-DC power supply. Note Vss pin of the gate driver is connected to the SOURCE (downstream of the current) side of the MOSFET. If you get this wrong, the MOSFET will always be on!|
The isolated DC-DC converter (U8 above) in turn will get the power straight from the battery, and provide VoutP − VoutM = n Vin, where I choose n = 1 (can be between 1 and 2).
Note the resistor between the MOSFET gates and their drivers is there to limit the inrush current into the gate, and should be chosen for the particular MOSFET. But conversely, we want to remove the gate charge from the MOSFET as quickly as possible during the turn off transition--again as much as the devices can tolerate. So in some examples, I found a Schottky diode (which is a very fast diode with little voltage drop) shorting out the current limiting resistor (as shown below), to effectively remove the current limit during the turn off transition. To be honest, I still don't understand why it's OK to remove current limit when removing the gate charge from the MOSFET, while a current limiting resistor is required when adding it.
Sboost implementation using diodes
|BUG ALERT: I should have connected outM pin of Uchg_dd to the SOURCE pin of Mchg, but instead connected it to the drain pin.|
MOSFET logic gate coordinationIn this realization of the power stage, there are total of 3 MOSFETS that have to be turned on/off in a coordinated manner. Let's enumerate their required on (closed) and off (open) states during the 2 phases in each mode:
|Mode||Step down (buck)||Step up (boost)||Charge Battery|
|Phase||D Ts||D' Ts||D' Ts||D Ts||D' Ts||D Ts|
- Boost = V(control1) > Vhigh/2
- Charge = V(control2) > Vhigh/2
Since the HW recommended a 5 V digital logic, I am using 2.5 V as the threshold. I still need a rapidly switching PWM from these 2 control voltages, so I can derive the PWM signals for the 3 modes like this:
- For step-down mode, PWM(Vcontrol1), with VM=Vhigh/2, so that Mbuck duty cycle will be continuous (D = 1) when going from the buck mode to the boost mode.
- For step-up mode, PWM(Vcontrol1 - Vhigh/2)
- For charge mode, PWM(Vcontrol2 - Vhigh/2)
In cases 2 and 3 above, I need a reference voltage and a subtractor. I am allowed to use an IC to generate a precision reference voltage (despite the irony of having to use a voltage reference in a DC-DC converter design); the LT1121-5 (the "-5" in the part name is for 5 V output) was recommended, and I use a voltage divider to derive a 2.5 V from it. With a 1% resistor, I know that the Vhigh/2 reference can be 2 % off (if one resistor is 1% higher and the other is 1% lower), but since the design does not require operation near 100 % duty cycle, I'll be OK. The subtraction of the Vhigh/2 reference voltage can be done with an op-amp with sufficiently high open-loop gain. I just used the instructor recommended part LT1498 (which has a rail-to-rail input-output, 10 MHz gain-BW product, and 6 V/us slew rate), as you can see below, where V(Ctrl1_2V5) = V(control1) - Ref2V5.
|This subtractor is going to suffer from analog issues (like part and temperature variance).|
- duty(Mbuck) = NOT(control2 > Vhigh/2) AND (control1 > Vhigh/2 OR PWM(control1))
- duty(Mboost) = NOT(control2 > Vhigh/2) AND control1 > Vhigh/2 AND PWM(control1 - Vhigh/2)
- duty(Mchg) = control2 > Vhigh/2 AND PWM(control2 - Vhigh/2)
To satisfy both the truth table and the MOSFET duty cycles for the operational points, control2 should be clearly be < Vhigh/2 during buck and boost modes. ANDing the digital signal with PWM's output is necessary because achievable minimum duty cycle may not be 0. The logic IC implements the "> Vhigh/2" operation internally, so I can simplify the above logic expression:Here is the implementation of duty(Mbuck), duty(Mboost), and duty(Mchg) that uses the 5 V and "2.5 V" explained above.
- duty(Mbuck) = NOT(control2) AND (control OR PWM(control1))
- duty(Mboost) = NOT(control2) AND control1 AND PWM(control1 - Vhigh/2)
- duty(Mchg) = control2 AND PWM(control2 - Vhigh/2)
Excessive power loss through the diodesIf I drive the converter in buck mode with duty(Mbuck) shown above, I can see the expected response of a buck converter.
|The current spikes through the MOSFET at the beginning of each MOSFET turn-on is many times the inductor current, and is on the order of maximum current spike specified in the MOSFET and the diode data sheet.|
Switch implementation without diodes
From the switch current flow and voltage digram given at the outset, it seems that Q3 and Q4 can each pass current in either direction and block the voltage in a single direction. Therefore, I only need to replace the diode I had used in Q2 with another MOSFET that turns on during the D' interval of the buck mode. Here is the modified switch implementations that can handle all 3 operational modes.
Now that the MOSFETs are doing the double duty, I have to expand the MOSFET truth table to consider the MOSFETs that are complementary to the existing MOSFETs.
The "x" in the truth table means "don't care"; which can be helpful in simplifying the digital logic to implement the truth table:
where I use the prime notation (pwm') to indicate the complement of the duty cycle. Scanning the above Karnaugh chart, it appears that I need both of the boolean signals for control1 and control2. So it's just easier to factor out those common digital logic circuit for reuse.
The 5V and 2.5V reference voltages are shown in a separate part of the schematic:
Finally, the 4 duty cycles can be generated from logic gates. The most complex logic is the 3 AND gates being fed to an OR gate for duty(Mchg), but the benefit of carefully building up the intermediate signals pays off.
control1 = 0
control2 = 0
control1 = 1
control2 = 0
control1 = 0
control2 = 1
|MOSFET||D Ts||D' Ts||D Ts||D' Ts||D Ts||D' Ts|
- duty(Mbuck) = control2 OR control1 OR pwm(control1)
- duty(MbuckP) = NOT(control1) AND NOT(control2) AND pwm'(control1)
- duty(Mboost) = (control1 AND pwm(control1 - Vhigh/2)) OR (control2 AND pwm'(control2 - Vhigh/2))
- duty(Mchg) = (NOT(control1) AND NOT(control2)) OR (NOT(control2) AND control1 AND pwm'(control1 - Vhigh/2)) OR (control2 AND pwm(control2 - Vhigh/2))
The 5V and 2.5V reference voltages are shown in a separate part of the schematic:
|I am using the same dead-time of Td = 100ns for all PWM.|
LC filter to damp out voltage ripple
The original power stage design shown above has only one inductor, and a cap each on the input and output ends. There are a few problems with this approach: to reduce the input and output voltage ripple requires huge inductance and capacitance, which in turn--since the natural frequency of LC tank is sort(LC)--slows down the transient response. And for some reason, the LiPo battery model given for the project neglects the naturally huge (>> 1 mF) capacitance. If such a large capacitance is modeled, the LC tank would slow down the response unacceptably during the transient to the charging mode. Reducing the L is desirable for speeding up the transient and keeping the part cost down, but the current ripple at the inductor might go above the saturating inductor current.
I think one way to work around the physics of the problem is to put a cascaded LC filter on the input and output side of the power stage, as you can see in this schematic:
|L2-Cout1 damps out the switching frequency ripple. L2 can easily be an order of magnitude smaller than the main inductor in the power stage.|
By using a small inductor-capacitor combination, the high frequency (at the switching frequency Fs) Vbus ripple can be reduced with negligible impact on the slower dynamics of the inner power stage circuit. I want to do the same thing on the input end, but the assignment allows at most 2 inductors, so I held back.
Inductor designIn this assignment, the Ferroxcube 3F3 material (ferrite) is suggested as the core material. Ferrite cores have the H-B (electric field intensity-to-magnetic field density) nonlinearity depicted below:
- Saturation flux density Bsat 0.33T ~ 0.43T, between 25 ºC ~ 100 ºC
- Remnant flux density Br 0.12T
- Coercive force Hc ~ 12 A/m (relatively temperature insensitive)
Choosing the inductance value
At first, I tried to use L1 = 247 𝛍H calculated above, and go through the core geometrical constant method (the "Kg" method explained in Chapter 14 of the course textbook that I follow in the next section) is used to design the filter inductor L1. But doing that, I wound up with a HUGE inductor (one that weighs hundreds of grams). A USB charging IC is selling for less than $1 at Digikey, so I reasoned that a huge inductor that is an order or magnitude or more expensive than the power management IC is a bad design, and looked for ways to reduce L1. The cascaded LC filter at the USB bus output end I explained earlier. I read the rubric, and actually did not find a requirement for the 10 % current ripple on L1, so I empirically arrived at the L1 and L2 value that met the requirements.
"Kg" methodThe step-by-step is to enumerate the requirements and constraints on the inductor:
- Winding material resistivity 𝛒 Assuming copper at 100 ºC, 2.3E-8 𝛀m.
- Desired inductance: L1 = 10 𝛍H, L2 = 1 𝛍H.
- Maximum current Imax looks to be about 30 A for L1 (the main inductor) and -30 A for L2 (the isolation inductor).
- Bmax < Bsat, which is a material property of the magnetic core. For ferrite core operating rather hot, Bsat = 0.4 T feels reasonable, so Bmax = 0.3 T.
- Fill factor Ku = 0.5 if using not-so-thin wire.
- R should be determined by acceptable copper loss = I2rms R. Let's say I accept 0.5 W copper loss (1 W through L1 and L2) at 3 A boost or charge mode. Then maximum R = 0.5/32 = 56 m𝛀 for each inductor.
The next step is to calculate the required air gap lg (inductors store most of the magnetic energy in the air gap) with this formula: lg = L (𝛍0/Ac) (Imax / Bmax)2, where 𝛍0 is the air's magnetic permeability 4𝛑 E-7 and Ac is the core's cross sectional area (0.433 cm2 and 0.101 cm2 in the above table). Using the values for L1 and L2 above, I get 2.9 mm and 1.24 mm for inductors L1 and L2.
Next, N--the number of windings around this core--is calculated with N = (L Imax ) / (Bmax Ac). I get 23.1 for L1 and 9,9 for L2, so just round them to 23 and 10, respectively. These correspond to AL = L 109 / N2--inductance per turn that can be measured while grinding down the core post to create the air gap--of 18.7 nH and 10.2 nH for the 2 inductors. A sanity check at this point is to approximate (assuming core permeability 𝛍c >> 𝛍0) the magnetic flux density B as ≈ 𝛍0 (N / lg) I; i.e. proportional to the current through the winding and inversely proportional to the air gap. For L1 and L2 calculations made so far, B then approximates to 10 mT times the current, so that at 30 A, B < 0.3 T.
Next, the winding wire cross area Awire should be less than Ku WA / N, where WA is the core's window area (bobbin winding area in the above table): 0.187 cm2 and 0.097 cm2 for the 2 cores chosen. So maximum Awire comes out to 4E-3 cm2 and 1.7E-3 cm2 for L1 and L2. In the same Appendix D of the course textbook, table D.6 lists the AWG (American Wire Gauge) specs. From this table, I picked out AWG #22 (Awire = 3.243E-3 cm2; diameter 701 𝛍m) and AWG #25 (Awire = 1.6E-3 cm2; diameter 505 𝛍m) as being reasonably close to the maximum Awire calculated above. To check that these wire chose does indeed meet the target copper loss, calculate Rser = 𝛒 N (MLT) / Awire, where MLT is the mean length per turn for the cores given in the above table: 3.71 cm and 2.90 cm for the 1811 and 1408 respectively. So Rser comes out to 60 m𝛀 for L1, and 27 m𝛀, which are reasonably close to the Rser sought at the beginning. For convenience, here is the comparison of the 2 inductors:
|"Kg method" formula||L1||L2|
|Target inductance L [𝛍H]||Input||10||1|
|Target serial resistance Rser [m𝛀]||Input||56||56|
|Target Kg [cm5]||(𝛒 / R Ku) (L Imax / Bmax)2||8.2E-3||0.082E-3|
|Off-the-shelf Kg [cm5]||Textbook Table D.1||9.4E-3||0.183E-3|
|Ferrite pot core size [mm2]||Textbook Table D.1||18x11||9x5|
|Core weight [g]||Textbook Table D.1||7.3||1.0|
|Cross section area Ac [cm2]||Textbook Table D.1||0.433||0.101|
|Winding (window) area WA [cm2]||Textbook Table D.1||0.187||0.034|
|Magnetic path length lm [cm]||Textbook Table D.1||2.6||1.26|
|Air gap lg [mm]||L (𝛍0/Ac) (Imax / Bmax)2||2.9||1.24|
|Number of winding N||round((L Imax ) / (Bmax Ac))||23||10|
|Inductance per turn AL [nH]||L 109 / N2||18.7||10.2|
|Bscale [mT/A]||𝛍0 (N / lg)||10||10|
|Maximum Awire [cm2]||Ku WA / N||0.187||0.097|
|AWG chosen||< Maximum Awire||#22||#25|
|AWG Awire [cm2]||3.2E-3||1.6E-3|
|AWG diameter [mm]||0.7||0.5|
|Winding resistance Rser [m𝛀]||𝛒 N (MLT) / Awire||60||27|
- L1 node1 node2 Hc=12 Br=0.12 Bs=0.33 A=43u Lm=26m Lg=2.9m N=23 Rser=60m
- L2 node1 node2 Hc=12 Br=0.12 Bs=0.33 A=10u Lm=12.6m Lg=1.24m N=10 Rser=27m
|SPICE works in MKS unit, so some mental conversion from the above table is required. I actually found that the "Value" line would not be deleted, so I wrote the SpiceLine on the Value line instead.|
|Vbus and Ibus settles quickly to 5 V/2 A and the 20 V/3 A steady state conditions for the buck and boost modes, and the maximum inductor current stays below the saturating current.|
Extra feature: current limiting
Although not plotted above, I found that the current spikes on the battery was approaching 200 A--clearly undesirable (and also physically impossible, due to the huge capacitance that should normally accompany a regular LiPo battery), so I came up with current limiting circuit. The current sense chip I've been drawing above (but not utilizing yet) only detect current in the forward direction, so I threw in another one, like this:
|Vcs measures the current in the forward direction, and Mcs measures in the opposite direction.|
I then low pass (1 pole) it before throwing that into a current limit comparator:
|The comparator has a large input impedance, so should not load the current sense chip.|
The opposite direction works exactly like above, except for using Mcs as the input. The current limit (iLlim) is hard wired to 90 % of 5 V, or 4.5 V, which should means I will cap the limit to 4.5 V / (20 x 0.01 𝛀) = 22.5 A, which is well below the 30 A saturation limit picked for the main inductor above.
To actually turn off the MOSFETs correctly when the current exceeds the threshold, the digital logic must be changed as follows:
|Buck stage complementary signal pair modified for current limitation.|
|Boost stage complementary signal pair modified for current limitation.|
I verified in LTSpice that the battery current is now capped at around 25 A, and the inductor current in either direction is also capped at about the same value.