Author Topic: Wien Bridge project  (Read 29767 times)

0 Members and 2 Guests are viewing this topic.

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Wien Bridge project
« on: February 09, 2021, 03:12:07 pm »
I have embarked on designing and building a wien bridge based sine wave generator, with the following desired characteristics;

  • 10Hz-100kHz frequency range, divided into four decade ranges (using 1% PP capacitors 1nF, 10nF, 100nF, 1µF)
  • Low distortion and fast settling time
  • 26 discrete & precise frequency steps per decade (I intend to put to use an old 26-position two-deck rotary switch I have had lying around for ages)
  • Output 1.55V-1.55mV adjustable in 10 6dB steps

I have been playing around with breadboarding of various designs. To have the frequency scale as intended with the capacitors, I need a fairly high bandwidth amplifier; a plain NE5532, TL072 etc. won't do. I found this design (https://sound-au.com/project179.htm) interesting:



It has the bandwidth required, attains the theoretically correct frequencies, but amplitude bounces badly on frequency change and takes too long to settle. Any attempts to replace the feedback network with a higher-impedant one more suitable for electronic stabilization resulted in self-oscillation at 7-8MHz.

Here it is on breadboard - using Global Specialties breadboards exclusively, after endless frustrations from working with cheapo Chinese no-name ones.



I tried this design: https://sound-au.com/project174.htm - instead of TL072 or NE5532 as suggested, I used the higher-bandwidth LT1253; this is dubbed a "video amplifier" but I thought; an amp is an amp.





The breadboarded sample&hold peak detector. This design has several limitations, but I was hoping it would work for my purposes.



I couldn't make the sample&hold peak detector work below 100Hz or above 10kHz, so I parked that and went for the "precision full-wave AC-DC converter described here: https://www.nutsvolts.com/magazine/article/op-amp-cookbook-part-4



After endless tinkering to make the optocoupler feedback stabilize the amplitude, getting nothing but squegging, probably because of the slow response time from the LDR, I gave up and tried the JFET-based stabilization circuit described here instead: https://sound-au.com/articles/sinewave.htm#s44



I failed in adapting the dual-opamp oscillator design from the "free-floating" LDR stabilized feedback to the ground-referenced JFET design, so I tried a simpler oscillator design, based on this reference design from Linear Technology: https://electronics.stackexchange.com/questions/274570/wien-bridge-oscillator-lt-super-low-distortion-variable-sine-wave-oscillator-d



OK, now I could get the frequency to extend to 100kHz, but stabilization vs. distortion vs. settling time is still a challenge, and I really need different values per frequency decade for the integrating capacitor in the rectifier circuit.

To be continued...
« Last Edit: February 09, 2021, 06:35:57 pm by richlooker »
 

Offline Conrad Hoffman

  • Super Contributor
  • ***
  • Posts: 1931
  • Country: us
    • The Messy Basement
Re: Wien Bridge project
« Reply #1 on: February 09, 2021, 05:43:54 pm »
I think a certain amount of bounce comes with low THD. IMO, everything you might want to know is here- https://www.diyaudio.com/forums/equipment-and-tools/205304-low-distortion-audio-range-oscillator.html It's understandable if you just conclude ;TLDR!

 
The following users thanked this post: edavid

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5875
  • Country: de
Re: Wien Bridge project
« Reply #2 on: February 09, 2021, 06:01:41 pm »
The amplitude bounce problem is well known with Wien bridge oscillators and stems from the gain regulation.
The gain is critical for low distortion and oscillator start and is classically done with either a self-heating NTC, or in your case an incandescent bulb.
Both are slow.

There are more modern ways of gain control that stabilize faster, eg, JFET control, but the distortion characteristics are usually not as good.

For a really good high speed op amp, I can recommend LM6171/6172 from TI. I have have used these with success.


