Author Topic: Opamp follower and Sallen-Key filter behaving strange  (Read 2374 times)

0 Members and 1 Guest are viewing this topic.

Offline CircuitChaosTopic starter

  • Contributor
  • Posts: 13
  • Country: pl
Opamp follower and Sallen-Key filter behaving strange
« on: June 08, 2023, 01:02:59 am »
Hi.

I made this circuit (edit: for some reason inline attachments don't seem to work… images are attached at the end of the message).

1801235-0

It's part of a bigger project. Input (FILTER) will get signal from a VLF antenna amplifier (mostly 50 Hz mains hum) and output (PC_OUT) will be connected to the PC's sound card. VCC is 5 V (from 78L05).

I tested this circuit and it behaved strange – the output was severely distorted. When tracking down this „strangeness”, I came out with the following oscilloscope screenshot.

1801241-1

Yellow trace is the input (FILTER point) fed from a signal generator. Blue trace is the signal on pin 1 (IC301A's output – a voltage follower that I want to use to create a bias level for inputs of two other opamps).

Pin 1's DC voltage is correct, but it has ripples that correspond to the input signal (they're phase-shifted, most probably because of the RC network in the first, high-pass stage, but they correlate with the input signal's amplitude and frequency).

P301 is shorted during testing, and PC_OUT is disconnected.

Other observations:

• Removing R304 removes the problem
• R303, R304 and R305 were 1 kΩ first (and C302 and C303 47 nF), but it didn't make any difference
• VCC is stable and decoupled (and without any ripple)
• Voltage follower's input (IC301 pin 3) has a nice DC voltage on it

What can be wrong here?
« Last Edit: June 08, 2023, 01:04:50 am by CircuitChaos »
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1227
  • Country: ca
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #1 on: June 08, 2023, 02:52:52 am »
Possible crossover distortion from the LM324... Try putting a 10K resistor from pin 1 of IC301A to ground or VCC.
« Last Edit: June 08, 2023, 02:56:27 am by Kim Christensen »
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3144
  • Country: au
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #2 on: June 08, 2023, 03:09:44 am »
I was going to say the same thing. The first opamp will have trouble keeping it's output at part rail because of crossover distortion in it's output stage. The output stage driver has to swing 3xVbe to keep the output steady and it might not swing fast enough. It is conceptually the same as having backlash in a mechanical system. Try an opamp that is specified for audio usage.
 

Offline CircuitChaosTopic starter

  • Contributor
  • Posts: 13
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #3 on: June 08, 2023, 01:55:27 pm »
Thanks!

Unfortunately adding a 10k resistor didn't change anything. Do you recommend some other amplifier that might be better suited for this purpose (and can work from a single 5V supply)? LM2904 would be OK?

And, more importantly, is there a way spot such problems in the future? Is there a parameter of LM324 that would suggest that it will exhibit such crossover?
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6730
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #4 on: June 08, 2023, 04:22:21 pm »
LM2904 is LM358, a dual LM324. All have this problem and they are they only common opamps with this problem. Sometimes it's documented in the "application notes" section of some datasheets or sometimes it's not, it's a well known quirk at any rate.

Try 1kΩ if 10kΩ doesn't help, or maybe a big-ass electrolytic on the output. Capacitance normally makes opamps unstable, but sometimes really heavy loading with some ESR actually works out in practice, YMMV. Note that a cap will only reduce the glitches, not really fix the problem. However, it's more power efficient than class A biasing the opamp.

edit
As for alternative chips, pretty much anything is better than LM324/358. But most old opamps don't work very well at 5V and modern ones you may not have in stock. Some MCP6004 could be an OK upgrade for LM324.
« Last Edit: June 08, 2023, 04:27:29 pm by magic »
 

Offline CircuitChaosTopic starter

  • Contributor
  • Posts: 13
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #5 on: June 08, 2023, 09:52:15 pm »
Hi,

5 V is required, because in a previous stage I used LMP7721 that nominally runs on this voltage. I used it, because it has very low input bias current, and I need to amplify very weak signals from the antenna, but tests show that these signals are much stronger than I thought, so I think I'll redo the whole contraption and use a larger voltage, possibly a symmetrical one (maybe ±12 V or even ±15 V).

Basically, what I want to achieve is to ground the circuit (I made a separate earthing just for this purpose), then connect a piece of wire to the input (I want to repurpose my 20m dipole antenna for that), filter out everything below around 3-4 kHz (as 50 Hz is the dominant component), amplify the remaining signal, filter out everything above around 20 kHz (to avoid aliasing after sampling) and feed the result to the PC's sound card to receive VLF signals (basically, radio signals in the audible frequency band). I also want to control the first stage's gain to avoid clipping (but this monitoring is done by a separate circuit, and it seems to work).

In my drawer I also have TL071 (+ TL072 + TL074) – do you think it will be OK to use them in this project (both as a first stage amplifying the signal from the antenna, and in the output filter)? I heard they're obsolete, but looking at parameters, I don't see anything that would disqualify them… (but I don't have much experience with op amps, so maybe?).
« Last Edit: June 08, 2023, 09:59:35 pm by CircuitChaos »
 

Online srb1954

  • Super Contributor
  • ***
  • Posts: 1077
  • Country: nz
  • Retired Electronics Design Engineer
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #6 on: June 09, 2023, 12:18:21 am »
Yellow trace is the input (FILTER point) fed from a signal generator. Blue trace is the signal on pin 1 (IC301A's output – a voltage follower that I want to use to create a bias level for inputs of two other opamps).

Pin 1's DC voltage is correct, but it has ripples that correspond to the input signal (they're phase-shifted, most probably because of the RC network in the first, high-pass stage, but they correlate with the input signal's amplitude and frequency).

P301 is shorted during testing, and PC_OUT is disconnected.

Other observations:

• Removing R304 removes the problem
• R303, R304 and R305 were 1 kΩ first (and C302 and C303 47 nF), but it didn't make any difference
• VCC is stable and decoupled (and without any ripple)
• Voltage follower's input (IC301 pin 3) has a nice DC voltage on it

What can be wrong here?
The problem is that the LM324 isn't really up to the job for providing a "stiff" i.e. low impedance bias point for the other circuitry at the frequencies you are using.

The low O/P impedance obtained from a voltage follower is dependent on the feedback reducing the inherent open loop O/P impedance of the op amp. The degree of reduction is dependent on the gain of the op amp, which in the case of the LM324, has already fallen significantly from its DC value at the frequencies you are working at. The effect is that the O/P impedance of the voltage follower rises with frequency as though there was an inductor in series with the O/P. This rising O/P impedance effect is noticeable starting even as low as 10Hz. With the significant O/P impedance from the voltage follower the signal currents through R304 and R305 will develop a ripple voltage. The inductive O/P impedance will emphasise the higher frequency components of any distortion products in these currents producing the the spiky waveform you are seeing.

There may also be an element of coupling of noise back through the 5V supply rail since the filtering obtained from C301 is not that great and the O/P impedance of your 78L05 is starting to rise at your operating frequencies.

The solution is to get a much better op amp for U301A which has a much lower open loop O/P impedance and/or still has plenty of gain at your operating frequencies.

Or just ditch the voltage follower altogether! By lowering R301 and R302, so that their parallel combination is relatively small compared to the values of R304 and R305, and substantially increasing C301, to more that 10uF,  you will get a low enough impedance bias rail to satisfy the circuit operation. This will also improve the filtering of noise from your supply rail. Chose a capacitor that has low ESR and minimum impedance at your operating frequency. The disadvantage of ditching the op amp is that you will get slightly more variation of the DC operating levels due to the op amp input bias currents but this is not important as the circuit O/P is AC coupled.

 

 
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6730
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #7 on: June 09, 2023, 08:29:35 am »
You could use ±5V rails, which is enough for most vintage opamps including TL074, and power the LMP from +5V only if you want to keep it.

If the antenna is really a piece of insulated wire and nothing more, the ultra low bias may be advantageous. A completely floating input will be biased by leakage to some potential between the supply rails, this may or may not be within the valid common mode of whatever random opamp you might choose. Of course, some high value biasing resistor could solve this matter definitely, not sure how you are doing it now.

Or just ditch the voltage follower altogether! By lowering R301 and R302, so that their parallel combination is relatively small compared to the values of R304 and R305, and substantially increasing C301, to more that 10uF,  you will get a low enough impedance bias rail to satisfy the circuit operation.
Maybe the best solution, actually.
 

Offline CircuitChaosTopic starter

  • Contributor
  • Posts: 13
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #8 on: June 09, 2023, 03:14:41 pm »
You could use ±5V rails, which is enough for most vintage opamps including TL074, and power the LMP from +5V only if you want to keep it.
Actually, with such strong signals, I think it will be better to get rid of the LMP and do everything on TL07x.

If the antenna is really a piece of insulated wire and nothing more, the ultra low bias may be advantageous.
Yes, true. But it's a long wire hanging from a tree. Actually, I want to use my 20m dipole (two wires of 5m) – ground one end and use the other as an antenna (an E-field probe really). With my initial circuit (1 GΩ bias resistor, 100 MΩ resistor parallel to the antenna) it immediately overdrove the amplifier. When I reduced the parallel resistor to 10 MΩ it was still too much. I hope that 1 MΩ will be fine (I can't test it immediately because the antenna is in a different location and I have to bring the circuit with me to test it).

I think I'll do the circuit similar to the one attached now (it's only a concept, I'll do portions of it on a breadboard first to be sure that it works before I actually make the PCB). Comments and suggestions are, of course, welcome :) I'm not really advanced when it comes to analog circuits.

Or just ditch the voltage follower altogether! By lowering R301 and R302, so that their parallel combination is relatively small compared to the values of R304 and R305, and substantially increasing C301, to more that 10uF,  you will get a low enough impedance bias rail to satisfy the circuit operation.
Maybe the best solution, actually.
But will it even work with LM324? I can get rid of the voltage follower, but outputs of other amplifiers might exhibit similar behavior, right?

BTW, I just found this page:

https://halestrom.net/darksleep/blog/038_fakeopamp/

I have TL07x in SMD and THT packages, but SMD ones are marked with ST logo. Does it mean, for sure, that they're fake?

„The ST logo on the outside is WRONG, and ST does not make TI chips, so the epoxy has been yelling FAKE all around.”
« Last Edit: June 09, 2023, 08:26:30 pm by CircuitChaos »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6730
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #9 on: June 09, 2023, 04:40:54 pm »
ST does make TL07x chips, as you can easily confirm:

https://www.google.com/search?q=st+tl074+datasheet

However, fakes exist. There are fakes with TI logo too.
 

Online srb1954

  • Super Contributor
  • ***
  • Posts: 1077
  • Country: nz
  • Retired Electronics Design Engineer
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #10 on: June 09, 2023, 10:12:46 pm »

Or just ditch the voltage follower altogether! By lowering R301 and R302, so that their parallel combination is relatively small compared to the values of R304 and R305, and substantially increasing C301, to more that 10uF,  you will get a low enough impedance bias rail to satisfy the circuit operation.
Maybe the best solution, actually.
But will it even work with LM324? I can get rid of the voltage follower, but outputs of other amplifiers might exhibit similar behavior, right?
Yes, the other amplifiers will exhibit similar behaviour and that might cause your filter response to deviate from the expected design parameters. This will particularly apply to the ultimate stop band rejection you can achieve from the low-pass section. You are pushing the LM324 to its limits in this filter design.

The best option is to do some SPICE simulations and determine whether the performance is acceptable for your application. If the performance falls short you can easily try out different types of op amps to improve the response.

A word of warning: the op amp models used in SPICE are typically simplified macro-models that don't fully simulate all aspects of the op amp performance. It pays to check each op amp model in some test circuits before doing the full filter simulation to ensure that the model matches up well with the datasheet parameters.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5798
  • Country: de
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #11 on: June 10, 2023, 10:13:22 pm »
What's the point of IC301C?
Ditch it.
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3144
  • Country: au
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #12 on: June 10, 2023, 11:17:27 pm »
Just a quick question regarding component values. For a Butterworth LPF the feedback capacitor is double the value of the shunt capacitor. Same deal with the two resistors in the HPF. That’s assuming you were after a Butterworth response of course. Not sure what response equal value parts would give using a gain of 1. There are equal value Sallen-Keys but they have a gain of greater than 1.
 

Offline CircuitChaosTopic starter

  • Contributor
  • Posts: 13
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #13 on: June 13, 2023, 11:05:53 pm »
What's the point of IC301C?
Ditch it.
It's there, because the dominant signal will be around 50 Hz, and I want to get rid of it in IC301B. Then, the signal level will be (much) lower, so I want to amplify it before further low-pass filtering in IC301D.

Just a quick question regarding component values. For a Butterworth LPF the feedback capacitor is double the value of the shunt capacitor. Same deal with the two resistors in the HPF. That’s assuming you were after a Butterworth response of course. Not sure what response equal value parts would give using a gain of 1. There are equal value Sallen-Keys but they have a gain of greater than 1.
I'm not sure if I correctly understand, but it's not a Butterworth topology. It's a Sallen-Key, with gain = 1. Are you saying that Sallen-Key with gain = 1 shouldn't have components of equal value?

I attach another version, by the way (of the whole circuit – previously I posted only the filter). I tested some parts of it on a breadboard and it seems to work as expected, but comments are welcome…
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5798
  • Country: de
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #14 on: June 13, 2023, 11:26:10 pm »
What's the point of IC301C?
Ditch it.
It's there, because the dominant signal will be around 50 Hz, and I want to get rid of it in IC301B. Then, the signal level will be (much) lower, so I want to amplify it before further low-pass filtering in IC301D.
Soo... you feed around 2.5 VPP into an LM324 operating from a single 5 V supply biased at 1.67 V. This is already at (or over) the common-mode limit.
And then you want to amplify the signal further?
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5798
  • Country: de
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #15 on: June 13, 2023, 11:37:55 pm »
Just a quick question regarding component values. For a Butterworth LPF the feedback capacitor is double the value of the shunt capacitor. Same deal with the two resistors in the HPF. That’s assuming you were after a Butterworth response of course. Not sure what response equal value parts would give using a gain of 1. There are equal value Sallen-Keys but they have a gain of greater than 1.
I'm not sure if I correctly understand, but it's not a Butterworth topology. It's a Sallen-Key, with gain = 1. Are you saying that Sallen-Key with gain = 1 shouldn't have components of equal value?
Sallen-Key is a filter topology, Butterworth is a filter transfer function. Sure, you can have an equal value Sallen-Key filter.

 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3144
  • Country: au
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #16 on: June 13, 2023, 11:52:56 pm »
Just a quick question regarding component values. For a Butterworth LPF the feedback capacitor is double the value of the shunt capacitor. Same deal with the two resistors in the HPF. That’s assuming you were after a Butterworth response of course. Not sure what response equal value parts would give using a gain of 1. There are equal value Sallen-Keys but they have a gain of greater than 1.
I'm not sure if I correctly understand, but it's not a Butterworth topology. It's a Sallen-Key, with gain = 1. Are you saying that Sallen-Key with gain = 1 shouldn't have components of equal value?
Sallen-Key is a filter topology, Butterworth is a filter transfer function. Sure, you can have an equal value Sallen-Key filter.
Yes, but AFAIK you can’t have an equal value SK with a gain of one. See Don Lancaster’s Active Filter Cookbook starting at page 121.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5798
  • Country: de
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #17 on: June 14, 2023, 12:17:07 am »
Yes, but AFAIK you can’t have an equal value SK with a gain of one. See Don Lancaster’s Active Filter Cookbook starting at page 121.
Of course you can. But it'll only have a Q=0.5 which is not very good.
Don Lancaster likes to simplify things. Good for beginners and amateurs, not very useful for engineers.
 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 3153
  • Country: us
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #18 on: June 14, 2023, 12:38:30 am »
There's a 3rd Order Sallen Key Type Butterworth filter with a gain of 1 that uses equal valued components. Here's a thread that discusses such, we published this in EDN long ago!!

https://www.eevblog.com/forum/projects/7th-order-butterworth-filter-help/25/

Found this in our notebook, you can swap the R and Cs for a LP to a HP.

Edit: You can have just about any practical filter gain by scaling the first unity gain buffer to have the overall desired filter gain. We've utilized this unique filter structure many times over the years, and it's so easy with just a quad op amp and a few equal valued components.

Best,
« Last Edit: June 14, 2023, 11:56:20 am by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3144
  • Country: au
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #19 on: June 14, 2023, 10:35:09 am »
Yes, but AFAIK you can’t have an equal value SK with a gain of one. See Don Lancaster’s Active Filter Cookbook starting at page 121.
Of course you can. But it'll only have a Q=0.5 which is not very good.
Don Lancaster likes to simplify things. Good for beginners and amateurs, not very useful for engineers.
Well anyway, this is the response of the final filter in the OP's schematic (using a TL072) and with the feedback capacitor the both same value (dotted line) and double the value (solid line) of the cap that goes to ground. With double value the response is possibly more useful.
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sc
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #20 on: June 15, 2023, 04:39:35 am »
You should consider a better OpAmp anyway. Asking 324 to work at 20kHz is way too much for it. Get at least 3MHz GBW to be safe
« Last Edit: June 15, 2023, 04:41:53 am by ArdWar »
 

Offline CircuitChaosTopic starter

  • Contributor
  • Posts: 13
  • Country: pl
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #21 on: June 15, 2023, 10:43:17 pm »
Soo... you feed around 2.5 VPP into an LM324 operating from a single 5 V supply biased at 1.67 V. This is already at (or over) the common-mode limit.
Only the first amplifier (HPF). The signal will be very small after the HPF.

Sallen-Key is a filter topology, Butterworth is a filter transfer function. Sure, you can have an equal value Sallen-Key filter.
OK, now clear :) Thanks.

Well anyway, this is the response of the final filter in the OP's schematic (using a TL072) and with the feedback capacitor the both same value (dotted line) and double the value (solid line) of the cap that goes to ground. With double value the response is possibly more useful.
Worrying, because I want the signal to drop only after around 18 kHz… I'll increase the cutoff frequency then. Thanks for that. BTW, in which software did you do this simulation?

You should consider a better OpAmp anyway. Asking 324 to work at 20kHz is way too much for it. Get at least 3MHz GBW to be safe
Yes, I already redesigned the circuit to use TL074.
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3144
  • Country: au
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #22 on: June 16, 2023, 06:30:01 am »
. BTW, in which software did you do this simulation?

https://www.simetrix.co.uk/

Free version.
« Last Edit: June 16, 2023, 06:33:15 am by Circlotron »
 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 3153
  • Country: us
Re: Opamp follower and Sallen-Key filter behaving strange
« Reply #23 on: June 16, 2023, 05:46:34 pm »
There's a 3rd Order Sallen Key Type Butterworth filter with a gain of 1 that uses equal valued components. Here's a thread that discusses such, we published this in EDN long ago!!

https://www.eevblog.com/forum/projects/7th-order-butterworth-filter-help/25/

Found this in our notebook, you can swap the R and Cs for a LP to a HP.

Edit: You can have just about any practical filter gain by scaling the first unity gain buffer to have the overall desired filter gain. We've utilized this unique filter structure many times over the years, and it's so easy with just a quad op amp and a few equal valued components.

Best,

Here's an implementation of a 3rd Order High Pass and 3rd Order Low Pass intermingled to optimize the output offset voltage and input DC coupling. This uses three 1nF, 100nF, 8K and 80K components, is highly insensitive to component values and Op Amp effects (shown as Unity Gain VCVS for simplicity). The corners are simply for High Pass 1/(2*pi*Rl*Cl) and Low Pass 1/(2*pi*R*C). The output offset voltage is only the offset voltage of the last Unity Gain Op Amp, and the Gain can be easily configured with either the first or second Op Amp, second is better as the Op Amp input "sees" the low pass effects of R1 and C1 before amplification. You can interchange the filter "Sections" without affecting the response, and as shown they have been positioned to remove the DC Input by having the passive high pass first (C4 R4), followed by the passive low pass (C1 R1) which helps remove out of band signals, and last stage high pass (C5 C6 R5 R6) which removes previous Op Amp offsets, with only the last Op Amp offset as the output.

A truncated version is also shown below, this merges the individual high pass and low pass sections to eliminate 3 of the Op-Amps, however the response is not exactly classic Butterworth in the High and Low Pass frequency areas as can be seen in the slight deviation between the amplitude and phase responses, Green is the top schematic version, Blue the lower truncated version schematic.

Basically this filter concept trades off simplicity of passive component selection with equal values, with the benefit of reduced passive component sensitivity for additional Op Amps, which for our work over the many decades we've utilized this topology has been a good trade since good performance dual and quad Op Amps are readily available and cheap, actually cheaper than a single 1% capacitor :-+

Best,
« Last Edit: June 16, 2023, 05:50:27 pm by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: Wolfram


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf