### Author Topic: op amp relaxation oscillator how can this one even work....  (Read 7476 times)

0 Members and 1 Guest are viewing this topic.

#### Simon

• Global Moderator
• Posts: 14454
• Country:
• Did that just blow up? No? might work after all !!
##### op amp relaxation oscillator how can this one even work....
« on: May 20, 2014, 08:38:04 pm »
So see attached oscilator circuit. I'm still trying to figure out how it can even work.

If the output is high the cap will charge until it hits VCC/2 then the output goes low and so the reference on the non inverting goes to 0, the cap will discharge but in theory it can never go low enough to trigger a flip, am I missing something. I thought there should also be a resistor from the non inverting input to VCC so that the resistor connected to the output changes the threshold at ever switchover giving a window the the RC circuit to work in.

#### grumpydoc

• Super Contributor
• Posts: 2701
• Country:
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #1 on: May 20, 2014, 08:45:50 pm »
Bipolar supply

Edit: sorry for short post, needed to sort something out.

The circuit works but from a dual rail supply.

Start as with your explanation with the output high and the cap charging. The non-inverting input is at +V/2 so, as you say once the inverting input reaches this point the output will go low, but not to 0V - it will go (close) to the negative rail.

The non-inverting input is now at -V/2

The cap will then discharge until it is at 0V, then charge with the opposite polarity until the inverting input goes below -V/2. The output will then swing (close) to the positive rail.

Rinse, repeat.
« Last Edit: May 20, 2014, 08:56:04 pm by grumpydoc »

#### IanB

• Super Contributor
• Posts: 9632
• Country:
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #2 on: May 20, 2014, 08:53:02 pm »
Bipolar supply

Yes. Vout can swing above and below ground.
I'm not an EE--what am I doing here?

#### Rerouter

• Super Contributor
• Posts: 4524
• Country:
• Question Everything... Except This Statement
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #3 on: May 20, 2014, 08:53:55 pm »
Attached is a single supply one, the cut off value is 22.1K

this one is used in a product that screams of everything being over engineered so i would say its a safe design.

#### Simon

• Global Moderator
• Posts: 14454
• Country:
• Did that just blow up? No? might work after all !!
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #4 on: May 20, 2014, 09:04:30 pm »
ah right yes of course, I keep forgetting that opamps are naturally dual supply devices

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #5 on: May 20, 2014, 10:16:19 pm »
The original circuit as shown will work perfect with a single supply(with some of your op-amps).
« Last Edit: May 23, 2014, 11:38:29 am by Paul Price »

#### Simon

• Global Moderator
• Posts: 14454
• Country:
• Did that just blow up? No? might work after all !!
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #6 on: May 21, 2014, 04:53:18 am »
really ?

#### David Hess

• Super Contributor
• Posts: 10665
• Country:
• DavidH
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #7 on: May 21, 2014, 07:36:20 pm »
No.  The original circuit would require one additional resistor from the non-inverting input to the other supply to work from a single supply.  The two resistors form a virtual ground which in the dual supply version is provided by the ground connection.

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #8 on: May 23, 2014, 01:48:41 am »
Original Poster's circuit exactly as shown.

Results:

Relaxation Oscillator: scope waveform 4V P-P:  with R=39k C=.1uF  Single Supply 5V-Gnd LM358 op-amp

Baseline is 0-Volts.
« Last Edit: May 23, 2014, 01:53:00 am by Paul Price »

#### c4757p

• Super Contributor
• Posts: 7805
• Country:
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #9 on: May 23, 2014, 01:59:20 am »
Judging by the duty cycle I'd say it barely works.
No longer active here - try the IRC channel if you just can't be without me

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #10 on: May 23, 2014, 02:06:53 am »
It is just a relaxation oscillator,  not a timebase to calibrate an atomic clock. It is a laid-back, kinda relaxed, relaxation oscillator, but it works consistently.
« Last Edit: May 23, 2014, 02:13:43 am by Paul Price »

#### David Hess

• Super Contributor
• Posts: 10665
• Country:
• DavidH
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #11 on: May 23, 2014, 02:40:38 am »
Now try the same circuit using an operation amplifier with the opposite input offset voltage.

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #12 on: May 23, 2014, 02:48:09 am »
Since I am not a doctor, I don't have an Operation Amplifier to try this out.

I do have a collection of 24-pieces LM358's and one after an udder, as the cow says, the chosen few start up and dance and the others suck at the job.
« Last Edit: May 23, 2014, 11:35:00 am by Paul Price »

#### ejeffrey

• Super Contributor
• Posts: 2054
• Country:
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #13 on: May 23, 2014, 05:46:35 am »
It doesn't matter.  It is an unreliable circuit.  It depends on the behavior right at the negative rail, and under some circumstances with some opamps it will fail to oscillate.  This is a case where you trust the analysis, not the experiment.

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #14 on: May 23, 2014, 11:22:44 am »
Who are we to decide what electrons want to do?
Some believe that the earth was created by chance, or that evolution, whatever that is, causes things to evolve.
Other, are more creative, and think that the world and electrons are created by Intelligent Design.
Whey should we bias ourselves one way or another, why not be offset in an unpredictable world?

I propose a new concept to explain why some Operation Amps oscillate and some do something else I am not so sure of. I say it is time to put a new spin on the behavior of electrons.

I call it Less Intelligent Design (LID for short.)

Anyway, to put the LID on this problem, "it" turns out that half of my op-amps, the ones I got from China on ebay are self-deterministic and ambitious and gladly give themselves to relaxed oscillation. Others, from some unknown or defunct company called Signetics fail to heed the call and come to a circuitous outcome in electron delivery. Some from ON do, some don't.

I am not offset by these results, I don't blame things ON Semiconductors or do I give favor to half off prices and ON electrons. I enjoy an electron lottery!
« Last Edit: May 23, 2014, 11:32:26 am by Paul Price »

#### ejeffrey

• Super Contributor
• Posts: 2054
• Country:
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #15 on: May 23, 2014, 03:41:28 pm »
Instead of insane ramblings, I will explain the problem.

If the opamp is saturated at its negative rail and the capacitor is charged up, the device will not oscillate.  That is because the output will be slightly above zero volts at a value we will call Voffset.  The negative input will be at Voffset, while the positive input will be at Voffset/2.  Since the negative input higher voltage than the positive, the opamp will be trying to go more negative, however it can.t because the opamp is already saturated.  The oscillator will just be stuck at the negative rail.

Any opamp used in this circult with a single supply will have some window of initial conditions in which it will fail to work in this manner.  The size of that window and whether it will happen in practice depends on a number of factors: how close to the rail the opamp can drive, what the input offset is, how the output transistors are biased during startup, and the output loading.  But the bottom line is, it is an unreliable circuit.  Replacing the resistor from (+) to ground with a voltage divider between the rails makes it a reliable circuit.

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #16 on: May 24, 2014, 01:49:36 pm »
With the original poster's circuit, this circuit will work perfectly with BJT input op-amps and a single supply if the two resistors on the + input of the op-amp are large( >=approx 3.3meg) and the timing resistor R=39k (always R<1meg) and C >=.001uF.

This circuit always works(i.e. with the values above) because input bias currents always flow out of a pnp-input stage and can be used to create an offset bias voltage that ensures that the relaxation oscillation will start and operate reliably.

The conditions for stable operation and oscillation are that the sum of offset voltage plus the voltage developed by the +input bias current at  Vin+ is  >Vin-  at the end of the discharge cycle over the temperature of operation.

This implies that the R-C timing resistor connected to the op-amp - input should be relatively small(less than 1Meg) to allow that  Vin+ (offset voltage + Ibias*R) satisfies  Vin+ >Vin- when the relaxation oscillator output has discharged the timing capacitor.  In other words, chose R to small as possible to minimize offset voltage at the Vin-.

This also mandates that the two resistors connected to the op-amp + input for positive feedback be large enough(in the Meg Ohms, 3.3Meg is a good choice for the LM358) to develop the required Vin+ offset.

I tried a random sample of (a total of 20) LM358's form Signetics, National, On Semiconductor etc. and they all worked perfectly when the feedback and timing resistors met the above criteria.

Never say never when you need a working circuit in a hurry and you just don't have that third resistor value oh hand.

« Last Edit: May 25, 2014, 12:31:43 am by Paul Price »

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #17 on: May 25, 2014, 12:20:10 am »
ejjeffrey says,"If the opamp is saturated at its negative rail and the capacitor is charged up, the device will not oscillate."

If the capacitor is at the negative rail, then the capacitor is certainly not charged up but very nearly completely discharged to a voltage very near 0-volts, but internally the Voffset of the op-amp can still bias the op-amp negative input very slightly more positive than Vin-.

ejeffrey says then, "The negative input will be at Voffset, while the positive input will be at Voffset/2"
This two inputs will actually be at the same potential(when measured externally with a DVM) but the internal voltage difference between the two inputs internally will be Voffset, not Voffset/2w.

However, the effect of the op-amp's offset voltage can be in the direction to pin the output close to the negative rail at the bottom swing of the oscillation cycle and no further oscillation occurs or it can be that the oscillator refuses to start at power up.

However, if you take a large random sample of op-amps, it is quite probable that Voffset is evenly distributed as to create in half the sample of op-amps a positive bias at Vin- and, for the remainder, a negative bias at Vin- . In other words about 1/2 of the op-amps will have an offset voltage that will will favor and permit reliable operation over some
large range of temperature operation.

When I experimentally tried a random sample of 20 LM358's in the OP's circuit, half of them worked and half of them did not.

At the same time, the input bias current of the op-amp(which is usually desired to be as low as possible as a figure of merit for an op-amp) can be used to advantage to create a reliable offset that mandates the relaxation oscillator will start and maintain oscillation over temperature if the non-inverting (+input) resistor values are chosen appropriately large so as to create a large offset favoring oscillation.  In this case all of the op-amps worked reliably.

Ejeffry says, "It doesn't matter.  It is an unreliable circuit."

In any circuit design, if the values of the components are chosen appropriately to best exploit the properties of the circuit components, a reliable design will result. If they are chosen without careful analysis, unexpected surprises will result.
"

« Last Edit: May 25, 2014, 12:35:35 am by Paul Price »

#### Rufus

• Super Contributor
• Posts: 2094
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #18 on: May 25, 2014, 12:31:58 am »
FFS it takes one extra resistor to bias the original circuit to produce a nominal square wave and be reliable on a single supply regardless of op-amp intricacies.

#### Paul Price

• Super Contributor
• Posts: 1419
##### Re: op amp relaxation oscillator how can this one even work....
« Reply #19 on: May 25, 2014, 12:39:40 am »
With a single supply, It does not take a third resistor at the +input to function as a reliable relaxation oscillator.
However you are certainly correct that it does require this third resistor to have a squarewave output.

Smf