Sinewave Generator with variable frequency

Started by dthurstan, September 04, 2010, 12:07:23 PM

Previous topic - Next topic

dthurstan

So I've been looking to build a simple sinewave generator for a while now. I found this thread http://www.diystompboxes.com/smfforum/index.php?topic=74094.0 and eventually got round to breadboarding it. Doesn't seem to work! I'm sure I've built it to the layout. Heres the layout:



Has anyone built this circuit? Is it correct? I've also drawn a schematic for it:



R1: 10k                    C1: 47uF
R2: 10k                    C2: 0.1uF
R3: 4k7                    C3: 0.1uF
R4: 4k7                    D1: 1N914
R5: 10k                    D2: 1N914
R6: 330                    P2: 100k dual pot (log)
R7: 330                    IC1: TL72

I didn't have a 30uF cap so I used 47uF. Also only have 100k log dual, although I have tried a 47k lin dual. I haven't used P1, I just connected pin 7 (o/p2) to pin 3 (+ i/p1).
The op amp appears to be working correctly i.e inputs & outputs are similar voltages. Although shouldn't it be oscilating?

Here are the voltages:

Vsupply : 9.45
Vref : 4.56

IC1
1: 4.62
2: 4.62
3: 4.62
4: 0
5: 4.56
6: 4.59
7: 4.62
8: 9.16

Im making this circuit to produce the carrier signal for a ring modulator pedal, but I may give up on it and built a triangle generator, like the LFO in the easyvibe. However I have read just changing the caps (in LFOs) to produce a higher frequency range may not work. Really I'm looking for a simple circuit running of 9V with a boosted output so I can drive a passive ring mod.

I've pluged it into my audio interface but don't get any sound out of it. Turning the pot you get hum at 1 end and complete silence at the other.

Can anyone see where Im going wrong with this circuit, please?

Cheers

Rob Strand

It's possible the circuit isn't starting up.  Try reducing R3 to 3k9, or even 3k3, just to confirm it works at all.
Lower R3 helps the oscillator oscillate but the smaller it is the more distorted the output gets.

For lowest distortion:

After that, put original value back in, add a large value resistor in parallel with R3 - start with 220k. 
Use the largest value  so that the oscillator still works then go one value lower for safety.
You could use a pot to trim it.

You need to make sure it works over all setting of the frequency pot when you do this.
The lack of tracking of the pots can make it drop out again.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

merlinb


R.G.

There are about a zillion ways to produce an almost-pure sine wave.

What you have there is an adaptation of the Wien Bridge circuit, I think. It needs a dual pot to change the frequency.
The phase shift oscillator does a good-ish sine if properly adjusted, and also needs a dual pot for wide frequency range.
The Twin T does a good-ish sine if properly adjusted and also needs a dual or triple pot for wide range.
The state variable filter can be adjusted for self-oscillation, needs a dual pot, and can have a WIDE frequency range. Dual OTA (LM13700) implementations can go from subaudio to ultrasonic in one range in the SV filter. I guess they can do that in a strongly modified phase shift as well.

All of these circuits suffer from the exactly-gain-of-one syndrome. To get self oscillation at all, the loop gain through the amplifier and back through the feedback path to the input of the amplifier has to be at least one. If the gain is over 1.00000, the sine wave increases in amplitude until it's held in check by some nonlinearity. The non-linearity necessarily introduces distortion, but cuts the gain back so the thing stays oscillating. The entire company of Hewlett-Packard was based on the masters-thesis idea that a light bulb's resistance varies nonlinearly but with low distortion; the HP200 sine wave generator provided easy tuning and really low distortion for the first time commercially, and that idea set up the company we know now.

If you can stand 1/2 to 1% distortion, sine waves are easy. Getting under that is HARD in a simple analog circuit.

One way to get a sine wave is to filter any wave down to its fundamental with a lowpass or bandpass filter. So you can take a high-order filter's output, which ought to be close to a sine wave, buffer it and feed it back into itself to drive itself. You tune the frequency by tuning the filter. Modern 8-pin dip digital lowpass filters tune with a digital clock at about 100x the filter frequency, so you can tune these over a wide range with a simple CMOS oscillator.

Another way is to digitally generate a sine wave. The shift-register tricks I wrote up in the article at GEOFEX let you feed in a 16X digital clock (for instance) and get out a digital approximation to a sine wave that even a simple filter makes be low distortion.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

dthurstan

Hey thanx for all the replies.

Rob Strand I tried reducing R3 and it still didn't work! I'm not sure if it would work in the ring mod coz of the voltage ref. Vref is taken as ground for the output. The other parts to the ring mod won't work as ground will be the battery -. My plan is to build the circuit in sections. oscillator, boosters (for i/p & osc), buff & blend to mix signals and of cource the passive ring mod.

Merlinb, thats a cool circuit I will have to build that some time. Bipolar power would have scaried me off not long ago but its pretty easy to build a small MAX1044 circuit.

RG, cheers for the responce. The first oscillator I looked at was the Q&D, I asked varying R in another post but it in my confused logic (fuzzy logic if you will ;)) I assumed that changing the value of R would detune the circuit  ???

Anyway, I breadboarded Q&D (what I shoulda done in the 1st place) and used a dual gang to vary the frequency. It worked  ;D

I think Im gonna play around with values to get a good range. I used a 47k above 5.7K the signal gets to low. I can sweep it from 500Hz - 1KHz.

One thing I don't understand is how to work out Fc. If I take R = 27000 & C = 0.00000001, then Fc = 1 / (2 pi R C) = 589Hz. Am I beening stupid  ???

Rob Strand

I suppose there's two issues.  The first is to make the oscillator oscillate the second is to get it to work with your ring modulator.

The circuit should work.  The biasing looks OK to me.   Here's another example with slightly different biasing, I don't see why either shouldn't work.

http://www.analog.com/static/imported-files/application_notes/46855865AB111.pdf


I'm thinking there is a missing connection somewhere:
- first try along R6, P2a, C2.
- If not there, then around  C3, R7, P2b.
- if not there, try around R3

Another option is you have got you resistor colors wrong (say R5, or R7).

(BTW the layout and schematic have the opamp halves swapped).
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.