« Last Edit: February 09, 2021, 06:06:26 pm by Benta »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #3 on: February 09, 2021, 06:15:49 pm »
I think a certain amount of bounce comes with low THD. IMO, everything you might want to know is here- https://www.diyaudio.com/forums/equipment-and-tools/205304-low-distortion-audio-range-oscillator.html It's understandable if you just conclude ;TLDR!

Thanks for the input, Conrad. Alas, I have read that thread and everything it references already. My requirements for frequency range 10Hz-100KHz go beyond the capabilities of any of these designs, many of them are theoretical and/or untested, and stating "no settling time" for a lamp-stabilized oscillator is IMHO a lie. Also, seeing the data for the commercial/professional lamp-stabilized designs - HP200[A-CD] and General Radio 1316 - the distortion rises sharply below 100Hz.

I believe the only way to achieve low distortion at low frequencies is by using peak detection / sample and hold. I am experimenting with modifications to the ESP design at sound-au.com; I am pretty sure it can be improved upon to handle 10Hz well, and probably also the upper decade 10kHz-100kHz.

I can recommend LM6171/6172 from TI. I have have used these with success.

And thanks for your input, Benta. I will check out these opamps. I have decided to stick with JFET control, with the distortion-minimizing tricks applied in the design I showed in the initial post.

Cheers, Richard
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5875
  • Country: de
Re: Wien Bridge project
« Reply #4 on: February 09, 2021, 06:28:12 pm »
The problem is, that at very low frequencies, the gain control natural frequency is close to the oscillator frequency and thus suddenly becomes part of the oscillator itself.
Your peak detect approach sounds interesting, let us know your results.

Cheers.

 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21686
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Wien Bridge project
« Reply #5 on: February 09, 2021, 06:44:51 pm »
Is the bounce really that bad?  I always got the impression that was normal, and these things weren't supposed to be agile or anything, just set it and wait for it to stabilize.

If you wanted an agile source in that era (60s tech), you might go for a dirtier oscillator followed by a filter.  Switched-cap filters are pretty cheap and effective, and the clock frequency is readily available here so it's no big deal to make a variable filter in this way.  (Whereas using OTAs for a variable continuous-time filter is a PITA.  Also, "just make it good in the first place" would be the HP approach, endless optimization of a circuit to balance performance at all corners.  That's the final-boss PITA that you're up against, here, I think.)

So, speaking of OTAs, I found this to be pretty effective:



OTAs are certainly contemporary, if not in IC form then they're easy enough to make discrete as well.

If you've taken higher level EE courses, you may recognize this as an implementation of the differential equation of an oscillator.  IC1A  and IC2A are integrators, R10 introduces a damping term, and IC1C provides a controlled negative damping term.  The differential equation equates the second integral of the signal, to itself, with a first integral term having a coefficient of zero for no damping (stable amplitude), or positive or negative for decay or growth respectively.

The components are nonideal, so there will be some poorly-defined amount of damping in the system, varying with operating point; effectively, this makes damping biased towards decay by default, with a variable amount of growth on top of that.  Exactly how much growth is needed to reach stable (constant amplitude) operation, that depends, but we can solve that with a feedback circuit.

My intent with this circuit was to get reasonably low distortion, and stable (or even controllable) amplitude, with frequency variable over a modest range.  It seems the amplitude is quite controllable indeed, which is at odds with the theoretical basis -- the trick is the OTA's tanh(x) transfer curve, only linear for very small inputs (~10mV).  As amplitude rises, average gain drops, gradually turning the integrator output towards a more triangular shape (it's nonlinear, it introduces distortion of course), but also limiting the amplitude.  So it happens that I could measure the circuit as shown, with just a trimpot for amplitude control -- I didn't have to implement AGC.  (I did add that later, using a simple precision rectifier and error amp; alas I don't have the schematic handy.)

The best part about this circuit is it produces quadrature (or, very nearly so, again given that the damping terms cause a little phase error).  A downside is, because there's a fixed integrator in the loop, the amplitude of one channel varies against the other, while varying frequency.  So it's not a constant amplitude quadrature oscillator.  That could be fixed by changing IC2A to another OTA (hmm, and R10 might have to be variable as well?), or adding an amplitude regulator to the quadrature output.

Also, the noise performance probably isn't great (the impedances are quite high, and the voltage dividers can't be helping), but I'm not trying to do precision audio testing with this.  YMMV.

So, this is commonly called a quadrature oscillator, or state variable oscillator (state variables meaning, the integrals of the signal).

This is rather beside the OP question (Wien bridge), but it sounds like you're more interested in any good oscillators, than in that type specifically, so that's okay.


And, as for that -- you can implement the gain control element in much the same way, i.e. using an OTA as a variable resistor or gain stage.  Then you can control the dynamics however you like.

The problem with the lamp is, while its thermal time constant is largely diffusion based (which is good, that should leave about 45 degrees phase margin at any frequency in the asymptotic range), it's limited in size (the asymptote doesn't extend to infinite time, it has a longest time constant somewhere in there), so will naturally go unstable at low enough frequencies.  To solve this, simply use a bigger bulb, of course!  But then settling will be obnoxiously slow at high frequencies, taking thousands of cycles say.

There can be no simple solution to this -- you need the amplitude control function itself, to be controlled proportionally alongside the oscillator.

So we might solve that, by using both halves of a dual OTA, one for the variable resistor in the oscillator loop, one for a variable term in the control loop.  A third (normal op-amp) does error amp duty.  Varying the second OTA, in step with the oscillator setting, the control loop response can be made to track the oscillator frequency.

Also, you don't want the control to respond too quickly, because it will convert some of the detector's ripple into amplitude ripple -- distortion.  In general, disturbance in the control loop is mixed into the oscillator response, so for example if the control has some 60Hz injected into it, you'll get 60Hz sidebands on your output.  Same for any other noise, including input noise of the error amp itself, etc.  This sets a limit on possible settling time versus distortion, and on the noise floor, phase noise, whatever.

