Author Topic: Wien Bridge project  (Read 28663 times)

0 Members and 1 Guest are viewing this topic.

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #75 on: April 04, 2021, 12:19:20 am »
I found a reference to schaeffer-ag.de in an older thread, downloaded Front Panel Designer and found this can clearly do the job. It's going to cost around €60 for the front panel, so I'll wait with that until I'm sure I have a working build.

Things move slowly, lots of simultaneous projects, but I have finally gotten around to designing the oscillator PCB. I didn't have the patience to figure out KiCad or Eagle PCB, so I made it in PowerPoint - my go-to universal drawing tool  :) I am not going to make the peak detector PCB in PowerPoint, though, so I'll just have to take the plunge and learn a proper PCB design tool. KiCad, Eagle, or something else - any suggestions?

I used a three-deck rotary switch for the frequency multiplier switch, and removed one deck to make space for some PCB in front of the upper deck.



PCB, 101.25x57.5mm, component side, courtesy of Microsoft PowerPoint :)



Solder side.

« Last Edit: April 04, 2021, 12:21:05 am by richlooker »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Re: Wien Bridge project
« Reply #76 on: April 04, 2021, 12:48:44 pm »
Kicad.

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #77 on: April 08, 2021, 09:29:58 am »
This is a tedious process;

  • Print solder side image 1:1 on paper
  • Tape paper template to PCB
  • Puncture every solder pad with awl
  • Remove paper template and draw traces by hand (the PCB marker pen is a b**ch to work with, it leaks drops which need to be cleaned up)
  • Etch
  • Drill holes



I use ammonium persulphate; less messy then ferric chloride.



In process...



And the result, not beautiful but usable.

« Last Edit: April 08, 2021, 09:41:32 am by richlooker »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #78 on: April 08, 2021, 09:47:44 am »
It's taking shape.





« Last Edit: April 08, 2021, 09:50:04 am by richlooker »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #79 on: April 08, 2021, 11:11:06 am »
Oscillator board done. Now I need to crimp some connectors and wire up some stuff to test it.

Or semi-done. There will be 2x2x4 resistors in front of the rotary switch, selected to get as close to 100Hz/1kHz/10kHz/100kHz as possible for each switch position. The exact values cannot easily be calculated - that would have to account for all parasitic/stray capacitances and inductances in the circuit - so I will have to rely on successive approximation. The theoretical value, disregarding parasitics, is 1591 ohms, and the per-range resistor pairs are in series with the 1500 ohms resistors just behind the switch.



« Last Edit: April 08, 2021, 11:27:58 am by richlooker »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #80 on: April 12, 2021, 03:10:18 pm »
Wired, powered and ready for testing.



Quite happy with the first frequency reading - bullseye :)




98 resistors for 26 discrete frequency steps per decade.

« Last Edit: April 12, 2021, 03:54:20 pm by richlooker »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #81 on: April 15, 2021, 11:08:19 am »
One evening's work, one out of two rotary switch decks done. Tedious work, but rather satisfying to see the result and verify that it measures as designed :)

Hoping to have the complete setup ready for testing this evening.


 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #82 on: April 19, 2021, 09:24:20 am »
It's nearing completion. But I'm not really satisfied with THD - 2nd harmonic is approx -54dB and 3rd harmonic ~-60dB, I was hoping for a cleaner sine. With the topology set, is there anything I can do to improve upon this?

(the results are similar over the entire frequency range)



« Last Edit: April 19, 2021, 09:26:51 am by richlooker »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Re: Wien Bridge project
« Reply #83 on: April 19, 2021, 10:42:41 am »
But I'm not really satisfied with THD - 2nd harmonic is approx -54dB and 3rd harmonic ~-60dB, I was hoping for a cleaner sine. With the topology set, is there anything I can do to improve upon this?

Could the distortions be from the sound card?  My guess is the soundcard can not cope with 1V amplitude.
Is the ratio of harmonics preserved if you put an attenuator (say a 1/10 resistor divider) at the input of the measuring soundcard?

Another question is the -83dB components at the left and right of the 1kHz fundamental.  That looks like an amplitude modulation.  How far are the two spikes from the fundamental?

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #84 on: April 19, 2021, 01:17:58 pm »
Could the distortions be from the sound card?  My guess is the soundcard can not cope with 1V amplitude.
Is the ratio of harmonics preserved if you put an attenuator (say a 1/10 resistor divider) at the input of the measuring soundcard?

Good point; will redo the test at -6dB - 0.3875V RMS / 0.548V PP

Another question is the -83dB components at the left and right of the 1kHz fundamental.  That looks like an amplitude modulation.  How far are the two spikes from the fundamental?

These are both exactly 50Hz from the fundamental, probably power supply ripple modulating amplification (non-infinite PSRR).
« Last Edit: April 19, 2021, 01:22:59 pm by richlooker »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Re: Wien Bridge project
« Reply #85 on: April 19, 2021, 01:46:45 pm »
A -6dB is a good start, I'll try at -20dB, too.

Maybe the 50Hz AM will vanish after putting the audio side in a shielded enclosure.  If you have a mains transformer keep it in a separated enclosure far away audio part.  Ideally will be to power the generator from a battery.

Otherwise a toroidal transformer (preferably covered in a permaloy magnetic shield) might be very expensive and still have a measurable influence through its magnetic field leaks.  While electric field is relatively easy to make, magnetic shielding is much, much harder.

E+I core transformers ("square core") will be a no go, even when shielded in permaloy they still have terrible magnetic field leaks.
« Last Edit: April 19, 2021, 01:52:06 pm by RoGeorge »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #86 on: April 19, 2021, 08:39:02 pm »
You were right about the audio interface not coping well with 0dB; reducing the level to -6dB reduced the 2nd harmonic a fair amount, while the 3rd harmonic stays put. Further reducing the level to -20dB changes nothing.

The two peaks between 7 and 9 kHz, plus the two smaller ones between 10 and 20 kHz, must be some nyquist/aliasing phenomenon; they are not harmonics of the fundamental, and they move about independently in a seemingly random manner as I change the signal frequency. Seems like I need a better audio interface :)



« Last Edit: April 19, 2021, 08:57:44 pm by richlooker »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Re: Wien Bridge project
« Reply #87 on: April 19, 2021, 09:14:46 pm »
Seems like I need a better audio interface :)

Chances are a brand name external soundcards (e.g. USB or Firewire) would do better, at least in terms of noise.

Beware that some of the so called 24bits/192kHz cards can only play at that resolution/sample rate, so look for the recording specs, too, they might differ badly.


LATER EDIT:
A big part of the remaining 2nd and 3rd harmonic seen in the last charts could still be because of the soundcard.
« Last Edit: April 19, 2021, 09:21:44 pm by RoGeorge »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #88 on: April 19, 2021, 10:00:50 pm »
I have two USB audio interfaces; a Propellerhead Balance (2011), and a Native Instruments Audio Kontrol 1 (2007) - both give similar results, and I just found out that both of them - even though they are capable of 192, 96, 88.2 and 48kHz sampling rate - behave nicely only at 44.1 kHz; now everything above the 3rd harmonic has vanished.

2nd and 3rd harmonic are the same for both audio interfaces, do not change with sampling frequency, are more or less equivalent at -6dB and -20dB, and more or less the same regardless of fundamental. THD measures 0.06-0.1% over the entire frequency range.

I am extremely happy with the performance at low frequencies; eg. THD less than 0.09% at 11Hz - this is simply impossible to achieve with thermistors or filament bulbs, and also impossible without a fast and precise peak/RMS detector.



 
The following users thanked this post: T3sl4co1l

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Re: Wien Bridge project
« Reply #89 on: April 20, 2021, 12:59:21 am »
Nice results!   :-+

Have you tried making the FFT with other types of windowing, too?

Hann is altering most of the samples, depending on the implementation it might add numerical artifacts.
https://en.wikipedia.org/wiki/Hann_function

I don't have any experience about how much this will affect the final result, so this is just shooting in the dark, but I'll be tempted to record and manually cut the samples so the whole recording will fit an integer number of sinusoids (manually trim the recorded samples to start and end with a 0V sample on the raising slope), then apply a rectangular window.  (some thumb rules about windowing at the end of this pdf https://download.ni.com/evaluation/pxi/Understanding%20FFTs%20and%20Windowing.pdf )

Asking because I am intrigued how Jim Williams got in the end ~0.0003%.  I wonder if it's the measuring method, FFT vs. analog Distortion Analyser (many distortion analyzers have a notch filter to get rid of the fundamental), or it's the op-amps, or the topology of the schematic described in "Max Wien, Mr. Hewlett, and a Rainy Sunday Afternoon"?

It might be just a coincidence, but ccktek measured about the same range of 0.0003% distortions with his generator https://www.eevblog.com/forum/projects/low-distortion-audio-oscillator-stabilized-via-trigonometric-identity/ , thought that's a different approach.
« Last Edit: April 20, 2021, 01:22:17 am by RoGeorge »
 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 774
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Wien Bridge project
« Reply #90 on: April 20, 2021, 06:17:44 am »
Just to give you an idea what to expect from a good sound card.
In this case a M-Audio Delta 192 PCI. Unfortunately long out of production.

Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Peaktech 2025A, Voltcraft VC 940, M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers, DL4JAL Transistor Curve Tracer, UT622E LCR meter
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14076
  • Country: de
Re: Wien Bridge project
« Reply #91 on: April 20, 2021, 08:07:17 am »
To see how much if the THD is from the generator, one could add a low pass or notch filter between the generator and sound card. If low pass filtering does not reduce the harminics, chances are they come from the sound card.

An alternative way would be a kind of classic THT analyser / notch to reduce the main signal and look at the residual with the sound card.

The harmincs ratio looks similar at 11 Hz and 1 kHz, so it looks like it is not the limited OP GBW and thus gain at higher frequency.
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #92 on: April 20, 2021, 08:57:15 am »
Just to give you an idea what to expect from a good sound card.
In this case a M-Audio Delta 192 PCI. Unfortunately long out of production.

How could I forget; I have at hand a superb audio signal generator: Tektronix ASG-100!

1kHz from Tek ASG, Propellerhead Balance, exact same parameters as you used, signal at -6dB because distortion increases with the Balance above that:

 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #93 on: April 20, 2021, 09:31:09 am »
I get the lowest distortion from the Propellerhead audio interface at -12dB input; will see what I can get from the Native Instruments one later.

This means the practical limit for THD measurement is probably around 0.01%

« Last Edit: April 20, 2021, 09:33:18 am by richlooker »
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1395
  • Country: ua
Re: Wien Bridge project
« Reply #94 on: April 20, 2021, 11:20:19 am »
It's nearing completion. But I'm not really satisfied with THD - 2nd harmonic is approx -54dB and 3rd harmonic ~-60dB, I was hoping for a cleaner sine. With the topology set, is there anything I can do to improve upon this?
I don't remember your circuit (and I'm not very good at circuit design), but I can tell that for Wien-Bridge topology a THD depends much on an amplitude control circuit setting. From my experience, it may vary by 20-60 dB with a relatively small AGC change.
« Last Edit: April 20, 2021, 11:26:59 am by Vovk_Z »
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1395
  • Country: ua
Re: Wien Bridge project
« Reply #95 on: April 20, 2021, 11:31:37 am »
I have two USB audio interfaces; a Propellerhead Balance (2011), and a Native Instruments Audio Kontrol 1 (2007) - both give similar results, and I just found out that both of them - even though they are capable of 192, 96, 88.2 and 48kHz sampling rate - behave nicely only at 44.1 kHz; now everything above the 3rd harmonic has vanished.
You need something with a 24 bit ASIO. Otherwise, you'll stack somewhere at no lower than 0.005 (+-) % THD.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Re: Wien Bridge project
« Reply #96 on: April 20, 2021, 12:48:03 pm »
I guess ASIO is not crucial here.  ASIO is about low latency in drivers (musicians can easily detect a few ms of extra delay while mixing or playing live), thought most of the true 24 bits cards are made for pro users which also need low latency, hence they are often called 24bits ASIO cards.
« Last Edit: April 20, 2021, 12:51:37 pm by RoGeorge »
 

Offline Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1395
  • Country: ua
Re: Wien Bridge project
« Reply #97 on: April 20, 2021, 12:55:55 pm »
It worked for me, and for others, so I think it'll work for all. ASIO is not only for low latency, but it is totally another audio path. For measuring purposes it gives much lower noise and THD for my card. It's like 16 bit vs 24 bit (Windows MME vs ASIO).
 
The following users thanked this post: RoGeorge

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6145
  • Country: ro
Re: Wien Bridge project
« Reply #98 on: April 20, 2021, 01:15:40 pm »
For measuring purposes it [ASIO] gives much lower noise and THD for my card. It's like 16 bit vs 24 bit (Windows MME vs ASIO).

Not trying to argue, just to learn if this difference can be measured indeed (and not just an audition placebo effect).

I always thought ASIO is about latency and Windows drivers only, so at least in theory it shouldn't make any difference in noise or THD.  (unless the non ASIO Windows drivers are in fact 16 bits only, and can not take advantage of the full range of a 24bits ADC).

Do you have any link, or measurement charts of ASIO vs non ASIO noise/THD, please?
« Last Edit: April 20, 2021, 01:18:29 pm by RoGeorge »
 

Offline richlookerTopic starter

  • Regular Contributor
  • *
  • Posts: 110
  • Country: no
Re: Wien Bridge project
« Reply #99 on: April 20, 2021, 02:44:17 pm »
I think the case is that a WDM driver _may_ resample the signal, but not necessarily so. I tested Audio Kontrol 1 with ASIO driver, a measurable but minimal difference. No difference between bespoke ASIO driver and ASIO4All. Balance ASIO driver won't work with Audiotester, but AAIO4All works. Again, a minimal difference. WDM gave THD 0.0016-0.0019%, ASIO gave 0.0014-0.0017%.





« Last Edit: April 29, 2021, 10:29:28 pm by richlooker »
 
The following users thanked this post: RoGeorge


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf