Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

PWM LED control and LC networks

Status
Not open for further replies.

MacGyverS2000

Electrical
Dec 22, 2003
8,504
First off, many thanks go to steveowens for taking time out of his busy schedule to discuss my circuit ideas, both through email and on the phone. Kudos! He has certainly helped me move from more complicated ideas to something more simplistic, but I cannot expect him to spend all of his time helping little ol' me.


What exists:I would like to hear the opinions of others as I try to lock down this piece of the circuit. I am controlling a variable number of parallel multi-color LEDs with PWM, each color independantly controlled with a separate PWM stream. Each LED has it's own current-limiting resistor. A PWM period is 32ms long with 1ms resolution, with duty cycles of 0-100%. To be honest, I could probably decrease the period by several factors of 2, but let's start with what I'm currently working with. Voltage supply will most then likely be a regulated +12V to simplify determining max LED current (but I'm all ears on other methods to solve that issue).

Problem: I would like to rid myself of the blinking visible at less than 100% duty cycle, especially at 0-50% duty cycles (I know my low PWM period is partly to blame for the visible flickering). Also, I would like better control of the brightness, especially at low brightness settings...since I'm pulsing at full on/off, even at 3% duty cycle the LED is quite bright (don't have the benefit of an incandescent bulb's filament intergrating effect).

What's been tried:It has been suggested that an LC network with a flyback diode (similar to a switching power supply design - boost/buck regulator, if you will) is the path I should be chasing. So, I've spent considerable time playing with values in an attempt to make a reaosnable circuit. This shoudl be as close to surface mount material as possible (or very small through-hole), so I set a self-imposed limit of <500uH and <20uF (since I have had trouble finding an inexpensive SM cap over 20uF).

Interesting simulation, but the voltage overshoot would blow things sky high. So, I added in a zener after the inductor to clip the voltage...worked reasonably well. Ringing could be removed with a sizeable cap (well over 20uF, though).

Where I'm at now:In doing all of this sim work, I think I lost sight of my goal...controlling the LEDs. After all was said an done, the voltage across the LEDs was still a close approximation of the square wave. If the PWM pulses controlled a FET for each LED color to begin with, slightly smoothing out the square wave train is hardly going to have any effect on the flickering. I'm sure it was thr original circuit's attempt to smooth out the incoming power (and reduce the flicker that way) rather than the PWM pulse, but I've got so many conflicting ideas running through my head I can't sort them out any longer.

Someone push me down a path that makes sense again...
 
Replies continue below

Recommended for you

LEDs are indeed square law devices and if you control them in a linear manner, by varying the current through them, you will indeed have a highly non-linear brightness vs. current effect. This will happen if you try to filter the PWM. However, the idea with PWM is that the LEDS are run at only one current flow when they are turned on. They are either at that current flow or off. Nothing in between. Fltering gives you inbetween states and the brightness becomes non linear. With unfiltered PWM uou have only one brightness level and you are chopping that to get variable brightness. You mention using an RC filter in an earlier post and I saw nothing about your removing this.
You must use absolutely NO filtering on the PWM or the effect will become non-linear.

As for the flickering, it depends on the human eye. SOme eyes cannot see a 60Hz flicker and some can. Computer monitors and TV sets flicker at a rate of about 60 to 70 Hz. Most people can handle this and a few cannot. I have seen it suggested that a rate of at least 100Hz be used to guarantee that all humans see no flicker.

As for the effect at low brightness, if you can see a discrete step between 1 and 2 units of your PWM, then you have too few steps. I suggest you use an 8 bit word to define the PWN rate which will give you 256 steps. Yes the difference between 1 and 2 steps is a 100% difference in brightness but how often will you be at that low a point anyway specially if you have 256 steps? However, this is an unavoidable consequence of PWM. It is reduced though by using more steps. 256 is a convenient number of steps as it fits easily into 8 bit data.
 
Ahhh, I see your point now. Essentially, though, you're confirming my thought that lower levels of brightness are possible with shorter pulses, correct?

To get shorter pulses I'll need to increase the ISR rate, but I've already decided that's going to happen on the final product anyway (about an 8-fold improvement). I'll definitely be increasing the resolution from 32 to 64, possibly more, so some more testing is in order.
 
Yes, you need shorter pulses for lower brightness levels. If you add filtering, you screw this up. SInce LEDs turn on and off in sub microsecond times, true PWM controlis possible if you use no analog filtering. The more steps you have, the finer your control will be. 32 steps are too few and 256 are likely overkill. You have to determine if 64 are enough of whether you need 128 or 256.

As well, the human eye behaves in a non linear manner and the linearity of pulse width to brightness depends on the background light level. The lower the ambient light, the more non-linear the LEDs brightness will appear. If the ambient is fairly high, the light will appear to change more linearly. If there is low ablient light, it takes less pulse width to make the light appear to be bright.

I have seen attempts to map perceived lamp brightness to pulse width so the pulse width for a given control signal will be non-linear in a fashion that gives equi-brightness steps. This is more a problem for incandescent lamps though than for LEDs.
 
I am designing a similar circuit at the moment for PWM LED control and have found this thread very useful(I am a new user). I am happy with the software side but I just want to confirm the hardware side. My led is a 350mA high intensity unit(4 such LEDs) running from 5v. I want to control it with a FET(switch ground into LED/resistor circuit). Please confirm that there are no clamping diodes etc required. Since I am drawing 3x350mA=1.4A from the 5v supply(which runs my micro etc) and being switched rapidly(PWM) I expect that I will need a large cap across the supply close to this circuitry. Please suggest how to calculate the value required(I do more software engineering than hardware).

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor