Showing posts with label boost. Show all posts
Showing posts with label boost. Show all posts

Thursday, January 02, 2014

Trailer Lights Version 3.1 Schematic

I am revisiting the trailer lights explained in several previous posts. I am implementing a few improvements. 
  • Twice as many LEDs. 
  • Real Lead-Acid battery charger built in. 
  • Lower "burden" current. 
The appropriate data sheets are linked to throughout this post. Figure 1 shows the version 3.1 schematic.

Figure 1. Trailer lights complete schematic.

Let's start with the input circuit as zoomed in on in figure 2. A 5A fuse protects the trailer battery from any short circuits. The boost switch-mode power supply at the input will convert the truck battery that may be between 10V and 16V to a steady 18V. If the truck battery is higher than expected, it will effectively pass through the boost circuit. A LM2587-ADJ is used in its default configuration for the boost. The Schottky diode (D1) in the boost regulator also forms a nice protection from too much voltage somehow getting produced on the circuit side feeding back into the truck battery. The parallel 3kΩ resistors (R18 and R19) were just to create a 1.5kΩ resistor and avoid getting yet another value of resistor.

Figure 2. Input boost regulator schematic.

A UC3906 forms the base of the charger section highlighted in figure 3. The two parallel resistors R20 and R21 set the maximum charging current. I couldn't find a reasonably priced ⅛Ω 2W surface mount current sense resistor, so I am using two ¼Ω 1W resistors instead. Note that 2A through a ⅛Ω resistor is ½W of continuous power dissipation; I think quadruple that is a reasonable safety margin since I want to avoid self-heating effects. The MJE15035G Bipolar (Q1) may drop up to 8V in the 2A charge state. Since that's 16W, a pretty hefty bipolar was chosen. The resistors are sized per the UC3906 data sheet with modifications from the application note. The Schottky diode D5 and connecting the bottom of the resistor string to the PWRIND (pin 7) pin instead of ground are hints from the application note to save power when the truck battery is not present.

The sense and power leads to the trailer battery are separate in the plug. The connection to the battery positive lead can be a single or double wire depending on how much trouble I feel like taking when constructing wiring harnesses. Given the effort needed to connect three wires to a four wire socket, I'll probably not run a separate sense lead all the way to the trailer battery, but the option is there. The fuse is in the power lead, of course, but this means the sense input to the charger controller is on the sense side of the fuse. If somehow the fuse blows but the trailer battery voltage is low enough for the charger controller to try to charge the battery but not so low that it senses an error (between about 10V and 13.8V), then the pass transistor Q1 could be turned on pretty solidly. If the truck battery is attached, this would drive the BATTRL power rail to about 17V (18V from the boost regulator minus a bipolar drop and a Schottky drop). This condition is not ideal, but all of the components connected directly to that rail are rated for continuous operation at that voltage.

Figure 3. Charger schematic.

The digital control section is zoomed in on in figure 4. I am using a TPS70950 linear voltage regulator because it has a 2μA bias current and is stable even when supplying less than 100μA. The good old LM7805 has a 6mA bias current and is not happy supplying less than 10mA current. The Microchip PIC12F609 run with a 32kHz crystal may consume only 60μA (2μA when asleep); since this is in the neighborhood of the battery's self-discharge current, it won't effect the working time between charges much. R1 and R2 are really just pads and holes to allow for any tuning needed to get the crystal oscillating. The resistor divider formed by R7 and R4 will force POWFB to 0.6V when BATTRL is 10V. A ±1% variation in R7 and R4 will mean 10.27V to 9.87V will cause the sense voltage of 0.6V. There is an additional ±50mV in the PIC reference voltage and ±10mV in the PIC comparator. This inaccuracy (call it ±10%) is acceptable since I'm just concerned with warning the user when the trailer battery is getting low. The bipolars Q3 and Q4 are a standard low current power switch. I'll discuss the program in the microcontoller in the next post.
The sharp eyed among you will notice the PIC12F609 cannot be configured with GP3 (pin 4) as a general purpose digital input and have the internal weak pull-up enabled. This is only true for GP3 (pin 4). So 1MΩ or so pull-up resistor will be "blue-wired" between BUTT and DIG (5V power). This was an oversight on my part that I didn't catch until after the PCBs were layed out and ordered. 

Figure 4. Digital section schematic.

