Frequency response of difference amplifier

I'm studying the difference amplifier circuit configuration of op amps, reading from this datasheet.

I know that unlike the instrumentation amplifiers, the difference amplifier differential gain can be controlled by changing the value of more than one resistor. For the sake of experimentation, I assumed all the resistors are equal in resistance. I used the high power gain op amp LM324 downloaded from here

In this case, all the resistors values are set to 100kΩ.

From my experimentation the 100kΩ values for the resistors indeed yields a relatively satisfying frequency response:

As I change to lower or higher values for the resistors, the frequency response also changes. Bode plots for: 10kΩ 100Ω and 100Meg

• Is there a deeper reason why setting all resistors to 10kΩ yields a better frequency response?
• Why is there a change in frequency response when we simultaneously vary all the resistors?

• when you change the value of resistors, are you changing all 4 equally, or just 2? May 29, 2021 at 11:19
• I change all four resistor values
May 29, 2021 at 11:21
• The frequency response image is too blurry for me to read, even when enlarged. What are the resistance values used, besides the 100k? Please answer by editing your question, so that people do not need to read the comments to find that information. May 29, 2021 at 11:51
• @MathKeepsMeBusy Besides the 100kΩ I also tried with 10kΩ,100Ω,150kΩ 2MegΩ, and 100MegΩ
May 29, 2021 at 12:12
• The old LM324 quad and LM358 dual opamps were designed for a low power supply current resulting in noise, crossover distortion, a poor high frequency response and a poor high level slew rate that cuts the levels of frequencies above a few kHz. May 29, 2021 at 15:24

This has got nothing to do with the op-amp being configured as a differential amplifier. Even in a simple non-inverting gain amplifier, as you increase the resistors (without changing the gain), the parasitic capacitors (input to ground and the parasitic feedback from output to inverting input) will cause the anticipated closed-loop gain to reduce. If you make the resistors smaller in value and push it too far, the op-amp won't be able to supply the current required by the negative feedback components.

As with most op-amp circuits, there is a goldilocks range of acceptable resistor values and, beyond that range, you start to get performance degradation.

Of course there are other things to consider; if you make the resistors too-high in value, input bias currents will start to degrade the DC accuracy of the circuit and this, in many cases is something to avoid.

Is there a deeper reason why setting all resistors to 100kΩ yields a better frequency response?

Well, the best response you got was with 10 kΩ resistors: -

Again, it's a trade-off situation; there is a range of values that suit a particular application and most folk would default to 10 kΩ for the LM324. If it were a high-speed op-amp, you'd be looking at 1 kΩ resistors in the feedback (or even lower up at 1 GHz).

• Where are parasitics in a simulation defined??? Not May 30, 2021 at 1:12
• @TonyStewartEE75 in the model of the op-amp for instance or, you can add them to the generic op-amp model. Mind you, you need to be using a simulator that is capable of doing this. May 30, 2021 at 8:13

The opamp has input capacitance. Therefore you form RC filters with the feedback network affecting the frequency response. If the feedback resistors are too large, the inputs will be very slow. Therefore the opamp will "notice" too late about errors at its inputs/outputs and will overcompensate them eventually. This will lead to oscillations.

For very small resistances, you basically short-circuit the opamp outputs to other nodes. If these other nodes are also very low impedance (e.g. Ground) the opamp cannot reach equilibrium any more because it lacks the drive strength to do so.

• "Shortcut" should be "short circuit."
– JRE
May 29, 2021 at 11:09
• An op-amp generally does not have significant input capacitance. The compensation capacitor within an op-amp is not "exposed" to the input. May 29, 2021 at 11:09
• When you say "drive strength" are you referring to the internal factors like the integrated circuit inside the op amp, can you give an example?
May 29, 2021 at 11:29
• @Echonormous Drive strength is basically given by the open loop output impedance, which you can find in the datasheet. It is the resistance of the output transistors. So yes it is related to the integrated circuit of the part. May 29, 2021 at 11:36
• @MathKeepsMeBusy Ok probably I misunderstand the details. I will happily read your answer and remove this one, if it is too wrong :) My simple hands-on picture of an opamp which I tried to share here is: the opamp is slowed down by capacitance on its inputs and output which makes its feedback more and more inefficient and the external compensation cap from output to IN- helps to provide a fast feedback path. And I always simulate all opamp circuits because I don't trust my own intuition very far on this one :) May 29, 2021 at 11:43

Andy is consistent with my poor experience with old LM324’s having 10k as the sweet spot for feedback.

@Audioguru said it best.

The old LM324 quad and LM358 dual opamps were designed for a low power supply current resulting in noise, crossover distortion, a poor high frequency response and a poor high level slew rate that cuts the levels of frequencies above a few kHz. – Audioguru

I took this question more seriously to point out the other weaknesses of this low-cost low current quad OA. I would have never chosen this old cheap OA for much more than low BW circuits such as when I used it for sweeping a Lexmark laser drum from -1.5kV to 5kV with a boost transformer rectifier in the nA range.

• you will get a different Bode Plot for the real IC on +ve peaks (poor) than negative peaks due to asymmetric current source, sinks used in the output stage which also have asymmetric hFE’s. (Yes that means THD above 20kHz is really bad and gets distorted at high f.
• The input bias currents are input voltage sensitive and the common mode voltage shifts 50% with the differential due to the Vin+ Has a /2 circuit and Vin- tries to follow that with the weaker Vout+. This why we always used a pullup resistor to improve all the foibles of this weak class AB biased output stage designed to minimize quiescent current and not linear response over the entire unity gain BW which is far more stressful than a high gain Diff amp.with a reduce BW.
• There is an initial pull down on the output near -Vss on power up that proves my point on the above and it takes about 10us for the output to rise to near 0V where you expect it to start with bipolar supplies. This was a flaw that was never fixed in this legacy design. Even the lowly 741 didn’t have this flaw, but had many others.
• There is an unspecified input capacitance that makes the input bias current look more like a square wave at your -3dB frequencies which should be near 1.2MHz if your simulator model is nominal instead of worst case. The average input bias current is still the same but reduces rapidly with the common mode voltage as these are PNP differential Darlington inputs designed to work down to -Vss. But this characteristic also causes an apparent bipolar input capacitance and changes with input swing of the input differential and common mode voltages. So it becomes far more pronounced using >100k feedback with high slew rate signals thus causing poor BW with 10M values.

There are more reasons why 10k is the sweet spot and a pullup improves the performance, but if you need better performance, don’t rely on the LM324.,Otherwise you need to understand the internals and get your head examined. No just kidding. Falstad’s model allows you to change the slew rate and current limiter values from default on the LM324. Does your simulator agree?

I know this answer is a little late. However, I am not convinced the effect seen is due to input capacitance. The frequency response curves do not show a characteristic peak or resonance at the knee which can be seen when input capacitance is the limiting factor of bandwidth. See This question for information about the missing "peak" I am referring to.

Rather, I suspect, based upon modeling, that the cause of the change in bandwidth is due to the following process.

1. An increase of the op-amps external resistors leads to a high impedance between the op-amp input leads and ground,
2. The high impedance between the input leads and ground leads to the differential pair emitters (and bases) to move toward one of the supply rails
3. As the emitters/bases move towards the supply rails, the differential pair transistors and constant current supply transistors move toward cutoff
4. Rather than rapidly leading to degradation of the output waveform, the the op-amp differential input stage "gracefully" loses transconductance (I attribute this largely to the small magnitude of the differential input voltage.)
5. When the input stage loses transconductance, the op-amp loses over-all open-loop gain
6. When the op-amp loses open-loop gain, a fixed gain (in this case unity gain) negative feedback amplifier will lose bandwidth.

I have used a discrete component model of an op-amp differential input stage.

simulate this circuit – Schematic created using CircuitLab

I realize that the discrete components used in this circuit do not match the much smaller components used in an LM324. Nevertheless, I think simulation of this circuit will illustrate the mechanism I propose.

The transistors models are for 2N3904/3906. The nominal beta of the 2N3904 is 140. The input voltage is 20mV peak-to-peak. R1 controls the the emitter bias current. $$\R_{in}\$$ represents the impedance from either of the op-amp input pins to ground.

For all values of $$\R_{in}\$$ less than 25k$$\\Omega\$$, the output looks something like this:

The non-inverting input when $$\R_{in}\$$ is 0 is obviously ground. When $$\R_{in}\$$ is at 25 k$$\\Omega\$$, the non-inverting input is at approximately -3.25V. The frequency response looks something like this:

As $$\R_{in}=75k\Omega\$$, little has changed, although the output amplitude is slightly smaller

At $$\R_{in}=1M\Omega\$$, the output has dropped by about -20 dB

And when $$\R_{in}=50\Omega\$$, the output is down about -50 dB.

However, note that although the amplitude has dropped, the waveform is still visibly a sign wave. "Saturation" of the differential-pair or constant current source more gracefully alters the waveform, compared to the waveforms one sees when the output of an op-amp is saturated. (The actual mechanism is transistor "cut-off", but we often refer to the "saturation" of an amplifier, hence the quotes around "saturation").

Once again, if the open loop amplification of an op-amp is reduced, then the closed loop bandwidth will be reduced. I think it more probable that the results seen in the question above are likely caused by a reduction in gain rather than to input capacitance, due to the lack of a characteristic peak or resonance when input capacitance is limiting the bandwidth.