Go Down

Topic: Op-Amps as Sine wave generator (Read 2441 times) previous topic - next topic

BabyGeezer

Don't knock the old meters - that's all I had when I designed this sort of stuff. And a scope, of  course.
i wasn't knocking old ;) - i should've mentioned it's a *cheap* multimeter. (knock-off brand name even !!)


The circuit you posted omits this essential 3rd stage and so cannot (usually) work . Extra phase shift in the opamps may add to the total shift and so work in some circumstances, but is unpredictable.
hmm, i'm probably waay out of my depth here, but just out of curiosity, the link that Tony Wilk gave showed this same Quadrature Oscillator circuit with only two op-amps;



I'll post a working circuit if you like .  a/ in principle or b/ detail - I'll have to figure that out.
thanks for the offer, but i have a lot on this plate already, as i said, i barely master single Op-Amp circuit variety, let alone what can be done with several of them in one go !


Either needs a sub-circuit to control the gain to obtain a pure sinewave - do you need this?

If any waveform will do and the frequency range limited, a 555  is easier.
yes, i've experimented with that already, can a 555 timer do sine wave or is it always square ?

although, i guess even a square wave at audible frequencies should still come out on a speaker, right ?


The voltage divider is there to lower the voltage range to 0.5V to 1V (depending on the voltage you are running the oscillator at).

Since you say you have a powered speaker, then that 0.5V to 1.0V signal could be fed into the input to the speaker amplifier... usually the 3.5mm jack plug that would go into a PC or MP3 player.
ahh yes - "lower the voltage range" makes it "more sensitive".

much like adding the sensitivity of an analog sensor, say an LDR (as R2) and increasing the value of R1 (in the voltage divider) to make R2 more sensitive. (ie. tapping the analogRead() in between R1 & R2.)



Hi,
The link to the YouTube comes back as video unavailable.

Tom.... :)
oh noes - thanks for pointing that out !! (i noticed there should be an uppercase 'E' instead... )

here's the video i meant;

allanhurst

That isn't a Biquad, as it  has 3 90 degree phase shifts.  Anything above 180 ought to work, though since there is no amplitude control it will be nearer a square than a sinewave output.


You can't make a 555 deliver sinewaves.

Allan

runaway_pancake

"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

BabyGeezer

That isn't a Biquad, as it  has 3 90 degree phase shifts.  Anything above 180 ought to work, though since there is no amplitude control it will be nearer a square than a sinewave output.


You can't make a 555 deliver sinewaves.
hmm, i think my topic title strays from the main intention - i'm getting a lot of good feedback (!) on generating Sine waves (pure even !) but the key issue is trying to hear it !

in other words, even if it wasn't a pure Sine wave, it would be acceptable - i'm really just trying to replicate the example circuit - a Quadrature Oscillator - *not* a Biquad.

infact, looking closely at the Quadrature Oscillator example from Tony Wilk's link - the values (of Res & Caps)  are *exactly* the same - except the op-amps are not the LM324 - and even the voltage supply is 5V !

so the problem at hand is actually finding the right speaker to realize the "Sine" wave that the Quadrature Oscillator is producing.

anyway, i thought since i can't find a way to hear it, maybe we can just *see* it.

here's a plot using a "Arduinoscilloscope" (instead of going to the speaker, i fed Pin1 to analogRead(A0); )


that would seem to be a confirmation of oscillation happening, right ?

i tried plotting with finer resolutions, even going all the way down to 20 microseconds, but it just looked random, and perhaps the macro view as shown above is more of a proper picture of the wave being generated.


Wien bridge oscillator
interesting...
allanhurst touched on this too;

i could probably follow this circuit;


i do have an incandescent lamp that can take up to 9V - and that would supply the circuit shown via the op-amp power pins, right ?

btw what does the 's' in C1s and C2s mean ? (is it also the same 's' referenced on the op-amp A0(s)

Grumpy_Mike

Quote
that would seem to be a confirmation of oscillation happening, right
Yes it would appear so.
Now while it is connected to the analogue input connect the speaker to see if it stops.

You need an amplifier so that you don't load the circuit. A computer speaker, one that needs a power supply, will be fine.

allanhurst

s =  jw


Where j is SQRT(-1)

and w is the frequency in radians/second.    It's 2* pi* frequency

Learn about Laplace transforms - a nice way to solve differential equations.

A

runaway_pancake

There is a diode/no-lamp Wien config too.
(BTW - The lamp doesn't glow.)



http://www.learnabout-electronics.org/Oscillators/osc34.php

"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

runaway_pancake

"a different circuit that will change frequency with voltage. You will get what is known as a frequency controlled oscillator."

That is a voltage controlled oscillator (VCO)
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

Southpark

#23
Feb 25, 2018, 01:23 am Last Edit: Feb 25, 2018, 02:17 am by Southpark
anyway, i thought since i can't find a way to hear it, maybe we can just *see* it.
If you're getting oscillations that look like the correct frequency, but if the signal is approaching square-waves instead of sinusoidal, then you might need to find out what part of your circuit controls voltage amplification around the loop of your system. You need to tweak the amplification ..... such as to reduce the amplification. This could probably be done by tweaking a resistor value or something like that. Too much application can mean clipping........or getting squarer type waveform rather than sinusoid.

And, as somebody already said ..... connecting a regular external 'load' to your oscillator could mean that your whole oscillator circuit will change. In other words, it will no longer be your original oscillator circuit. This means that whatever you had designed before could be messed up because the external circuit changes your overall circuit. So this is when you should use some kind of middle-person device (ie. a 'buffer'), which has a relatively high input impedance, that doesn't change the behaviour of your original oscillator circuit too much. So, refer to buffer circuits, such as 'unity-gain voltage follower'.... or 'unity gain op-amp buffer'. So your oscillator output can go to the input to a 'buffer' device, and the output of the buffer device can go to a high power amplifier, which can drive your speakers. This is the basic way of thinking of it. There are amplifiers that handle this 'buffering' and amplification etc. But no need to think about that at the moment.


MarkT

Just to make it explicit the criterion for an oscillator is a loop with gain greater or equal to 1.0 at some frequency where the phase shift is 360 degrees (or 720, or 1080, etc)

The criterion for a pure sine oscillator is that the gain is exactly 1.0 (but it has to be more than 1.0 at the
start to build up oscillations from nothing).

So a gain feedback loop can be used where the amplitude of the oscillator throttles back the gain (but on a much
much longer timescale than the oscillations themselves - the classic lightbulb as a thermistor).  This leads
to very low distortion oscillations assuming the gain elements round the loop are linear themselves.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

TonyWilk

Just to make it explicit the criterion for an oscillator is a loop with gain greater or equal to 1.0 at some frequency where the phase shift is 360 degrees (or 720, or 1080, etc)
This was REALLY BUGGING ME for a while, just couldn't remember ... then Dolly (the dog) came in wanting to go down the garden.

Slap! of course:  BARKhausen  :D

Yours,
  TonyWilk
 
P.S. TBH I did try searching for BARKer, BERKley, BARKing before I got a hit.

BabyGeezer

#26
Feb 25, 2018, 04:08 am Last Edit: Feb 25, 2018, 04:09 am by BabyGeezer
wow - brilliant, i'm being bombarded by knowledge !!

Just to make it explicit the criterion for an oscillator is a loop with gain greater or equal to 1.0 at some frequency where the phase shift is 360 degrees (or 720, or 1080, etc)

The criterion for a pure sine oscillator is that the gain is exactly 1.0 (but it has to be more than 1.0 at the start to build up oscillations from nothing).
great, fundamental facts !


And, as somebody already said ..... connecting a regular external 'load' to your oscillator could mean that your whole oscillator circuit will change. In other words, it will no longer be your original oscillator circuit. This means that whatever you had designed before could be messed up because the external circuit changes your overall circuit.
heh-heh, the act of observing the phenomenon changes it ! :D


s =  jw

Where j is SQRT(-1) and w is the frequency in radians/second.    It's 2* pi* frequency
i see, i just realized that formula was to calculate the impedance of that part of the circuit, if i'm interested in determining the frequency, i just have to deal with 1/(2*PI*R*C)


Learn about Laplace transforms - a nice way to solve differential equations.

A
ahh, that name again - along with Fourier also keeps popping up in my cursory learning of QM - it all starts to weave together  into one super tapestry !!


There is a diode/no-lamp Wien config too.
(BTW - The lamp doesn't glow.)
ooh - good to know ! otherwise i'd be thinking something was not correct with the circuit (when i build it).



http://www.learnabout-electronics.org/Oscillators/osc34.php
i'm starting to get used to reading circuits !

that above is the same as this on the wikipedia page;




Yes it would appear so.
Now while it is connected to the analogue input connect the speaker to see if it stops.
nope, it doesn't stop;



You need an amplifier so that you don't load the circuit. A computer speaker, one that needs a power supply, will be fine.
ok, i guess we can confirm the Quadrature Oscillator circuit is functioning okay - the issue is finding the right speaker to accept and transpose the "sine" wave being produced.

or alternatively, an amplifier circuit (here comes another op-amp !) to boost the signal, right ?

what sort of specs should i be looking at ?

thanks a lot everyone - this is becoming a very fruitful exercise !!

TonyWilk

Going a bit off-topic, but you did mention Fourier and the joy of learning...

These videos from 3Blue1Brown's channel on YouTube are a real delight:
But what is the Fourier Transform? A visual introduction
and Uncertainty principle? It's not about quantum

Yours,
 TonyWilk

Grumpy_Mike

#28
Feb 25, 2018, 08:39 am Last Edit: Feb 25, 2018, 08:40 am by Grumpy_Mike
Quote
or alternatively, an amplifier circuit (here comes another op-amp !) to boost the signal, right ?
No most op-amps are not suitable for driving a speaker. There are specific audio amplifier chips like the LM1785T, LM386 or the TDA2030A. But these need components round them and most need a large decoupling capacitor on the supply. Download the data sheets to see recommended circuits

You might want to look at this:- https://www.maximintegrated.com/en/app-notes/index.mvp/id/5590

TomGeorge

Hi,
Can you post a picture of your current circuit, so we can see your component layout and a copy of the schematic?

Thanks..  Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up