Discussing Pulse-Width Modulation

[Michael Kleinigger] posted a lengthy discussion on Pulse-Width Modulation that goes beyond the traditional beginner tutorial. He starts a bit of background info on PWM and a tip about using a camera to judge frequency and duty cycle of LEDs. From there it’s down the rabbit hole with some testing of power-loss versus frequency.

When you change from frequencies of 50 Hz to 1 MHz how does the parasitic power loss from switching affect the overall efficiency of the circuit? It turns out there’s a rather large amount of loss at the highest level, around 1.5 mW. The greatest balance of low power loss and elimination of flicker seems to be right in the 300-500 Hz range.

Comments

  1. Frank says:

    Hi there, I think the link above is missing.

    frank

  2. CampGareth says:

    Uh, is it just me or that link just “http:”?

    Still, awesome to see this getting covered, I’m gonna need to mess around with it soon-ish for various projects.

  3. Jin says:

    Link missing

  4. c010n says:
  5. Robin Chan says:

    No me too. links broke. :(

  6. nilb says:

    Wrong link…

  7. Gustibus says:

    Not just you – hopefully fixed soon, I’d like to read this :)

  8. Scott Jaeger says:
  9. Satiagraha says:

    You may get a wonderful efficiency at 300-500Hz, but you may also get significant side-effects such as audible noise when you drive anything bigger than an LED. For this reason, it is sometimes better to run PWM at frequencies higher than 20kHz

  10. Haku says:

    @Satiagraha, definitely if you’re powering motors through PWM, I made an ESC using a Picaxe 08m and found that setting the PWM frequency to 40khz meant the motor didn’t make that awful whine like almost all ESC’s I’ve heard do when the motor is only being driven slowly. Not sure if the h-bridge I used was meant to take such a high PWM rate but it works fine.

    On the other hand you can purposely make the motor whine at different frequencies as an audible indicator of a setting or something, much like those people who have made played tunes on their DIY CNC’s etc.

  11. M4CGYV3R says:

    PWM makes the best music…

    I ♥ LFOs

  12. cornelius says:

    Picking a transistor with lower gate charge will also help to reduce switching losses.

  13. Circuitmage says:

    Yeah link no workey for me either.

    PWM depends on duty cycle and frequency, so maybe a nice chart comparing the two would be good to have (???). I dunno….methinks this has to be played with for each application, but some handy charts for LEDs, 5V motors, and other commonly driven things might be nice…

    As for the sound issue…yeah…sometimes it’s nice to actually hear your circuit working.

  14. osgeld says:

    its a good read (if you can find it)

    Scott Jaeger’s link works

  15. Aaron says:

    500Hz… Depends on what you are driving. I can see an led flickering at more than 2KHz as I was curious one day after being irritated by the light on my xbox 360 controller (which happens to flicker at 2KHz 64% duty cycle). Does any one else notice the flickering in the new LED brake lights on modern cars?!? This drives me nuts when I am driving at night. ~Aaron

  16. Mike says:

    @Aaron – Whoa, you can see 2kHz? Cool…

  17. Mike says:

    Aaron – I too can see the brake lights on LED using PWM… it does get annoying. If you’re like me, I can also tell when a DLP projection screen/ tv is being used, as the white objects look like a rainbow due to the color wheel… it gets pretty hard to get used to…

  18. Erik Johnson says:

    @Aron, the new brake lights drive me batty too. But they are more in the 100s of Hz range… 2KHz is mighty fast!

  19. Travis says:

    http://en.wikipedia.org/wiki/Flicker_fusion_threshold
    Most people can’t detect flicker at 100 Hz.

    I propose a simple A B test to see how high you can detect the frequency.

  20. Shadyman says:

    Whoa, double capacitor all the way! What does it mean?

  21. andrew says:

    @Travis, agreed.

    If people here claim they can see flicker above 100hz, the flicker they’re actually seeing is probably due to noise and under 100hz.

  22. alankilian says:

    All that 2KHz blinkin’ LED talk reminded me that our little group of goofoffs had an LED blinking at 5,000,000 Hz in 2001.

    Scope shots are here:
    http://www.sampson-jeff.com/rsoh/010406/

    We had a real good time fooling around with them. Very instructive.

  23. Mike says:

    @Travis and andrew,

    Yes, I’ve read in places that 60Hz is the cutoff for most people. And I think that’s about right, assuming you’re starting directly at the LED without any relative motion. However, when you start to move your eyes across the LED or if the LED is moving, you may notice the flicker, maybe even up to 2kHz depending on the speed of the motion. This is why POV displays work.

    @alankilian

    Speaking of 5Mhz modulations, I’ve been hearing lately about research into high-speed data transmission using ambient LED lighting. In the future, when incandescents and fluorescents are replaced by high-intensity LEDs, your laptop might actually connect to the internet via the lights in your room; they’ll be doing double duty – lighting the room and transmitting data via high-frequency modulation. Pretty cool, eh?

  24. Cynyr says:

    @travis,

    When the flickering object is or is not moving? what is the difference between the flickering objects brightness and ambient? I’m willing to bet you can see 2kHz when it’s moving at night. Not moving in the sun, 20Hz might be enough. Human eyes are marvelously complex beasts, the whole 24fps, 30fps, 60fps thing is mostly a myth and highly dependent on individual, and conditions. A bright white pulse in a dark room for example is detectable at far more than 1/60th of a second.

  25. Andrew says:

    the 360 controller LEDs don’t flicker, they’re either always on or always off. The 360 ROL does flicker, and it’s a hell of a lot slower than 2kHz.

    There is no way you can see a 2kHz flicker on a stationary light. hell, I don’t think I’d believe you if you said 200Hz.

  26. andar_b says:

    I hate the flicker my old CRT monitors get at 85Hz, but I can’t see anything bothersome at 100Hz or above.

  27. emelya says:

    CRT monitors have an vestigial glow but LED, as I believe don’t. Then LED flickering might be visible in higher frequencies.

  28. Smerky says:

    Broken link is broken! :(

  29. DarkFader says:

    and don’t put all your heavy-load PWM channels on the same phase unintentionally.

  30. chippy says:

    Good article MORE!!!

  31. Mike Barber says:

    Efficiencies from protoboards shouldn’t be related to circuit boards. Protoboards are full of capacitance. Also, lead inductance can come into play with the through-hole vs surface mount components.

  32. lurker says:

    Haven’t read the article yet, but the flicker talk is interesting. Perhaps he’s seeing nulls? I remember the lights in school bugging the hell out of me – between the tv’s, crt’s and 8-foot flourescents, I could see the bulbs flicker at 30hz when the tv was on and the crt flicker if the tv was on, provided both were in my field of view – it’s like the brain locks onto the highest frequency and lets you see the nulls in the lower one… Just a theory, I never really looked into it – Might be an interesting field of research, though…I’m sure I’m not the only one that’s ever noticed this.

  33. Circuitmage says:

    @allyouguystalkingaboutLEDflicker

    Just like the old LED clocks, you can kinda tell when things are pulsed, even over 60hz.

    One trick for detecting this is to motorboat your lips. The displays will vibrate…:)

  34. Mike says:

    @lurker – very interesting stuff, I had no idea there could be what sound like a sort of resonance between different flickering sources.

  35. Dom says:

    Hey can anybody tell me the name of the white thing this guy has put his components

  36. Mike says:

    @Dom

    If you mean the white supercapacitor, it’s made by NessCap and can be found here: http://parts.digikey.com/1/parts/90426-capacitor-ultra-2-5f-5-0v-radial-emhsr-0002c5-005r0.html

    If you’re talking about the white LED, it’s made by Cree and can be found here: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=C513A-WSN-CV0Y0151-ND

  37. Dom says:

    @mike

    Thank you for the info this is helpful but i mean the base bit, with the red and blue lines on it
    that all his things are stood in/on i want to start out and im looking for somewhere to buy one from but need the name first lol

  38. Karl says:

    Dom:
    It’s a modular IC breadboard socket – Radioshack #276-003 as an example.

  39. Mike says:

    Lol, right, the protoboard. Thanks Karl!

  40. Dom says:

    @Karl & Mike

    awsome thank you very much!

  41. Johny says:

    Now you all know you are not allowed to use PWM dimming on LEDs because you may get your ass sued by Color Kinetics. They own a patent on this shit and are quite liberal when it comes to handing out the lawsuits.

  42. Karl says:

    Dom:
    For wire, don’t bother with the store bought lengths – the wire from a piece of cat 3/4/5 cable works just fine – I’ve used short lengths from telco 50 conductor cable, and it’s nice because each wire has its own color combination.

  43. stephen says:

    @ johny

    im no lawyer but last i checked unless your building their circuit they cant sue or if they do you can get it thrown out of court. lets face it you cant patent the action of pwm but you can patent the circuit. just build a different one.

  44. joe2 says:

    stephen, i wouldn’t be so sure about the fairness of our legal system…. as it stands now, a good lawyer can turn the most unfair thing into a prosecution, as long it has a small amount of grey area.

    combine that with the fact that our justice system basically is a matter of stacking money on the scales of justice, and suddenly something as stupid and unfair as patenting the action of pwm suddenly becomes very possible.

    monsanto patented THE PIG, as well as corn. absolutely unfair, unjust, and in no way should be legal, but our justice system let it happen.

  45. Adam says:

    The discussion of power consumption and frequencies reminds me of Tesla’s work with high frequencies

  46. Alex says:

    That’s a weird cap…the double one in the corner.I’ve never seen one before.And by the looks of it, it ain’t home-made…If anyone knows more about it, post a reply

  47. Mike says:
  48. Alex says:

    thanks mike…another cool one i’ve seen on digikey was a 400 Farad 2.7 volt cap…That’s some serious storing power.

  49. Mike says:

    Whoa, yea 400F is pretty impressive… also incredibly expensive I’m sure. Looks like the largest one DK has in stock now is 4000F, 2.5V, for a mere $250. I want.

  50. Joe says:

    The operating frequency of PWM (pulse width modulation) for some LED’s is indeed 2 to 3 KHZ’s and is a very real affect on some viewers! It is known as flicker fusion or critical fusion frequency and does not have the same effect on all viewers. Appropriate rigger for the consideration of human factors was not performed.
    mountainvision@hotmail.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,285 other followers