Can a capacitor be used to smooth PWM?

I’m wondering if running a capacitor between the wires to the LED would decrease the intensity of PWM. I imagine it would also cause a slight lag in the light out put when changing modes, on and off, etc. Wouldn’t the decreased shock in current changes generally extend LED life?

Has anyone tried this or have any educated guesses on driver/performance impact?

If anyone know what would probably be the best type of capacitor to use and/or size for a 3.5amp light, that would be great to hear.

I would guess that a capacitor would bring the voltage below the Vf of the led during PWM, and the led will not light.

You would need a sizeable capacitor to provide enough current to drive the LED during the off period. Your typical smd micro caps aren’t going to be anywhere big enough. I would guess it’d be the size of several stacked coincells if not a small battery size. Then you have to deal with wiring and heat.

KuoH

A capacitor will discharge starting at whatever supply voltage it was charged to, but it has almost no internal resistance. As soon as supply power is turned off, it will discharge the stored energy at whatever current the LED is able to pass until the voltage falls below Vf. Though for most capacitors that would fit in the head of a small single cell light, they would probably be discharged in a matter of microseconds. Not long enough to make a perceptible difference.

KuoH

since pwm is used to lower maximum brightness, if you do get it to work, will it not mitigate low and medium?

Do you mean the capacitor discharge cycle would be too slow or too fast? I’m just a layman, but my intuition says the capacitor might be too slow since PWM is a generally at very high rates.

It does work to a degree, but probably not to the point where you eliminate PWM altogether. A capacitor and an inductor is best used together to create the low pass filter.

An example is the king, of course, with its lousy 180Hz low. If you notice, it’s not as annoying as any regular 180Hz should be. That’s because its toroidal driver filters/smoothes the pwm a bit.

I wouldn’t think so. I was thinking the capacitor would need to be pretty low capacity so that it absorbs just a little bit of the current flowing to the emitter. Then when the current stops, it gives up enough to smooth the light wave somewhat.

Interesting concept. I don’t know if anyone has noticed this but if you have a light using a Nanjg105C driver turned on in a mode that uses PWM (i.e. any mode other than 100%), after you turn it off, the LED will faintly glow for a few seconds after being turned off. It baffled me for the longest time, but I eventually figured it was the small capacitor on the backside of the board discharging.

You just took me back to my youth when I would mod/build speakers. Back then we would use capacitors for high pass to the tweeters and inductors for low pass to the woofers. I tried to stay away for 3 way speakers, but in those cases both would be used to pass the mid-range.

With the speakers, the filters offered a path of least resistance for each speaker. With 3 way speakers, there would be a phase change to deal with. I’m guessing due to the delay going through the extra component for the mid-range speaker.

With the LED, I want all power to go to it. Do you recall if SRK is actually a “filter” that bleeds off some of the current?

Interesting observation Slim. I wonder if that is what they are doing. I have noticed that Nanjg’s don’t seem to bother me. I usually notice PWM when working on something close. I will have to look at that driver ’s circuitry and try some close work with it.

The answer is maybe, sometimes it will work, sometimes not.

This depends on the driver, if it is current limited a capacitor can smooth the pwm, but you might need a few 1000 uF, before it really works.

For a driver without current limit, the capacitor will just be charged to the full voltage, each time the pwm pulse is on.

When I try to quickly calculate that, my result is that for a 200Hz PWM to reduce the ripple of the current to 20%, you’d need 60mF (60000µF) - Much too big. 2.2mF are already too big for the typical head.

But I might have calculated wrong.

That depends on what factors you have used, i.e. what current you are assuming the led are getting and how much the voltage are allowed to vary. If you say 200mA (Remember we are not talking high mode) and 0.1 volt, the capacitor is 10000uF at 200Hz

Thank you DrJones and HKJ. Both of your numbers sound pretty big for a flashlight. I was just hoping to round off the corners a bit on the wave and then see if I noticed it in the light quality. I picked up a cheap used oscilloscope recently, but still need to get leads for it. I may have to play with around with it anyway, but at least my hopes won’t be unrealistic going into it now.

Thank you for your input.

Ahhh! So many things to comment on, no time… head exploding! :slight_smile:
Later on tonight I have many responses.

I actually tried this a few months ago, and the largest capacitor I ended up testing was a 2200uF, which was already way too big to fit in most flashlight heads. (It might fit in a SRK head.)

Although it made a slightly noticeable difference, it certainly wasn’t substantial, and nowhere near good enough. It also introduced some very strange additional problems when attempting to cycle modes.

Testing was done on a Shadow Mini T6, which I love, but I hate the PWM. (I need to do a driver swap.)

This appears to be the identical capacitor I was using:

I suppose this just confirms what DrJones and HJK said… you need a BIG capacitor.

That’s why I mentioned it wouldn’t fit in most small heads. Also the capacitor is potentially back feeding the driver during PWM off, depending on how it’s designed, which probably accounts for the mode switch anomalies you observed. You could try adding other buffering components, but that creates more loss and power handling problems when full on.

If it were that simple to smooth out the PWM flicker, I think circuit designers would’ve gone that way long ago.

KuoH

My LED analyzer device (Any interest in a LED/Battery analyzer device?) has a big MOSFET on it that is driven by a PWM signal (16 kHz, 10 bit resolution) that can PWM the battery input power to the LED/load output connector. It acts like a buck converter. The control software allows it to generate a constant voltage, current, or power to the load or charge lithium batteries. These operating modes require a filter cap to be installed across the load to smooth out the PWM pulses. I have been using a 1000 uF cap for most applications. Looking at the cap voltage on a scope shows a few percent overshoot when the PWM pulse turns on.

Note that if the battery input voltage is quite a bit higher than the desired load voltage, the PWM pulse width gets too small to get fine control from. For instance, if you wanted to charge a 4.2V Li-ion cells from a 12V input, the required PWM pulse width drops to around 2. With a 5V source it uses around a 50 pulse width.

Playing with some standard LED drivers, most don’t like having their outputs filtered. This is particularly true of switching type drivers.

Is there a catch-all explanation for this?