A more efficient driver (digital to analog controlled buck)

First, I doubt I had this idea first. Not claiming I did.

We all know linear regulation blows off I^2R losses to produce IR voltage drops.

It's also true that PWM runs the LED at a fixed high current where it's not very efficient, even though the average current is lower when dimmed.

It turns out that linear seems to beat PWM:


(in part because PWM doesn't do as bad as some non-thermally corrected estimates might have you think)

And it's also true that when the number of cells in series equals the number of 3V led's in series you probably can't do much better.

But if we start with say 2s batteries and drive 1s LED's then we get a new tool, buck regulation of course, but does it really help? (Ok, that's not really the right question, but anyway, if we do it wrong it certainly will be worse than above and worse than it needs to be)

I've a number of people tell me how a) PWM is just buck regulator. False. or how Buck drivers are more efficient than linear (can be, but are any?, I mean compared to a linear driver from 8.4 down to 3.5V of course, but for dimming? Probably not, stay tuned.)

RMM's fabulous buck drivers:


use the MAX16820


Which says:

"a dedicated PWM input (DIM) enables a wide range of pulsed dimming."

and page 4 shows that the current is really pulsed to the LED.

Maybe RMM did something different, but I suspect not.

So what's happening here is we buck down to some pre-determined 100% current level. This could almost as well be a fixed voltage level give or tak LED variation and temperature fluctuations. Then we're basically back being just like we have a 1S battery. There are some differences:

1)voltage doesn't drop over time

2)You choose a more suitable voltage for a more sane 100% level and this DOES gain some efficiency (but why be forced to choose, we can have it all)

3)You already lost some efficiency because bucks still aren't perfect, so if you want that 6A 100% level, you'll be worse off now.


We haven't fundamentally avoided the issues of PWM at all. We're just doing it the same as before and with the same general inefficiencies (and they're pretty big at low or probably even medium levels, and I care more at medium really where tipple drivers like the texas avenger don't fix it)

But what if we could actually control the analog current output of the buck driver. Then you keep that high 90+% buck driver efficiency, and it never changes it is not reduced by other inefficiencies! *

But. I think you can do this (well you can, hobby regulators do it, but can it be simple and small). Here's the latest proposed buck chip that RMM himself apparently recommended recently (according to TA):


And you can see that it has input 2, IADJ : "Analog LED current adjust. Apply a voltage from 0 to 1.24 V, connect a resistor to GND, or leave open to set the current sense threshold voltage."

That's not the same as the sense input. The sense input senses the current, this analog voltage adjusts the set point.

Problem, atiny13 doesn't have a voltage out. Oh, but it does have a PWM output. And if you filter a PWM out you can make it into a controlled voltage.

Why reinvent the wheel though, so I googled it and got this:


Presto PWM to voltage converter. And the great thing is, all the old firmware should still work!

So, buck.. and nothing else. Reuse PWM software, but no real PWM needed.

Now, I didn't really look in detail at how to setup the D to A converter, if the parts can fit well, if there are some side effects, so I'm open to comments there. It seems to me that shouldn't be so hard though.

Of course I have to ask, does this already exist? I have been actually a little surprised to learn that it's not the norm. I would have suspected it.

Edit:Kiri baru correctly points out that buck isn't necessarily more efficient than other methods because buck efficiency is tuned for a certain power output. For this or other reasons he can certainly be right, but while buck may become innefficient for instance at low output, it will only be more innefficient at low output with PWM.

We need buck sometimes, and it has some nice properties, and this is a better way to do it than buck +PWM I think.

Oh.. and does this mean we can get rid of an extra FET? I think so.

kiba-ru correctly points out that if PWM is done well (hopefully the bucks with PWM input do it well), it should be possible to keep the buck always operating in the same current range (during the pulse) where it has optimal efficiency. Loosing that possibility might come at a cost which counters the gains in LED efficiency. Overcomming this depends then on how well one can get the buck to operate over the needed current ranges.

(udpate) after doing much detailed calculations on buck losses, I'm less convinced by this concern. Basically several types of I^2R losses go up at high power. The freewheel diode loss is simply proportional to power (for a fixed voltage output, like driving a diode as we're doing). Two things happen at low power. FET switching losses don't budge and so become a bigger fraction. Also at some point inductor ripple becomes big enough to send the buck into discontinuous mode. I don't think discontinuous is necessarily a big problem but I haven't looked at it closely. But you can stay above DCM at a few percent power level (limited by space for inductor). The limiting factor then is switching losses. Again, looks like even for a p-type fet this can be better than 10% probably (rough unproven estimate) at a few percent power level. That did come at a very slight cost to I^2R losses at the highest power levels, in compromising FET selection. The trick will be using PWM from an appropriately low and efficient mode (optimizing driver efficiency and LED efficiency) to then go down to moonlight. But this will PWM down from maybe 10% not 100%. By far the biggest LED inefficiencies have been recovered already at that point. This can all probably be optimized slightly better yet with an n-channel buck, if we find a good (simple) one with analog control.

On the other hand nickleflipper points to data that shows that a particular buck with PWM control gets less efficient when PWM'd, so then you're loosing from PWM in both the buck AND the LED. The devil, and reality here strongly depend on details of a particular implementation clearly.

This was a great read. I don’t know how any of this really works, but I’m learning a bit more each day. One thing I thought about while reading your post. If the buck driver is already reducing voltage to the range of the LED, then using PWM from there to get lower modes should still be more efficient than using PWM at the higher Li-Ion voltage of 4.2V or even up to 4.35V for some cells, right? My thinking is that the LED should run cooler at the lower voltage, giving a bit better efficiency even with the same PWM signal.

Thanks, I've been putting all this together for a little while now. Hopefully it's sensible.

I think you are referring to my difference number 2. Yes, if you start with an effectively lower 100%-level voltage, then you get more efficiency in the whole range.

BUT you lose the supper bright turbo ability, and it's still not as efficient as analog control. You can have it all.

This might not be more efficient that 1s 1s in the end, because bucks themselves aren't perfect either. I suspect it wins a little, but it's definitely more efficient that 2s bat 1 s LED would be without using this. And that's a very nice configuration anyway I think because of difference number 1, and this just makes that configuration better I think. Also it's sometimes a required configuration, if you have an odd number of cells and even number of batteries, or in a bike context where all batteries are 2s etc. It might be boost, but the same arguments apply.

Nice summary of characteristics of different driver types. There are some buck drivers that don’t use PWM for dimming, right? Like in use by manufactures like Fenix?

I believe there are, and part of what I've done here also is put out an idea for how we can make one compatible with existing software. It may be kind of obvious, but yeah.. anyway, here it is all in one summary if nothing else. Like I said, not saying it's my idea. I did work through the homework problem though and thought I'd share.

You don`t understand what is buck driver.
It will have efficiency curve with one extremum, neverless what changes are you going to make.
There is always consensus in L-C characteristics, you can get little better effincy with half-load, but with bigger output ripples, or vice versa.
To have 90% efficiency at 5% load, you need different pcbs with different frequency, L and C, and switch between them on different loads.

Pretty sure the MTNmax drivers are non pwm controlled with true current regulation. The problem of voltage ripple remains which limits the maximum current the led can tolerate but for power and size they can’t be beat.

If I understand correctly that converter will convert 4.2v 50% into 2.1v, not enough to even light up the Led, if it can even handle the high currents. The Led vf is not linear like that.

Couple of things:

The family of buck drivers linked in the OP can handle a wide range of Vin and Vout — Vin from 6V to 42V and Vout from 1.25V to 42V. The output is completely adjustable, so there should be no problem driving a 3V led from a 2s configuration, or even a 3s.

There is a problem with the linked buck drivers — the minimum Vin is 6V, meaning that it won’t be able to fully drain your batteries, since a 2s configuration fully drained is right around 5.6-5.4V, depending on whether you want a low-voltage cutoff at 2.8 or 2.7V per cell.

This really depends on which switching regulator you’re talking about. Yes, there are some regulators which have an efficiency curve with a sharp peak. Efficiency might be 95% at a particular Vout and Iout, but drops below 70% if deviating from that specified output by too much. On the other hand, there are also adjustable regulators out there with a very high efficiency (>90%) across a wide variety of output voltage and output currents. Furthermore, many regulators have a “burst mode” which enables them to maintain high efficiency at light loads. For our purposes, a driver with this means that moonlight and firefly modes can be extremely efficient without sacrificing efficient mid and high modes.

Again, this depends. There’s switching converters which have FETS built-in, but there’s also switching controllers, which require external FETS to drive the load. As a general rule, regulators with built-in FETS will have a lower current limit. At least one of the family of drivers you linked to in the OP is a controller which requires an external FET.

Analog dimming is ideal for our purposes. While PWM dimming has the advantage of avoiding a tint shift (in certain use-cases), analog dimming is obviously more efficient. The problem with analog dimming for most of these regulators is that it has a small dynamic range. In the driver OP linked, there’s only a 250:1 analog dimming ratio (in contrast to a 10,000:1 PWM dimming ratio), which means that at a 5A maximum, it could only go down to about 20mA. Obviously this is still very low, but a 1mA firefly mode it is not. Fortunately, this isn’t really a problem, as most drivers allow you to use both PWM and analog dimming. So it would be possible to dim from 5A to 20mA (or whatever point you like) via analog control, and dim via PWM the rest of the way.

There’s also no need to limit ourselves to switching regulators explicitly designed to be LED drivers. It is very possible to use general purpose switching regulators, which regulate an output voltage rather than current, and hook them up to a microcontroller for analog dimming. I know of at least three ways to do this. One is via the low-pass RC filter mentioned in the OP. Another is by connecting a pot or digipot to the feedback pin of the controller. Most buck/boost/buck-boost regulators require a feedback loop to maintain a low output voltage ripple. At their most basic, these feedback loops involve a resistor voltage divider with the bottom resistor usually connected to ground. By replacing or augmenting that bottom resistor with a pot or digipot (where the digipot would be controlled by serial output from the microcontroller), it’s possible to change the output voltage (which for an LED means the output current, which is what we’re interested in) without disrupting the balance of the feedback loop. A third way is to replace that bottom resistor with an independent voltage source. This can easily be accomplished by connecting the microcontroller to a small external serial-controlled DAC. Pumping an external voltage into the feedback network means that the switching regulator will lower its output voltage to compensate, and vice versa. This method is perhaps the easiest, and it can allow a wide dynamic dimming range too. These styles of analog dimming, in conjunction with a burst mode for efficient ultra-low outputs, would make for an excellent LED driver with high efficiency across the board. TI, Linear, and Maxim, to mention only three, all make suitable regulators. But the design of these drivers is much more complex than a comparatively simple linear regulator, as you have to deal with electrical noise generated from the high switching frequencies.


I agree with kiriba-ru that PWM’ing a buck converter cannot maintain the design efficiency. Same goes for PWM with low pass filter, or even an analogue voltage.

I found a linear relationship more or less between the PWM duty cycle and the efficiency of a buck driver. Here is a reference to the LTC3454 buck/boost driver efficiency, in the buck mode, at different led currents. PWM at 10% duty cycle equaled approximately 16% hit in efficiency. Higher PWM duty cycles would mean less of an efficiency penalty.

I already addressed this in my response. I'm not saying this more efficeint than a 1s PWM or 1S linear regulator. I'm saying it's more efficient than a PWM'd buck regulator or a buck regulator with linear regulation after it. I should probably make it more clear in the OP.

So what you get are the advantages of a buck, (and any disadvantages) and remember sometimes we MUST use a buck... but we don't add EXTRA inefficiencies to it that just are not necessary.

5% load with PWM and 5% load without PWM are both still inneficient to some buck designed for higher current, and I guess about equally so, but one also has PWM innefficiency from the LED added on top of that and one doesn't.

Yeah… I don’t have delusions (at this point at least) that this is simple. RMM apparently said the same to TA, and the Ti manual makes it pretty clear too that dealing with electrical noise is difficult. For the amateur or at least off-hours enthusiast crowd it might be more effort than it’s worth to anyone to try. But if anyone does take a stab at this Ti buck, maybe this DA method isn’t too much harder.I’ve also read rumors about these methods of modifying the sense voltage. I guess that’s an option for chips without this analog control feature. You still a DA converter as FPC points out.

Another trick I might like actually is just using a pot knob on the flashight case. Analog user control, avoids the D to A and gives continuous control. The downside to continuous control for the user is you don't get predictable battery life, and fitting pots on cases might be tricky? Doesn't some light have this?

Unfortunately, the LTC3454 isn’t a particularly efficient regulator. Linear, TI, Maxim, etc., all offer some regulators now with peak efficiencies as high as 96% and 98. Furthermore, the LTC3454 doesn’t offer the sort of input and control that conduces to efficient LED control of the type I’m speaking about. Instead of an FB or CTRL pin where an analog voltage can control the regulator’s output, the 3454 has two resistor-coded current values which are enabled/disabled by EN1 and EN2, where the efficiency of EN1 can reach 90 typical and EN2 80% typical. PWM through these inputs is switching the regulator on and off, which will be highly inefficient because of the internal soft-start timer. I’m not saying it’s necessarily a bad choice for a LED driver, but its applications are limited and it’s not the best for many scenarios.

There’s not really a huge reason why a buck regulator can’t be nearly as or more efficient than a linear regulator, even when the input and output voltages of the linear regulator are well matched (as in a 1s config).

On a more general side note, there’s at least three things going on here in this thread that need to be appropriately differentiated. More specifically, three different uses of PWM.

  1. PWM referring to the switching frequency of the regulator
  2. PWM dimming, which is a feature specific to switching regulators designed as LED drivers
  3. PWM from the microcontroller, which can be used to control the switching regulator’s output.

As regards (1), the PWM duty cycle of the switching regulator, this refers to how quickly the controller switches the FET (s) (either internal or external) to step-up or step-down the voltage of the source. The load never sees this PWM, because it’s smoothed out by the inductor and the input/output capacitors. Nickleflipper, you’re right to point out that the switching frequency and duty cycle of a regulator are connected to its efficiency (this is absolutely true!). A low switching frequency, say 100kHz, can make for a very efficient regulator. The downside is that it requires inductors and capacitors with a large inductance and capacitance, respectively. A higher switching frequency, say 1MHz, will drop the efficiency of the regulator, but allow for much smaller components because the energy stored by the inductor and filtered by the capacitor is comparatively less for each cycle. How much the switching frequency affects the efficiency of the regulator is a function of the individual regulator — it depends. Some are highly frequency dependent, others less so. Furthermore, the duty cycle of a given PWM frequency, which is varied as Vin and Vout vary, has an effect on efficiency. Again, it just depends on the individual switching regulator’s characteristics.

(2), PWM dimming in switching LED drivers isn’t the same as the switching frequency or duty cycle of the regulator. It’s a feature specific to certain regulators designed specifically for driving LEDs, and is not the same as sending a PWM signal through the RUN or ENABLE pins to turn the regulator on and off. It’s unrelated to the efficiency of the regulator (or at least not as related as many of these other factors) — it’s just related to the efficiency of the LED. Obviously, we want to avoid PWM dimming in general and control an LED with constant current (which is why we’re more interested in the analog control of the regulator).

(3) PWM from the microcontroller, converted into an analog signal and sent either into a CTRL pin on an LED driver or the FB (feedback) pin on a general purpose switching regulator, is unrelated to the frequency of the regulator. In these cases, the analog voltage is fed into an error amplifier and compared to an internal reference voltage. The switching regulator tries to keep the FB voltage equal to its internal Vref, and so either lowers or raises its output (basically by changing the duty cycle, although in more complex regulators there are additional factors at work) until the two match. How we change that analog signal — whether via changing a resistor value with a mechanical or digital pot or directly influencing the voltage via PWM sent through a low-pass filter or DAC — doesn’t matter to the regulator as long as there’s not an unnecesarily large voltage ripple in the signal, which there shouldn’t be in a well designed feedback loop. The switching regulator only sees the analog signal. Obviously, since the signal controls the output, it has an effect on efficiency, but in a driver with an efficient regulator (say, the LTC3785, which is a regulator I’m interested in making use of in the future) this efficiency remains fairly high over a wide range of Vin and Vout. For the 3785, efficiency is over 90% in most use cases for output currents ranging from 200mA to 10A, and by enabling its Burst mode, the efficiency can stay high (>80%) even down to 1mA of output current.

As an aside, a well-designed buck-boost regulator offers huge advantages in a 1s config as more and more LEDs are coming out with low Vfs. I’m thinking of the Nichia 219C, XP-G3, and the new XP-L2, all of which feature very low Vfs. Using a buck-boost regulator to drive them with a single li-ion takes advantage of that lowered Vf, whereas it makes a linear driver less efficient (although it does allow for it to stay “in regulation” longer at higher currents). The further advantage of a buck-boost driver is that it’s possible to maintain constant output over the entire voltage range of the li-ion cell, something which isn’t possible with a linear regulator.

I just don’t agree with this statement based on the experimental data gathered with the LTC3454. The PWM figure alluded to in previous post went thru a low pass filter first. I expect that other buck drivers would vary from my results. I am open for discussion. Does anyone have reference to a flat efficiency curve across any sort of dimming method?

Regarding your point 2, I wondered this.. is the regulator already doing what we want with the PWM input signal. If so great. I think in that first buck I linked, if I read the manual right, that one does not. I'm pretty sure the Ti also does not from the way it words the difference with the PWM and analog control, but I'll have to check again more closely. Others might do it right though in the way you say. Why not? Sorry, no time to read the rest right now... will soon.

I misworded that in the sense now clarified in much discussion. As for filtering the PWM though, Page 4 of the MAX manual clearly shows their "typical application" idea of what PWM looks like with that regulator, and it's square pulsed LED current. I think filtering before a PWM input on a regulator won't work. And I am skeptical about how efficient filtering PWM output can easily be. I would be quite a bit surprised if the RMM's regulators, design linked above and available at MTN, are not sending square pulses to the LEDs, but I'm not certain.

I might have missed something in the "previous post" still. A bit distracted now, so forgive me if I lost part of that point.

OK, I have a reply back from RMM in that thread, yes, his driver is really PWM to the LED's. Of course all this stuff is dependent on someone's free time, and on making it fit in the desired light, keeping it cheap, in some cases keeping it DIY-able, and not causing more problems than you fix etc... So no delusions here. Simple is also good, just exploring ideas.

Sorry, I should have been more clear. On a switching regulator designed as a dedicated LED driver, the PWM input is used to send PWM to the LED. Most switching regulators designed as LED drivers aren’t designed for the types of applications we envison. Usually, they’re either designed to drive a single LED at a low voltage and low current, typically only a few hundred milliamps, or a string of a bunch of LEDs in series at a high voltage and low current. So in those use cases, PWM to the LED makes sense — since your max current to the string of LEDs is say, 300mA, PWM dimming allows you to keep a high efficiency while not worrying about the tint shift that occurs when driving LEDs with a variable current. This is hugely different from our applications, where we want to drive the LED at 5A or so on max. Since the LED isn’t very efficient at that current and produces fewer lumens/watt, PWM dimming from that max is also very inefficient. Accordingly, the PWM input on a dedicated LED driver switching regulator isn’t really what we’re after, since it’s effectively the same thing as PWM through a single FET. That’s why you’re on the right track to want analog control, which on many regulators is sent through a FB or CTRL pin. I’m not actually all that familiar with dedicated LED drivers so I can’t speak to their internal mechanisms, but general purpose switching regulators may actually be a much better fit for our purposes since they’re often simpler and it’s still very easy to control them with an analog voltage signal.

Here’s a decent example. The efficiency of this regulator peaks at around 95% and stays above 90% from an output current between 200mA and 6A with a Vin=9V and a Vout=5V. Now obviously that’s a constant voltage example, because that particular regulator is designed to output a user-selectable but constant voltage. So it doesn’t officially support an implementation where the output voltage changes, only an output with a constant voltage but varying current. But if you download the provided demo circuit here and simulate it in LTSpice, you’ll find that you can easily change both the output voltage and current by varying the resistor R3 (a higher value equals a lower output current). An actual working circuit could use a wide-range digipot or DAC. Running an efficiency calculation shows that the simulated circuit maintains a comparatively high efficiency (~85-90%) over a wide output range, even when Vin=9V and Vout<3V. And it’s worth noting that demo circuit isn’t the most efficient design (and also that it’s just a simulation with a load resistor rather than a simulated LED, so it’s not going to take into account a few factors) and could definitely be improved upon.

Correct. Sending an analog voltage to a PWM input won’t do anything good.

Also correct. It wouldn’t make much sense to use an RC filter on PWM output from a switching regulator…it’d be a little redundant.

No worries, it all becomes a bit confusing, and it is hard to make blanket statements about generic drivers. Each individual driver seems to have it’s own quirks. For instance the LTC3454 has several valid dimming techniques! (see Fig. 3 page11).