Switch mode power supply filter - Page 1
Forum section: electronics / beginners

author: paulca
author_rank: Super Contributor
timestamp: March 05, 2018, 01:23:26 pm
content: Been through a bunch of articles and you tube videos and I'm still a bit lost.I have a PSU which produces two rails, +15v and -15v. However both have 50mVpp pulsing ripple. On a scope there are repeatative ringing pulses which I assume are inductor spike from the switching.I'd like to at least have a crack at removing them.So far I tried placing capacitors between a rail and ground, a 470uF + 100nF from each rail to "common/ground". This had virtually no effect which is a bit bizarre. Should the caps be across both rails, ie, the full 30V span? I would have thought this would be pointless as both + and - rails have the same noise, making it common mode noise. The GND/common rail is quite quiet (or so it seems on a scope, but really I am just connecting the scope GND and probe to the same circuit, so I won't see noise). Actually the fact the caps did nothing might suggest this is indeed common mode noise.One solution I found on the web was to place small ferrite ring inductors before the decoupling caps. Is this likely to work? I don't want to order them, even though they are about £1.50 for 10, if they aren't going to work.The project they power will consume around 100-200mA, the PSU is rated for 200mA. The project invovles lots of opamps and while I'm sure the ripple artifacts will probably not upset the audio signal, they make my scope look a mess when debugging and it's urk'ing me.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 05, 2018, 01:53:44 pm
content: Do you get the same ripple when probing ground to ground?Tim

author: Avacee
author_rank: Unknown
timestamp: March 05, 2018, 02:10:19 pm
content: What's the frequency or are they random?Does it go away if you turn off everything else in the room?

author: paulca
author_rank: Super Contributor
timestamp: March 05, 2018, 02:33:47 pm
content: Quote from: Avacee on March 05, 2018, 02:10:19 pmThe frequency is hard to get as the scope will not trigger on it properly. It's more a series of ringing pulses.Actually, here it is: ( wouldn't trust that freuquency as the scope was not triggering properly on it and the frequency was bouncing around all over the place ).It is present on the PSU rails, but not elsewhere. However it is also propogating through to the output of the amps to a lesser degree.Red is input (clean), Yellow is output, showing the PSU noise artefacts.https://imgur.com/a/owSEF

author: paulca
author_rank: Super Contributor
timestamp: March 05, 2018, 03:14:07 pm
content: Quote from: T3sl4co1l on March 05, 2018, 01:53:44 pmDo you mean probing two different but similar grounds? EG: The scope ground (test signal pin) and the project ground with AC coupling, or... do you mean probing ground relative to Earth? ie. attach the ground clip to an earth bond point like the Earth connector on my bench PSU and probe the circuit ground?I haven't tried either, but it's an idea thanks.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 05, 2018, 04:12:48 pm
content: If it's common mode, it will appear even on literally the same ground.What's actually happening is, the device overall has some voltage difference across it. Usually with respect to the power cable, or chassis, or any other connection. Equal and opposite reactions, this pushes current into the probe ground clip. Voltage drop across the ground lead is significant at high frequencies, so that clipping the probe tip to ground, actually measures the voltage drop across the ground lead.Tim

author: paulca
author_rank: Super Contributor
timestamp: March 05, 2018, 07:07:17 pm
content: Quote from: T3sl4co1l on March 05, 2018, 04:12:48 pmThe ground of the circuit is quiet. But that doesn't explain why capacitors won't decouple it to ground.Should I try the ferrite ring, LC filter or is it worth losing a volt or so using an RC or LRC filter?

author: Kalvin
author_rank: Super Contributor
timestamp: March 05, 2018, 07:14:19 pm
content: Try a simple LC PI-filter on both supply lines. Here is two design guides from a quick google search:http://www.ti.com/lit/an/snva489c/snva489c.pdfhttp://www.analog.com/en/technical-articles/designing-second-stage-output-filters-for-switching-power-supplies.html

author: paulca
author_rank: Super Contributor
timestamp: March 05, 2018, 07:57:56 pm
content: Thanks. This one looked like it was the ticket:http://www.analog.com/en/technical-articles/designing-second-stage-output-filters-for-switching-power-supplies.htmlUntil it listed the things I need to know to design it.Delta-Ipp ... no idea. Don't even know how to measure it and I can't anyway as the PSU is a potted sealed unit.ESR of the capacitor, no idea, it's output capacitor is inside it. If they mean "my" output capacitor, I don't know what it is yet and if I did I almost certainly don't have ESR figures for it.Switching frequency of the converter... datasheet says "typically 300kHz"... and so on... Some of them I don't even understand.Then it goes off into endless maths. The changes are a few bits of guessing will get me a filter that is acceptable to me, but not from that guide, this guide seemed designed for fully qualified EEs to perfect the thing. It even mentions that a basic LC filter will probably take care of almost all the noise done to 1mVpp, but doesn't even stop to suggest what that might be before delving off into the full on mathmatically approach with values I don't have and requiring test equipment I don't have to get.Here is an example.QuoteWTF? Right hand what?To summarise, not a beginner article. I have found a dozen similar articles that are way over my head.The TI one focuses on the INPUT filter for DC-DC non-isolated PSUs, I want an output filter for an isolated one.Experimenting with small ferrite inductors may lead me somewhere, but...What concerns me with just winging it, is that putting an inductor and capacitor into a circuit and getting the values incorrect looks awfully similar to a boost converter. It might be fine until I switch the unit off when the inductor collapses it's magnetic field and dumps a spike of 400V into my circuit. GreatScott on youtube has a great video showing what happens if you build the text book boost converter circuit on a breadboard using a manual switch. To summarise it sets the smoke alarms off.EDIT: I have seen a dozen FPV RC guys throwing inductors and capacitors into circuits to limit motor switching noise off their video transmittors. The only one who put a scope on the result had voltage spikes clean off the scope, both negative voltage and positive voltage, we are talking about 20Vpp spikes at least.So either filtering a PSU with ball park figures is not wise and the full mathematically approach is required, thus I can't do this and need a different, linear PSU or there is a "layman" way to get it "close" or "good enough" without endless maths.

