Electronic – Problems with Wien Bridge oscillator circuit simulation in Mutisim

multisimoscillatortransistorswien-bridge

I am trying to build a Wien bridge oscillator that oscillates at 2.1kHz and that can be switched on by a transistor. The reason for me placing a transistor switch in the circuit is so that I can turn the oscillator on and off from a PIC MCU. However, when I build the simulation in multisim, I get an DC output voltage of 3.0mV and an. I want an output voltage of 5.0V p-p, so can anybody explain to me what the problem with this circuit is? Any help would be much appreciated.

enter image description here

Best Answer

Your opamp only has a gain of 1.
A wien bridge oscillator needs a gain of 3 to compensate for the attenuation of the RC network at the freqeuncy of oscillation.
Try adding the neccessary feedback resistors for G = 3. You would typically need some AGC (automatic gain control) in a real circuit, possibly here too.

EDIT - I just noticed the 3.01k resistor (R4) on the V+ pin of the opamp. What is this for?
It will certianly cause strange behaviour as the opamps supply voltage will vary according to how much current it draws.
To simplify things I would get rid of R3,R4,Q1 and V3. Just use V1 to supply 5V directly to the V+ pin (pin 7)
If you could update your diagram with the new version (with gain setting resistors, etc) it would help to be sure you have it right.

EDIT 2 - I just tried this in LTSpice:

Schematic:

Wien Bridge

Simulation:

Wien Bridge Sim

There are two things to note here. One is the use of a gain slightly higher than 3 (R2 + R1)/R1 = 14.9k / 4.9k = ~3.04.
The other is the inclusion of "startup" in the .tran command. This tells it to start the supply voltages at 0, giving the oscillations a chance to start before the circuit has reached a steady state. Otherwise you would have to inject some noise into the circuit to simulate real world conditions. You should have a similar setting in MultiSim (e.g. "start supply voltages from 0" box to tick or something like that)

To include an AGC, you would use something like a thermistor in the feedback path (e.g. between R2 and ground) When the gain rises above 3, the thermistor passes more current and raises it's resistance, thus dropping the gain. You can also use a JFET, diodes, bulbs, etc. I wouldn't worry about this now though as you can get the circuit to work without this. The main purpose is to stop clipping/distortion of the sine wave which would be bad for e.g. a signal generator.

EDIT 3 - Limiting current with a resistor is not necessary, the TL071 will only draw as much current as it needs so you can connect it directly to the voltage source. The amount of current the supply could provide is irrelevant, the TL071 will draw max 2.5mA whether connected to a 5V 3mA supply or a 5V 300A supply.
To switch the power on and off, a P-channel MOSFET would work okay. You would tie it's source to +5V, drain to opamp V+ and gate to microcontroller pin. Set pin to 0 to turn on, 1 to turn off. If microcontroller supply is lower than 5V, then you would need a pullup resistor from gate to +5V (say 10k). Set pin to Hi-Z (e.g. input) to turn off, set to output and 0 to turn on.

EDIT 4 - An N-Ch MOSFET wouldn't work very well, as when you turn it on (e.g. gate to 5V), the source voltage rises and narrows the difference between the gate and source again. It will ultimately settle at around Vgate - Vt. So if the Vt (voltage required to turn on = threshold voltage) is say, +1.5V, and the gate is set to +5V then the source would only reach 5 - 1.5 = 3.5V. Since the source is connected to V+, then the opamp will only see 3.5V for it's positive supply.

Here is an example of the switching. Note how when the mcu pin (represented by V3) is set to 0 the oscillations start and vice versa:

Schematic:

Wien Bridge Switch

Simulation:

Wien Bridge Switch Sim