DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: j-pee on March 16, 2025, 07:09:30 PM

Title: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: j-pee on March 16, 2025, 07:09:30 PM
hi,

It would be great to know for certain if omitting the resistor from the usual RC low pass filter is an okay thing or not?

The logic behind this is that there is a diode in the place of the resistor.
and since there is a voltage drop over the diode, it must be seen as a resistor...

Really many circuits -- I mean, PCB and veroborad layouts -- go about it like this...

So can we just use a diode and that's it?
or we do need the resistor too?

I mean:  9V -> diode -> capacitor (100uF) to GND ...
instead of 9v -> diode -> resistor (5O ohm / 100 ohm) -> capacitor (100/220uF) to GND

For example:
https://tagboardeffects.blogspot.com/2012/06/ehx-green-russian-big-muff.html
or
https://tagboardeffects.blogspot.com/2022/12/caline-cp-29-white-heat.html

So, please, make it clear for once and for all! :)

thanks in advance,

Peter





Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: PRR on March 16, 2025, 08:02:17 PM
Quote from: j-pee on March 16, 2025, 07:09:30 PMsince there is a voltage drop over the diode, it must be seen as a resistor...

Try a 6V motorcycle battery. Lots of voltage drop. May carry 100 Amps at 5V (1V of sag) so 0.001 Ohms, not a lot of resistance.

Why do you need an ABSOLUTE answer? Resistor is the cheapest electrical part. Just put one in it. It has many advantage. You can measure current directly. It can't pass "infinite" current. If you have a cap it is sure to reduce power ripple. Of course if you are charging NiCad cells you may not mind ripple.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: ElectricDruid on March 16, 2025, 08:10:04 PM
It's not an RC filter if it doesn't have an "R"! In fact, it's not really a filter at all.

Like PRR said, a diode isn't really a resistor, whether it has volt drop or not. How would you calculate the cutoff frequency of the RC if the R is a diode? It just doesn't work...

Do the job properly and put the resistor in. You'll get a reliable result, instead of something that might work ok most of the time.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: Rob Strand on March 16, 2025, 08:55:36 PM
The diode will filter but it works as a peak detector with the filter cap controlling the ripple.  The filter cap discharges via the load.  (It does filter.  It's a non-linear filter.)

The RC filter filters off the higher frequencies and ideally leaves the DC component ie. the average level.

The diodes filtering has little to do with the voltage drop; as mentioned already.

For an equivalent set-up with the same input ripple, same voltage drop across the resistor and diode, same load current:  The diode will produce about twice the ripple as the RC filter.  Also the ripple for the diode case will contain more higher harmonics (as the waveform is more more saw-tooth than sine).

This might be more convincing:

(https://i.postimg.cc/KKT2Zxfc/PSU-Filter-Diode-vs-Resistor.png) (https://postimg.cc/KKT2Zxfc)

The 150 ohm resistors represent other loads on the PSU which increase the input ripple.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: antonis on March 17, 2025, 05:03:22 AM
+1 to what said above.. :icon_wink:

A single capacitor after diode is just another reservoir cap..
(like the big one right after AC rectification configuration..)
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: Clint Eastwood on March 17, 2025, 05:57:24 AM
A diode, interestingly, does not act the same for AC and DC. For AC, like ripple, the impedance is quite low. So I say you have to use a resistor for adequate filtering.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: R.G. on March 17, 2025, 11:01:54 AM
Yikes. Some facts of all of this are correct. Rob's comments are very good, as usual.

@ OP: A diode acts differently depending on whether it is conducting DC, DC plus AC floating on it, or pure AC, and whether it's loaded with a resistor, a capacitor, an inductor, ...

If the diode is always conducting, its current never drops to zero, then it does have a resistance, but it's very, very small, and highly changeable. You can think about it as a 0.7V battery in series with a low (1 to 50 ohms, maybe) resistor. The resistance varies with the current through the diode. It's not an effective filtering resistance. In pedals, the power line series diode is just for reverse polarity protection, not for filtering. It's ineffective for filtering, as the posts said.

If the diode ever stops, starts, stops, starts, ... conducting, then it's better to think of it not in terms of resistance, conduction impedance, etc. at all. Instead think of it as a voltage controlled switch. If the voltage across it in the forward direction is greater than the diode turn on voltage, the switch is closed. If the voltage is less than the turn on voltage, or negative, then the switch is open.

These conditions reflect the difference in what we were taught as AC (or frequency) domain and time-domain. the difference is that AC or frequency domain is all about AC flow and frequency response. Time domain is purely about what current does with respect to current stopping, starting, how fast it ramps up or down, that kind of thing.

The diode you're talking about has essentially no bearing on filtering and AC domain. It's purpose is entirely time domain.

Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: j-pee on March 17, 2025, 06:10:45 PM
OMG :) :)