Finally, figure 5 zooms in on the LED power supply. Another LM2587-ADJ boost controller is configured as a current regulator. The lower current (and slightly cheaper LM2585-ADJ could be used, I just wanted to keep my parts list a little simpler and use the same boost controller that was used on the input. When R15 is 40Ω, about 30mA will be directed through an eight LED string. This current is also mirrored to the other eight LED string because of the mirror formed by Q4 and Q5. This current mirror is a cheap mirror, not a nice single package matched pair. In this application a few percent variation in current just isn't that big of a deal. The zener diodes D2 and D3 have a 36V breakdown. They keep the boost circuit from running away if the LEDs are not plugged in when the circuit is on or if either LED string has an open circuit because of a broken wire or smashed LED or any other reason. The resistors R12 and R13 with a value of "unpop" are not meant to be populated on the board but they do allow lowering the resistor value (and thus increasing the LED current) after the board has been populated. 
Figure 5. LED driver schematic.

The PCB for building this circuit is shown in figure 6. The bottom layer ground plane isn't shown for clarity. I am sticking with 1206 packages for resistors and small capacitors because they are easy for me to solder by hand. I ended up using through hole inductors because they are physically large devices and the through hole versions can be oriented vertically, taking up significantly less board space. The Q1 bipolar is a TO-220 package for power dissipation reasons so it is also through hole. The huge 1500μF capacitor C12 is meant to be leaned over the board, covering the microcontroller as shown in the 3d model in figure 7. The boards are on order and not expected until the end of the week, so I won't have a picture of an assembled board for a couple of posts.

Figure 6. PCB layout.
Figure 7. 3d model of PCB.

There's $88.72 worth of components in this project. The largest cost is
  • $22.89 GP1272F2 Sealed Lead Acid Battery 12V 7.2Ah .250" Faston tabs 
  • $17.78 (2@$8.89) LM2587S-ADJ/NOPB Switching Regulators 5A FLYBACK REG
  • $7.43 UC3906DW Battery Management Lead-Acid Linear Charge Mngt IC
  • $5.02 (16@$0.314) CP41B-WGS-CK0P0154 LEDs Through Hole 90DG C-WT STNDOF P4 LED 9000K 3.6V
  • $4.02 (2@$2.01) 0154005.DR  Surface Mount Fuses Fuseblock w/ fuse 5A OMNI BLOK 154
  • $3.35 RP-SPNS  Pushbutton Switches PUSHBUTTON SWITCH SPST 1A 120VAC 28VDC
  • $3.01 2210-V-RC  Fixed Inductors 56uH 15% Vertical
  • $2.64 (3@$0.88)  STPS5L60S  Schottky Diodes & Rectifiers PWR Schottky rectifier
  • $2.50 2200HT-102-V-RC  Fixed Inductors 1.0mH 15% Vertical
Six prototype boards from Silver Circuits run $105 including shipping ($17.50 each).

Now that I am writing this review I see one thing I should have done differently. I should have provided a 1MΩ in parallel with output capacitor C8 to bleed it off when power is removed.

I also wish I had found some way to move the big bipolar Q1 away from the electrolitic capacitor C12. That bipolar is going to run hot and I would prefer to keep hot components away from electrolitic capacitors.

My next post will cover the PIC program.
The post after that will discuss the case design and printing.
I may do a final post to wrap everything up and show the installation.
I will try to do a post every week so this project is complete by the end of January.

Bruce McLaren

Wednesday, December 05, 2012

Boost Regulator Powering Small White LEDs

My short contract turned out to last from March until November. Great for the paying the bills, lousy for getting anything else done. It was a decent gig, I got to do lots of things. Everything from writing and synthesizing Verilog, to block level analog verification, to top level mixed-signal verification, to Perl/Tk for a simulation environment, and creating a PSpice model to round the contract out. I had never done high level modeling in PSpice before, so I got to do a variety of things I've done before and something new. Not too bad. 

I have decided to publish this blog on a monthly basis; I intend to publish on the first Wednesday of each month. I should be able to keep up that pace even if I am in neck deep in a contract. Since I am briefly between contracts, I will write several blog entries ahead. I might even proofread them if I write them ahead of time like that. 

Enough administravia, on to some design!

I am revisiting and finishing the LED lighting system for a boy scout trailer. As you might recall, the challenge is to place a robust, low power lighting system inside a boy scout troop equipment trailer. The lighting system will be powered by a 12V lead acid battery that may only get charged for a couple of hours each month. the lights need to usable for two nights of camping in between those charges. Low power (30-40mA) white LEDs seem like a good way to handle this. 

To simplify the wiring to the LEDs, the LEDs are connected in series. Only two wires need to be connected to the LEDs from the control box this way. I want to keep the highest potential present in the system below about 40V. The white LEDs I chose have a maximum forward voltage drop of up to 4.4V. So eight in series. 

I am using the National Semiconductor (now Texas Instruments) LM2585 boost regulator controller. It's a nice chip for this application. It is simple to use, has a low pin count, and has more than enough power capability. The LM2585 datasheet recommends using TI's WEBENCH Power Designer. This is a nice tool, I like it's power, it's simplicity, and it's wealth of produced information (even a suggested parts list). However, it requires a more recent version of Adobe Flash than I have bothered to install on my Linux computer, so I had to shift over to my Windows laptop to use it, and I didn't really get the feel of the circuit. Since I am using the regulator in a current feedback mode, the simulations can't be made to do what I'm going to do. So it's a great system but I had to fiddle a bit with it's results before I was comfortable. Of course, I checked the results with hand calculation to make sure they made sense. 


Figure 1. LM2585 30mA LED driver.
There isn't much to say about this. It is close to the standard application schematic except that the feedback point is taken at the top of a 41Ω current setting resistor. The LM2585 will try to control the out voltage to maintain 1.23V at the FB node (1.23V/41Ω=0.03A). The 36V zener diode across the output keeps the voltage from increasing wildly if the chain of LEDs is broken. I have tested this by intentionally opening one of the LED connections. By the slight smell, I can tell this is straining the capacitor and the circuit is none too happy about that operating mode, but it is keeping the circuit from actually blowing up. Bursting into flames is almost always a bad thing.

I put this circuit together on a generic PC board as poorly shown in figure 1. The close up in figure 2 shows that my way of making a surface mount inductor into a through hole inductor. Just solder a couple of wires to it.

Figure 1. The physical implementation. The 1mH inductor is almost as large as the rest of the circuit. 


Figure 2. Now it is a through hole inductor.



Figure 3 shows a scope shot of the circuit in operation.

Figure 3. Scope shot. Channel 1 (yellow) is SWITCH. Channel 2 (blue) is FB. Channel 3 (purple) is OUT. Channel 4 (green) is IN. The too large capacitor (22uF) keeps the output level. 



When I started this project, I assumed getting the LED regulator going would be most of the work. I was wrong. Next time I will show what I came up with for the on/off switch. That turned out to be more complex. In fact, the installment after next will be the program for the micro-controller that is becoming part of the switch. 

Figure 4. The whole circuit on my dining room white board.


Next month, the on/off switch circuit and a complete parts list. Until then, I hope I'm doing someone besides myself some good. Good luck on your own projects!

By the way, does anyone out there know how to submit Design Ideas to EDN? I couldn't quickly find the submission guidelines online or in the print magazine. 

Bruce


Wednesday, May 02, 2012

Boost Regulator

My first attempt at designing a boost regulator was comical. I took what I knew about SMPS (Switched Mode Power Supply) buck regulators and applied that. Then I figured out that running a boost regulator in CCM (Continuos Conduction Mode) creates a RHPZ (Right Half Plane Zero) that is not present in the buck regulator. That creates a circuit that is not stable. Did everybody get through that pile of acronyms? Then it's time to make something that works.

There are three basic approaches that I could take. 
1) I could design it to run in DCM (Dis-continuos Conduction Mode), where the inductor is small enough that it is fully discharged before the end of the cycle and the current is drawn from the capacitor. This requires a bit of finesse in component sizing, load current specification, and feedback network setup. It could make sense for this application because the load current has a narrow expected range.

2) I could stick with CCM but roll the response off at a fairly low frequency. This works for this application because I'm driving LEDs through a current regulator. The load current will change very slowly, mostly with temperature.

3) I could make sense of this paper or similar and keep a high bandwidth while retaining CCM. That isn't needed for this application. Maybe next time. 

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 to avoid visible flicker, but I'll want much higher to keep the inductor size reasonable. 
Very simplified Bode plot for the boost control to output gain

The frequencies fLC, fZ, and fESR are from the output stage. The fC frequency is where the feedback system will get the crossover frequency to be. The crossover frequency needs to be at least three times higher than fLC so the peaking doesn't mess with it too much. fC also needs to be at least 1/3 of the lowest fZ. fZ needs to be at least 10*fLC.
Time for some numbers now.

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

The minimum inductor size needed stay in continuous conduction mode with a 100kHz switching frequency is
L ≥ (Vout D (1−D)2)/(2 Iout f) = 156-347μH I choose 750μH.

The minimum capacitor to keep the output ripple to less than, say, 1V is
C ≥ (Iout D)/(ΔV f) = 0.035μF choose 1μF because that seperates fLC and fZ.

Therefore
fLC = (1-D)/2π (LC)1/2 = 1210-2910 Hz, 1.8k Hz typical.
fZ = (Vout/Iout) (1-D)2/(2π L) = 10.1-58.4 kHz, 23 kHz typical.
I'll want fC to be about 8kHz.

FESR = 1/(2π CRESR) = 320kHz (I assumed 500mΩ)

DC Gain is 20*log(Vout/((1-D)Vramp) = 43dB.
Gain at fC (8kHz) is about 18dB.

So the feedback compensation needs to provide a couple of zeros at about 3/4fLC or 1.35kHz, a couple of poles at fESR or 320kHz and attenuation of about -18dB at about 8kHz.

The next table summarizes this in terms of component values. I made a spread sheet to do the actual calculations.

Compensator values
ParameterFormulaNumbersResultStd Value
GZGC-(20*Log(fZ/(3/4fLC)-18dB-(20*10^(23kHz*0.75*1.8kHz))-46dB
R1picked200kΩ200kΩ200kΩ
RZ2R1*10^(GZ/20)200kΩ*10^(-43dB/20)1.50kΩ1.5kΩ
CZ21/(2π RZ2 3/4fLC)1/(2*3.1416*1.0kΩ*0.75*1.8kHz)77.6nF75F
CZ31/(2π R3/4fLC)1/(2*3.1416*200kΩ*0.75*1.8Hz)582pF470pF
Cp11/(2π RZ2 FESR)1/(2*3.1416*1.0kΩ*320kHz)334pF470pF
Rz31/(2π CZ2 FESR)1/(2*3.1416*0.68μF*320kHz)1.064kΩ1.0kΩ

The inductor is larger than I'd like, but it is set by the basic specifications. I don't think I can easily make a triangle wave generator faster than 100kHz on a PCB (this will be a breadboard style project, no custom PCB will be purchased). Raising that frequency would allow a smaller inductor.

Schematic is below. This is obviously not the implementation schematic. I am using ideal op-amps, comparators, and saw-tooth wave generator. The resistors on the the op-amp outputs helped initial convergence. The highest value comped (the output of the feedback loop) can take is 9V. The saw-wave switches between 0V and 10V. This means the gate signal will always be switching, even when the feedback is saturated to its rail.

Simulation schematic for boost regulator.


A simulation showing typical operation is below. The current through the LED legs is in blue, the voltage output (pwr) is in green on the right axis, the inductor current is in orange on the left axis. The pwr output overshoots then settles to 44V. The currents are controlled at 18mA in each leg. Not too bad; I may want to raise the LED currents. I do not understand the quick drops to ground that the pwr signal does every now and then. When zoomed in on, they drop in one time step which suggests a simulation issue. I'm not certain of that, though. The 10V case input gets the output voltage up past 40V which meets spec, but it is no longer regulating. I'm going to call that good enough; low voltage operation works, but not well.

Simulation results for 10, 13, and 20V batteries.

Zoom in to show inductor current. I'm going to need a hefty inductor to handle 400mA continuous. 

The next steps are to find real components that can be used and design a saw-tooth generator. I will probably use a triangle wave generator running at twice the frequency. This would be trivial for me on and IC, but I haven't done it using components before. "It shouldn't be too bad." I'm still thinking through how best to ensure the triangle-wave always has a peak higher then feedback network's high saturation point. I will also need to either make a soft-start or a voltage limiter. 80V initial transient is a bit large, and I wouldn't be surprised if the real (non-simulation) peak is even higher. I am also considering removing the LM317 based current sources and instead controlling the current directly.


I found several good references while working to understand boost converter stabalization.

Loop compensation of voltage-mode boost converters This stepped through the design process in a organized and understandable fashion. If I had found this first instead of last, I would not have had much trouble.

Compensating the RHPZ in a CCM Boost Converter: the analytical way This is part three of a four part series that is pretty good, but hard to follow because the equations and figures are not in-line with the text.

DC/DC Boost Calc This is a quick and dirty component calculator.


I'm making some progress on this project. I would like to finish up the design in nest week's blog. What I expect to do is write an entry on miller op-amp compensation or ADC specifications because I need to prepare for a technical phone interview.

Bruce