Author Topic: wien bridge oscillator LTSpice simulation  (Read 17301 times)

0 Members and 1 Guest are viewing this topic.

Offline RamiTopic starter

  • Newbie
  • Posts: 3
  • Country: us
wien bridge oscillator LTSpice simulation
« on: November 25, 2016, 11:58:31 pm »
Hello,
I am trying to simulate the circuit described in the art of electronics called Wien Bridge low distortion oscillator. My experience with LTSpice is not extensive and I am not sure what I am doing wrong here. I am not getting the sine wave output. I would appreciate the help in getting this simulation to work, so I can understand the theory better. I have attached what I have done so far. Since there is no lamp in LTSpice, I put a resistor and set its value to R=1+1000*time to get the incremental increase in resistance with time.   
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19682
  • Country: gb
  • 0999
Re: wien bridge oscillator LTSpice simulation
« Reply #1 on: November 26, 2016, 12:30:25 am »
It seems to work. The problem is gain stabilisation. Either there's too much gain so it clips or too little and it dies away.

What about implementing automatic gain control with a J-FET?
 
The following users thanked this post: Rami

Offline RamiTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Re: wien bridge oscillator LTSpice simulation
« Reply #2 on: November 26, 2016, 04:19:35 am »
yeah but implementing automatic gain control with J-FET is too complicated for this application and not necessary but could be a solution.

The voltage gain from the non-inverting input to op-amp output should be exactly +3.00 to keep the amplitude of the oscillation within the linear region of the amplifier. With less gain the oscillation will cease and with more gain the output will saturate. An incandescent lamp (which is represented by the variable resistor R4) is used as feedback element to to maintain the +3.00 gain.

I believe I almost figured it out! my mistake was having the value of the variable resistor, R4, as a linear function of time. After reading the book more carefully, I noticed that it should be a function of the output voltage, not time. In real life, the temperature of the incandescent lamp will increase with increased applied voltage and therefore increase of resistance. I changed the value of the variable resistor from a linear function of time (R = 1+1000*time) to a quadratic function of the output voltage (R=1+100*V(out)**2).
Now finally, I have a sinusoidal output signal but not at the desired frequency. I calculated the resistors and capacitors to be 80K ohm and 10nF for 2KHz and the output signal is measured at 160Hz.
I wonder if the problem could be related to a phase shift? The idea is to make a feedback amplifier with 180 degrees phase shift at the desired frequency. Any ideas? 
I have attached my latest simulation results for reference.
 

Online Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2741
  • Country: ca
Re: wien bridge oscillator LTSpice simulation
« Reply #3 on: November 26, 2016, 11:50:34 am »
Hi,
This is classic. The Wien bridge oscillator requires a non-linear element to control the amplitude. JFETs, incandescent bulbs and thermistors have been used to stabilize the amplitude. One the simplest, and cheapest, ways to do this is add diodes to the feedback path of the op-amp:



Without the non-linearity, the oscillator will stop, or not start or the amplitude is controlled by the amplifier clipping.

The diode method introduces some distortion, the model has about 2% distortion.



I have attached the modified model.

Regards,

Jay_Diddy_B



« Last Edit: November 26, 2016, 11:53:19 am by Jay_Diddy_B »
 
The following users thanked this post: Rami

Online Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2741
  • Country: ca
Re: wien bridge oscillator LTSpice simulation
« Reply #4 on: November 26, 2016, 12:22:37 pm »
I found a model for an incandescent bulb. The bulb is 28V 25mA. If I modify the model like this:



Now R4 has been changed from being a resistor to a bulb. This is done by right clicking on R4 and changing the attributes to:



The prefix was changed from R to X, X is used for a subcircuit. The SpiceModel was changed to LAMP to match the subcircuit name.


If I run this model, you can see the lamp stabilizing the amplitude:



I have attached the model.

Regards,

Jay_Diddy_B
 
The following users thanked this post: Zero999, Rami

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19682
  • Country: gb
  • 0999
Re: wien bridge oscillator LTSpice simulation
« Reply #5 on: November 26, 2016, 07:27:23 pm »
yeah but implementing automatic gain control with J-FET is too complicated for this application and not necessary but could be a solution.
It needn't be too complicated, see attached.


Quote
The voltage gain from the non-inverting input to op-amp output should be exactly +3.00 to keep the amplitude of the oscillation within the linear region of the amplifier. With less gain the oscillation will cease and with more gain the output will saturate. An incandescent lamp (which is represented by the variable resistor R4) is used as feedback element to to maintain the +3.00 gain.
Yes, the trouble is, there's no way to make an amplifier with an exact gain. It'll always be a little too high or a little low.

Quote
Now finally, I have a sinusoidal output signal but not at the desired frequency. I calculated the resistors and capacitors to be 80K ohm and 10nF for 2KHz and the output signal is measured at 160Hz.
I wonder if the problem could be related to a phase shift? The idea is to make a feedback amplifier with 180 degrees phase shift at the desired frequency. Any ideas? 
I have attached my latest simulation results for reference.
I think you've got your oscillators mixed up. A Wien bridge oscillator needs a phase shift of 360o.
« Last Edit: June 21, 2024, 07:14:10 pm by Zero999 »
 
The following users thanked this post: Rami

Offline RamiTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Re: wien bridge oscillator LTSpice simulation
« Reply #6 on: November 27, 2016, 12:57:22 am »
Thank you both @hero999 and @Jay_diddy_B for the help. This is the very first time I have ever participated in an online forum and it has been an amazing experience! It made me realize how awesome the internet is where 3 guys across the globe help out others! :)
I know it is a classic problem which is why I was frustrated with solving it. it seemed very simple and I reread the explanation multiple times.
Hopefully other can find this post resourceful.

Quote
I think you've got your oscillators mixed up. A Wein bridge oscillator needs a phase shift of 360o.
The 180 degrees shift is a quote from the Art of Electronics book. 
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19682
  • Country: gb
  • 0999
Re: wien bridge oscillator LTSpice simulation
« Reply #7 on: November 27, 2016, 01:22:03 am »
Are you sure you weren't reading about a phase shift oscillator with three RC circuits?

Here's a site which takes you through the calculations for the Wien bridge oscillator.
http://www.electronics-tutorials.ws/oscillator/wien_bridge.html
« Last Edit: June 21, 2024, 06:24:34 pm by Zero999 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf