8
\$\begingroup\$

I recently made a triangular waveform generator circuit using LM324 op amp. But the output of the generator had some sort of periodic spikes in it. However I was able to suppress the spikes by lowering the load resistor (<=1Kohm, 680ohm completely killed the spikes). What can be the reason for that? My first guess was that there may be a pole somewhere in the feedback loop due to parasitic impedance and the lower load resistor has compensated for that.

I tried the same circuit using TL084 op amp which has JFET inputs. This time the spikes were never there even when the load resistor was not connected! So if there was a pole in the feedback loop, then the spikes should have appeared in this circuit also. I am wondering what can be the REAL cause for the spikes and how did the load resistor kill it? I really appreciate some help from someone with an experience in this field.

Note: I used a solder-less breadboard for constructing the circuit

Schematic:

schematic

simulate this circuit – Schematic created using CircuitLab

Waveform (LM324) enter image description here

Waveform (TL084): enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ What did you power the circuit from? An interesting point is that the frequencies are very different (due to the different amplitudes of the output). \$\endgroup\$ Jun 1 '16 at 8:41
  • 1
    \$\begingroup\$ Re-measure the 324 with a few kilohms from output to V-, forcing its output stage into Class A. It's notorious for problems when its output transistors switch on or off (aka crossover distortion). \$\endgroup\$ Jun 1 '16 at 10:53
  • \$\begingroup\$ @PeterSmith, the circuit is powered from a bench-top linear power supply. \$\endgroup\$ Jun 2 '16 at 7:04
  • \$\begingroup\$ @BrianDrummond, I tried what you suggested. Connected a 4.7k resistor from o/p to V-. That suppressed the spikes on the +ve side. I then lowered the resistor to 2.2k. This time the spikes were gone. I think you're right about the crossover distortion. I read the TI datasheet and they have mentioned it to use a pull down resistor to reduce the crossover distortion if the load is ac coupled. I was using LM324 mfg. by ST and their datasheet doesn't mention that. The class b o/p stage in the LM324 has poor performance. TL08x has a better designed o/p stage. I think I'll use TL08x. \$\endgroup\$ Jun 2 '16 at 7:15
7
\$\begingroup\$

This is a great example of why the various physical limitations of different op amps need to be considered.

You're correct, it is not a pole. In fact, it's got nothing to do with the circuit itself, or hidden parasitics or anything like that.

There is a huge and vital clue hiding in plain sight. The spikes happen with the LM324. They do not with the TL084. There is your answer, right there. The cause is something to do with the LM324 itself. But what does the TL084 have that the LM324 doesn't?

Speed.

Or more specifically, slew rate. That is how many volts per microsecond (or whatever measure of time you'd prefer) the op amp can slew or wiggle its output, regardless of all other considerations. This is distinct from phase shift. I like to think of phase as a delay that gets introduced, it's sort of like reaction time, but the op amp is still able to faithfully recreate the input signal on it's output (or whatever the op amp is configured to be doing), even if it might not be quite in phase with the input.

Slew rate is not that. Slew rate isn't speed in terms of delay or reaction time. It's about how fast the signal itself is actually changing. If the input signal changes so fast that recreating the amplified signal on the output would exceed that op amp's slew rate... it's not going to work. The op amp just can't move that fast.

What you're seeing in this specific case is switching noise from the first LM324's square wave. Look at the triangle wave as well as the square wave on your oscilloscope, and you should see the spikes

There are op amps that can slew several thousand volts per microsecond. For these very fast and slewy op-amps...well, their business is wiggling. And business is good.

Then there are op amps that can't even manage an entire volt in a microsecond. Op amps like the LM324. It has a slew rate of just 0.5V/µs. To put it bluntly, it's slower than a sloth on ketamine.

Because it's so slow, in your circuit, it isn't able to react quickly enough.

Clear as mud, right? Let me break it down a little.

Story time!

I apologize in advance, but I am going to personify op amps because, frankly, no one told me not to.

Let's ignore the the LM324 generating the square wave, it isn't really a significant player in this phenomenon. It is enough to simply keep in mind that the first LM324 is just there to create as close to a square-ish wave as it can, which drives the triangle wave from the second, spikier LM324.

Now, our second LM324 is configured as a low pass filter, which can also be viewed as an integrator.

For the first part of our square wave, it is low, below ground. It's at the plateau region, and our LM324 integrator is happily charging capacitor C1 through R3. The current is a constant Vin_low/R3, and the op amp's output increases linearly as the capacitor is charged. This is what we want, this is what is generating that nicely shaped triangle wave we built the circuit to produce.

Suddenly however, something disastrous occurs for our poor little op amp. The input, with next to no warning, has suddenly shifted from Vin_low (let's call it -1V) to Vin_high, which is +1V! The input has completely reversed polarity, and fast! Far too fast for this tortoise-like op amp to ever hope to keep up with.

Slew rate essentially exposes an op amp's non-zero output resistance. This goes up with higher frequencies, which results in a loss of gain, until you actually demand the op amp slew as fast as it can, and now it's output acts like a resistive, linear region one. It's trying to force its output as fast as it's little transistors can manage.

So what we now have is all that charge that our LM324 spent the entire low cycle of the the square wave shoving into the capacitor, with the new, opposite polarity voltage impressed on that same capacitor. The output has not changed fast enough, so we get a current pulse that couples back through the capacitor to the input.

You can view it as artificially forcing the 'ground' at the output, or just as a current pulse making the input overshoot, and causing the output to spike. It's a very typical problem in slew-rate limited integrators like this.

Now, the load resistor isn't actually eliminating the spike, but once it is low enough that it dominates whatever current that normally would need to rely on the op amp's output resistance (which is at its highest when slew-rate limited), then the magnitude of the spike will be reduced further and further until it is as good as gone. It can flow through the load resistor and be less effected by the output impedance/resistance of the op amp.

The TL084 works without any load resistor at all because it's impedance is still quite low even at those fast rise and fall times of the 'square' wave input. It gladly takes the square wave switcheroo being given in stride, while it simply confuses and frightens the poor LM324.

We can tell this is what is happening by looking at the actual location of where the spikes are occurring. See how they aren't perfectly aligned with the triangle peaks and valleys (which are also the square wave zero crossing points)? The spikes occur slightly after that. I smell capacitor shenanigans.

capacitor shenanigans

Yep. You can confirm all of this by measuring the current through C1, then watching how that impacts the input voltage right after R3. Overlay your spiking triangle wave, and I am confident you'll be able to empirically put this mystery to rest!

I did my best to explain, but its not so easy. For a more text-book like explanation, check out "page" 6.180 of Signal Amplifiers by Walt Jung.

TLDR: Sloths are slow, especially on ketamine.

\$\endgroup\$
1
  • \$\begingroup\$ Are they as slow as a slow cooker that hasn't been turned on yet? \$\endgroup\$
    – Paul Uszak
    May 15 '17 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.