Opamp follower and Sallen-Key filter behaving strange - Page 1
Forum section: electronics / projects

author: CircuitChaos
author_rank: Contributor
timestamp: June 08, 2023, 01:02:59 am
content: 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).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.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 itWhat can be wrong here?

author: Kim Christensen
author_rank: Super Contributor
timestamp: June 08, 2023, 02:52:52 am
content: Possible crossover distortion from the LM324... Try putting a 10K resistor from pin 1 of IC301A to ground or VCC.

author: Circlotron
author_rank: Super Contributor
timestamp: June 08, 2023, 03:09:44 am
content: 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.

author: CircuitChaos
author_rank: Contributor
timestamp: June 08, 2023, 01:55:27 pm
content: 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?

author: magic
author_rank: Super Contributor
timestamp: June 08, 2023, 04:22:21 pm
content: 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.editAs 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.

author: CircuitChaos
author_rank: Contributor
timestamp: June 08, 2023, 09:52:15 pm
content: 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?).

author: srb1954
author_rank: Super Contributor
timestamp: June 09, 2023, 12:18:21 am
content: Quote from: CircuitChaos on June 08, 2023, 01:02:59 amThe 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.

author: magic
author_rank: Super Contributor
timestamp: June 09, 2023, 08:29:35 am
content: 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.Quote from: srb1954 on June 09, 2023, 12:18:21 amMaybe the best solution, actually.

author: CircuitChaos
author_rank: Contributor
timestamp: June 09, 2023, 03:14:41 pm
content: Quote from: magic on June 09, 2023, 08:29:35 amActually, with such strong signals, I think it will be better to get rid of the LMP and do everything on TL07x.Quote from: magic on June 09, 2023, 08:29:35 amYes, 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, welcomeI'm not really advanced when it comes to analog circuits.Quote from: magic on June 09, 2023, 08:29:35 amBut 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.”

author: magic
author_rank: Super Contributor
timestamp: June 09, 2023, 04:40:54 pm
content: ST does make TL07x chips, as you can easily confirm:https://www.google.com/search?q=st+tl074+datasheetHowever, fakes exist. There are fakes with TI logo too.

author: srb1954
author_rank: Super Contributor
timestamp: June 09, 2023, 10:12:46 pm
content: Quote from: CircuitChaos on June 09, 2023, 03:14:41 pmYes, 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.

author: Benta
author_rank: Super Contributor
timestamp: June 10, 2023, 10:13:22 pm
content: What's the point of IC301C?Ditch it.

author: Circlotron
author_rank: Super Contributor
timestamp: June 10, 2023, 11:17:27 pm
content: 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.

author: CircuitChaos
author_rank: Contributor
timestamp: June 13, 2023, 11:05:53 pm
content: Quote from: Benta on June 10, 2023, 10:13:22 pmIt'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.Quote from: Circlotron on June 10, 2023, 11:17:27 pmI'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…

author: Benta
author_rank: Super Contributor
timestamp: June 13, 2023, 11:26:10 pm
content: Quote from: CircuitChaos on June 13, 2023, 11:05:53 pmSoo... you feed around 2.5 VPPinto 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?

author: Benta
author_rank: Super Contributor
timestamp: June 13, 2023, 11:37:55 pm
content: Quote from: CircuitChaos on June 13, 2023, 11:05:53 pmSallen-Key is a filter topology, Butterworth is a filter transfer function. Sure, you can have an equal value Sallen-Key filter.

author: Circlotron
author_rank: Super Contributor
timestamp: June 13, 2023, 11:52:56 pm
content: Quote from: Benta on June 13, 2023, 11:37:55 pmYes, 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.

author: Benta
author_rank: Super Contributor
timestamp: June 14, 2023, 12:17:07 am
content: Quote from: Circlotron on June 13, 2023, 11:52:56 pmOf 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.

author: mawyatt
author_rank: Super Contributor
timestamp: June 14, 2023, 12:38:30 am
content: 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,

author: Circlotron
author_rank: Super Contributor
timestamp: June 14, 2023, 10:35:09 am
content: Quote from: Benta on June 14, 2023, 12:17:07 amWell 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.

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 15, 2023, 04:39:35 am
content: 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

author: CircuitChaos
author_rank: Contributor
timestamp: June 15, 2023, 10:43:17 pm
content: Quote from: Benta on June 13, 2023, 11:26:10 pmOnly the first amplifier (HPF). The signal will be very small after the HPF.Quote from: Benta on June 13, 2023, 11:37:55 pmOK, now clearThanks.Quote from: Circlotron on June 14, 2023, 10:35:09 amWorrying, 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?Quote from: ArdWar on June 15, 2023, 04:39:35 amYes, I already redesigned the circuit to use TL074.

author: Circlotron
author_rank: Super Contributor
timestamp: June 16, 2023, 06:30:01 am
content: Quote from: CircuitChaos on June 15, 2023, 10:43:17 pmhttps://www.simetrix.co.uk/Free version.

author: mawyatt
author_rank: Super Contributor
timestamp: June 16, 2023, 05:46:34 pm
content: Quote from: mawyatt on June 14, 2023, 12:38:30 amHere'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% capacitorBest,