**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.

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.

Let's do some calculating.

The duty cycle is D ≈ (V

The minimum inductor size needed stay in continuous conduction mode

L ≥ (V

The minimum capacitor to keep the output ripple to less than, say, 1V

C ≥ (I

f

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.

The duty cycle is D ≈ (V

_{out}−V_{in})/V_{out}= 50-79%, 69% typical.The minimum inductor size needed stay in continuous conduction mode

L ≥ (V

_{out}D (1−D)^{2})/(2 I_{out}f) = 4.8mH I choose 6.8mH.The minimum capacitor to keep the output ripple to less than, say, 1V

C ≥ (I

_{out}D)/(ΔV f) = 0.035μF choose 1μF because I have several of that size laying around.f

_{c}= 1/(2 π √(LC)) = 1.9kHzLet'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

Two useful pages that list standard resistor and capacitor values.

Parameter | Formula | Numbers | Result | Std Value |
---|---|---|---|---|

R_{1}+R_{2} | V_{out}/I_{ref} | 44V/1mA | 44kΩ | |

R_{1} | V_{fb}/I_{ref} | 1.2V/1mA | 1.2kΩ | 1.2kΩ |

R_{2} | R_{1}+R_{2} - R_{1} | 44kΩ-1.2kΩ | 42.8kΩ | 43kΩ |

f_{p1} | f_{c}*7.5 | 1.93kHz*7.5 | 14.5MHz | |

C_{2} | 1/(2 π R_{2}^{2} 0.04) | 1/(2*3.1416*43kΩ^{2}*0.04) | 2.17nF | 2nF |

f_{p2} | 1/(2 π C_{L} C_{ESR}) | 1/(2*3.1416*1μF*0.5Ω) | 318kHz | |

f_{z1} | f_{c} | 1.93kHz | 1.93kHz | |

R_{3} | (f_{z1}*R_{2})/(f_{p2}-f_{z1}) | (1.93kHz*43kΩ)/(318kHz-1.93kHz) | 261Ω | 270Ω |

C_{1} | 1/(2 π f_{p2} R_{3}) | 1/(2*3.1416*318kHz*270Ω) | 1.92nF | 1.8nF |

f_{z2} | f_{c} | 1.93kHz | 1.93kHz | |

R_{4} | 1/(2 π f_{c} C_{2}) | 1/(2*3.1416*1.93kHz*2nF) | 41.2kΩ | 43kΩ |

f_{p3} | 0.75 f_{sw} | 0.75*100kHz | 75kHz | |

C_{3} | 1/(2 π f_{p3} R_{4}) | 1/(2*3.1416*75kHz*43kΩ) | 49pF | 51pF |

Two useful pages that list standard resistor and capacitor values.

f

_{p2}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.
f

_{z1}and f_{z2}are set to cancel to cancel the poles at f_{c}(1.6MHz).
Set f

_{p3}to about 3/4 the switching frequency.
C

_{2}should be much larger than C_{3}.
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. V

_{pwr}=V_{batt}-V_{diode}. 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