A few questions about Wien Bridge Oscillators and clean sine waves

Thread Starter


Joined Feb 12, 2013
Hi all,

I am working on a function generator circuit which will do sine, square and triangle waves at audio frequencies to be used for testing amplifier circuits and similar. I don't need to get to .0000000000000000002% or anything like that as this is just a hobby project but I would like to get it as clean as possible, of course. Perhaps 0.01% distortion would be a good target. Additionally, I don't have a distortion analyzer, just an old analog scope, so I have to rely on coming up with a good circuit design without actually being able to measure the result.

This is my core oscillator circuit:

though, on my breadboard, I currently have this one wired up:

(discussion is here: http://www.4qdtec.com/singen.html)

I want to run this off a single supply of either 9 or 12 volts and that's why I'm using the 4qdtec circuit currently. The plan is to use the standard circuit (as in the wikipedia link) but use another op amp to provide a 1.5V voltage reference by, basically, detaching R1 and C1's left connections from the wikipedia diagram and connecting them to the 1.5V reference.

The only other twist that makes my circuit different than the standard one is that I would like to use the resistor side of optocouplers in place of R1 and R2 (see 1st diagram link). I'll be using Silonex NSL-32H-101 parts since I just bought 100 of them on the cheap. The goal in this is that I'm wanting to use a microcontroller with an output PWM voltage to control the frequency of the circuit... but this is just for overview, not really part of my question except for the fact that A) optocoupler LDRs do add their own distortion compared to actual resistors and B) the resistors will be mismatched fairly poorly compared to precision resistor values.

I've been studying up on the Wien Bridge circuit math and there are a few questions I haven't been able to find an answer to.

A) if I mismatch the two legs of the wien bridge circuit (the series RC versus the parallel RC) does that add distortion? Or does it just change the oscillation frequency? Simulating it, I only see that the frequency changes if I randomly change the 4 R and C values, but I don't see any misshaping of the waveform.

B) Where does the amplitude or midpoint voltage come from in the standard circuit (see link 1)? I know the frequency is 1/(2 Pi R C) if R and C are matched but I don't know what determines the final amplitude. When I experiment with a variable resistor in place of the two R's I see the amplitude seems to change (randomly?) at some frequencies but there's no overall decrease or increase across the frequency spectrum that I can see.

C) Why do most circuits use multiple switched values for their capacitors, one per decade or what have you? With a value of, say, C=100nF and R=82 to 10082 I've gotten a frequency span of about 200 Hz to 20K Hz and the circuit oscillates throughout and the amplitude is similar. Is it just because it's too hard to adjust a knob to that level or is there a distortion factor? My goal is to use a feedback loop with the microcontroller so it would be doing the minute frequency adjustments, checking the resulting frequency then readjusting until the desired frequency is obtained. Is there anything wrong with using a single C value along with an R value swing of this magnitude?

D) This is extra credit (lol) but in the 4QD circuit (link 2), I had wired up the original circuit with ceramic, cheap caps and it handled the frequency range of 200Hz-20kHz without ceasing to oscillate at any point in the range and without any obvious clipping; then I bought a bunch of polyester film caps and used those; then, suddenly, adjusting the 500R resistor (see link 2) became a very, very sensitive chore where the high frequencies would stop oscillating unless I reduced the 500R knob a bit but then, when I'd lower the frequency back to 200Hz, it would be clipped a bit (over-amplified). The end result was that I couldn't really tweak the circuit to handle the full frequency range with the polyester caps, but could with the ceramic caps. Please ignore this one unless I'm missing something obvious :)

E) Is using PWM to control the two R's of a Wien Bridge a bad idea? It would run at maybe 40kHz or 100kHz, run through a low pass filter for smoothing then finally control the two opto couplers which represent the two resistors of the Wien Bridge. (This one can be extra credit too :) )

If anyone has any input into any of these questions, it would be greatly appreciated!