A possible solution is an ideal detector, i.e., given a waveform A sin(w t), it returns the amplitude A regardless of phase t.  The easiest way to implement this is using the Pythagorean identity, sin^2 t + cos^2 t = 1.  For which you need an ideal quadrature circuit -- which is a point in favor of the quadrature oscillator.  You then need a pair of squarers, then the sum is the amplitude -- with zero ripple, no filtering required -- which can then control the amplitude exactly over time.  (Which, if this is starting to sound like more of a PITA, you're right.  Now you understand why analog computers went out of favor...)

Otherwise, the problem with tracking the control response is, it has to track with the oscillator rate.  Presumably you'd use a double ganged potentiometer to set the Wien bridge resistors; a third gang I guess could be added to get a control voltage, which can be offset as needed, to at least match the required response at two points.  Hopefully a linear response matches nicely -- it's not obvious to me offhand if it would be linear, or follow a curve.  If it actually needs a curved response (like, a hyperbolic section often shows up in situations like this, i.e., the gain needs to vary inversely with control level), then it can be tuned to match at two crossing points, and it'll settle worse away from those points.  (Hopefully not so much worse that it oscillates.)  Maybe it's a narrow enough range, and the tolerance is loose enough (say +/-20% of ideal settling), that it's fine.  Anyway, the point I want to get at is, wouldn't it be great if the Wien bridge itself were variable, by that same control voltage, and proportional to it?  So you could transform the resistors or capacitors with OTAs, or some other kind of analog multiplier.

At this point, it's just a little rearrangement, really, to make a state variable oscillator with OTAs -- so, one might argue it's still semantically correct, assuming one allows the above transformations.  (Which is just a really technical way of saying, "I know you said Wien; well, teeeechnically...")

Anyway, despite the exponentially greater semantic complexity... this is really making a DDS look attractive, isn't it? :P

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: salbayeng

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Wien Bridge project
« Reply #6 on: February 09, 2021, 07:19:15 pm »
« Last Edit: February 09, 2021, 08:01:43 pm by RoGeorge »
 
The following users thanked this post: T3sl4co1l

Online blackdog

  • Frequent Contributor
  • **
  • Posts: 739
  • Country: nl
  • Please stop pushing bullshit...
Re: Wien Bridge project
« Reply #7 on: February 09, 2021, 07:25:37 pm »
Hi  richlooker

First of all, my compliments on the way you put the components on the breadboard!
Except for myself, I don't see that often.  :-DD

Below you see two links of a sine wave oscillator project by the designer J.S. Tregellas.
I built the schematic with LME49860 opamps.

With a well chosen ratio of the LED current and series resistance of the LDR, the distortion is less than 0.001%.
which I measured with my Audio precison measuring set in the middle of the audio frequencies.
You can get the distortion in the low frequencies a little lower by increasing the RC time of the rectifier.
Those are the 100 Ohm resistor and the 100uF 16V capacitor.

A well-chosen LED / LDR combination will give almost no bounce.
That was very noticeable about this circuit.

Schematic
http://www.users.on.net/~endsodds/aocct.jpg

Project page
http://www.users.on.net/~endsodds/ao.htm

Kind regards,
Bram
Necessity is not an established fact, but an interpretation.
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #8 on: February 09, 2021, 07:28:38 pm »
If you've taken higher level EE courses, you may recognize this as an implementation of the differential equation of an oscillator.

I did indeed take higher level EE courses, but I did not recognize this. Might have something to do with the fact that my university years were 1989-1993, and I have never touched stuff like that since then. Thanks for taking the time to write all this; interesting concept, but it's going to be wien bridge until I succeed or am forced to give up.

dirtier oscillator followed by a filter

Nope, I prefer doing it the right/hard way in the first place.

This is rather beside the OP question (Wien bridge), but it sounds like you're more interested in any good oscillators, than in that type specifically, so that's okay.

I'm in fact really, really interested in making a good wien bridge based design, I have been playing with it on and off for years, but now I am determined. David Packard and Bill Hewlett designed the HP-200CD in 1955, how hard can it really be to make a 10Hz-100kHz wien bridge with modern components? And is fast settling time _and_ low distortion really to much to ask for???

Anyway, despite the exponentially greater semantic complexity... this is really making a DDS look attractive, isn't it? :P

Never. The digital domain is devoid of beaty and elegance   ;)

This Wien Bridge is fast settling and very low distortions:
https://www.eevblog.com/forum/projects/low-distortion-audio-oscillator-stabilized-via-trigonometric-identity/


Interesting concept - albeit not a wien bridge - but I will pursue the peak detector solution first, which if I can get it right will output a  "D.C. voltage whose amplitude is proportional to the amplitude of the outputs and independent of frequency"

Cheers, Richard
« Last Edit: February 09, 2021, 07:42:27 pm by richlooker »
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5875
  • Country: de
Re: Wien Bridge project
« Reply #9 on: February 09, 2021, 07:47:47 pm »
As you're planning to use a decade switch anyway, an approach could be to use this to set the gain control loop's natural frequency as well (making a double or ganged decade switch necessary, of course).
This would give you relatively slow settling at low oscillator frequencies, but fast settling at high ditto.

The second issue is the gain loop's damping ratio. If you can set it to critical damping, the amplitude settling time would be low.

The third is the gain loop's "own" gain. If this is set to be low enough to allow the oscillator to start, but no higher, this would also limit the amplitude bouncing.
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #10 on: February 09, 2021, 07:49:39 pm »
First of all, my compliments on the way you put the components on the breadboard!
Except for myself, I don't see that often.  :-DD

My brain works like that; I don't trust anything that looks like a rat's nest - it has to be neat and orderly, and I have to be able to spot easily how everything is connected. Also, aesthetics ;D

Below you see two links of a sine wave oscillator project by the designer J.S. Tregellas.
I built the schematic with LME49860 opamps.

