op amp relaxation oscillator how can this one even work.... - Page 1
Forum section: electronics / beginners

author: Simon
author_rank: Unknown
timestamp: May 20, 2014, 08:38:04 pm
content: 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.

author: grumpydoc
author_rank: Super Contributor
timestamp: May 20, 2014, 08:45:50 pm
content: Bipolar supplyEdit: 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/2The 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.

author: IanB
author_rank: Super Contributor
timestamp: May 20, 2014, 08:53:02 pm
content: Quote from: grumpydoc on May 20, 2014, 08:45:50 pmYes. Voutcan swing above and below ground.

author: Rerouter
author_rank: Super Contributor
timestamp: May 20, 2014, 08:53:55 pm
content: Attached is a single supply one, the cut off value is 22.1Kthis one is used in a product that screams of everything being over engineered so i would say its a safe design.

author: Simon
author_rank: Unknown
timestamp: May 20, 2014, 09:04:30 pm
content: ah right yes of course, I keep forgetting that opamps are naturally dual supply devices

author: Paul Price
author_rank: Super Contributor
timestamp: May 20, 2014, 10:16:19 pm
content: The original circuit as shown will work perfect with a single supply(with some of your op-amps).

author: Simon
author_rank: Unknown
timestamp: May 21, 2014, 04:53:18 am
content: really ?

author: David Hess
author_rank: Super Contributor
timestamp: May 21, 2014, 07:36:20 pm
content: 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.

author: Paul Price
author_rank: Super Contributor
timestamp: May 23, 2014, 01:48:41 am
content: 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-ampBaseline is 0-Volts.

author: c4757p
author_rank: Super Contributor
timestamp: May 23, 2014, 01:59:20 am
content: Judging by the duty cycle I'd say it barely works.

author: Paul Price
author_rank: Super Contributor
timestamp: May 23, 2014, 02:06:53 am
content: 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.

author: David Hess
author_rank: Super Contributor
timestamp: May 23, 2014, 02:40:38 am
content: Now try the same circuit using an operation amplifier with the opposite input offset voltage.

author: Paul Price
author_rank: Super Contributor
timestamp: May 23, 2014, 02:48:09 am
content: 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.

author: ejeffrey
author_rank: Super Contributor
timestamp: May 23, 2014, 05:46:35 am
content: 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.

author: Paul Price
author_rank: Super Contributor
timestamp: May 23, 2014, 11:22:44 am
content: 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!

author: ejeffrey
author_rank: Super Contributor
timestamp: May 23, 2014, 03:41:28 pm
content: 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.

author: Paul Price
author_rank: Super Contributor
timestamp: May 24, 2014, 01:49:36 pm
content: 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.

author: Paul Price
author_rank: Super Contributor
timestamp: May 25, 2014, 12:20:10 am
content: 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 somelarge 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."

author: Rufus
author_rank: Super Contributor
timestamp: May 25, 2014, 12:31:58 am
content: 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.

author: Paul Price
author_rank: Super Contributor
timestamp: May 25, 2014, 12:39:40 am
content: 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.