LTspice modeling of SMPS Filters - Page 1
Forum section: electronics / projects

author: sean0118
author_rank: Frequent Contributor
timestamp: October 10, 2017, 09:51:37 am
content: Hi everyone,I've been getting into simulating some switched-mode power supply filters in LTspice. There's a lot of material available online, but I still have some questions...I've been modeling common-mode chokes as coupled windings, but I'm unsure whether I should use ideal coupling (K1 L1 L2 1) or say 90% (K1 L1 L2 0.9)? Am I right assuming a lower coupling between windings increases the attenuation of differential signals? In the 'real world' what is the difference in inductance of a common-mode choke for both common-mode and differential signals?Also, with common-mode chokes, it seems common to put them on the AC input side of SMPS, but can they also be added to the output DC side?With regards to AC analysis, for an AC input filter is it best to have both the source and load (SMPS input) as 50ohm? Or should the SMPS input be modeled as a constant current load or similar?Also, why do the 1nF capacitors to GND in my attached simulation cause resonances if I plot Vout+? They disappear if I plot the differential of Vout+ and Vout-... I understand they are there to bypass common mode signals, but I'm unsure how to simulate that...Thanks everyone.edit: Image for anyone without LTspice:

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 10, 2017, 05:56:51 pm
content: This is a tricky subject:- You need to measure CM and diff, and match them up to observations.- CM chokes are not simple inductors, but complex elements all their own. Here's a curve fit I did of a VAC common mode choke:The R+L parts correspond to the flattened rising slope, characteristic of eddy currents in the laminated metallic core material. The dominant, naive model would be just R1, L1, C1, but as you can see, many more components are necessary to accurately capture the complex behavior of such an element. Even so, it breaks down above 10MHz, where I didn't bother doing it too accurately (and maybe their measurements are a bit questionable as well).I think they measured that curve for a single winding, the other open circuit; so the other winding will act as a 1/2 wave resonant stub, and that's probably what causes the notch (at 10MHz, represented by C2, L2 I think). Noteworthy that R5 is not physically realistic (it has to be DCR only), it could stand to be another R||L element.And ALL of this circuit, is simply the model of one winding. It's not the transfer characteristic between windings -- I don't have data for that anyway. Replace V1 with your entire circuit around L1, say, and you'd have the right impedance (if you're using this VAC part), but just for the one line.- Similarly, the capacitors need to be modeled. This is usually pretty straightforward, as film capacitors are pretty well behaved, and only their low impedance properties are important here (the finest details of loss, of Q factor, won't affect the filter much). An RLC series equivalent is usually the way to go.- The very circuit itself -- the layout -- should ideally be modeled as well. Traces have low-frequency-equivalent series inductance and parallel capacitance, and nearby traces couple to each other (the inductors have small k).All of this is not to make you feel hopeless about things. There are onlyfinitely manythings to worry about, and all those things absolutely can be measured, modeled and solved for. Such is the domain of engineering: a lot of busy work, driven by some smart theory, and often ultimately implemented by turning a bunch of knobs until it looks right.In actual answer to one of your questions: CM chokes are usually in the k = 0.98 range. Depends on type. In my above example, if it is reasonable to assume L2, L3 and L4 are the leakage between windings, then the total of about 2.5uH, in relation to the primary inductance (lowest frequency equivalent) of 37mH, gives k ~= 0.992. This is fairly exceptional, because nanocrystalline cores have very high permeability, but still not far off (about 0.99, versus 0.98 for most ferrite cores, or maybe down to 0.90 for powder (MPP) cores, if you happen to find such a thing used for CMC).CMCs can be placed on the DC side, yes: the difference is they don't filter FWB diode recovery noise.The source impedance can be 50 ohms (this is how most filter manufacturers rate their products -- there's also a 1/100 ohm asymmetrical test, or something like that). The load depends on what circuit you're looking at. If you're considering the filter performance during the AC input peak, where the FWB is conducting (low impedance), then the load is a big honking electrolytic, and the common mode impedance is whatever capacitance to ground, and to secondary side, is present (often capacitance from transistor tab to heatsink, from primary to secondary inside the transformer (these two are the most common offending sources, by the way -- you can model this as well!), and any Y capacitors added in these locations).Note that, anywhere you have L and C together, you also have an impedance, whether you meant to or not. This is Z = sqrt(L/C), the resonant impedance. Typically you'll have a large Z for common mode and a small Z for diff mode.Remember that a filter always has a load impedance. If you do not provide one, it will find one of its own, and it probably won't be what you were expecting.(Perhaps the response peaks at an unlucky frequency, corresponding to the filter's load being some parasitic resistance in the components.) The source being 50 ohms helps with this, and you can use that as the basis for damping the filter; you may want other resistances though, such as an R+C across the line to provide diff mode dampening (the diff mode is a rather low impedance, because leakage inductance is small -- a few uH -- and C is large, around 1uF), or a ferrite bead in series with a Y capacitor for CM damping.Distributing losses throughout the filter helps by making the filter response less sensitive to source and load impedances. Like the VAC core example: that flattened rising slope is very lossy (lots of R+L), so a filter can be well damped if it has a resonant peak in that frequency range.Oh, regarding measurements: you're applying a half CM, half diff signal, and measuring some mixture of the two at the load end. The definition of CM is (Vout+) + (Vout-) / 2, and diff is (Vout+) - (Vout-). Apply source voltages accordingly!Tim

author: macboy
author_rank: Super Contributor
timestamp: October 10, 2017, 10:37:56 pm
content: From my own experience playing with such things, my advice is so not forget to add realistic capacitor and inductor ESR (even if extremely low).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 10, 2017, 10:52:06 pm
content: Quote from: macboy on October 10, 2017, 10:37:56 pmYeah, even if each part is represented by a single order RLC (so, for the capacitor, RLC series; inductor, RLC parallel, usually also with DCR too), that's a long way towards getting realistic numbers. As you go up in order (each parasitic R/L/C you add to the model), it gets more accurate.The reason I gave the example I did, is because it shows how complex inductors can be. The difficulty is that there are contributions from the winding itself (some variation on a helical waveguide, if you like to read far too much about things as I do), as well as the winding over the core (a metal core is pretty conductive, so acts as one plate of a capacitor, against all the turns in the winding -- a distributed capacitance or transmission line effect; whereas ferrite has a high dielectric constant, and is lossy, so has a loading effect with dissipation), and the magnetic field penetrating into the core (in much the same way that skin depth arises as AC current penetrates into a conductor). All these factors lie within the passband of interest (0.1-30MHz), so models that are usefully accurate can get complicated very fast.Tim

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: October 10, 2017, 11:18:49 pm
content: Hi,ImpedanceThe OP shows modelling the SMPS filter in a 50 Ohm environment, 50input and 50load.This simplification will get you into trouble every time. If the SMPS output impedance was 50it would be trivial to get the rid of the noise. The input and output impedance of a power supply is low, very low.This is a mistake that some (many) filter manufacturers make.Modeling Common Mode ChokesThe relationship between the coupling coefficient and leakage inductance is:L (leakage) = Inductance ( 1 - K2)So a 1mH inductor with K=0.99The leakage inductance is 1mH (1- 0.992) = 19.9 uHSo simplified:K= 0.995 is 1% leakage inductanceK= 0.99 is 2% Leakage Inductance...This is true if K if K>0.9Having said that, I would model the leakage as an inductor, not as a coupling coefficient, to keep the ground continuous.You have to include all the parasitic elements in the circuit, ESL, ESR, self resonant frequency etc.. to be successful.Regards,Jay_Diddy_B

author: sean0118
author_rank: Frequent Contributor
timestamp: October 11, 2017, 10:55:36 am
content: Thanks for the responses everyone, it's going to take me awhile to get my head around all of the concepts.Quote from: T3sl4co1l on October 10, 2017, 05:56:51 pmThanks Tim, that's a very interesting model, I wish my network theory was that good. Just to check, you used a network analyser or similar to measure the response of one winding, then made the model to fit the curve?Quote from: T3sl4co1l on October 10, 2017, 05:56:51 pmThe capacitors are modeled with series R of 0.2ohm (it's just not visible on the schematic) and the CM inductors with series R of 0.4ohms. I'll look into adding series inductance to the capacitors, good idea.Quote from: T3sl4co1l on October 10, 2017, 05:56:51 pmBut they can all be modeled to aninfiniteaccuracy, so I'm screwed!Quote from: T3sl4co1l on October 10, 2017, 05:56:51 pmDoes the leakage inductance act as a differential mode filter? Even 1% leakage is quite large inductance seeing that alot of CM chokes are in the tens of mH range.Quote from: T3sl4co1l on October 10, 2017, 05:56:51 pmWhy is this? Would a large Z for diff mode lead to instability?Quote from: T3sl4co1l on October 10, 2017, 05:56:51 pmI had 10ohms in series with 2.2uF across the line at the SMPS input, but I took it out when I posted it, I should have left it in.Quote from: T3sl4co1l on October 10, 2017, 05:56:51 pmOkay I see what you mean, would this be the right source for a CM measurement? What should the source be for differential measurements?

author: sean0118
author_rank: Frequent Contributor
timestamp: October 11, 2017, 11:34:10 am
content: Quote from: macboy on October 10, 2017, 10:37:56 pmThanks, I've added ESR, but it's not shown on the schematic, can only see it when selecting components in LTspice. There are a lot of other parasitics I should now add though, for example, I don't have parellel resistance or capacitance on the inductors.Didn't even know that helical waveguides were a thing! Still getting my head around rectangular ones.Quote from: Jay_Diddy_B on October 10, 2017, 11:18:49 pmThanks, I should have said, the filter I posted above would have AC mains on the left and SMPS input on the right. I see your point though and it's annoying that most (if not all) thwe filter datasheets I've looked at list attenuation for 50ohms source/load.So I guess the simulation I've posted is measuring attenuation of noise injected from the mains side, but if I'm interested in siming the noise injected from the SMPS back to the mains, how would I do that? What would source/load impedances be then? Would the SMPS input look like a current source?Quote from: Jay_Diddy_B on October 10, 2017, 11:18:49 pmThanks for the correct leakage inductance formula, I did not know that.Would the leakage inductance be in series with each windings or parallel to them? Looking at Tims model I think it's mostly series?I might go read up on 'self resonant frequency', heard of it, no idea how to model it...

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 11, 2017, 04:09:06 pm
content: Quote from: sean0118 on October 11, 2017, 10:55:36 amDatasheet curve, which would've used a NA of some sort, yes.Unfortunately they didn't measure winding-to-winding properties, so I didn't create a complete model of the component: just one aspect of it.QuoteUgh, hidden parasitics. One reason I HATE LTSpice.QuoteMathematician: "But I'll never touch her!"Engineer: "I'll get close enough..."QuoteYes, and yes. Check out the LF equivalent model for a transformer:Note that Xo/Ro includes a capacitor, representing winding capacitance. There is also capacitance between primary and secondary.This is shown primary-referred. A symmetrical model keeps Z2 on the secondary side.Actually, a couple of things should be rearranged, as far as the order of leakage inductance, capacitance and core inductance. But anyway, the correct ordering, and the level of complexity of each element, depends on the component being modeled, and the frequency range desired. So yeah.BTW, leakage physically arises from the inductance between windings, without core. If the windings are uncoupled without core (which is nearly the case for most toroids, where the windings are on opposite sides of the core, probably k ~ 0.07 without core), then the leakage inductance is simply the inductance of each winding (without core).When you introduce the core, the magnetizing inductance goes up, so k goes up. But the leakage remains nearly constant!QuoteJust the fact of the components: for a diff mode cutoff of 100kHz, and diff mode inductances (leakage) on the order of 20uH, you get Zo = 12.6 ohms (and C = 0.13uF).And again, CM impedance is mainly set by capacitance at the SMPS end, and Z of the chokes.QuoteNot quite: you've shorted out diff mode. Where the original source was, put 25 and 25 ohms, so the generator drives the tap between them. And, technically, the CM generator will be 37.5 ohms, since the 25's act in parallel for 12.5 ohm equivalent, and that equivalent acts in series. Right?Same thing at the load end, you can divide the 50 ohm diff resistor into two 25's and read Vcm off the tap, no need for postprocessing math.Tim

author: macboy
author_rank: Super Contributor
timestamp: October 12, 2017, 03:07:48 pm
content: Quote from: T3sl4co1l on October 11, 2017, 04:09:06 pmAfter adding the parasitic value in the normal way (right click component, fill in fields), you can Ctrl-right-click the component, then check the "Vis" box next to the paramters you want to be visible.