OK, a phase-shift oscillator. I might try that later. But I am very skeptical towards the LED/LDR feedback, at least I have not been able to tame it, especially at frequencies <100Hz.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Wien Bridge project
« Reply #11 on: February 09, 2021, 09:35:16 pm »
This Wien Bridge is fast settling and very low distortions:
https://www.eevblog.com/forum/projects/low-distortion-audio-oscillator-stabilized-via-trigonometric-identity/


Interesting concept - albeit not a wien bridge - but I will pursue the peak detector solution first

Ooops, entangled memories!  Not Wien, sorry.   ;D

Just that when I found out about the idea of summing the square of quadrature signals in order to control the amplitude, I thought maybe it'll worth trying that to stabilize a Wien bridge.  Never put that into practice yet.

So far I've tried to stabilize a Wien Bridge in two ways
- with a miniature incandescent light bulb; that worked unexpectedly well
- with a JFET (as a resistor controlled by a diode peak detector) it also worked, but with higher distortions caused by the little ripple after the diode peak detector and because of the JFET nonlinearity with Vds (at high amplitude the distortions were so big that they were visible even on the oscilloscope).

Found that breadboard!   :D



There use to be decoupling 10uF||100nF on each power line, near each IC (not present any more in this pic), but a mandatory add for low distortions and stable oscillations.  That AD509KH driving the Wien Bridge is a beast of an opamp, best opamp I've ever had.



Later edit:

Wow, I see only now you updated the OP with lots of pics and details, nice project!   :-+
« Last Edit: February 09, 2021, 09:43:30 pm by RoGeorge »
 

Online Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1417
  • Country: ua
Re: Wien Bridge project
« Reply #12 on: February 09, 2021, 11:44:20 pm »
The amplitude bounce problem is well known with Wien bridge oscillators and stems from the gain regulation.
+1.
Here is a good stable one in an attachment. Not a Wien bridge, so very stable with live frequency changing. Doesn't need stereo potentiometers. It has 0.006% as is but can go up to 0.001% with some small changes (R3 can be decreased up to 22-27k). I used 2N5484 instead of 2SK30.

« Last Edit: April 29, 2021, 12:35:18 am by Vovk_Z »
 

Online Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1417
  • Country: ua
Re: Wien Bridge project
« Reply #13 on: February 09, 2021, 11:51:05 pm »
Here I found my 50 Hz project (43-53 Hz). Very cheap and reliable:

« Last Edit: February 09, 2021, 11:58:43 pm by Vovk_Z »
 

Offline Conrad Hoffman

  • Super Contributor
  • ***
  • Posts: 1931
  • Country: us
    • The Messy Basement
Re: Wien Bridge project
« Reply #14 on: February 10, 2021, 12:26:47 am »
Another thought, though probably not a Wein. Have a look at the oscillator used in the Bob Cordell THD analyzer project published in Audio many years ago. I don't remember it having much bounce, but probably a bit.

http://www.cordellaudio.com/papers/build_a_thd_analyzer.shtml

It gets down below 0.001% and has decently wide bandwidth. The downside is it needs multi-deck switches that aren't as widely available as they used to be. Some people have used small relays and such.

 

Offline RandallMcRee

  • Frequent Contributor
  • **
  • Posts: 541
  • Country: us
Re: Wien Bridge project
« Reply #15 on: February 10, 2021, 01:31:43 am »

The thread that Conrad first recommended over on diyaudio has much, much more information...

Anyhoo, here is a very good one that I have built and settled on some years ago...it has some nice features and is quite stable. This basic design (courtesy of Janas Card) is in that thread, but, of course, is hard to find.

http://www.janascard.cz/PDF/An%20ultra%20low%20distortion%20oscillator%20with%20THD%20below%20-140%20dB.pdf

Good luck!
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 16618
  • Country: us
  • DavidH
Re: Wien Bridge project
« Reply #16 on: February 11, 2021, 01:47:31 pm »
Jim Williams has an extensive discussion of Wien Bridge oscillators starting on page 29 of Linear Technology application note 43 including the need for common mode suppression.

 
The following users thanked this post: RoGeorge, ch_scr

