Active PWM filter - how not to pollute the supply rails? - Page 1
Forum section: electronics / beginners

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: October 05, 2017, 08:12:28 pm
content: Hi there.Say I have an active 2-pole filter to filter a PWM coming out of a MCU to create an analog voltage, which will be fed into analog circuitry.I thought then, this filter should probably be supplied by the analog rails. (like +/- 5V)But I suspect that all the fast switching (100 kHz or more) would pollute the analog supply rails.So I'm probably not entirely on the right trackBtw, my filter is a sallen-key setup, but using a bipolar transistor as emitter follower as the active element, which actually is fast enough for this as opposed to my cheap-ish opamps of choice. In LTspice it works nicely, and it's simple enough and cheap, so I wanted to go with that. (the BE offset is no problem)How is this supposed to be done?Thanks in advance.

author: Benta
author_rank: Super Contributor
timestamp: October 05, 2017, 09:07:21 pm
content: Use a fast opamp, they're not that expensive. And don't use Sallen-Key, there are better options (eg, MFB).

author: danadak
author_rank: Super Contributor
timestamp: October 05, 2017, 11:09:18 pm
content: Look at PSRR vs Freq for the OpAmp. As well make sure the supplyrail, at the OpAmp power pins, has good bypassing, like a low Z ceramic.Particular attention to Z vs F matters -If OpAmp driving significant load also add a polymer tantalum to pins as well.http://www.psma.com/sites/default/files/uploads/tech-forums-capacitor/presentations/is184-aluminum-electrolytic-vs-polymer-%E2%80%93two-technologies-%E2%80%93-various-opportunities.pdfRegards, Dana.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 05, 2017, 11:37:59 pm
content: Why would you suspect a filter would inject noise into the supply rails?A Sallen-Key filter uses a resistor between the input and the feedback capacitor, so there is a corresponding current flow I = V/R through that resistor, into the op-amp output pin, and therefore into the supplies. This is true at high frequencies, where the op-amp gain is low and the op-amp output impedance is modest.This hand-waving kind of analysis gives a worst-case figure, in this case. The current will normally be well under 1mA (say for a resistor value of 10k or more).Is your supply really that vulnerable that <1mA of PWM signal will affect it?Even better if you choose a 3rd order filter. The extra pole is always free: just add an RC in front of the filter. This only works because the pole is a real pole, and when the filter itself can be configured for a somewhat higher Q to account for the new filter type. Values are harder to calculate (they all interact, because the filter's input impedance is not simply the value of the first resistor, but complex because of feedback from the output), but calculators are available, or you can poke at it in SPICE or whatever. Anyway, with one passive pole out in front, high frequencies are shunted directly to ground first, and then the remainder goes on to the filter. You might end up with tens of uA into the supply, in this case.Tim

author: b_force
author_rank: Super Contributor
timestamp: October 06, 2017, 01:48:20 am
content: Quote from: Benta on October 05, 2017, 09:07:21 pmI don't see any reason why Sallen-Key would be that bad?In fact it's being used more often than MFB for a lot of reasons.You can even make a 4th order filter with just one opamp.If you can deal with a tiny bit of signal loss, it's also not hard to make a 2nd order filter with just two RC filters in series.You will end up with a 2nd order filter with Q=0.5IF you would get some noise on the power rails (which I don't find that likely) simply use a little RC network or a ferrite close to the pins.So you end up with a CRC or CLC (L = ferite).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 06, 2017, 09:49:52 am
content: Quote from: b_force on October 06, 2017, 01:48:20 amJust because it's popular, doesn't mean it's objectively good. It just means it's popular.Other examples:5552N3055, 2N2222 (I even count PN2222)PHPKardashiansetc.Tim

author: danadak
author_rank: Super Contributor
timestamp: October 06, 2017, 10:46:32 am
content: One never gets something for nothing. SK vs MFB, each have theirown advantages/drawbacks. SK high sensitivities to passive components,low to OpAmp Gain effects, the opposite for MFB. There are times oneeven desires specific high sensitivities, such as tuneable filters.https://www.embedded.com/design/real-time-and-performance/4007555/Circuit-Sensitivity-Analysis-An-Important-Tool-for-Analog-Circuit-Design-Part-2#http://www.ti.com/lit/ml/sprp524/sprp524.pdfRegards, Dana.

author: b_force
author_rank: Super Contributor
timestamp: October 06, 2017, 01:09:27 pm
content: Quote from: danadak on October 06, 2017, 10:46:32 amThis is exactly what I mean.It's just a bit of a weird statement to just say MFB is better, that really depends on the context.As long as it gets the job done and doesn't go into oscilation, who cares even?

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: October 06, 2017, 02:21:56 pm
content: Thanks for the input so far,why I would suspect that it pollutes the rails, well, I'm not knowledgeable enough to calculate how much of an effect that would have, it was a gut feeling that this could happen.When it comes to mixed digital / analog circuits, I have not yet created something beyond "basically works" i.e. not measured finer parameters of performance.If you can name a cheap opamp that can work in a e.g. 160kHz PWM LPF, please do, I only know a few opamps I've used for audio so far.(I doubt it beats one BC556 in price & area (routing), thoughBut if the discrete circuit sucks for other reasons, so be it an opamp)Does LTspice have one which would be able to do that for simulation? (mainly to verify the frequency response that the passive components form, assuming the employed opamp model performs reasonably well at the desired frequencies)Anyway,actually I was being inaccurate, the active part is a 2-pole S-K LPF, but as was suggested, I actually already slapped an RC behind that to get a 3rd order filter, as described in a PDF I found which specifically talks about PWM filters. I calculated the Sallen-Key part with Microchip FilterLab, and then fumbled in LTspice with the slapped-on RC to get results that fit my needs.