author: Kalvin
author_rank: Super Contributor
timestamp: March 05, 2018, 08:11:29 pm
content: Yes, those articles were a bit heavy on math. Maybe this gets you going as it shows the basic principle with very little math:"DC-TO-DC CONVERTER NOISE REDUCTION"http://www.ti.com/lit/an/sbva012/sbva012.pdf

author: The Soulman
author_rank: Super Contributor
timestamp: March 05, 2018, 08:24:25 pm
content: Don't overthink this, if this isn't common mode noise an r-c filter should be sufficient to filter it out, well two actually one on each rail.Dropping half a Volt on the R should be plenty, choose the value of C for enough attenuation of the high frequency's, bigger of course means more attenuation. Also provide some capacitance near each op-amp.If the noise is common mode than it might not be even there without your scope connected, or it might..Showing some pics and/or schematics of your setup might help there.

author: paulca
author_rank: Super Contributor
timestamp: March 05, 2018, 08:34:17 pm
content: That shorter guide gives an example using a 100uH inductor and a 1uF capacitor. Isn't that a boost converter topology? That's a lot of inductance which will dump an awful spike of voltage when the power cuts... ? Or am I barking up the wrong tree?This is the PSU. (Yes their certificate has expired)https://xppower.com/pdfs/SF_JCA04-06.pdfAs to a schematic, if I plug this PSU into breadboard and give it 12V DC, commoning the ground on both sides I get the noise on the scope. It's an isolation PSU, if I don't give In and Out a common ground will it still work?I did not add the "Class B input filter", should I?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 05, 2018, 10:52:22 pm
content: Quote from: paulca on March 05, 2018, 07:07:17 pmThat was first things first. Now we can deal with normal (differential mode) filtering.Capacitor lead length matters, because physical length equates to inductance. They are proportional quantities. If, shared in common between the PS output loop and the measurement loop, the capacitor lead length is, say, 5mm, then those 5mm ~= 5nH shows up in series with the capacitor.The length from PSU output to capacitor lead also has inductance. Together, these act as an inductor divider, at very high frequencies. If they are of similar lengths, you won't have much attenuation -- regardless of the capacitor value!That may be what you are observing here.Simple fix? Swamp the cap ESL by throwing more inductance in series between the cap and PSU. 1uH would be enough (as you note, 100uH is kind of a lot).You want sqrt(L/C) on par, or lesser than, the load resistance of the circuit. So, 15V 100mA is 150 ohms, so you might want 50 ohms or less. An R+C2 in parallel with the C helps dampen it further, usually using C2 = 3*C or so, and R = sqrt(L/C).And yes, the same filter applies on the input side, give or take L and C values because of different V and I values.The noise measured between grounds may be a problem yet. For this, you need a small capacitor between grounds, and much more inductance. This is because of two things: one, this is a high impedance path, so C should be small, and L large; two, you usually want minimal C here, which means even higher Z and L. The inductance is provided by common mode choke(s). CMCs also have some diff mode inductance (leakage inductance), which can be used with, or as, part of the diff mode filter. This is how typical line filters work, and the same designs and concepts probably apply here.Tim

author: paulca
author_rank: Super Contributor
timestamp: March 05, 2018, 11:31:13 pm
content: So if I started with an LC filter using one of these:https://uk.rs-online.com/web/p/leaded-inductors/1350068/And one of these:https://uk.rs-online.com/web/p/ceramic-multilayer-capacitors/1365583/on each rail ... and retest to see if the noise has been reduced sufficiently?Also on mentioning inductance and capacitance being sensitive in these things I can assume a breadboard with jumper leads is not a good place to test it? A strip board is an option to mount the PSU and the filter. I don't want to do that if it's not essential as the PSU is expensive and I'd lke to keep the same one through prototyping into PCB build if possible. One soldering into a strip board won't hurt I figure.Sometimes I wonder if my lack of interest in learning mathematics will ultimately force me away from analogue electronics. It's not really a lack of interest, it's more about holding onto the information. I can watch or read a dozen tutorials in a maths concept, grasp what they are explaining completely, but have completely forgotten all about it 2 weeks later. I even have to revise simple things like rearranging equations.When I see articles like the first one mentioned, it's like chipping away at me.Goes like this.... I can take one or two, but when we getting 3 I'm out.1. Looks like it involves maths!2. Oh, quite a bit of it.3. Ahh! It involves trig, simultaneous equations or calculus.Nah, sod that.The trouble with noise is it's AC which involves 3. However thank you for trying to skip most of 3 in your explaination. Not sure I understand it fully, especially the later parts, but I gather a 1uH inductor and a 1uF ceramic is my best bet for trial and error. I'm not aiming for a silent medical grade rail, just one that doesn't make my scope traces look like they need deburred.

author: paulca
author_rank: Super Contributor
timestamp: March 23, 2018, 07:44:51 pm
content: Okay, so I got a chance to breadboard this stuff again.I have managed to kill the ripple, which was easy. I have also managed to half the spikes.First up I found my Tenma bench PSU is an noise antenna and even with it switched off I had spikes, so I powered the circuit from a battery and noted the residual noise with the battery disconnected was still present was much less. So I accept this as my environmental noise. A small pulse around 10mVpp at around 600kHz. No idea what it is, could be the PC. It's the only thing I didn't switch off while hunting for it, of course it could be the laptop running the DSO software.Anyway, here are my efforts. Please note I made a school boy error and had the probes set to X1 while the scope was set to X10, so all values on the snapshots should be divided by 10.In all snapshots the red (ch1) trace is the raw output of the switch mode PSU's positive rail. The load is a White LED w/ 1KOhm resistor, circa 11mA.With a 1uH ferrite inductor and 1uF low ESR tantalum filter on the output:With an 8uH inductor and a 1uF low ESR tantalum filter:With a 100mH inductor and 1uF low ESR tantalum filter ( just for giggles, but more inductance had little effect):With a 8uH inductor, a 1uF low ESR tantalum and an LM7812 linear regulator:With a 8uH inductor, a 1uF low ESR tantalum and an LM7812 linear regulator and a 1uF+100nF on the regulator output:So ball park figures (remembering the scope was set to x10 incorrectly) I have dropped the ripple to nearly zero and the spikes from around 32mVpp to 15mVpp.I figure I can live with that. I know I will still see it on the output of the opamps, but complaining about 15mVpp noise is getting petty.

author: paulca
author_rank: Super Contributor
timestamp: March 23, 2018, 07:55:46 pm
content: I could possibly even live without the regulator, which only chopped about 3mV off the spikes.Correction the capacitor is not a tantalum, it's a MLCC:KEMET 1?F Multilayer Ceramic Capacitor MLCC 50V dc ±10% X8L Dielectric

author: MosherIV
author_rank: Super Contributor
timestamp: March 23, 2018, 10:47:03 pm
content: QuoteErrrm, can I suggest get another power supplyAny work with Opamps needs a really clean power supply. You will probably never get rid of the noise to an acceptable level but trying will be a good learning experience. Trying to clean up a smps for opamps (unless it is for audio) isAt 200mA a simple linear should not be hard to make. Just make sure you get a dual 18V transformer, 15V transformer will not have enough head room for V regulators.

author: Jwillis
author_rank: Super Contributor
timestamp: March 24, 2018, 12:34:39 am
content: You can cancel the noise by using a split wound toroid with paralell capacitors . Since the currents are flowing in opposite directions on each rail ,equal winding's for positive and negative cancel the frequencies you don't want. You can also do this for a three rail as well by winding three coils on a toroid .I don't know the values ,like you I find the math sometimes overwhelming.The caps are added after the toroid in parallel positive to negative and from common to negative rail and common to positive rail on a three rail.

author: paulca
author_rank: Super Contributor
timestamp: March 24, 2018, 07:03:27 am
content: Quote from: MosherIV on March 23, 2018, 10:47:03 pmIt is for audio. A simple linear supply won't work as I want to power the thing from the "automotive" power range, 9-15V DC. So my only two options are single supply with virtual 1/2 Vcc ground or boost/buck SMPS. I'm going to preserver with the later unless it becomes far too much of a faff.I won't hear the spikes as they are ultra-sonic but I still want to limit them as much as possible.Quote from: Jwillis on March 24, 2018, 12:34:39 amThat would be a common mode choke, no? I've been tempted to order one, but as you point out, working out what kind, size etc. Is witch craft.

author: BrianHG
author_rank: Super Contributor
timestamp: March 24, 2018, 09:22:26 am
content: Do not put all your hopes in a linear regulator after the DC-DC supply. Depending on frequency and load, ripple and ring can be transmitted through.2 1-10 ohm resistors in series, or the right value inductors with 2 huge caps right at the output of the switching supply + 2 ultra low ESR caps after the 2 series resistors/inductors will kill almost everything giving you pretty much a battery clean output.Without your schematic, we cant see what you are doing and where you are measuring this noise from.Why not use a quality isolated DC-DC converter? Take in 9-18v, output +/-12 or +/-15v DC, regulated.These thing have gotten cheap today. A high end one, good for audio grade can be 15$ where as a decade ago, they would cost 50$.

author: MosherIV
author_rank: Super Contributor
timestamp: March 24, 2018, 09:35:50 am
content: QuoteOk, have you tried it out as is?Like you said, the noise is beyond hearing range.Although the opamp and main amp will have the noise, the physical speaker will a)act like a LR filter b) be physically unable to create the high frequencies.Just a thought.I was surprised that some audiophiles now like and use smps instead of linear psus.

author: BrianHG
author_rank: Super Contributor
timestamp: March 24, 2018, 09:39:48 am
content: Quote from: MosherIV on March 24, 2018, 09:35:50 amNeed citations please...

author: paulca
author_rank: Super Contributor
timestamp: March 24, 2018, 05:33:29 pm
content: Quote from: BrianHG on March 24, 2018, 09:22:26 amYou are correct, as the traces I posted show, the linear regulator did not tame the spikes much, a little, maybe took 40% off them, but it did clean other HF noise off the rail a little.More inductance didn't really make a difference. The PSU has a maximum capacitive load of 100uF, although I did try it with 470uF's on the rails, didn't remove the spikes.I have not tried with RC or LRC just an LC filter.Calculating inductor, resistor, capacitor values to remove a specific frequency pulse, without breaching the 100uF capacative load value will take more maths than I am capable of or care to try.QuoteIt's not worth a schematic. I am using an isolated low noise DC-DC converter with sub 50mV ripple (the marketing claim). Without spending a LOT more money this is the best I could get.The schematic is basically the +15V output wired series though an 8uH inductor with a 1uF MLCC bypass to "common" of the DC converter after the inductor. Standard LC filter circuit. Across the output of that was a 1K resistor and a white LED. The probes on the scope traces above, the red one was directly on the +15V output pre-filter the yellow one was on the - lead of the LED. OF course I then added a 12V regulator wired in the normal way with a 1u and 100n filtering it's output.If you consider things in perspective I am measuring spikes that have a Vpp of about 15mV with this filter in place. The ripple has gone almost completely, without having to use a large cap. I think I have done pretty well.The spike frequency is over 500kHz, it's not going to bother audio and the only reason I wanted to filter them down was because they made my scope traces look ugly.

