Wednesday, February 29, 2012

Boost for LEDs

I need to light the inside of a trailer used to haul camping equipment for my son's Boy Scout troop. I've discussed this with the adult quartermaster at some length. We have agreed small white LEDs placed about every 30cm around the top inside perimeter should provided sufficient illumination without being so bright as to completely ruin night vision. 
My original idea was to to use an LM317 regulator configured as a current source to drive two groups of two LEDs (four LEDs per regulator). My previous blog entry discussed one way to achieve this.  That design had several problems.
  • Needs 11.1V to operate at worst case corner.
  • Lots of wiring needed to connect LEDs to regulator.
  • Several regulators needed around the trailer.
I decided a better design would include a DC-DC boost regulator to boost the battery voltage to 40V. Two LM317 configured as current regulators would then each drive a string of eight LEDs with 20mA current as shown in the schematic. I chose 20mA because the LEDs are sufficiently bright at that current and it is significantly below the maximum specification of 35mA. Eight LEDs at the maximum forward voltage of 4.4V still allow 4.8V of dropout in the current regulator.

The 40V supply could be provided from a capacitor charge pump or a switch mode chip. Since I want to actually design and implement the circuit myself, I chose to ignore these simpler, cheaper, and more rational alternatives. Basically, I want to solve this problem using a switched-mode boost converter because I've never designed or worked with a switched-mode boost converter. I expect to learn some things along the way. So let's dive into a switch mode DC-DC boost voltage regulator from components.

First, the most important stage of any design, the specification. You can't design something if you don't know what you're designing.

Parameter Minimum Typical Maximum
Input Voltage 10 V 13.8 V 20 V
Output Voltage 40 V 44 V 48 V
Output current 36 mA 40 mA 44 mA

That's all that really matters. The input voltage minimum and maximum are somewhat arbitrary. The output voltage needs to be at least 40V to allow for the worst case corner, +/-10% seemed reasonable, so I set the maximum 20% higher. The frequency should be higher than 200Hz so any brightness variation isn't visible.

The schematic you find plastered all around the internet is shown here. It is wonderful if what you want to do is discuss operation principles or interview someone. It is woefully incomplete if you want to design a regulator.

Oversimplified boost schematic

The next schematic is what I've put together to actually design from. It is largely gathered from a special topics course Dr. Abhiman Hande taught at UTD during the fall of 2008, I am especially leaning on Ian Lopez's excellent final report. I know using a MOSFET instead of the schoktty diode would improve the efficiency, but I am sticking with that simplification for now. 
Simulation schematic

Let's do some calculating.

The duty cycle is D ≈ (Vout−Vin)/Vout = 50-79%, 69% typical.

The minimum inductor size needed stay in continuous conduction mode
L ≥ (Vout D (1−D)2)/(2 Iout f) = 4.8mH I choose 6.8mH.

The minimum capacitor to keep the output ripple to less than, say, 1V
C ≥ (Iout D)/(ΔV f) = 0.035μF choose 1μF because I have several of that size laying around.

fc = 1/(2 π √(LC)) = 1.9kHz

Let's zoom in on the compensator. The textbooks refer to this as a "Type III" compensator. I'm used to it being a "PID" controller. Whatever you like to call it, I certainly need the feedback circuit.
Compensator schematic

Compensator values
Parameter Formula Numbers Result Std Value
R1+R2 Vout/Iref 44V/1mA 44kΩ
R1 Vfb/Iref 1.2V/1mA 1.2kΩ 1.2kΩ
R2 R1+R2 - R1 44kΩ-1.2kΩ 42.8kΩ 43kΩ
fp1 fc*7.5 1.93kHz*7.5 14.5MHz
C2 1/(2 π R22 0.04) 1/(2*3.1416*43kΩ2*0.04) 2.17nF 2nF
fp2 1/(2 π CL CESR) 1/(2*3.1416*1μF*0.5Ω) 318kHz
fz1 fc 1.93kHz 1.93kHz
R3 (fz1*R2)/(fp2-fz1) (1.93kHz*43kΩ)/(318kHz-1.93kHz) 261Ω 270Ω
C1 1/(2 π fp2 R3) 1/(2*3.1416*318kHz*270Ω) 1.92nF 1.8nF
fz2 fc 1.93kHz 1.93kHz
R4 1/(2 π fc C2) 1/(2*3.1416*1.93kHz*2nF) 41.2kΩ 43kΩ
fp3 0.75 fsw 0.75*100kHz 75kHz
C3 1/(2 π fp3 R4) 1/(2*3.1416*75kHz*43kΩ) 49pF 51pF

Two useful pages that list standard resistor and capacitor values.
fp2 is set the cancel the ESR zero. At least that's what the textbooks say. The capacitor ESR isn't a specified parameter, so it could be much higher or lower than this. But the pole needs to be set somewhere, so here it is.
fz1 and fz2 are set to cancel to cancel the poles at fc (1.6MHz).
Set fp3 to about 3/4 the switching frequency.
C2 should be much larger than C3

Some AC simulations are needed to verify this. But I'm impatient so I throw together a quick transient simulation just to do a quick check. And all you out there who know boost regulators already know the results. Vpwr=Vbatt-Vdiode. The problem is that if no switching is going on, it doesn't matter how the comparator is hooked up, the power transistor is either on or off and the feedback never crosses the reference. If switching isn't happening, it never starts. 

I didn't find any good references discussing this start up issue, so I'll have to figure a good solution myself. One quick solution is to simply ramp the reference voltage slowly. The current compensator and transient simulation is shown below.

compensator with ramped Vref

slow start-up, but at least it goes
There is much more switching noise than I expected, so I really need to verify those AC parameters. 

Looking at this start-up scheme, I also need to have a way to re-awaken the oscillations if they stop for some reason. Oh, well, more design work yet to be done! 

My son's Boy Scout Eagle project is this weekend and I have a short contract starting Monday so the next few entries here will be a bit brief. 

Until next week,
Bruce McLaren