Staggering PWM to Reduce Power Supply Noise

NewLinuxFan

Well-known member
Is there a simple way to reduce power supply noise when several LED strips are at approximately 50% duty cycle (the loudest). I'm thinking a very basic solution would be to have half the outputs align leading edges and the other half align trailing edges. I saw the recent thread where somebody wanted to align the pulses (opposite) but didn't understand the low-level commands being used or the pages of AI answers. I'm looking for something very simple like this:

pins 1, 2, and 3: leading edge
pins 4, 5, and 6: trailing edge

Something more advanced would be to stagger everything so that leading and trailing edges never align, but I imagine that would take some coding work and math strategy.
 
If I'm not mistaken, I believe there's special chips you can get that adds jitter to the output. I know of at least one company that did this in their LED driver product so that they could pass noise certification.
 
They often are individually free-running PWM so are already at random phases to each other, although you might need a high speed camera to check this.
 
They often are individually free-running PWM so are already at random phases to each other, although you might need a high speed camera to check this.
That's a good point. I should probably ask them and get more details, if they'll tell me.
 
More power supply decoupling per strip, quite large values are needed, maybe 330uF to several mF, as the base frequencies are in the kHz range. Some strips have access to the power at both ends, try adding decoupling at both ends.
 
They often are individually free-running PWM so are already at random phases to each other, although you might need a high speed camera to check this.
As I think about this more, I think it was for making their box compliant, but not necessarily the strips.
 
What kind of strips? Individually addressed? Or dumb LEDs with PWM on the power?
I'm a bit slow to respond because I was sick. Appreciate the replies.

It's a single power supply and analog RGB strips connected to MOSFET switches. (Other projects of mine used digital LED strips but not this current project.) Very basic setup. In the past I've used long-life low-ESR capacitors placed after the fuses to the LED strips, but I'm hoping there's an easy coding fix for this issue.
 
You could try using analogWriteFrequency() to adjust timings. See td_pulse for details. For your example of using pins 1 through 6, pins 2 and 3 share a timer on Teensy 4, so using analogWriteFrequence() on pin 2 will also affect pin 3.
 
Since all of pins 1-6 are eFlexPWM, you could set some of them to be edge-aligned and some center-aligned. At 50% duty cycle they would be 90 deg out of phase. The eFlexPWM peripheral is pretty complex, but the eFlexPWM library (github) was built to work with T4.x and the examples work out of the box, so they give you a good starting point. You might find there are advantages to different pin selections, depending on exactly how your PWM signals are related. See the table in cores\Teensy4\pwm.c for eFlexPWM module and channel mapping by pin number.
 
Since all of pins 1-6 are eFlexPWM, you could set some of them to be edge-aligned and some center-aligned. At 50% duty cycle they would be 90 deg out of phase. The eFlexPWM peripheral is pretty complex, but the eFlexPWM library (github) was built to work with T4.x and the examples work out of the box, so they give you a good starting point. You might find there are advantages to different pin selections, depending on exactly how your PWM signals are related. See the table in cores\Teensy4\pwm.c for eFlexPWM module and channel mapping by pin number.
Thanks! I'll take a look. I use up to 18 pins sometimes, but if I can change half of them that could reduce the noise.
 
You could try using analogWriteFrequency() to adjust timings. See td_pulse for details. For your example of using pins 1 through 6, pins 2 and 3 share a timer on Teensy 4, so using analogWriteFrequence() on pin 2 will also affect pin 3.
That's an interesting idea. I have it dialed in the get 16 bits at the highest frequency, but there is some range to play with. The question is how often the pulse edges would align.
 
Back
Top