author: Jwillis
author_rank: Super Contributor
timestamp: March 25, 2018, 01:35:13 am
content: Not sure if I' right but I came up with a 214uH 120 degree three winding balun for the three rail and a 214uH 180 degree balun for the two rail . Seems to concur with the frequencies you would like to filter Common Mode .The first caps after the coil should be around 6.8 uF probably tantalum and the second caps should be around .3uF probably ceramic would be fine. Made a little diagram for the 3 rail since you mentioned 15 volt and negative 15 voltI should mention that finding 120 degree coils is tough.But making them is easy.Made a few myself..well not 120 degree ones.

author: BrianHG
author_rank: Super Contributor
timestamp: March 25, 2018, 01:43:13 am
content: Don't forget, you need to cap the power input as well!!!The caps should be right on the pins of the DC-DC converter as well as a set at the output pins.If all you want to use is 100uf, use these guys: (I know the photo is wrong, they are 100uf 25v)https://uk.rs-online.com/web/p/aluminium-capacitors/8392183/

author: paulca
author_rank: Super Contributor
timestamp: March 25, 2018, 07:59:36 am
content: Yea, I was going to implement the input filter on the datasheet as well to see what difference it made.As the actual circuit it is supplying will initially be on another board I was going to put 10uF and 100nF power rail caps on it's power input as well as 100nF on the op amp power pins.On capacitors I was going to use this series, they seemed a balance on price and ESR. They are also small, only 5mm diameter and 2mm pitch.http://uk.farnell.com/kemet/a758bg106m1eaae070/cap-alu-polymer-10uf-25v-radial/dp/2614088Quote from: Jwillis on March 25, 2018, 01:35:13 amYea, I took a search and found nothing anywhere. Not made coils before.I am tempted to keep the PSU module separate to the circuit it will power, so I can change it or tweak it later, I don't think I should be all that worried about 15mV of 500kHz noise on an audio board. For now anyway.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 25, 2018, 08:20:06 am
content: Quote from: Jwillis on March 25, 2018, 01:35:13 amNote that filtering the two lines, without common, allows unbalanced DC. Namely, if the DC loads on the two supplies are unequal. This can easily saturate a common CMC. Better to use inductors, and you might as well use independent rather than coupled inductors, for better filtering.QuoteTriple winding CMCs are most common for three phase power -- in the 10s of amperes, for industrial applications. So, not very practical here.It may be better to use a four-line "data/power" choke.For low current applications (where compensated current is not a big deal), two-line CMCs can be connected in parallel. Example, filtering an SPI data port: you have four signals, MISO, MOSI, SCK and CS, and two power rails, VCC and GND. For the power lines, use one CMC (with relatively low winding resistance). For the data lines, use one winding of one CMC, each. Connect the spare windings in parallel with the GND or VCC winding, so that all CMCs share the same AC voltage.This can be extended to other ratios (between the data choke and power choke turns ratios), allowing some compensation of stray inductance, as you get for modest lengths of unshielded cables, say; but this isn't very practical due to uncertainty in that inductance.Tim

author: paulca
author_rank: Super Contributor
timestamp: March 25, 2018, 02:06:20 pm
content: I put together a schematic with two versions. I realise it's not really going to address any common mode noise, but I'd be grateful of your thoughts, corrections and even "DoH! You muppet!"s. Actually especially the later.I'm not entirely sure about "pin 9" on the DC Converter. Datasheet doesn't help. I assume it's common with pin 16, by connecting it to the input - I am making that the ground reference... I think.

author: BrianHG
author_rank: Super Contributor
timestamp: March 25, 2018, 02:32:51 pm
content: I would change the 22uf caps and most likely the way you wired out the circuit, unless you went for 0.01 ohm caps, at lower frequencies than the 100khz defined in most low esr caps. Layout and wire leads inductance and resistance counts here. They are what radiates the ringing throughout your circuit.Or, keep the 22uf, preferably changed to 100uf, low esr caps and add 1000uf or 10000uf in parallel.LOL, put a bunch of these all over your PCB, and if you have a good ground plane, there will be no noise. Though, it gets expensive... Also, at 15v, they will consume around 3ma each...https://uk.rs-online.com/web/p/aluminium-capacitors/1000066/

author: paulca
author_rank: Super Contributor
timestamp: March 25, 2018, 03:14:37 pm
content: The DC DC converter has a max capacitance of 100uF. I'll get round to layout soon. The 22u caps I believe are 0.07ohm.Note however that the capacitors do little to remove the spikes and on the breadboard it only took 1uF to remove the ripple.Which version, should I attempt to make the linear regulator section optional via a jumper?As long as it doesn't make things worse it's a winner.

author: Jwillis
author_rank: Super Contributor
timestamp: March 25, 2018, 04:20:05 pm
content: Oh shoot! sorry folks.That filter description was for second stage filtering at your output of the switching supply.Not for primary filtering.I was under the impression that there was already a primary filter and you wanted to filter out CM (common mode) and DM (differential mode) noise coming for supply.If you have no primary from mains that would be a good idea as well.That diagram is not for 3 phase.It's designed so that however you have your load it still cancels out the CM noise and the caps filter out the DM noise.The only thing was whether the values are right for between 500KHz to 1.5MHz since that seemed to me that's where the noise was.

author: BrianHG
author_rank: Super Contributor
timestamp: March 25, 2018, 04:57:41 pm
content: Quote from: paulca on March 25, 2018, 03:14:37 pmNot after your inductors, that spec is at the output pins.This is usually to prevent the internal voltage feedback reference from running the switcher in a haywire manner.The inductors allow that mv oscillation variation at the output pins to still be there. I doubt the power-up of the device will blow up your DC-DC converter with a 1000uf cap, especially after your filter inductors which will allow the switching oscillator to start up.This also doesn't count for the power input.

author: paulca
author_rank: Super Contributor
timestamp: March 25, 2018, 06:52:33 pm
content: So I gave a layout a go. Just couldn't get it without a few vias. I might, as usual, have one or two more goes at it.I tried to isolate the two sides ground, but I'm not sure if that is the correct thing to do and "pin 9" still bothers me. I'm fairly sure when I was testing it on the breadboard I did not common both sides of the PSU.I have 220uF of the same size sitting in my Farnell basket, so I can swap the 22uF for 220uF as late in the game as I need.

author: paulca
author_rank: Super Contributor
timestamp: March 25, 2018, 07:12:29 pm
content: Quote from: paulca on March 25, 2018, 06:52:33 pmI think I'm going to assume, then test that as this is an isolated supply that "Common" is secondary side only. +VIn and -Vin should be all the input side needs. The fact that the input pins are on one side of the blob and the two common pins sit beside the two output pins kind of suggests it belong to the secondary side.The datasheet they provide on their website is the "Short form", but I can't find a longer form to clarify.EDIT: I cleaned up the lower Via by swapping the regulators and flipping the output connector upside down. The input cross over via can be got rid off but it means flipping the DCDC converter around and running traces under it's length. Not sure which is worse.

author: Jwillis
author_rank: Super Contributor
timestamp: March 25, 2018, 08:10:55 pm
content: Although this is for a slightly different DC-DC converter .The general filtering would be about the same for primary and second stage filtering.http://www.interpoint.com/product_documents/DC_DC_Converters_Output_Noise.pdfSorry I didn't post the PDF earlier.I had to look for it and the older bookmarks on my back up drive.Knew it was someplace.

author: paulca
author_rank: Super Contributor
timestamp: March 26, 2018, 08:55:52 am
content: Quote from: Jwillis on March 25, 2018, 08:10:55 pmThanks, looks like a good read. I think I have the circuit right, but I'll see if I can pull any better values out of this without having to do the maths.I also note, they tend not to use large capacitors in any of these SMPS filter guides.

author: paulca
author_rank: Super Contributor
timestamp: March 26, 2018, 02:20:01 pm
content: If I put the filter in my schematic ... or most of those guides ... the LC filter into Spice i get a rather worrying Bode plot.It appears to ramp UP then spike to +60db at the resonant frequency and then continue to rise to +30dB by 1Mhz.Is this just a simulation artefact or what is going on?If I play with the values and put a 560pF in place of the 22uF before the inductor I can get it to attenuate a band around 100kHz, but with the values even close to those being proposed it only attenuates low freuencies and has a resonant spike around 10khz!EDIT: Think I nailed it by reading further into that linked document. By placing a tiny amount of resistance in series with the capacitor after the inductor it produces a very normal LP bode plot, removing the resonance and a cut off around 50kHz. Pushing a 500khz 50mV with a 15VDC offset through it and it comes out at less than 5mVpp. Of course this is simulated, real world with parasitics will be different.Also picked up that my PCB layout should really be using flood fills instead of tracks for the +15 and -15 traces to minimise parasitics in the traces.

author: TimNJ
author_rank: Super Contributor
timestamp: March 26, 2018, 05:25:25 pm
content: Quote from: paulca on March 26, 2018, 02:20:01 pmI think you basically figured it out. Basically, you've made an LC tank circuit which has the ability to resonate at a given stimulus frequency. You can't really prevent an LC circuit from "wanting" to resonate, but you can damp it sufficiently so that oscillation can't and won't happen. Use the smallest inductor value possible to get the amount of attenuation (at your problem frequency) that you need. More correctly, keep the inductance:capacitance ratio sufficiently low. If you decrease your capacitance, you should adjust L accordingly too.There's a variety of techniques you can employ to get some damping, as it seems you have discovered.http://www.analog.com/en/technical-articles/designing-second-stage-output-filters-for-switching-power-supplies.html

author: paulca
author_rank: Super Contributor
timestamp: March 26, 2018, 06:16:46 pm
content: Yea, when I got the end of that document I found they gave a full design, a few very low value resistors. I think I probably got away with things on the breadboard due to general breadboard resistance etc and may have made things much worse on an actual PCB.So I had a rather interesting afternoon in work, sitting on conference calls listening to every word that was being said (not) while designing an SMPS output filter in LTSpice

author: paulca
author_rank: Super Contributor
timestamp: March 26, 2018, 07:38:36 pm
content: So this is the simulation of what I've come up with below. (Photo bombed by Jullian Ilett!)R2 and R4 do somewhat depend on the ESR of the capacitors, but I have put values in, with the real datasheet value for the 22uF and an arbitary 0.05Ohm for the ceramic 1uF. I 'can' lower R2 and R4 but when I do I move closer and close to resonance.The only thing that slightly concerns me is the current isn't damped out as can be seen on the transient plot. If I increase the inductor it does become more damped, but it also rings or resonates at low frequency.Should I be concerned that the current continuing to oscillate will re-induce voltage noise further in the circuit?Input is a 15V DC + 500Khz Sine + 500Hkz Pulse spike. The ringing on the spikes will be above the 500Khz, probably multiple MHz, but as the bode plot suggests they will become increasingly attenuated, I think it's fine.

author: paulca
author_rank: Super Contributor
timestamp: March 26, 2018, 08:18:19 pm
content: Okay, figured it out. The higher the value of the series resistance the less current can pass the capacitors, so the less the current is damped.Using values of 220mOhm gives me must less current peaks and only a tiny amount of low frequency escalation which settles.I'd probably be better off ordering a range of values, though it seems once you go below 1 Ohm the price of resistors sky rockets.

author: Jwillis
author_rank: Super Contributor
timestamp: March 26, 2018, 10:22:53 pm
content: Ya I don't know why they get pricey.I know that as the wattage goes up they start getting expensive but that's because of the extra material used I suppose.Tolerances can go as low as 0.1% and even lower from what I understand. I can't see the reasoning behind using such a tolerance for such a low value.Normally if it falls around 5% that's sufficient for most applications. Maybe some could give an example where low tolerance low ohm resistors are used aside from current sense.I suppose if the application falls in the micro amp/volt range it would make sense.That's just a domain I don't enter for lack of the precision equipment.

author: TimNJ
author_rank: Super Contributor
timestamp: March 27, 2018, 03:22:54 am
content: Quote from: paulca on March 26, 2018, 07:38:36 pmI wouldn't say the current is "continuing to oscillate", per say. You gave it an input stimulus of 500kHz with a 500kHz short pulse, and the low-pass LC filter is doing its job to attenuate high frequencies according to it's frequency response (Bode plot). Looking at the output vs. input ripple, you can see there is significant reduction in amplitude. It's only "continuing to oscillate" because your input stimulus is also continuing.Your filter will only "oscillate" at frequencies in which its gain is greater than 0dB. (When doing AC analysis in LTSPICE, it is useful to use an AC amplitude of '1', as that will give the frequency response relative to 0dB.) On your Bode, between ~3kHz and 20kHz, the gain of your filter is >1 (equivalently, greater than 0dB). If presented a signal with frequency content between 3 and 20kHz, the filter has the potential to oscillate. In your case, there is very little gain (about 1dB max) in that range, so it is unlikely to cause much of problem with real world ESRs and loads.I drew up your circuit in LTSPICE, and then modified the L value so that the circuit has a huge resonant peak. In thise case, it appears at ~3.3kHz,as shown in the first attachment. Then, I applied 3.3kHz to the network, and lo and behold, it oscillates. You can tell it is truly oscillating because the amplitude of the sine wave component on the output is greater than the amplitude of the sine wave component on the input. (Another give away is that the amplitude grows over time.) With no resistance and no limit in output voltage, the amplitude of the oscillation would approach infinity. In this case, we see that the amplitude of the oscillation approaches a finite number.

author: paulca
author_rank: Super Contributor
timestamp: March 27, 2018, 06:13:03 am
content: Thanks. The thing that puzzled me more was that the voltage is attenuated to nearly 0, but the current remains quite high related to the input. I figure there is an obvious reason for this I haven't quite spotted yet.On the sub 1 Ohm resistors, I can always stack 1 Ohm resistors on top of each other. A little bit Magiver, but hey. Might not do noise any favours.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 27, 2018, 06:45:35 am
content: A couple of notes:1. Ideal sources are ideal.1a. A current source in parallel with a voltage source, is a voltage source. The current source can be deleted with absolutely no impact on the circuit.1b. A voltage source in series with a current source, is a current source. The voltage source can be deleted with absolutely no impact on the circuit.(Corollary: it doesn't matter which two nets a current source connects between, or which two loops are bridged by a voltage source, as long as the sums remain constant. This can be used to transform circuits, by splitting and combining sources, to optimize and solve DC/AC steady state circuits.)2. SPICE sources are ideal, unless they aren't. LTSpice has a bad habit of a. having the option of entering parasitics for a component (which, in and of itself, can be a nice convenience, but..), b.not showing parasitics on the schematicby default, and c. setting default values for you.Please check the properties for each component, and either turn off the parasitics, or show them on the schematic.3. All filters have real, finite, nonzero resistance. It is the resistance that does the work. Whether it's a source resistance (representing, effectively, how much work the source can deliver), or load resistance (a sink which dissipates the work delivered by the source), some resistance is fundamentally required. To have a meaningful filter circuit, and response, you must provide these resistances, preferably at the two ports of the filter. (Only one resistance is technically required, but that's more complicated. Note that any passive filter calculator you look up online only covers the double-terminated case.)4. Real filters are measured at 50 ohms, unless otherwise specified. (Mains filters are sometimes measured with asymmetrical impedances, like 0.1/100 ohms.)Filters with multiple ports are also tested per channel (normal mode), or with pair-wise combinations (common and differential mode).Note: a mains filter has four ports: two on the line side, two on the load side; all with respect to the fifth terminal, ground.You can take any pairs of ports and test them (so, a 2-line mains filter has 16 combinations), though for a specific purpose (like a mains filter), you'd never see a measurement like, Line-N to Line-L, or Line-L to Load-N.So, the simplest way to implement this: push the source off to one side, and the load to the other. The source and load are both voltage sources in series with 50 ohms (the Thevenin equivalent; or current source in parallel with -- the Norton equivalent). (To test one direction at a time, set one voltage source to zero as the load, and the other nonzero as the source.) Place the filter in the middle, connecting the respective pins and grounds.Use as many sources and loads as there are ports. So, a mains filter has two sources on the left, set to +1V AC and (+ or -)1V AC (depending on CM/Diff, respectively), and two loads on the right, set to 0V. (And vice versa, to test in the opposite direction.)After building this simulation test fixture, you will find good agreement (at low frequencies) between measured and simulated characteristics, say if you punch in the component values for a commercial filter. (At high frequencies, you need more parasitics. Typically, the choke has a resonance in the 10-30MHz range, and capacitors have ESL that must be accounted for. So, the circuit becomes somewhat more complicated.)Which is a good goal to pursue, by the way -- reproduce the measurements and component values of a commercial part, so that you understand what component values need to go where, to model a real component.Tim

author: paulca
author_rank: Super Contributor
timestamp: March 27, 2018, 08:55:53 am
content: Quote from: T3sl4co1l on March 27, 2018, 06:45:35 amEm, lots of useful information as usual Tim, but most of it went straight over my head.I was more or less copying the commercial design of the filter from that Crane document. Then modifying it a little to see if I could reuse the 1uH or 8.2uH inductors I have. Then seeing what difference capacitors and resistors have. The odd thing though, when I implement theirs as is it resonates badly in Spice and I need to add more damping resistance. They only had the ESR of the capacitors to damp the resonance. Although they did present a design with a 1 Ohm ESR 10uF, that's seems quite a high ESR for a cap, but I'm sure cheapo ones come close.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 27, 2018, 09:28:04 am
content: Quote from: paulca on March 27, 2018, 08:55:53 amThat's why I described a circuit to build. You should be able to reproduce the response first!Aside:Does paragraph formatting do nothing? Does italic formatting do nothing? Do lists do nothing? It seems like very few people read my lengthy posts. I suppose just as well, there's a competitive advantage thing there: if you aren't interested in reading it, you're no threat to me anyways, or something like that? Not that I'm worried about that sort of thing at all. It doesn't help me any, as I don't get any response either. "Over my head" doesn't tell me how much has actually been read, or how to better streamline it.Tim

author: paulca
author_rank: Super Contributor
timestamp: March 27, 2018, 09:57:35 am
content: Quote from: T3sl4co1l on March 27, 2018, 09:28:04 amFor me it seems very theoretical in nature. Or at least it reads that way. It seems academic and on the other end of the room from where I am. I am not a student of electrical engineering or mathematics. My engineering experience is in software. So when I read advice is posts I am thinking of "how do I apply this" either directly, practically or as a means to build a mental model and understand things.For some reason when I read a lot of your posts I struggle to grasp how I pick the new information and run with it.Consider that your points 1a and 1b appear to cancel each other out. "Are measured at 50Ohms"... why? is this a standard? My circuit doesn't produce a 50Ohm load, the load is variable, but probably will be around 75 to 100Ohms. I tried different loads and it made little difference, so I left it near the maximum so I could see what the input current did with regards the initial capacitor charge up current.Filter ports. What exactly is a filter "port"? The output? Does the positive output count as a port and the ground does it count?This is not a mains PSU it's a DC-DC switch mode PSU. So it provides two DC rails, rather than one AC input. So I sort of skipped the part about the mains filter.I couldn't quite grasp why you would put a 0V output voltage source to test input and sort of got lost on the point of that.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 27, 2018, 11:35:00 am
content: Quote from: paulca on March 27, 2018, 09:57:35 amAre you interested in becoming one? Autodidactically or otherwise.QuoteAh, there's a direct analogy in logic for that one --Consider evaluating the expression:1 && (foo == bar)The 1 short-circuits away as always true, and the expression reduces to (foo == bar). Likewise,0 || (foo == bar)reduces in the same way.A similar logic applies when using voltage and current sources.A basic toolkit is required to discuss anything in electronics -- you need to know how to draw a schematic, label a node (identifying all the parts connected to it), add up all the voltages around a loop, and apply KVL & KCL.Would you ask someone to write a sort algorithm in C without them knowing the grammar first?QuoteYes; there are underlying reasons, too (but we don't need to get into that, obviously).QuoteFair enough. You'll get different results (though not grossly different, only within a factor of two!) compared to 50 ohms, and you can tweak the circuit for best results in the circuit that way; but be careful what you're setting up and measuring. You need to model the entire isolated circuit -- a challenge even for experienced engineers!For mains filters, a 50 ohm standard is also used because it's not too far from the characteristic impedance you'd expect from real mains wiring (Romex or conduit). The real impedance will have peaks and dips away from 50 ohms, but if your filter also has a ~50 ohm impedance at radio frequencies, those regions will absorb (and potentially radiate) even less real power than a 50 ohm (matched) load will, so it's at least not hand-wavingly unfair.QuoteAh, a port, at its most basic, is a pair of pins, through which current flows -- and only those pins. So, an ideal port acts as an ideal transformer into a circuit.In practice, one side is usually grounded, so that a two-line filter (which has four pins plus ground) is a "4-port".A passive (two terminal) component is a one-port. A termination resistor, say. Or, I suppose you can say a resistor is an N-port, with no coupling to the other ports.Ports are used to abstract an RF block (typically filters, amplifiers, mixers..), just as you abstract a computer function with data flows. The port is the ABI, as it were.QuoteAh well, there's nothing different between DC and mains, as far as the filter is concerned (until you get the cutoff frequency down in the low kHz, anyway), so it's quite applicable I can assure you.Using 0V sources serves two purposes:1. Orthogonality or consistency. A source is a load, and vice versa; waves travel in both directions (very muchunlikecomputer functions, which are strictly one way, presently).2. Easy to turn around and test both directions, by simply changing the amplitudes.Tim

author: dmills
author_rank: Super Contributor
timestamp: March 27, 2018, 11:52:08 am
content: Nothing wrong with Tims posts that I can see (Sometimes I learn things from them).50 Ohms is something of an RF standard, and makes measurement easy because all of our standard network analysers and such are designed to that standard, it is also a reasonable sort of value and often close enough.I would note that those pulses of ringing are **FAST** they are probably going off at a few tens of MHz, not down near DC, and you need quite different filters to remove them compared to what you would need at low frequency.Think inductors of maybe 1uH or so and caps measured in terms of a few tens of nF, which must be ceramic and must have the shortest possible lead lengths (Rule of thumb, electrolytics for Hz to tens of kHz, tants (if you really must) to hundreds of kHz, ceramics above that).Big electrolytics and millihenry inductors will do nothing for you here, because up where that ringing is happening the inductors will look like caps and the caps like inductors, which is to say the parasitics will dominate.Taming small flyback supply noise is not all that hard, but you need to read the datasheets for the components and pick things where the SRF is high enough, then do a layout that respects the noises RF nature.Regards, Dan.

author: paulca
author_rank: Super Contributor
timestamp: March 27, 2018, 12:06:56 pm
content: On language I also understand that the language of electronics is effectively mathematics. Mathematics can be used to describe the relationship between things, how they interact and if you put values in, calculate cause and effects.Things like Ohms law etc. I am fine with, it's when you get into capacitors, inductors, and anything that involves a frequency that trigonometry raises it's head. Putting PI, sin(), cos() etc, into an equation I can probably keep up with, they are just functions and constants after all. But when it get's into things like simultaneous equations to get values out or quadratics I just switch off.

author: MrAl
author_rank: Super Contributor
timestamp: March 27, 2018, 12:10:38 pm
content: Quote from: paulca on March 05, 2018, 01:23:26 pmHello there,Did you try a post LC filter yet? That's the typical way to get rid of small ripple out of a switcher.A small inductor with large capacitor and ceramic capacitor takes the spikes down quite a bit. The inductor can be low inductance so you can use an air core device which you can wind yourself. Even 2uH and 100uf in parallel with 0.1uf will take the spikes down.An important point though is to NOT connect the feedback of the power supply to the output of the filter. The filter goes after the feedback. If you put the feedback after the filter you can get all kinds of oscillation so dont do that.So dont change the feedback at all, just add the L nad C and C to the output and see the nice results :-)I've seen this work on numerous power supplies, but one i remember is when myself and some other online users did a 300kHz power supply that used a Zetex chip made for use as an LED driver. Adding a small inductor and some capacitance took the 300kHz spikes down low.The other thing to watch out for is fake readings. If the scope picks up the noise from the inductor in the switcher it could look like ripple on the output. You may have to make your own low impedance probe, bu try the 1x setting first.

author: paulca
author_rank: Super Contributor
timestamp: March 27, 2018, 12:29:42 pm
content: Quote from: dmills on March 27, 2018, 11:52:08 amNo, there is nothing wrong with them at all. It's me who is at fault. I think me and Tim are on different sides of the room regarding understanding of electronics so I maybe lack the understanding to fully understand what he is telling me.As to whether I want to become an electrical engineer. Probably not. What I do want is to continue a progression as a hobby which involves challenges, solving them and producing practical, functional electronics. This I find fun.I can certainly do "Maker" style stuff of buying ebay boards and hooking them together and maybe introducing a micro-controller for logic and orchestration. However projects like this often throw me into the deeper darker worlds of analogue filters and I'm up to my neck in the intricate details and maths. Without the mathematic's background I struggle as I cannot "see" or "hold" the problem in my head.At the same time I can't expect to come in here and ask someone to design it for me. However, what I often hope for is that there is a "good enough" generic solution that can be explained fairly easily that will get me by the problem for now and provide me with a little understanding I can build on later.Back to context, trying not to forget the problem I'm trying to solve and the scope I'm solving it in. I am not going to spend months learning everything about SMPS filters, LC / LRC filters and iterating to get a perfectly quiet supply. The circuit will not effected that much by the noise anyway. I just wanted to make a "best effort" attempt at reducing it somewhat, without... and this is key... without actually introducing more noise, such as resonance from the LC circuit and making things worse.I might go with something like the Spice I posted, redo the PCB layout, and get the PCB made and built and see how it does. If it gets a net reduction in noise I will consider it a success and move on for now. I'm sure I'll be back to filters again, many times and hopefully each time I learn more and get better and ask less stupid questions.

author: TimNJ
author_rank: Super Contributor
timestamp: March 27, 2018, 04:28:20 pm
content: Quote from: paulca on March 27, 2018, 06:13:03 amDo you think the noise on the output voltage is attenuated to nearly zero just because itlookslike it's zero? I think the auto-scaling of LTSPICE is fooling you. You have an input signal with very high peak-to-peak amplitude, and so your output voltage looks nearly flat in comparison. In the same vein, your current signal is auto-scaled such that you can see it, so it appears pretty large.Let's do a quick sanity test.By my estimate, the peak-to-peak amplitude at n001 (blue) is approx 0.02V / ~8 = 0.025V. (Not a lot of resolution on the y-axis, so it's hard to tell.) With a 75ohm load, the peak-to-peak ripple current through the load should 0.025V/75 = 0.033mA. Now let's take a look at the peak-to-peak ripple current waveform through the 75 ohm resistor. My estimate is 199.365 - 199.343 = 0.022mA.0.033mA vs 0.022mA. Pretty close for an eyeball estimate.