Offline jonpaul

  • Super Contributor
  • ***
  • Posts: 3366
  • Country: fr
Re: Wien Bridge project
« Reply #17 on: February 11, 2021, 02:14:57 pm »
Hello all:

Jim Williams Lin Tech note is the best, he was a scion in the industry and had studied and restored the old HP 200s.

The incandescent lamp has been replaced by optocouplers and balanced FETs in some designs.

Finally the THD, and output V requirements affect the design, many tradeoffs.

Kind Regards,

Jon

Jean-Paul  the Internet Dinosaur
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Wien Bridge project
« Reply #18 on: February 11, 2021, 02:37:46 pm »
Jim Williams has an extensive discussion of Wien Bridge oscillators starting on page 29 of Linear Technology application note 43 including the need for common mode suppression.

Some extra tails and details in the chapter 7 of Jim Williams' book "Analog Circuit Design Art, Science and Personalities":
"7. Max Wien, Mr. Hewlett, and a Rainy Sunday Afternoon"
http://www.introni.it/pdf/Williams%2007%20-%20Book%20Chapters.pdf
 
The following users thanked this post: ch_scr

Offline Conrad Hoffman

  • Super Contributor
  • ***
  • Posts: 1931
  • Country: us
    • The Messy Basement
Re: Wien Bridge project
« Reply #19 on: February 11, 2021, 09:07:48 pm »
I believe some of that material is copyrighted and shouldn't be there.
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #20 on: February 11, 2021, 11:15:35 pm »
I believe some of that material is copyrighted and shouldn't be there.

Dang. That didn't occur to me. You are probably right, thanks for pointing that out. I'll contact the owner of sound-au.com and ask for permission.

Cheers, Richard
 

Offline MikeK

  • Super Contributor
  • ***
  • Posts: 1314
  • Country: us
Re: Wien Bridge project
« Reply #21 on: February 11, 2021, 11:17:56 pm »
I was just reading in "Timer/Generator Circuits Manual" by R.M. Marston that the bounce problem of variable Wien circuits can be minimized with diode stabilization (two diodes in anti-parallel in the feedback path).  See page 19.  Can also be done with back-to-back Zeners (page 20).
 

Offline Conrad Hoffman

  • Super Contributor
  • ***
  • Posts: 1931
  • Country: us
    • The Messy Basement
Re: Wien Bridge project
« Reply #22 on: February 12, 2021, 12:14:43 am »
Actually, it was the Jim Williams book chapters I suspect shouldn't be up there. I have the book and highly recommend it.
 

Offline JoeyG

  • Regular Contributor
  • *
  • Posts: 117
  • Country: au
Re: Wien Bridge project
« Reply #23 on: February 12, 2021, 01:02:19 am »
How about digitally ?   
This example goes to 24KHz    @ 0.6% distortion
http://archive.siliconchip.com.au/cms/A_111885/article.html
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #24 on: February 12, 2021, 11:52:43 am »
Actually, it was the Jim Williams book chapters I suspect shouldn't be up there. I have the book and highly recommend it.

With respect to the diagrams I copied from the sound-au.com site, I received this response from Rod Elliott, the owner:

Quote
Richard,
All material on my site (and on most other sites with original material) is copyright.

Ideally, you would link to the page where the drawings are located rather than upload them to a forum.  I have a great deal of difficulty with other sites pirating material, and you haven't helped.

Your understanding of copyright law is not correct - copyrighted material remains copyrighted.  US style 'fair use' is often misunderstood - see https://www.copyright.gov/fair-use/more-info.html

Considering the nature of the thread, I will (reluctantly) grant permission for those images you have already used, however this does not extend to further images or text.

There is a copyright notice at the end of all pages on my site, and it specifically states that republishing without express permission is prohibited.

Cheers,    Rod

Richard
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf