How to deal with EMI and wire inductance on a LED PWM application? - Page 1
Forum section: electronics / beginners

author: Faranight
author_rank: Unknown
timestamp: December 06, 2022, 09:23:17 am
content: Hello, doing a custom LED lighting circuit with high-power LED's (up to 1A each) that are dimmable by 1.5 kHz PWM. The controller will drive multiple LED's that will be spread out by long wires up to 15 meters away (1 LED per wire). I'd like to minimize any potential issues with this design like current spikes and EMI. I've already done some research and tried to implement countermeasures, but I'd like someone to review my design to see, if I'm doing this correctly. I will show the circuit for a single LED channel. If any modifications are needed, I will replicate the them on other channels.Current spikesI've seen numerous circuits on online forums where people are using PWM on N-MOS switches to regulate speed of a DC motor (an inductive load). Most of these circuits strongly suggest to add a flywheel diode in parallel to the motor to reduce any current spikes. I know that long wires can also act like an inductive load, so I added a diode D2 in a similar manner. Is this ok/required?Reducing EMISecond issue I'd like to address is EMI. Long wires can act like antennas, and the fast switching of a mosfet causes ringing that can span up into the VHF/UHF regions. Though, many people teach us that it's not about the switching frequency, but rather the signal rise and fall times that determines the frequency domain we're operating in. Most solutions I've found deal with this by increasing the mosfet switching time by adding some extra components like a gate series resistor and shunt capacitor. I've added C2 to increase the gate capacitance, R1 series resistor to slow down gate dis/charging, D1 to speed up turn-off time when needed, and R2 to keep the mosfet turned off while the controller PWM pin is tristated. Component values are not yet optimized and can be adjusted, if needed.Will this approach be sufficient for my application?Thanks in advance.

author: jonpaul
author_rank: Super Contributor
timestamp: December 08, 2022, 03:15:37 am
content: Stock controllable LED ballasts are easily accessible commodity items.Dimming via industry standard DMX digital or 0..1V analog.Safety and EMI compliance 100..240V mainsno need for DIYjon

author: Faranight
author_rank: Unknown
timestamp: December 08, 2022, 08:14:41 am
content: I am sorry, I don't mean to sound rude, but it's just that your post fits into the category of "mildly infuriating". First, you're giving off the impression that you only posted in this thread as a pity for having 0 replies, your post does not answer any of my questions, and "no need for DIY" is not really the spirit of this forum.I already have the circuit design mostly finished, and I am working on finalizing the PCB layout. Just need to sort out some final details. Microcontroller firmware is also mostly done. I am thinking of adding an additional LC filter at the board LED outputs (inputs since I use a low-side switch). That should slow down the rise/fall times some more. Worst case I'll have to design a small test PCB with all the components and measure the EMI myself.Regards.

author: MrAl
author_rank: Super Contributor
timestamp: December 08, 2022, 08:46:13 am
content: Quote from: Faranight on December 06, 2022, 09:23:17 amHello there,Well after looking over a few things in your schematic i can see some things that need asking about.For one, what is the reason for C2 the gate to ground capacitor? The MOSFET already has significant gate capacitance and you usually work it with the gate resistor to get the switching speed to change.Second, why asymmetrical gate drive?If you want slower rise and fall times, the resistor would mean slower fall time but the diode would mean faster rise time at the drain. A single resistor with no diode would mean both rise and fall times would be shorter and thus reducing EMI.If you have a good reason for doing this though perhaps you can mention what that is.Third, using a microcontroller output pin to drive a mosfet probably means the rise and fall times will be slow already and that is because of the significant gate charge. Designs that want maximum switching speeds use gate driver ICs that are made just to drive MOSFETs. The typical output current for one of these guys is 1 amp. They act to charge the gate as fast as possible, or at least as fast as needed. A microcontroller output pin will most likely have maybe a 20ma limit (or something like that) so you may want to check the switching times before adding more components, although a resistor is a good idea to help prevent overloading the uC output pin. Since your uC has a 5v output for a logic high, a 100 Ohm resistor means 50ma max into the gate, but that quickly drops as the gate starts to charge up. At 1v the max is 40ma, at 2v 30ma, at 3v 20ma, and at 4v 10ma, and if your uC pin really gets up to the full 5v then 0ma at 5v.I think the back emf diode is a decent idea because what the two parasitic inductors end up forming along with the MOSFET is a boost converter. The output at the drain will have a tendency to overshoot the power supply source voltage like boost converters are by design meant to do. Thus the diode should be able to shunt that back into the power source with only a small increase in drain voltage. It will however cause some high current spike at the time the diode has to switch off, so it is a good idea to use a very fast diode like a Schottky or a zero recovery diode.The most important part of these kinds of designs is the testing after the first phase of the design is completed. You scope it out. This tells you exactly what you've got and what you haven't got. You then make modifications until you get what you really need.You can start with spice of course, but then take it to the bench with a prototype and scope and waveform generator or the actual uC chip programmed as needed.Of course you are probably thinking about efficiency too, which means you dont want to slow down the rise and fall times any more than necessary.As to a little theory on the switching speed in case you havent read this yet, the frequency components in an ideal rectangular wave go up approaching infinity, but the energy of each comes down as frequency increases. Lucky we dont even have an ideal rectangular wave. As you decrease the rise and fall times the wave ends up having ramping up and down portions and a ramp has less energy in the higher frequency components. Transmitters with lower power dont put out as much energy so it's a good idea to keep the power low when possible.It would be interesting to hear your answers to these questions and any other ideas you might have.