Thank YOU, gentlemen, it really is a privilege having your comments / advice / verdict.

I hope that this thread would be a reference in the future, changing the trend (of omitting that resistor) :)
Of course, it is not about what I do but how veroboard activists draw the layouts, with/out a resistor in the RC filter (in the power filtering block)...
I never feel an urge to modify any layout, I wouldn't want to omit anything, plus I'm happy when some parts of a circuit are clear to me in terms of what's happening there...

What I'll do: keep checking the layouts and changing "the diode" for a resistor to make the RC filter complete, and add the diode elsewhere (in the box), or add an extra row to the layout...

What I hope: layouts  in the future will tend to have functioning RC filters in the power filtering section...

Thank you very much!! :)

Peter


Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: Rob Strand on March 17, 2025, 06:17:03 PM
Perhaps something obvious but not stated is the diode adds polarity protection!
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: PRR on March 17, 2025, 08:27:17 PM
Quote from: j-pee on March 17, 2025, 06:10:45 PMI hope: layouts  in the future will tend to have functioning RC filters in the power filtering section...

Why? Batteries are quiet. Some switching supplies are quiet, more every year. We rarely used enough capacitance to absorb 50Hz-120Hz hum/buzz.

Do any pedal-reviewers keep a crappy $9 supply to test with?
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: Rob Strand on March 17, 2025, 09:15:37 PM
Quote from: PRR on March 17, 2025, 08:27:17 PMWhy? Batteries are quiet. Some switching supplies are quiet, more every year. We rarely used enough capacitance to absorb 50Hz-120Hz hum/buzz.

Do any pedal-reviewers keep a crappy $9 supply to test with?
Batteries fix most problems but filters only fix some problems.

Isolation is another 'fixer' to throw in but it needs to be done right.
Batteries are isolated by nature.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: drdn0 on March 18, 2025, 02:19:22 AM
Quote from: PRR on March 17, 2025, 08:27:17 PM
Quote from: j-pee on March 17, 2025, 06:10:45 PMI hope: layouts  in the future will tend to have functioning RC filters in the power filtering section...

Why? Batteries are quiet. Some switching supplies are quiet, more every year. We rarely used enough capacitance to absorb 50Hz-120Hz hum/buzz.

Do any pedal-reviewers keep a crappy $9 supply to test with?


Because using disposable batteries instead of a <1c component isn't particularly great for the planet if we want to keep inhabiting it.

I don't think mains buzz is much of an issue with most power supplies
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: antonis on March 18, 2025, 06:29:25 AM
Quote from: j-pee on March 17, 2025, 06:10:45 PMWhat I'll do: keep checking the layouts and changing "the diode" for a resistor to make the RC filter complete

This is a good "rule of thumb" for 1:Low current circuits and 2:Not well regulated power supplies..

In case of No 2 not true, the filter is retundand and in case of No 1 not true, filter's resistor(*) eats substantial working voltage.. :icon_wink:

(*) Of course, you can set its value low enough for affordable voltage drop but this will result into big value capacitor (for retaining the filter's RC product..) 

P.S.
Part of eaten voltage can be countervailed by placing reverse polarity protection diode in shunt configuration.. (running the risk of power supply potential strain..)
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: ElectricDruid on March 18, 2025, 07:19:06 AM
In the case of circuits with a higher current drain, one simple solution to the volt-drop across the filter resistor is to run the circuit on 12V instead of 9V!  :icon_biggrin:

After all, if you've got a few volts more, you won't miss a couple here or there.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: antonis on March 18, 2025, 08:51:37 AM
Quote from: ElectricDruid on March 18, 2025, 07:19:06 AMIn the case of circuits with a higher current drain, one simple solution to the volt-drop across the filter resistor is to run the circuit on 12V instead of 9V!  :icon_biggrin:

 :icon_lol:  :icon_lol:  :icon_lol:
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: aion on March 18, 2025, 10:56:29 AM
Doesn't the power supply impedance act as a baseline "R"? So any filter capacitor would already be part of an R-C filter. I think this is accounted for in Rob's simulation with the 20R resistor at the beginning - but I just want bring this out front since I don't think anyone has stated it explicitly.

A series resistor is just adding more resistance, significantly improving the filter that already exists. But you can also significantly improve it by increasing the capacitor size, which doesn't impact the supply voltage at all.

I assume you (OP) would know to account for the current draw of the circuit when deciding the size of resistor to use, and you'd know not to throw a 100R resistor onto a BBD delay. But inexperienced people reading this might only take away a notion that "no resistor is bad, always include a resistor" without knowing the particulars. As they get into more complex circuits with higher current draws, at some point the resistor is going to burn out, or cause enough of a voltage drop that the circuit doesn't perform correctly.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: antonis on March 18, 2025, 12:33:39 PM
Quote from: aion on March 18, 2025, 10:56:29 AMDoesn't the power supply impedance act as a baseline "R"? So any filter capacitor would already be part of an R-C filter. I think this is accounted for in Rob's simulation with the 20R resistor at the beginning

Rob also stated that it is a non-linear filter.. :icon_wink:
(it works as a filter only during diode(s) conduction angle..)

Otherwise, reservoir cap size should be decided according to that "R"C product and not to load current in conjunction with desirable ripple, as it is widely implemented..

Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: ElectricDruid on March 18, 2025, 07:32:39 PM
Quote from: aion on March 18, 2025, 10:56:29 AMDoesn't the power supply impedance act as a baseline "R"? So any filter capacitor would already be part of an R-C filter. I think this is accounted for in Rob's simulation with the 20R resistor at the beginning - but I just want bring this out front since I don't think anyone has stated it explicitly.

Yes, that's true, and you're right to make it explicit. Even if there was only a wire (no diode) from the power supply to the cap, there's still *some* resistance, so there's still an RC filter at some frequency.

The point is that unles you specifically put the R in, you don't really know *what* that resistance is, and you don't know what the cutoff frequency is. If you add the resistor, you have a "worst case scenario" defined right there (any other resistances will *add* to the one you've put in). If you can live with that worst case scenario, you're all good to go! ;)
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: R.G. on March 18, 2025, 08:08:33 PM
We're being too gentle here.

Diodes are so little worth as filters that the should be ignored in nearly all cases; and this is one of those cases.
Replacing the polarity protection diode with a resistor in hopes of getting more filtering is nearly as useless, for the many reasons already cited.
Fundamentally, the OP thinks that the diode and cap are there to filter. That is not true, and is a distraction. The diode is there purely to prevent reverse polarity damage.
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: ElectricDruid on March 18, 2025, 08:28:11 PM
Quote from: R.G. on March 18, 2025, 08:08:33 PMReplacing the polarity protection diode with a resistor in hopes of getting more filtering is nearly as useless

I thought I understood this, but I don't understand this sentence. The diode doesn't provide any effective resistance, so doesn't make a good filter with the capacitor - we agree about that. After all, that's not it's job or why it's there. But *replacing* it with a resistor will absolutely get you more filtering, won't it? Bigger R or bigger C or both is better filtering.
Ok, you'll lose the *polarity protection* that the diode gave you, but that's a separate thing, and the reason why you really need *both* the diode *and* the resistor.

RG? Is that not right?
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: Rob Strand on March 19, 2025, 12:32:36 AM
On the whole the OP's questions and misunderstandings have been answered.

As with most things if you think about it there's more to it than meets the eye.

If you have heap of ripple, say in the extreme where the input is a rectified but unfiltered waveform (ie. no pre-diode filter cap) the diode + cap will peak detect.   The ripple will now be set by post diode filter cap.    Because the diode is peak detecting the output voltage will be high.    The ripple perhaps a bit more.  The resistor cannot peak detect, since the output voltage of the filter is the average DC level the the output will be 0.64 times the peak.   So even with very small (no resistor) the output voltage will be less than the diode case.  Also we would expect the output ripple to be quite high for resistor.

Now go the other way suppose we have a tiny amount of input ripple, say < 100mV.   The diode won't turn off, the diode essentially passes the output current all the time and the output cap doesn't act much as a reservoir.  In that case the output waveform with the diode would be expected to track the input.  So it doesn't actually filter any/much ripple.    The resistor will still act as a filter and reduce the ripple, almost by the same reduction factor regardless of the size of the input ripple.

So there's only a small range of ripple voltage where we can make comparisons.   For large ripple the diode wins and for small ripple the resistor wins and with very small ripple the diode does very little.

EDIT:
So it seems this is the case.

For the example circuit I gave earlier.  Very roughly:   if the input ripple is less than about 1.45Vpp the resistor produces less ripple and when the input ripple is more than 1.45Vpp the diode produces less ripple.

(The conclusion (rule of thumb) I gave earlier that the diode is half as good is only true when the input ripple is about 1Vpp.   I probably came to this conclusion because the I considered input ripples of 0.5Vpp to 1.0Vpp.)
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: R.G. on March 19, 2025, 04:19:31 PM
Quote from: ElectricDruid on March 18, 2025, 08:28:11 PM
Quote from: R.G. on March 18, 2025, 08:08:33 PMReplacing the polarity protection diode with a resistor in hopes of getting more filtering is nearly as useless

I thought I understood this, but I don't understand this sentence. The diode doesn't provide any effective resistance, so doesn't make a good filter with the capacitor - we agree about that. After all, that's not it's job or why it's there. But *replacing* it with a resistor will absolutely get you more filtering, won't it? Bigger R or bigger C or both is better filtering.
Ok, you'll lose the *polarity protection* that the diode gave you, but that's a separate thing, and the reason why you really need *both* the diode *and* the resistor.

RG? Is that not right?

The key word there is "nearly". As noted before, a resistor drops the voltage at the same time it filters. There is an inherent limit on how much you can drop voltage into a pedal circuit before it starts to affect the circuit, for better or worse. The amount of filtering available is limited by the need to make the resistor "low" to avoid voltage drop and "high" to get better filtering. It's a double bind. Sure, every milli-ohm of resistance lowers the corner frequency of an R-C high pass filter; but should we string many feet of wire in series to the filter capacitor just because the milliohms add up?

A test of reason should apply: will a small resistor added to the bulk filter cap in the pedal get you to a frequency cutoff you need? Will adding a 10 ohm resistor help? A 100 ohm? Is that a tolerable voltage loss?

I personally don't like inserting a diode drop for just this reason. I developed a couple of polarity protection circuits that protect against reversal and have voltage drops under about 10-50mV for just this reason. I only accept a Schottky protection diode under duress.  :)

This whole thread is based on some faulty premises. These are that (1) protection diodes have anything to do with filtering, and (2) that replacing the >protection diode< with a resistor can get you any usable filtering. It would be far better to take a systems view and ask what and why are you filtering?

Is your DC power into the pedal so humm-y and noisy that you have to design your pedals to fix that? Wouldn't it be better to use a quieter power supply? Those exist - I know one of them intimately - and are not expensive.

If you're stuck with a noisy DC supply, some modern LDO regulators could give you, say, 8Vdc while suppressing hum by 46-50db. Maybe better than messing with swapping resistors and diodes.

I sympathize with the OP, it's fascinating to just swap a couple of parts in isolation and think that you've done an improvement. But if that was really possible, the original circuit designer, if they were good, would already have done it.










Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: j-pee on March 19, 2025, 05:00:09 PM
Quote from: R.G. on March 18, 2025, 08:08:33 PM... the OP thinks that the diode and cap are there to filter.

With respect, I don't :)

The OP keeps seeing vero board layouts with "9V -> diode -> 100uF cap to ground" blocks...
and he thinks that the layout creators did that because they thought a diode would be suffice (in the place of the resistor)

The OP, of course, might be wrong about that (too)


Take this example:
V 1.1 versus V 2
https://tagboardeffects.blogspot.com/2023/01/t-rex-mudhoney-v11.html



But PRR's argument about PSUs being silent these days is absolutely convincing! I'll adapt that approach! :)
(I'm really not a big pedal builder, nevertheless)

~
Title: Re: power filtering: evrybody omits the resistor from the RC filter -- is that OK?
Post by: R.G. on March 19, 2025, 08:35:29 PM
Quote from: j-pee on March 19, 2025, 05:00:09 PMWith respect, I don't :)
No problem. I should have read more closely.

QuoteThe OP keeps seeing vero board layouts with "9V -> diode -> 100uF cap to ground" blocks...
and he thinks that the layout creators did that because they thought a diode would be suffice (in the place of the resistor)

With respect, I think that may be mistaken. We usually can't know what was in the layout creators' heads when they put in a diode. I believe that they put in that diode for reverse polarity protection, or just because they saw it a lot on other layouts/pedals and didn't think about it much.

On the technical side, a diode is near worthless for filtering, and a resistor will have a tough time being both large enough to place the low frequency cutoff above line frequency to filter hum and simultaneously small enough not to steal too much voltage from the DC supply voltage. They are opposed requirements.

It is only my personal opinion, which may be wrong, that there should be neither a diode nor a resistor in that position. Instead, using a quieter DC power supply would be superior to both.

QuoteBut PRR's argument about PSUs being silent these days is absolutely convincing! I'll adapt that approach!

And he's right about that. I agree completely with you adopting quiet DC power supplies. If I were in your position, I would also remove the and insert a wire where it was. If polarity protection is needed/wanted, I would use either a bipolar or MOSFET polarity protector, circuits for which are at geofex.com.