Continue to Site

# Op Amps

#### Mike_Z

##### Newbie
I'm an old man, attempting to learn something new. Recently I read a little about Op Amps and wanted to try my hand at them. I purchased a breadboard, some parts, a Pico Scope and a power supply. My first circuit is a multi vibrator using a LM324. See attached diagram. The wave froms are of the capacitor voltage (triangular wave with the rounded tops), and the divider voltage (square wave). The other waveform is a calculation that the Pico can do. It is the divider voltage minus the capacitor voltage. I was trying to simulate the comparator of the LM324. My first question is, as the capacitor is charging through the 10k resistor, it will eventually equal the divider voltage. At this point in time the output of the LM324 should change from +Vsat to -Vsat. AND the capacitor should begin to discharge through the 10k resistor. If you inspect the attached JPG, the capacitor continues to charge for some time after the divider and capacitor voltages are the same. I thought maybe this was when the op amp was in it's linear part of operation, but I thought that the difference between the divider and cap voltages would only be about 1 milliVolt and not for as long as the diagram shows. I'd appreciate any help understanding what I'm looking at, Thank, Mike

The trip point + is different that the trip point - because you have hysteresis
around the comparator using the +fdbk. Keep in mind the OpAmp output
swing limitations, and that fact they are not symmetrical, also affect the
hysteresis edge trip voltages.

Otherwise it looks good to me.

You also have secondary effects due to output and inputs not rail to rail, and OpAmp slew rate (typical of .5V / uS)., thats why
comparator edges not fast, although in this design running around . 4uS period. not a big concern.

Regards, Dana.

Last edited:

Due to the large positive feedback and asymmetric limiting voltages away from the +/- supplies, non-ideal results are expected. Also the since the Op Amp has a 1st order integrator internally to make it unity gain stable, the slew rate is far less than a comparator or a CMOS Schmitt Inverter which have symmetrical waveforms.

I used Falstad's browser based simulator with the LM324

Due to the large positive feedback and asymmetric limiting voltages away from the +/- supplies, non-ideal results are expected. Also the since the Op Amp has a 1st order integrator internally to make it unity gain stable, the slew rate is far less than a comparator or a CMOS Schmitt Inverter which have symmetrical waveforms.

View attachment 189389
I used Falstad's browser based simulator with the LM324

You used the wrong value R for the + fdbk.....

Regards, Dana.

Dana, thanks for the reply. It may take a little for me to get may head around this. Are you saying that since there is positive feedback, the op amp exhibits hysteresis? So when the output is positive, divider voltage greater than capacitor voltage and the capacitor voltage rising, the output will not flip to negative until the capacitor + a little hysteresis voltage is greater than the divider voltage? Is the hysteresis dependent on the positive feedback? Or is it naturally there? Does a data sheet mention this? Again, being a beginner most of this is new to me. Thanks for the help.

Dana, thanks for the reply. It may take a little for me to get may head around this. Are you saying that since there is positive feedback, the op amp exhibits hysteresis? So when the output is positive, divider voltage greater than capacitor voltage and the capacitor voltage rising, the output will not flip to negative until the capacitor + a little hysteresis voltage is greater than the divider voltage? Is the hysteresis dependent on the positive feedback? Or is it naturally there? Does a data sheet mention this? Again, being a beginner most of this is new to me. Thanks for the help.

The OpAmp is a part of creating the hysteresis in that its output V changing changes the trip point V
along with the action of the divider scaling the trip voltage. fed to its input.

So when the output is positive, divider voltage greater than capacitor voltage and the capacitor voltage rising, the output will not flip to negative until the capacitor + a little hysteresis voltage is greater than the divider voltage?

Thats correct.

Is the hysteresis dependent on the positive feedback? Or is it naturally there?

Yes it depends on + fdbk. w/o + feedback there is no hysteresis. As yiou can see the output state,
and the + fdbk R divider, determine trip point. There are a number of Youtube videos on this topic.

Some older OpAmps and comparators, when inputs taken out of their allowed V range (called
common mode range) can experience phase reversal, eg. the + input not acting to raise output V
rather lower it, same reversal for - input. Another topic for another day. Thats why C voltage must
not be allowed to go outside its specs, same for + input and settings for Hysteresis

Regards, Dana.

You used the wrong value R for the + fdbk.....

Regards, Dana.
Yes I knew that , but it wasn't worth correcting as the waveforms only affect frequency from positive feedback ratio. What's the big deal?

Last edited:

What's the big deal?

I thought it might confuse the OP. Additionally I encourage folks to correct my errors,
as I think thats best in class when applied to a learning center. And I do make errors.

Regards, Dana.

I was trying to provoke the nonlinear inputs observed in his waveforms but was unable. TY. I didn't check but I believe it to be caused by differential input clipping diodes.

Normally unexpected results may occur when an Op Amp is not performing in it's intended linear mode. The Relaxation Oscillator works by saturating the outputs and this is operating with zero gain by over driving the input with +ve feedback. The negative feedback allows it to return to linear mode only during the polarity reversal where the slew rate is being stressed by output current limiting.

Better versions of this design would use a high BW CMOS Op Amp or a comparator with a 1k pull up resistor. These offer rail-2-rail output swing and much faster toggle frequencies.

Since the -ve feedback is exponential and the +ve feedback is linear ratio of the output swing, it truncates the exponential to a fairly linear triangle wave guided by the dV/dt=Ic/C with a large swing controlling Ic and a small ratio of 1/(1+10) for dV.

Hi,

there are OPAMPs and COMPARATORs ... for a good reason.
Different parts for different applications with different operation modes:

Thus I recommend to us a comparator when you need a comparaotr function and use an OPAMP when you need an amplifier.
In short:
OPAMP:
* input differential voltage always very close to zero
* output voltage nerver saturates (analog output)

Comparator:
* input difference voltage may be bigger
* output is meant to saturate at either supply rail (digital output)

Klaus

This is pushing the limits on the choices of comparators for input offset and output fall time to operate at 50 MHz with risetimes in ns possibly not achievable with a 1 mA 5V swing so lower voltages are necessary and/or possibly differential Current Mode Logic.

Notice the extreme +_ve FB ratio of 1:1000 reduces the input to 2.4 mV and the differential input to 5 mVpp.

Interactive simulator
https://tinyurl.com/22b26l5p using an ideal comparator.

Feel free to break it

Last edited:

If you want a more modern op amp that's closer to the ideal, with much higher slew-rate and frequency response and lower offset as compared to the ancient LM324 (designed in 1972), along with rail-rail inputs and outputs, use one such as the TLV9152.
--- Updated ---

Below is the LTspice sim of the circuit with the TLV9152:

Note that, as compared to the LM324 sim in post #2, the output has much faster rise and fall times, and is symmetrical, going between the two power supply ±5V rails, .
The red trace shows the voltage change at the op amp (+) input due to the positive hysteresis feedback.

Last edited:

@OP, other considerations ( there are more than fills one book ) :

1) There are recommendations to use a faster opamp, with good reason, but
that brings its own challenges, possibility of high frequency oscillations
due to layout and stray L & C.

2) OpAmps, in general, do not like C load. Because OpAmp has finite Zout the C will cause phase
shift and that can lead to spurious oscillations.

3) When using scope probe, in general, use it on X10. That presents a Cload of ~ 10 pF, whereas
set to X1 its more like 100 pF. Which with modern day OpAmps with wide bandwidth can cause
instability.

There are tons of books, videos, and papers on the subject of stability.

4) Pay attention in datasheet to bypassing power supplies for the OpAmp, and layout
recommendations. Solderless breadboards can themselves contribute to errors and stability,
so beware.

Regards, Dana.

Again, thanks for the reply's. I was unaware of the difference between op amp and a comparator. 1972 doesn't seem that long ago to me, I was 30 at that time. Stopped at the library yesterday and found a book call "The Versatile Op Amp" by Michael Kahn. I see that there is a lot to learn. This book uses the 741 op amp for most of the examples. I appreciate the links to other information. Let me do some reading and then maybe test a few ideas on my breadboard. I see that you are using a simulator? I downloaded LTSpice, but am having a devil of a time getting it to do what I want. Sure would be nice if there was a 'how to' manual for us beginners. That's a laugh me a beginner. Thanks again, Mike

Tutorials over here -

Regards, Dana.

1972 doesn't seem that long ago to me, I was 30 at that time
Doesn't to me either but I got you beat by two years.
I downloaded LTSpice, but am having a devil of a time getting it to do what I want. Sure would be nice if there was a 'how to' manual for us beginners.
Look up LTspice tutorial.
You will get many hits.

Last edited:

Can't say that I ever used youtube. My grandkids knew what it was and got me going. There is a LOT of stuff there. I looked at the first tutorial on LTSpice made a voltage divider. Need some time to work through all this stuff. Pretty neat! Thanks Mike