author: inse
author_rank: Super Contributor
timestamp: December 08, 2022, 09:56:24 am
content: I would like to understand how you are driving the LED.The supply voltage is 24V, the current 1A, what is the forward voltage of your LED?EMI, PWM frequency and switching losses all depend on each other.If you drive the LED with a lower frequency, you can control the MOSFET with slower slopes while still maintaining reasonable power dissipation and thus reduce EMI and also the freewheeling diode would be obsolete.Either do a simulation or a practical measurement on how to dimension the switching cell.Also for 5V gate voltage the asymmetrical driving is not necessary.It makes sense for driving it at high frequency with high gate voltage to symmetrize delay times.

author: Faranight
author_rank: Unknown
timestamp: December 08, 2022, 04:50:50 pm
content: Greetings!Thank you for the proposals, I do find them interesting.Quote from: MrAl on December 08, 2022, 08:46:13 amThe schematics are from an older design where I used to drive the mosfets near 100kHz and I had problems with the FET's turning off too slowly.Please consider D1 and C2 as DNP, I simply planned to leave the footprints on the PCB in case some further optimization would be needed.Quote from: MrAl on December 08, 2022, 08:46:13 amNo, I am using a dedicated PWM driver ICPCA9685to drive the mosfets. It's a 12-bit PWM driver with totem-pole capability on each pin with 25mA sink and 10mA source current at 5V. It works at 1526 Hz, but also has a clock input pin that can potentially be used to lower the PWM frequency. That is as long as the LED flicker isn't visible to the naked eye. I can easily see the 100 Hz flicker of some bad LED drivers, and I can't stand it.Quote from: MrAl on December 08, 2022, 08:46:13 amThis is true. I do plan to order some cheap test PCB's on JCL with the output circuit only and perform scope measurements with various components to see how the outputs behave.Quote from: inse on December 08, 2022, 09:56:24 amSorry, it's actually a LED array rather than a single LED. Several LED's in series can be driven with currents somewhat higher than 1A... Vf@1A is about 20V.I am limiting each output to 1A@24V with a series resistor since there is a similar current limit on the mosfet. I could go lower with current, if needed.Quote from: inse on December 08, 2022, 09:56:24 amThanks, I'll leave the diode unpopulated or maybe remove it from circuit depending on what the tests show.Interestingly enough, I've also been checking various tutorials on how to reduce the EMI of a PWM driver for stepper motors. A lot of people suggest to put a ferrite bead on the power lines close to the driver (between motor and driver). Perhaps I should consider adding one too on the outgoing cables or maybe even on the PCB itself.

author: MrAl
author_rank: Super Contributor
timestamp: December 08, 2022, 07:18:54 pm
content: Quote from: Faranight on December 08, 2022, 04:50:50 pmHello again,Oh ok sounds good :-)I forgot to mention the most modern way to reduce EMI in converter circuits. That's using resonant switching.A resonant converter would put out mostly a single frequency sine wave that would, well, just contain that one frequency component. If you worked at 1500Hz, then it would be 1500Hz, period.It's a much more complicated design however, you have to obtain a resonance to get this to happen as might seem obvious.Part of it is detecting when to switch on and when to switch off, and the other part is the resonant part.An interesting part of this is you switch during times when there is zero current (or zero voltage) and that means zero switching losses! The main reason for switching losses is because there is still current flowing through the drain when the transistor has to shut off, or when it has to turn on, and that gives us that ramp of current and voltage that dissipates real power. If you switch during a time when there is zero current there is no power dissipation during the switching transition.You could look this up on the web for further information. It is more complex but it's the ultimate solution for reducing EMI.You may find it helpful or may not or it may seem too complicated so you'll have to reach that decision yourself.If you do decide to do a resonant type, i'd love to hear about it.

author: John B
author_rank: Frequent Contributor
timestamp: December 08, 2022, 08:25:29 pm
content: My immediate thought would be a low side LC filter to reduce high dI/dt in the wires, but also keep in mind that there are discontinous currents being drawn from the power source too, which may benefit from it's own LC filter depending on the length of that wire. Something like this (component values purely for demonstration purposes)Falstad linkThe best way is still constant current control, then simpler schemes like constant off time/ peak current control chips. You can always use your existing PWM signals to dim an LED driver chip, HV9910B for example. Depending on how many drivers you need, component count and cost escalate quite quickly, and LED drivers are quite affected by the component shortages at the moment.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 08, 2022, 09:23:56 pm
content: Not reading in detail here, just dropping comments on the schematic, concerns mentioned, and some of mine:- Flyback diode is a good idea, and indeed wire inductance can total up some amount here. It should be fairly small (some ~uH; cable inductance goes as about half of \$\mu_0\$ or 0.6 uH/m; can be less if closely paired), so the 1A diode is likely overkill, but that's fine.- And the local bypass cap goes with that. Likely such a large value isn't needed either, but something is needed, so that's good.- Oh, at a glance it's not clear if this is one per LED, or many in parallel and this switch is common. If it's more than one, then, well -- I have no idea what a 5Q2364EE5 is, it doesn't turn up anywhere, maybe it's rated enough, maybe not, no idea. I'll assume one each for now.- C2 is bad: it doesn't do all that much to turn-on speed, and the LC resonance in the gate-source loop likely makes it oscillate in the transition region. A few to tens of ohms in series would damp that.- The reason it doesn't do much is Cgd is very small on modern MOSFETs. If this were like a IRF540 instead, it'll be more noticeable as far as slowing gate voltage affecting drain voltage speed, but it's less and less effective for this reason. Instead, consider an R+C from D to G, to increase (and stabilize -- the internal capacitance is very nonlinear, dominant at low Vds but almost negligible at high) the Miller effect.- Likewise, I don't get the speed-up diode on turn-off, that seems to be undoing things half the time. Note that drain swing (in terms of dI/dt or dV/dt) still isn't dictated strictly by that, because you could toss extra capacitance out there for example, which slows the dV/dt. Downside is, that capacitance also stores some energy that the LEDs might continue to glow on (depending on how far it discharges due to line inductance -- which we can't count on if lines are "up to 15m", not consistently long). So you might even want a pull-up resistor or FET to force the LEDs off.- There's also no short circuit protection, which, meh, maybe that's not too important either -- maybe the 24V supply is limited and the transistor is big enough to brown it out (including all caps in parallel!) or blow the fuse. Maybe total failure in this case is simply an acceptable sequence of events, that can be fine too.So, the better way to deal with transistor speed, is to return some Cgd, with damping resistance, so that Miller effect dominates the rise and fall; and some LC filtering may still be desirable for dI/dt, or gate dV/dt which will also control drain dI/dt (which is to say, R1 and D1). Filtering can also be added to the output, particularly if enough internal noise remains (say from PWM edges feeding straight through the transistor -- it's a tiny effect, but keep in mind, ~mV matter for EMI). Which might be as simple as a ferrite bead, or a CLC filter section (plus some damping R+C at the output so it doesn't ring).As for amount, preferably the emissions at the switch should be low enough that the wire length doesn't behave as an antenna. So, 15m, call it 1/4 wave at 60m or 10MHz, so we should be much slower than that -- >>50ns edge rate.We also can't be too slow, because the ~1kHz PWM needs some range of adjustment; that's a 1000us period, but 10% duty isn't much visual reduction yet only a 50us on-time already. And it takes more like 1% and below to get a significant reduction -- visual response is logarithmic, more or less, so it's quite demanding on PWM dynamic range. So, if we switch as slow as ~1us, that starts to eat into the duty cycle in the single-percent range, and we might want another method instead.Anyway, somewhere in that range, air on the side of slower switching, for insurance; if we say 500ns, and load current is 1A, then the load will swing 24V in 500ns with a capacitance (Cds) of C = I dt/dV or about 21nF. I'd use not pure C, but an R+C here, maybe 10R + 22nF. That limits peak turn-on current and the resistance makes oscillation less likely.For the Miller effect network (G-D), this is in ratio to the input resistance, and also assuming more than some minimum load current (if insufficient load current is present, the drain side simply won't rise fast enough to make Miller effect happen). If we say Rin = 100R, and the gain ratio is say 24V/5V, and we effectively have an integrator with Rin = 100R and Cint = Cgd making a ramp from 0...24V in 500ns, then: C ~ 680 to 1000pF should be right. And, at least 10R in series with it to prevent oscillation, but beyond that, this can be tested to see how round of a waveform you get.These two networks are exclusive, in that the hand-waved derivations above don't account for each other. Probably best is to use both but reduce each of their values by half or so, on the assumption that they will together drop the slew rate / bandwidth by a similar amount. So maybe 10nF + 10R at the drain/load, and 330pF + 10R at drain-gate. And that would be just R1, remove D1 and C2.And you could still use C2, which could affect some additional rounding-off of edges, but don't place it directly on the gate, either put some resistance in series (ca. 10R) as mentioned, or you could divide R1 in half say, and put it there -- in that case it acts to filter the input, rounding off the logic edges. Some nF would still be a fine value.Or increase R1 (or its respective splittings) and decrease C2 and the Miller (G-D) C, and increase Miller R, proportionally. Probably C2 on the order of Ciss is fine, so, whatever that is for the transistor.Tim

author: MrAl
author_rank: Super Contributor
timestamp: December 09, 2022, 04:43:35 am
content: Hello again,John B reminded me of something else too.Some LEDs are not supposed to be pulsed. It will state that in the data sheet though so that should be checked too.And yes constant current drive is the best even if you have to use a buck converter to get there with current feedback.Buck converters are not that hard to implement either, the simplest of all the true power converters.And talking about power converters, that also reminds me that PWM is not as efficient as using a true power converter like a buck. PWM can waste a lot of power depending on the input voltage and the voltage of the LED or LED string.

author: Faranight
author_rank: Unknown
timestamp: December 09, 2022, 08:57:47 am
content: Quote from: MrAl on December 08, 2022, 07:18:54 pmOh? I thought using a spread spectrum was the preferred way to reduce switching EMI. It's used with some switching buck/boost PMIC's.Not sure, if I'd be able to implement it with a PCA9685, maybe, if I continuously update the duty cycles with random deviations?As forT3sl4co1l, you've given me a lot to think about.Quote from: T3sl4co1l on December 08, 2022, 09:23:56 pmIt's aSQ2364EES. No idea why the KiCad's font makes an S look like a 5. Those RC networks sound like an interesting proposal to try out. I'll make a test PCB with RC footprints from DG, GS and DS to try out with various components and optimize the waveform, and I can easily measure the rise/fall times on the scope. I'll remove the D1 and C2 like you suggested.Quote from: T3sl4co1l on December 08, 2022, 09:23:56 pmWhat kind of short circuit protection you were referring to? There is a barrel fuse present at the 24V power input of the board (not drawn in the OP schematics). Its current rating will be adjusted depending of the cumulative power of the LED's when driven at 100% duty cycle. Let's say 8 channels of 1A gives 8A total, so a 10A fuse would be installed. Or did you have something else in mind?Best regards,-F

author: jonpaul
author_rank: Super Contributor
timestamp: December 09, 2022, 12:29:12 pm
content: EMI ...ferrite bead, eg clamp onwire inductance ...use twisted pair. not an issue anyway, as the LED gets DC feed.j

author: MrAl
author_rank: Super Contributor
timestamp: December 09, 2022, 06:18:15 pm
content: Quote from: Faranight on December 09, 2022, 08:57:47 amWell i think it depends on the basic switching frequency and resonate converters are not that common. But if you think about it, if you are only generating a sine wave at 1500Hz and only switching when the current or voltage is zero, how much can that really radiate?I suppose once you get up into the 100's of kilohertz it may become more significant.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 09, 2022, 07:13:50 pm
content: Quote from: Faranight on December 09, 2022, 08:57:47 amNamely, current limiting of the output, suitable to protect the device. The MOSFET is long since a lump of charcoal before that 10A fuse even thinks anything's happened. The simplest example would probably be a foldback current limiter, which takes another transistor and a couple resistors, per MOSFET. Although, there are some catches with that, which make it kind of tricky to use with LEDs. An alternative would be a flip-flop and comparator, which turns it off when peak current rises above a threshold, and the PWM input simply sets and resets the flip-flop (edge triggered 'on', level triggered 'off'). That will operate fast enough (~µs) to protect the FET while repeatedly triggering at ~1kHz. Of course if PWM comes from an MCU, you could potentially route a lot of functions through that, too (depending on how many GPIOs you can monitor with quick response, or have event inputs or analog comparators available; perhaps a combination of these even).At the very least, it doubles the pin count between controller and switches (i.e. some kind of current sense signal to MCU), or multiplies the components needed per switch channel. Meanwhile, LEDs should be a pretty stable load -- it's not unreasonable to choose the "charcoal" option -- the consequence might simply never happen.Not to forget: there's the option of self-protected MOSFETs, which integrate some combination of the above features, among others; they're very popular in automotive applications for instance, as they can drive lamps, relays, solenoids, or short circuits, without destruction (or, at least a greatly reduced risk thereof). They do cost more, but being automotive, they're surprisingly competitive.Tim

author: inse
author_rank: Super Contributor
timestamp: December 10, 2022, 06:54:27 am
content: Did you already calculate the power dissipation if you were doing linear dimming?Put an R/C network at the PWM output and convert it into an analog voltage.Thus you would get rid of all the EMC issues you are so afraid of.