author: b_force
author_rank: Super Contributor
timestamp: October 06, 2017, 03:28:37 pm
content: What is the impedance of the next stage btw?Like I said before you can even get away with a passive filter.If your PWM is coming from a ucontroller, it's sometimes worth looking into a MFB filter connected as a differential amplifier.Inverting one of the outputs.That way you can a much higher output voltage and a very good filters at ones.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 06, 2017, 06:04:39 pm
content: Quote from: b_force on October 06, 2017, 01:09:27 pmThe context is component sensitivity. SK has worse sensitivity while MFB has low to optimal sensitivity (optimal being, any given change in the response is merely proportional to the given component).Especially critical in high order filters.Tim

author: b_force
author_rank: Super Contributor
timestamp: October 06, 2017, 06:22:39 pm
content: Quote from: T3sl4co1l on October 06, 2017, 06:04:39 pmThat could be, but in a lot of cases SK will work totally fine and there will be other considerations why SK would perform better than MFB.Ones again, you can't simply say something is better, there are many more factors than pure performance and 'sensitivity'.The fact that a MFB is inverting for example, to just name one.

author: David Hess
author_rank: Super Contributor
timestamp: October 06, 2017, 08:10:26 pm
content: I have done exactly what you are describing before and dealt with related circuits which had the same problems with supply and ground pollution.For a PWM signal which was then filtered, I added a CMOS logic gate on the analog side so that the noise on the digital supply did not modulate the output and the supply voltage to the gate could be closely regulated and then separately RLC decoupled it from the analog supply. The one time I had a problem with the filter, I added a third pole with a separate ground return to the input of the existing 2 pole active filter to remove the highest frequency content before it got to the active filter.Attention to the ground returns was required to prevent noise coupling through a ground loop. A solid ground plane is not always the best solution for this. Sometimes I have resorted to using a transconductance output (current) or instrumentation/difference amplifier to remove ground noise. Current or voltage baluns are also useful in some cases. One of the odder things I have done when working with an existing design was to cut a slot into the ground plane to route return currents away from sensitive nodes.

author: Pitrsek
author_rank: Regular Contributor
timestamp: October 06, 2017, 09:22:03 pm
content: With opamp based SK and PWM filtering I would definitely recommend to use 3rd order filter. If you go just for 2nd order filter, depending on PWM slew rate and opamp GBW, you might get nasty feed-trough from fast edges trought the first capacitor. Due to limited bandwidth of the opamp, the output impedance is not low anymore. Google for "Stop-band limitations of the Sallen-Key low-pass filter" for some more info. If you'd like something discrete with smaller offset, you might try diamond buffer. I can imagine that with discrete buffer, feed-trough might not be problem (still worth checking for tough).Currents are usually low, and power supply impedance is usually low as well. low*low=negligible . Never had a problem with it.Ground/power plane pair is helpful, as well as proper bypass capacitor selection.There are some quite nice videos from Steve Sandler(of picotest) about capacitor selection for flat impedance profile.

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: October 06, 2017, 09:25:57 pm
content: Quote from: b_force on October 06, 2017, 03:28:37 pmThe output of the 3rd, passive RC feeds into the emitter (via 470 Ohm) of a common base PNP, of which the collector delivers current to a current-controlled circuit, between 0...1mA.It's the amp bias input of the LM13700 powered by +/-15V, go on make comments about that arcane device and the high tension linesIf I pick out some likely DC case from the spice graph (the analog voltage isn't moving a lot) and look at what flows into that circuit and what voltage the node has, it's something between 1..2 kOhm. (doing anything more complicated than that, I have no clue about). So it probably does influence the filter, but the frequency response shown in LTspice looks usable. After all, I got the components for the passive LC by playing with spice, including the receiving circuit being present.And thanks for the additional replies added in between guys, lots of stuff mentioned I need to check out.

author: David Hess
author_rank: Super Contributor
timestamp: October 07, 2017, 03:04:28 am
content: Quote from: Pitrsek on October 06, 2017, 09:22:03 pmThe problem I had was coupling between two free running oscillators driving integrators when one was producing pulse width modulation. The remedial solution for me was adding a couple of LC decoupling networks. Had I known that it would be an issue, I would have used a different design with either synchronous operation from one reference frequency or a different oscillator and integrator design; the design I used was just unusually sensitive and a great accidental example of the power of synchronous demodulation.If you work with low jitter digital circuits, then coupling through power and ground becomes a primary limitation very quickly. This is especially the case with integrated logic.