Show by Label

Showing posts sorted by relevance for query fft. Sort by date Show all posts
Showing posts sorted by relevance for query fft. Sort by date Show all posts

Saturday, October 14, 2017

Setting up an FFT Measurement System


In this post I'll describe how I use a number of components/instruments to create a system that you can use to measure harmonic distortion and noise by using FFT's. This system can be configured in several ways to verify and measure the distortion of amplifiers, sine wave generators, power supplies etc.

Here is the complete set of instruments that make up the analyzer.
From top to bottom, the modified E-MU 0202 USB Sound "Card" digitizing interface to the PC, the "Pete Millett" Sound "Card" Interface, and on the bottom the combined "pure" Victor Mickevic 1 KHz sine wave oscillator and an active 1 KHz Twin-T notch filter.


First a little overview

To measure the performance (here the amount of distortion generated or added) of a black-box system (the Device Under Test - DUT), a very clean and low distortion sine wave (the fundamental) is used to stimulate the DUT, while the output is sampled. The output signal is stripped from the fundamental sine wave by means of a sharp filter, and the remaining residual, the combined noise and distortion is fed to an FFT system that can show the results.

Following is a picture of the setup needed to measure the Total Harmonics Distortion (THD) and the THD plus noise (THD+N) from a DUT.






This is a setup that can be used to measure sine wave generators, or to verify the Sound Card interface to the PC and the FFT software.

A high quality low distortion 1KHz sine wave is fed to the DUT, here symbolized as an amplifier. The output signal from the DUT is fed to the Soundcard Interface and is probably attenuated. This interface protects the delicate and sensitive inputs of the other intruments in the chain, like the T-filter and the USB Sound Card, and also facilitates making a few measurements. The resulting output is then fed to an (active or passive) Twin-T filter which removes the 1KHz fundamental. The residual (everything added by the DUT to the pure sine wave) is then fed back into the Soundcard Interface and then going to the USB Sound Card Interface, here a simple SD-AUD20040, where it is digitized and sent to the PC over a USB link. On the PC/Laptop, a software application like AudioTester, is used to show the residual (and noise) by means of an FFT.

This same setup can also be used to measure the noise performance of a power supply. In that case, the power supply output is first stripped from the DC component by using a capacitor (not shown), and then fed to the Sound Card Interface, and from there to the USB Sound Card for digitizing and on to the PC and the AudioTester FFT software.

If you want to measure the quality of sine wave generators or verify the components in the link, you can also use the following much simpler setup.



How you inter-connect the various instruments depends on what they offer. In this example, the output of the sine wave generator is fed directly to the Twin-T filter and the residual is digitized by the USB Sound Card. The Sound Card Interface is not needed, because the input levels can be set low enough, althoug you need to be carefull or use attenuation adapters.


The instruments that are used in the chain

In an earlier post on this Blog, I already described how I put the the "vicnic", a very high quality sine wave generator, and an active Twin-T filter in an enclosure.
On the left is the 1KHz sine wave oscillator with a dual output connector. One the right is the Twin-T notch filter, optimized for a 1KHz sine wave.



This instrument is described here:  simple but precise 1khz distortion system

The sound card interface

I also used a DIY Sound Card Interface, to attenuate (high) signals coming from the DUT, which would otherwise destroy the input of the USB Sound Card, or the other measurement components. The output from the Interface then goes to the Twin-T filter and then to an actual USB Sound Card (to digitize the analog signal) connected to a PC. The digitized output of the Sound Card is used by the AudioTester software running on the PC to show the results, typically by showing a pseudo Spectrum Analyzer  FFT diagram.





The Sound Card Interface above is another DIY project based on a design from Pete Millett and described here

The USB sound card interface

A USB sound card is used to digitize an analog signal (typically music) so it can be send to a PC for prossesing. It's still called a sound "card" interface because in earlier years this was actually an add-on (or more precise, an add-in) board that plugged-in to a PC slot. With Laptops, that option is no longer possible so a separate instrument with typically a USB interface has to be used instead. 

The same instrument can be used in our chain to digitize the resulting signals for further processing on the PC/Laptop.

During my first baby steps in putting this system together and collecting some experience, I used this inexpensive (around 25 Euros) USB Sound Card Interface:


It worked OK as you can see in the posts I mentioned earlier, but I was not very impressed with the results. It needed further tweaking, adjusting and modifying. After getting it all working and playing with the chain of intruments and making some measurements, I moved on to other projects. So for a few years, I really didn't need this setup so didn't spend any more time on it.

New technology and upgrades broke the chain

When I recently wanted to profile my DIY Tek SG502 rebuild, I put the system together again and quickly made some changes to the inter-connect cabling that makes the connections between the units easier.

However, problems showed-up right away that I had not seen before. It was probably caused partially because in the meantime, I switched to a newer and different Laptop and I also upgraded to W10. I could also very well have done something wrong during some of my experiments, because I suspect that something in the USB Sound Card box could have be damaged because it now shows a lot more harmonic distortion then I remember having seen before.

At first I was mystified to the cause, and could not put my finger on it. I now attribute it to a combination of my W10 Laptop, the W10 sound drivers, the W10 drivers for the USB Sound Card, plus something wrong with the drivers of the AudioTester software, because it is now crashing all the time.

Fault finding...

There were way too many variables in play so I started to address them one by one.

When I used my FY6600 DDS Function Generator, it showed THD+noise performance that looked pretty good and only a little worse than the specifications. 
My unprofiled and just finished Tek SG502 was also just outside the distortion specifications, but that was to be expected. So far so good. 
However, the ultra pure 1KHz sine wave generator designed by Victor Vickenich (vicnic) showed results that were only a little bit better than the other two, so initially I started to suspect the 1 KHz reference. 

To address my first suspect, I got in contact with Victor because I suspected a problem that I must have created with his reference. With his patient and excellent help, we found out by making some measurements on the oscillator itself, that the problem was not due to his sine wave generator. Of course it wouldn't.

I then focussed my attention to the PC software side. I have a license for the AudioTester software, but I was not happy with the overall driver situation after I switched to W10 and I also had problems with the calibration. To eliminate that aspect, I tried another software package, called ARTA. I selected this, because there are many references on the web and many examples of measurements made using Victor's oscillator in combination with the ARTA software, so I could start to compare. However, it still did not improve on the root cause of the problem I was having, the excessive harmonic distortion on Victor's oscillator. Have a look here...


That simply looks terrible! It has to be something else in the chain...


A better USB Sound Card

It was now time to take the next step, and invest in a better USB Sound Card. After quite a bit of research, I purchased a (brand new) ASUS Xonar U7 from Amazon. To my utter dismay, I found out that the CD that came with the unit did not have W10 drivers. Also online was nothing to be found. C'mon ASUS, we're in the middle of 2017, and you have not updated the CD yet? Obviously, that did not give me a lot of confidence. Making a few measurements did not improve the situation much, so I returned the unit the next day.

Time for a reset. I realized that I lacked the knowledge to get to the bottom of this issue, so I had to learn a lot more first of all. I literally spend a few weeks going through all kinds of Forums and Blogs to see what other people were using, and to learn more about the overall system and the components in the chain in much more detail.

Eventually, after going through many blogs and forum's, I found that there were a number of USB Sound Cards that stood out. The majority were from the same company, the E-MU 0202 and the E-MU 0404 and also a few others. The good news was that they were available "as used" on eBay now and then for reasonable prices.
I decided to try to score one of these and after some miss-hits, I scored a used E-MU 0202.


Modifying the E-MU 0202

After I scored the bid for an E-MU 0202, we were out of the country for 7 weeks (Winter Birding), so the unit would arrive but I would not get my dirty little hands on it. This gave me the time to do some more investigations, so I started to study more about the 0202. 

The ultra-pure 1KHz sine wave generator I have was designed by Victor Vickenich (vicnic), and to my delight, I found that he also published a couple of modifications to his own E-MU 0202 Sound Card, with lots of pictures together with the FFT results using the same 1KHz source. With the modifications to the 0202, Victor was able to get incredibly good results. 

That was going to be my reference now.

During my investigations, I also learned that the schematics for the 0202 are very similar to the 0404, although in a different layout and with several value changes and part numbering changes. Schematics for the 0404 are available, but I did not find good ones for the 0202. The various sources of 0202 schematics I found on the Web had errors, or were incomplete.

Since I had nothing else to do at the moment, I took the time to capture all information I could find in my schematic capture program (DipTrace), so I would have a record of the original status, and could put a description together for the modifications Victor did.

Based on the various sources and photographs of the PCB, here is the resulting schematic I was able to put together for the E-MU 0202 "B" channel input to the ADC, the well known AK5385AVF. That chip provides 24-bit resolution at a 192KHz sampling rate and has a 114dB dynamic range.
Here is the data sheet from DigiKey.

E-MU 0202 Front-End Schematic Diagram Channel B 



And here is the slightly more complex "A" channel:

E-MU 0202 Front-End Schematic Diagram Channel A




For the time being, I left out all power related parts. I may add them when needed, because at the time, I was considering adding an external separate power input, instead of using the (typically very noisy) USB 5V coming from the PC. That's a potential project for later.

My plan was that as soon as I got home and could start to work on my unit, I would start with the modifications that Victor made to his 0202. He eliminated much of the front-end of the unit and only used the "B" channel. He also uses an attenuation of his own, so there was no need for the input section. 

I will be using my Sound Card Interface only for this application, so this is no limitation for me either. Cutting that input section out of the loop saves a number of dB's in noise, and turns the Sound Card (more accurately a digitizer) more into a tailored measurement instrument.

Modifying my E-MU 0202

The EMU0202 I scored on fleabay was supposed to be working, but that was not true. The output amplifier did not work. I could not find the error, but I really didn't care. I wanted the digitizing front-end, so I applied the same modifications Victor published and did on his 0202.

Here are the two links to Victor's modifications and measurement results, they start with post #171 on page 9:
Victor's modifications and results

Scroll to page 10 and post #184 to get to his contribution with the photographs and the modifications. 
Note that a little below this post is another one from him with a correction to the value of R46, which needs to be 6K8. This is in post #187.

Below is the schematic information I put together for his modifications to the "B" channel, and highlighted the parts to be removed to isolate the front-end components to ADC input.




The volume control potmeter is removed to make place for an RCA or BNC connector on the front panel. I used a BNC connector myself.
The two removed series resistors, R54 and R32, both 1K4, will isolate the front-end input from the drivers for the ADC. The two resistors that are used to create the dynamic zero balance, R35 and R41 need to be removed too.

Following are the value changes and the new additions to form the new input circuit to the ADC.


The RCA or BNC connector can be mounted on the front panel in the hole of the R-Hi-Z/Line potmeter. I had a BNC connecter that fitted perfectly. After that, the input series resistor, the capacitor and the input Z resistor can be mounted Manhattan style. Note that Victor mentioned that this resistor can be tweaked in value to remove artifacts. I kept mine to 220K.

Three feed-back resistors change in value.
R28 : replace the 1K value to 6K8.
R46 : replace the 1K value to 1K5
R34 goes from 1M to 1K. (Victor used the original removed 1K resistor from R28 and simply soldered that resistor on top of R34 with the 1M value.)

Finally, the connection from the output of U6-B to the input of U6-A can be created by soldering the second removed 1K4 resistor, (the originals are too small, I used a new 1K5 0603) "Tomb Stone" and with a small wire to the input of U6-A. His detailed photographs show the way.

The results are stunning!

Connecting his reference oscillator to my now modified EMU0202 shows rather stunning results I think THD = 0.00096%,  noise at -120dB. Wow!


So now my modified EMU0202 digitizing front-end together with Victor's high quality oscillator, is a perfect reference combination for my distortion measurement applications.

As you can see from the picture below, I used a BNC as the input connector.





Here is a screenshot of the modified EMU0202 with my analog DIY Tektronix SG502:


The measured THD of 0.026% of my DIY re-build is actually better than the Tektronix specification of 0.035%. Not bad at all!

And here is the result from my digital FeelTech FY6600-30 Dual Channel Function/Arbitrary Waveform Generator:



So with the described changes to my setup I finally solved the issues I had in the chain. 

Next step will be to add in the Pete Miller Soundcard Interface and do some more measurements.

It may take a while, I have a few other projects I'm working on, but stay tuned for more...

Enjoy!

Friday, September 15, 2017

DIY build of a Tektronix SG502 Sinewave Generator

Because I sold all of my Tektronix gear, I was a bit sad to loose three particular instruments.
One was the DIY 5CT Curve Tracer with my readout modifications that was already covered in another post, the 5A22N Differential Amplifier, and the SG502 Sinewave Generator.


When I was at Tek, I build several instruments from parts, the SG502 being one of them.



I really liked the SG502, for its simplicity using analog(!) discrete parts only, and the overall specifications that made it perfect for most if not all of my applications. This instrument covers the frequency range from <5Hz to >500KH and has a pretty good distortion performance with only 0.0035% THD between 20Hz and 50Khz. The output is 5V RMS open circuit or 2.5V RMS into 50 Ohm. It also has a good step attenuation ranging from 0-70dB. Finally, it has a 5Vp-p square wave output that can also function as a trigger out.

The reason I seldom used it over the last years was that it comes as a TM500 plugin, and that uses a lot of real estate. The TM500 series are very deep, and they are heavy. I don't have room for them on my desk or counter anymore, so eventually I cut the umbilical cord and sold everything I had from Tek. Well, not really everything (sorry Raymond). I kept a few goodies.

I also have the so called Victor Mickevich Ultra Low Distortion 1kHz sinewave generator with a reported 0.00001% THD for special measurements (also described in another post: simple-but-precisice-1khz-distortion-tool), and I recently purchased the FeelTech FY6600S-30 14 bit DDS. That instrument is a Dual Channel Function/Arbitrary Waveform Generator, very versatile, but, it's digital...

If you consider building one, the SG502 has a few critical or rather special (unobtanium) parts. One is the dual N J-FET (Tek p/n 151-1054-00 or the 2N3958), used for the input differential amplification, another J-FET (Tek pn/ 151-1021-00 or the FN815) used in the AGC, and then the precision dual 10K tracking pot and satellite adjustment contraption, used to set the frequency. Less critical is the matched capacitor set (10uF, 1uF, 0.1uF 0.01uF and 0.001uF). They are used in the bridged T notch filter in a rather clever dual purpose way. The last rather special item is the SG3501D (156-0208-00) IC that is the center of the dual tracking +/- 20V power supply. I recently found that this IC died in my SG502, but I was able to order replacements on flea-bay.

I happened to have all these items as "spare" parts, and kept them since the early 70's, waiting to be used again. I did not have the special matched set of timing capacitors, but individual ones and testing revealed that they were so close and precise that they didn't need any further matching or adjusting.

Just to kinda take care of my guilt in letting my trusted and self build Tek gear go, I decided to rebuild the SG502, but in a much smaller enclosure. I use the TEKO KL22 enclosure in black/aluminum a lot for my projects. They cost less than 15 Euros, and have just the right size for most of my projects. I used them already for my three power supplies, my DC load, and now my SG502.

I first dabbled with the idea to upgrade the design with modern OpAmps and see if I could improve on the specifications. After thinking about this for a while, I decided not to. I could have build the SG505, Tek's own upgrade to the SG502 which uses OpAmps, but in my opinion, this classic should stay the way it was designed by Steve Stanger in the early 70's. Period! 

BTW, the PG505 has been described as a real masterpiece of analog design wizardry. The instrument was designed by Bruce Hofer who now is at Audio Precision, and is a true analog design genius. So, my statement "I could have built the SG505", must be taken with a handful grains of salt. It will not be easy to replicate that instrument. (well, it's now 2025 and that's exactly what I'm going to try)

In contrast, rebuilding the SG502 instrument turned out to be rather simple. If you follow some common sense design and layout rules, anybody with a little above average skills can do it. If you can't get your hands on the critical parts, you could try to find an SG502 unit on flea bay or on one of those surplus markets where they sell old electronics. Sometimes these SG's can be bought for less than 20 Euro's. Because all components are THT, it's real easy to harvest and use the most critical parts.

I'm not going to cover the design, you can find the Tektronix Instruction Manual online, here.  It has everything you ever wanted to know about this instrument. One thing you should note is that Tek made some important changes to the original design (especially the ACG, the voltage supply and the output attenuation circuit), and I used the latest available Change Reference (M34075 from 1-19-79) in my redesign. 

Just recently, I found a note from Bruce Hofer, the designer of the SG505 with some additional low distortion modifications that will reduce the distortion to well under 0.002%. Modifications
I have not yet added these modifications myself.

One of the challenges is to get or replace the S50 push button switch set for the frequency selection and also the S160 push buttons used for the output attenuation. I used the same technique again that I already used for my DIY 5CT, and that is by using (reed) relays to do the switching. This will allow you to use inexpensive single deck rotary switches, in combination with diode matrices if required.

Here is the schematic of the range switching for the frequency selection:


Here is the schematic for the AGC damping (top) and the output attenuation:


After completing the unit, and testing it, I noticed a "design flaw" in my output attenuation switching design. When you switch between especially the higher attenuation settings, there is a short moment in-between the "clicks" that the output goes back to full scale. I need to add a delay to the relay fall-off times, to create the equivalent of a make-before-break action, change the rotary switch to make-before-break, or add a master output relays contact that prevents glitches to the DUT in-between setting changes.

I also redesigned the power supply somewhat. Normally, the SG502 uses the big transformer, diode bridge, electrolyte smoothing capacitors and the power transistors from the TM50X mainframe. I measured that the original SG502 uses about 70 mA on each 20V supply rail, so I could get away with a much simpler design.

First of all, I am a big fan of not putting mains transformers into the measurement enclosures. It keeps the hum out, and you don't have to deal with the bulky transformers, the main switch, filter, bridge etc. It allows me to use smaller enclosures, and put the transformer and the needed other stuff in a separate box that I can put someplace out of sight or away from my precious desk or bench space. Another benefit is that I can get multiple usages out of these transformers/supplies boxes.

Here is a photo of the 24-0-24V AC 160mA transformer box :



I didn't produce a schematic for the supply, so let me describe what I did. In the enclosure above, I put a 24-0-24VAC 160mA PCB transformer. I put a dual pole switch, a fuse and a neon indicator lamp on the primary side. On the secondary side, I connected the 24-0-24 AC outputs to 4mm binding posts.

Because the current demands are so small, I put the rectifier (1N4002) diodes directly on the 4 mm binding posts in the SG enclosure and also mounted the two smoothing caps (1000uF/50V) Manhatten style on them. On a little circuit board, I mounted the power section directly from the SG502 manual, and used two smallish power transistors that I had for the series transistors. I selected the voltage setting resistor (R348) to get as close as possible to the +/- 20V DC. Tek also hand selects this resistor, and I ended up with a value of 14K7, probably due to the fact that I used different power transistors.

To drive the two sets of (reed) relays, I wanted to balance the transformer and rectification loads a little, so I used an LM317/LM337 pair with 270 and 820 Ohm resistors to get + and - 5V rails. The +5V section is used to drive all the reed relays for the frequency selection and AGC dampening, and the -5V drives the 3 output attenuation relays. The grounds of both the 5V supplies are not connected to the analog ground on the analog circuit boards.

Here is a photo of the power board:


The left section on the board deals with the +/-5V and the right side with the +/-20V. I just happened to have the SG3501D chip, otherwise I could have used another set of LM317/337 to obtain the +/- 20V supplies. With these  more modern components, I really don't believe the supplies need to be tracking, because the LM317/337 are stable  and good enough.


The oscillator section is mounted on the main board, and looks like this:

Top left is the AGC damping section with 5 reed relays. On the right half is the frequency selection with the two sets of 5 reed relays. The large 10uF precision capacitor is mounted on top of the 1uF and 0.1uF capacitors to save some space. On this picture, the two output transistors(Q82 and Q83) are still the (isolating plastic!) 2N3904 and the 2N3906, they have been replaced by the 2N2222 and the 2N2907 metal can transistors after I was happy with the performance and took the picture. (Watch out for the different pin-out between these transistor types, as I forgot myself (;-o) )


I'm showing the backside with the rats nest, because it's a testament to the quality of the original design that I could stay well within the specifications without using a properly laid out PCB.

The output amplifiers for the sine wave and the output attenuation, in addition to the square wave generation and amplifier are on a separate board.


This board will be mounted through the output level potmeter to the front panel, and also on a stud to the main board.

The rest is mounted directly on the front panel:
The open hole on the left is for the output potmeter, and the hole on the right for the power LED.


To the left is the 5 position  rotary switch for the frequency multiplier then the special potmeter with the fine adjustment hardware contraption, and to the right the 8 position rotary switch with the diode matrix for the output attenuation (0 to -70dB in -10dB steps).

Together it looks a little bit cramped, but it fits easily.


The cool ribs you see on right at the outside of the back are not needed. I just stumbled on this old adhesive CPU cooler, and added it to the back initially, just in case.


And here is the front panel in detail:



I typically make a design of the front panel in PowerPoint, together with the drill map. I print the design on a color printer, using the best photo paper I can find, and in the highest resolution and best color quality.
I use double sided tape to secure the front panel and use a very sharp knife to cut the holes, I then carefully, without twisting the front layer of the paper, mount the hardware. Note that I try to use the same color scheme Tek used in the 70's. I really like it and use that for all my designs.


And here is the final unit.

While I was building the various sections, I was checking and verifying the results. When I was at Tek, I used to repair these instruments and I was amazed how well the original design worked, even with my modifications and wire nests and felt proud to have been part of this bit of T&M history. In retrospect, I'm glad I started on this project.

Using the procedure in the Instruction Manual, I verified everything as good as I could. I don't have a distortion analyzer or dedicated spectrum analyzer so I can't specify the distortion level. I used the FFT capability of my Rigol DS2302A scope, and that looked very good.

A small bit of info:
I went from using Tek equipment to a Rigol scope. Well, you probably didn't know this, but the Rigol subsidiary for the America's is located in Lake Oswego, which is only a few minutes from Beaverton, the home of Tek. You wonder why Rigol picked this location? (;-))

At a later date I will try to do a comparison with my Mickevic oscillator, my active double-T notchfilter together with an external sound card and my PC based analyzer software.

Everything else, except the rise/fall times for the square wave (>50nSec instead of <50)  is well within specification. I have not investigated this edge issue yet, for me it's good enough.

I did tweak the capacitor for the 50-500kHz range to match the other ranges. The 100Khz signal is the most critical, so I went back and force a few times to adjust the value of C55 the timing capacitor so when I switch ranges, the frequency setting is well within the specification. The original C565 value is 87pF, I ended up with 92pF.

What that means is that when I set the frequency setting to the (reference) 100.0MHz in the X100K setting, and switch to the X10K setting, the frequency is 10.17kHz, in the X1K setting 1.03kHz, in the X100 setting 101.7Hz and in the X10 setting 10.2Hz. That is excellent I think.

One caveat, and you may have already missed it. I don't have room for the frequency dial. First of all, I don't have one in the first place, but because I normally attach my scope anyway, it has a digital read out of the frequency setting, so I don't need the dial.

Even though I did not have the calculated precision resistors for the attenuation switch, I got really close by getting the closest E96 resistor value or selected a couple, and again, I was able to stay well within the specification.
If you're interested why Tek used these funny resistor value: have a look here :
matching-t-attenuator-calculator (use the 600 Ohm input/output setting and you'll see that the values match exactly to those that the Tek designers probably calculated with a slide ruler (;-))

One thing I need to do still, is to order copper sheet metal and use that on the inside of the (plastic) enclosure. Whenever I use my T12 solder iron, the high frequency pulses from the heater come right through. That's not just this unit alone though, but I want to create an extra barrier for this one.

All in all, I am mightily impressed with the design quality the Tek engineers at the time were able to pull off in the 70's. Rebuilding this unit and staying well within the original specification is again a testament to their skills. Hats off!

UPDATE 22-11-2017

After a lot of issues, I was finally able to create a vastly improved setup to measure FFT's, so I can now present the THD distortion number. A measured THD of 0.026% is even better than the specification for the original, which is 0.035% for the 20Hz to 50KHz range.
Here is the screenshot:


Enjoy!

If you like what you see, please support me by buying me a coffee: https://www.buymeacoffee.com/M9ouLVXBdw


Tuesday, March 4, 2025

DIY Build of the Tek SG505 Oscillator

 

The rather famous SG505 oscillator






I'm going out on a limb here. Although I already built a copy of the SG502, described here, the SG505 is a very different beast all together. At the time I did the SG502, I was not ready to attempt the SG505, a masterpiece of analog engineering by wizard designer Bruce Hofer. After a number of years mulling about it, I was recently looking at the instrument again after seeing it used in a YouTube series, and this time decided to give it a try.

As with many, if not most Tektronix designs, they incorporate special parts, or the parts are obsolete by now. The added difficulty is that with these older designs (this one was created in 1980) that pre-date the internet, you can't find any datasheets for these parts. Most manufacturers went defunct or merged and do not show these old parts on their websites.

So when looking at the SG505, I first wanted to try to build the sine wave oscillator. I used the information from the Option 2, that has the balanced outputs, because that has improved schematics and parts.



Here is where you can find a lot of information about the SG505 and it's designer Bruce Hofer.


So what is so special about the SG505

First of all, among specialists, it has the status of a real piece of analog art, designed by one of the great masters himself, Bruce Hofer. While at Tektronix, Bruce was responsible for many products and designs in the 7000 oscilloscopes and the TM500/5000 series. He also designed the AA501, the first automatic audio analyzer that worked in tandem with the SG505. As a matter of fact, I understand they designed the AA501 to verify the SG505 after production. In the manual for the SG505, you can see the rather elaborate method to calculate the total harmonic distortion, and the equipment needed. 

Just the specification of 0.0003% THD from 20Hz to 20KHz will give you an idea of the design quality. 

The SG505 has at least one patent that I know of, describing a "State variable oscillator having improved rejection of leveler-induced distortion". Have a look here : patent.

When Tektronix management was not interested in taking the AA501 and later the AA5001 distortion analyzer concept further, Bruce co-founded Audio Precision and that is the current and undisputed leader of this field.

You may ask why I'm so interested in rebuilding the SG505? First of all, it's a great design made by one of the few analog wizards. It is very well documented and also has been manufactured for several years so the selection of components went through this test. This "fitness for manufacturing" should not be underestimated, because the parts (source, value, tolerance, tempco, etc) in every possible permutation will have to meet the specification of the final product over the years. In other words, the bugs are out. This cannot be said about many other DIY designs.

The other reason for selecting the SG505 is that you can freely select any frequency by just selecting the desired range, and using the dial and vernier adjustment to select the frequency you want. There are several other pure oscillator designs that are more modern, and even have better specifications. In almost all of their applications, they are used in a THD measurement, and in those cases, you "only" need a few fixed frequencies. That makes it easier to get better specifications because you can tune both sine and cosine oscillators with fixed parts. None of them use an analog variable frequency selection.


Some Small print:
As I normally do on my Blogs, I describe the way I get to the final design, with trials and errors, ups and downs, warts and all, but hopefully in a way that you learn something, and avoid my mistakes. With my projects, it's not going to be an IKEA hand-holding type design. Some effort is required. And most importantly, there are no guarantees it will work for you too, I'll do my utmost but that's about it.

I will add information to this Blog and the Github as I go, and with this pretty extensive project, it may take a long time. As a matter of fact, I may not be able to finish it with the sought after quality, so take that into account before you heat-up your soldering iron or start to order parts. I'm not a really experienced engineer, and I'm not hampered in any way with specific know-how or experience, nor do I have the proper equipment to verify and test the design. I'll do my best, and will make you part of the process, but that is as far as I can promise.


Interesting articles and information:

There are many articles about sine wave oscillators, because building a simple one is easy, but a really good one is a real challenge. Over the years I have collected a few interesting ones:

Rod Elliot has a lot of interesting information on his site, but there is one particular posting where he explains the various architectures with their pro's and con's.
https://sound-au.com/articles/sinewave.htm

A few other articles can be found on my Github site here:
https://github.com/paulvee/DIY-Rebuild-of-the-SG505.

Then there are several Forum posts that deal with the modernization and rebuild of the Bob Cordell THD Analyzer that contains a very good oscillator, just like the SG505 (that original article is on my Github). The latest and most impressive rebuild of that instrument that is 30 years old, but now with a processor to drive the measurements is on this Github from Emile666, a very impressive and complete design. Also have a look at the diyAudio site, there are designs that deal with specific 1KHz and 10KHz pure oscillators of outstanding specifications (search for "LT AN67 1KHz or 10KHz oscillator", from Frex) The AN67 application note is listed on my Github. The author of that impressive design is the rather flamboyant Dale Eagar, who worked for my buddy in crime Bud at LT. Small world.


Component Issues & Challenges

For this particular project, let's discuss the road-blocks and challenges for a rebuild, based on the components that are used in the instrument.

First off, there are several special parts and some of them are no longer available on the market.

The potentiometer that sets the frequency is a high quality single turn dual 10K wirewound version without a stop. It was originally made by Spectrol, but is now part of Vishay. The part used is a Model 100 with the following part number: 100B2-103-103-XXXX

According to the datasheet, it has +/- 3% tolerance and the independent linearity between the two sections is only +/- 0.5%. Unfortunately, the datasheet does not specify the THD. This part is still active and manufactured it seems, but nobody has it in stock. 

The next item is a mechanical part that is used in combination with the potentiometer, to create a finer adjustment by reducing the number of rotations 6:1. The Tek part number is 401-0161-00 and the manufacturer is Jackson Bros (London). Their part number is listed as 4511/DAF in the SG505 manual, and believe it or not, you can still buy this part for a reasonable price, here. This reduction unit also gives a very smooth and controlled action on the potmeter. Highly recommended!

I am the lucky owner of having the potmeter and the reduction unit, it is used in my SG502, but for others, I'm going to try to find a replacement part or method for it. It's the most critical part of the design so it would be critical to find an alternative. I have some ideas using other potmeters, even digital ones but I have no experience with them whatsoever so I need to give that a try when I have a functioning oscillator.


The next item in the list is the special drum switch (or cam shaft) that Tek manufactured themselves that select the output attenuation. This in addition to the special pushbuttons that are used to select the frequency multipliers. In my design for other Tek instruments, like my 5CT1 (without N below) where I added readout capabilities and also for the SG502, I used reed switches or a small relay in combination with a simple rotary switch and diode matrixes to re-create the sometimes rather complex switching arrangements. 



Luckily, the SG505 switching used is quite simple. At first I was contemplating using analog CMOS switches or MOSFET's, but I understand that will add too much resistance or add to the THD distortion budget, so I will most likely use reed switches again.

Next-up is the J-FET used in the AGC circuit. The Tek part number is 151-1021-00 and is used in many Tek products. In the manual, they show the FN815 from Siliconix. I have not been able to find any information about that part at all, and I know I'm in good company because of the frequent use in other products. Many makers are looking for replacements. There is another J-FET 151-1025-00, an SFB8129 (in later manuals changed to SPF3036. The recommended alternative is the 2N4416, and the alternative for that one is the J111) This J-FET is used in the power supply as a current source, but that one is a lot less critical. Lastly, that same J-FET is also used in the output buffer amplifier in a special circuit that Bruce got a patent for : patent

One of the most critical components, in terms of the distortion budget, is the special hybrid substrate that is used to select the dBm output settings. I happen to know that the construction used in the SG502 is the source of some extra distortion, so Bruce Hofer created an unofficial modification to change that for the SG502, significantly reducing the total harmonics from an original 0.035% THD to well under 0.002%. My assumption is that using discrete components is going to be a challenge, but on the other hand, we now have very good SMT devices Bruce didn't have at the time.

Lastly in this list is the set of matched timing capacitors used in the oscillator phase-shift amplifiers. Luckily, for a DIY project, the absolute values that are matched in the SG505, are less critical. In a manufacturing process, you don't want to tune the product, it has to work right of the production line with as few adjustments as possible. The critical factor for the original design was to create a situation by which the frequency dial is set to say 1, and by selecting the X10, X100, X1K and X10K, you would would get the exact reading of 10Hz, 100Hz, 1KHz, 10KHz and 100KHz +/- a few percent, but we don't really care do we? Besides, we don't have the frequency dial anyway. We will need to work around that.

I already have a little and simple side-project working, using an Arduino Nano and a small OLED display to measure and show the frequency.


Simplifications for the DIY design

From the outset, I will be concentrating on the sine wave oscillator itself. I'm not planning to add the differential output that the Option 2 provides. What I will eventually use as the sync output is still open. All I want is a way to trigger my DSO on the signal, and an edge of a square wave is actually more stable to trigger on than the slope of a sine wave. 

I will also not implement the Intermodulation Module because I don't see the need for it in my projects.

Next up is a more simple instrument setup. The original SG505 has to function in a TM500 or TM5000 mainframe, together with a host of other instruments right next to it. Some of them can be very unruly and noisy neighbors. The SG505 is completely floating from real earth ground inside this environment. My plan is to keep it that way, but build it in an enclosure that has no earth ground connection anyway, so it will be floating from the outset.

The power supply is a critical element in the chain and will deserve a lot of attention, but I will address that later. I will use my lab dual power supply in the beginning.


My Plan

My plan is to build a prototype PCB that will give me a functioning oscillator that will allow me to test and try some different strategies and components, and build a reference platform for my measurements using my mostly home-brew set of inexpensive tools. Some if which I already have, some I may need to build to verify and test the specifications. I envision something similar as the design of the VBA Curve Tracer, where we went a step at a time over the course of about two years.

After going through the documentation many times, and watching YouTube videos and strolling the internet for information, I started by creating a schematic in KiCad. I then spent many long hours pouring over the Replaceable Electrical Parts list selecting and finding the parts for the prototype. I used Google, Mouser, DigiKey and LCSC for days, and eventually decided on a BOM to order from LCSC because of the total price including S&H. It turned out that they did not have one particular resistor value from all the parts I need, so I ordered a combination of two to get the missing part.

I did not save money on the parts but selected the best quality. All resistors are 1% metal film, better than the original THT resistor specifications. I also matched or exceeded the higher precision resistors (like 0.1% at 25ppm). However, I did not use Mica capacitors, but good quality NPO with the same 1 or 2%  tolerance. The electrolytes are all Tantalum except for the two used in the supply rails.

Almost in parallel, and now knowing the parts and footprints, I started to design a PCB and ordered it as well. Both the parts and the PCB's will be on their way soon. Talking about on their way, another "way", PCBWay has agreed again to sponsor me with this project, and I'm grateful to get boards from them for free and with a very high quality. I may need to go through a number of re-designs while progressing so this support is very helpful.


The schematic for the prototype




There are a number of rather unusual refinements that Samuel Groner pointed out in a diyAudio.com post. Here is that post replying to a user that wanted to improve the SG505:

Bruce Hofer did (as usual) an excellent job here. There are a lot of subtleties going on (and I'm sure I'm missing one or the other), and it is unlikely that we'll find an easy fix which will significantly improve performance. Just to highlight a few details:

* It looks like residual ripple of the peak level detector is cancelled through C1502 and C1603;
* The NE5534s implement various tricks--feed forward compensation (C1514, C1622), two-pole compensation (C1405, C1406, R1405), forced class A operation (R1621) and even a simple composite opamp (Q1620, see US-patent 4296381); [My comment: this is in the output amplifier section described quite a bit later here]
* The for higher frequency ranges unused integrator caps in the second integrator (C1312, C1320, C1322) are pre-charged to a specific voltage through R1421/R1422. I presume this speeds up settling after a range switch, because the capacitors are already in the correct phase relation to those in the first integrator (which a pre-charged to 0 V);
* The power supply of the peak detector is heavily low-pass filtered (R1611, C1600). This localizes the current loop of the distorted currents, and avoids coupling to the main signal path.

One thing you could try is to make the drain feedback of Q1501 adjustable. Unsolder the ends of R1510/R1513 which connect to the gate of Q1501; take a (quality multi-turn) 1k trim pot; connect its wiper to the gate of Q1501 and the resistance element ends to R1510 and R1513 respectively. By adjusting the trimmer you might be able to reduce the 2nd harmonic for certain frequencies. But make sure it doesn't get worse for others!

Something else might be the addition of a 68r resistor between pin 5 and 6 of U1401 (as done for U1520). This forces the output stage of the NE5534 into class A operation, with possibly some distortion improvement.








This is after I fixed the discovered errors.

The component names and values are the same as in the original schematic in the Option 2 manual. Where they do not, or I had to use other parts, I indicated that.

However, I deviated quite a bit from simply redrawing the original schematic in the manual, to show the many intricate and not-so-obvious feed-back and feed-forward connections, as well as the many compensation circuits, especially around the inverting Opamp U1510. This is where most of the magic happens.  I suggest you read the Theory of Operation in the manual and also the patent application for the feed-forward invention, that allowed Bruce to significantly reduce the harmonics. In essence, he applied his wizardry to remove the fundamental frequency AC signal from the AGC circuit DC-level in several places. I know that the picture above is not of great quality, but a Github project is available here and I will upload files as the project progresses.

The three hierarchical boxes in the schematic are "hiding" the frequency and dampening switches and parts but are inconsequential at this moment. I just followed the original design, but used jumpers instead of switches.


The 2-layer PCB prototype


The layout of the PCB largely follows the schematic, so there is a full circle with the circuits following the State Variable design as is in the schematic as well.

I made the decision, right or wrong, to use ground fills on both sides of the PCB. We'll see if that will show up as an issue, in which case I need to go to a "star" grounding method with all ground going to the output BNC connector.

For this prototype, I will be using jumpers to select, add and try components and also activate the capacitors for the frequency selection and the AGC damping. For the frequency selection, I will use a normal dual (stereo) cermet 20K potmeter, just to have a functioning oscillator. 


J-Fet Selection

I added two kind of foot prints for the J-FET so I can use SMD and TFT to experiment. The TFT version has a socket. I actually have the original but now elusive unobtanium J-FET, and I also have a Curve Tracer, described here, so I can verify or measure the specifications if needed. I already ordered or had a small selection of J-FET's to try.


The elusive, unspecified & unobtanium 151-1021-00 J-FET

While waiting for my parts, that were returned to sender because a very bright DHL delivery person could not find the apartment I lived in for 17 years, I started to look for alternatives for the 151-1021-00 JFET. I already had a number of candidates, and more are in the shipment so I could get started. As a spoiler alert, I think I have been successful, but I now need to test the alternative 2N4391 in the real circuit, and compare the results with the original 151-1021-00 part.

Because I did not do a write-up for testing JFET's with our Curve Tracer yet, I added that episode to the following document. Scroll down to the end in that posting to see the JFET result.

Making measurements with the VBA Curve Tracer


Capacitor Selection

For the frequency setting capacitors, I used good quality Polypropylene film capacitors, but now that modern NPO and COG ceramic capacitors are available in good quality and with very precise tolerances, I may want to experiment with them as well. I will most likely trim the Polypropylene values to match by using the ceramic parts, and measure the effects.


What are the chances of success for the rebuild?

I'm very anxious to see what the results of this prototype is going to be. When I built the SG502, I was pleasantly surprised that my rats-nest construction (no PCB) produced a slightly better THD specification than the production version one had. A testament to the conservative specs and the quality of the original design. 

Who knows what I find with this one...


How am I going to verify the results?

As I stated earlier, I do not possess all the proper equipment that is required to really verify the SG505.

I will have to do with less and see how far I can get. If needed and possible, I can build something, like the passive notch filter (067-0938-00) that the Tek engineers designed specifically to test the SG505 performance. 

I already have an active T-notch filter for 1KHz that I may need to duplicate or extend for the other frequency ranges (10Hz, 100Hz, 10KHz and 100KHz), we'll see about that when we get there.

Luckily, I have a kind-off reference oscillator, the Viktor Mickevich 1KHz design that has a very respectable THD. He claims (verified by others), a whopping <0.00001% THD. 

With my simple DIY equipment, (look at this post and this one) I could measure the THD for his oscillator as far down as 0.00096%, so that is a very good start.




For the rest, time will tell.


Possible solutions as an alternative to the dual 10K potmeter

As I mentioned earlier above, this frequency adjustment potmeter is a very critical part that is crucial for the operation and more importantly, the specification of the oscillator. The specification needs to be tight because of the "State variable" design of the oscillator. Each section of the pot sets the frequency for the two 90 degree phase shift circuits (states). If there is a difference in the resistance between the two potmeter sections, it will negatively impact the phase shift. The timing capacitors also have an equally important role, but they can be more easily matched to each other or the value tuned by adding parallel capacitors.

The combination of the original 1-turn 360 degree 10K potmeter together with the 4511/DAF 6:1 reduction allows the sensitivity or rather resolution to be as follows. For the potmeter, 10K / 360 degrees is 27.7Ohm per degree of rotation, further reduced by 6 to 4.6 Ohm per degree of rotation. And then there is the vernier adjustment of +/- 1% of the frequency. 

Looking at it from a frequency perspective, with the frequency multiplier at 1K, the potmeter can adjust the frequency from just below 1KHz to just over 10KHz. That translates to 1,000 Ohm for every 1,000 Hz, or 1 Ohm per Hz. 1 degree of rotation is 4.6 Ohm and therefore 4.6 Hz. The vernier range is 1% of the frequency so that translates to 10Hz at 1KHz and 100Hz at 10KHz. That will be not so easy to duplicate.

So, provided you can't get your hands on the original Model 100 potmeter, what are the possible options or alternatives?

After quite some time looking at alternatives, I came up with a few potentials.

1. Use a dual (stereo) cermet potmeter
With the right 6mm shaft diameter, it can also be used in combination with the 4511/DAF 1:6 mechanical reduction. The challenge is that these potmeters do not have very tight specifications. A good quality one will still cost about 25 Euro's and at best has a 10% specification, but I could not find a specification for the linearity between the two halves, and that is the more critical specification. An overall value miss can be adjusted with resistors at the beginning or end, but not in-between. This type potmeter is what I'm going to use with the prototype. I can use a trimmer to make sure both halves have the same value at a particular setting.

2. Use a dual 10 turn precision potmeter
This will give you a much higher resolution in setting the frequency, and you don't need the 4511/DAF reduction. The vernier circuit can stay as it is. The specifications for tolerance (3%) and linearity are better than for a cermet potmeter, but there is a significant price differential. A suitable one will cost about 46 Euro's. The downside is that you need to turn the knob a lot (10x) to go from the beginning of a range to the end. Even with this quirk it could still be the most viable solution. I searched at Mouser for candidates, and by the time you have made the criteria selection, there are only 4 left, ranging in price from 46 all the way up to 157 Euro's. 

The least expensive one is the Bourns model 3549S-2AA-103/103A


It has a linearity specification of 0.2%, an overall 3% tolerance and 50ppm/C. This is pretty close to the original Model 100 that has 0.5%, 3% and 20ppm/C.


3. Use a digital potmeter.
I have no experience with using them, but I first thought this could be the solution. So after reading a lot about these devices, I found that there are actually a few stumbling blocks for this particular application. With most devices, the voltage range of the potmeter is limited to 0..5V. The regular maximum granularity is 256 steps (there is a special one with 1024 steps). This means that from a 10K value, every step will be 39 Ohm. That's 8.4 times more than the original resolution, so the vernier adjustment has to be modified to cover the difference. That can be done, but digital pots have other issues, like the linearity and tolerance, and then there are the resistance of the wiper and, a bit less important, the end and beginning resistance. When you change from one setting to the next, there could be a jump or glitch in the frequency, although there are ways (zero crossing) to avoid or suppress that. On top of that they are not that good with temperature changes. 

Based on our particular circuit, one of the best solutions could be the TI PGA2310 designed for hi-end audio stereo volume control. It has excellent specifications, even removing some of the issues with other digital pots. The chip is not cheap however, with a price of  about 28 Euro's.

Most importantly, these digital pots will need some form of digital logic to drive them. Normally, you would use a rotary encoder as the input, and use logic or a processor to drive the electronic potmeter settings. I have not discounted this solution, it provides some potential but it's not my favorite to develop at the moment.


4. Use a rotary switch.
When using a rotary switch, you need one with a double deck and one pole per deck with at least 10 positions, so you can create 10 segments of 1KOhm each by using fixed resistors. By using tight specifications for the resistors, you can really get the best linearity and matching between the two sections and probably also get the best Tempco results, surpassing the original design. The downside is that you can't smoothly turn through the whole frequency range, you have to select a section (1/10th of the range) and than use the modified vernier (modified to 10x the adjustment) for a finer resolution within the section. You can select shorting and non-shorting versions for these switches to avoid large frequency jumps when you switch. 

The suitable devices I found will set you back by about 45 Euro's. This is a rather complicated solution for a rather cumbersome user experience, so not my favorite to develop. For almost the same 45 Euro's, you could also buy the dual 10K Bourns.


Summary:

Depending on your particular application for the oscillator, there are a few options you can select from.



Frequency Display

As mentioned above, because we don't have, or will have a dial, I'm planning to use a small OLED display to show the frequency of the SG505.

Here is the prototype with an Arduino Nano and the tiny display I'm planning to use. I like the yellow color. The dimensions are 0.9" with 128x32 pixels.  I tested the FreqCount library from Paul Stoffregen with my function generator, and it easily covers the range of 10Hz to 200KHz.





The boards arrived.

I received the boards from PCBWay within a week of posting the Gerber files. They are really fast.

There is no gold plating, that is the light fixture playing tricks. The quality of the boards is great, as I came to expect from PCBWay. They also sponsor me for this project which is highly appreciated!

Update on the parts ordering saga:

Unfortunately, the parts I ordered at LCSC are still in limbo. They have been returned by DHL to the European distribution center and will then be sent out again. Hopefully this time DHL selects a more intelligent driver that can find the apartment I have lived in for 17 years. In his ultimate wisdom, he determined that I don't live here, and instructed to have the shipment returned to sender. DHL was unable to reverse this mindless decision. Great! The order was placed on March 4 and I'm told it may take another 1-2 weeks before I can get my hands on them. I just received notice (April 2nd) that the parcel has been re-discovered and this time I instructed DHL to deliver it at a pick-up point so I can pick it up tomorrow. Finally.

Well, on April 3rd, I finally have the parts in my hands and can continue with the project.

To create the best possible frequency selection, I selected the best matching capacitors for the timing ones. Because my minimum ordering quantity was 5 for the 1uF and 20 for the 100nF, 10nF and 1nF all with 5% tolerance, I could easily get matching pairs, but not precise values. That can be tweaked later if needed, but I don't think I need that. The matching between the values is much more critical for the distortion budget.

I also should mention that I'm using the Tektronix 151-1021-00 JFET in the AGC circuit. I'll investigate alternatives later.


First power-up and test

I used my new hotplate reflow solder station to solder all the SMD parts, and that went very well. I then added all the THT parts, and after thoroughly soaking and cleaning the board twice and inspection with a microscope, I tested the power rails for shorts. No issues, so I then used my Lab supply to provide +/17V at 50mA each and gave it a go. My DSO was showing a nice sinewave! Great!

While going through the range selection with the jumpers, I noticed that I goofed with the schematic and subsequent layout for the 10K multiplier selection jumper J15. A few trace cuts and jumper leads fixed that. I also noticed that turning the frequency potmeter didn't really change the frequency. That was caused by me flipping the 3-pin connector the other way around for one half of the potmeter on the PCB. Swapping the connector leads also fixed that. I now had a fully functional sine wave oscillator.



Frequency selection

Because I use a "kind of" dual 10K potmeter (see above), but with separate adjustments for either half, my plan was to see the effect of "in-equality" of the two pots, and adjust them to be exactly the same by using an ohm meter. The goal was to see what effect the in-equality (not only the linearity) would be on the distortion. I will get to that later. However, because of my goof with the connector swap, I stumbled on an optical verification of the in-equality or tracking. When you swap the connector, so one half of the pot will drive one phase change circuit with an increasing value, and the other phase change circuit with an "equal" decreasing value, the frequency should stay at the same value. But only if the two pot halves track each other 100%. Mine does not, there are slight changes in the frequency when I turn both pots together. 

Here is what I'm seeing. At fully CW or fully CCW, the frequency is almost the same at say 308Hz. During the rotation of the potmeters together, I see the frequency dipping down to a minimum frequency of 259Hz somewhere at 75% of rotation and then rather rapidly going up to 308Hz again. My calculator shows that to be an error of a whopping 19% in frequency which is quite a lot. 

To put that in perspective, the 10K potvalue creates a frequency range between 83 and 1.100Hz, or 1.017Hz. That means 9.83 Ohm/Hz, so a tracking error of 308-259=49Hz/9.86Ohm=5.96% of 10K. That's more reasonable, but it shows how important the tracking specification is. And we don't even know yet what the distortion contribution of this tracking error is.

I will do that same measurement with my original Model 100 precision potmeter later.


Does it meet spec.?

I use my dual lab supply to supply +/17.00V. The current consumption is 24mA for the positive rail and 26mA for the negative rail.

The sine wave output is 2.04VRMS (6.00Vp-p) into 1MOhm , and that is according to the specification.

The frequency ranges are within specifications.

  • 10x     8Hz to 111Hz
  • 100x   83Hz to 1.1KHz
  • 1Kx    833Hz to 11.7KHz
  • 10Kx  8.8KHz to 107KHz

When I go beyond 107 KHz, the sine wave collapses, so that's really the maximum.

The Vernier adjustment at a frequency of 10KHz goes from 9.92 to 10.12KHz, also good enough.

The AGC circuit works well, visually, but I did not test that any further.

When I set the frequency in the 10x multiplier setting, and adjust the frequency to mid-range and then select the other multiplier settings I see this:

  • 10x     50Hz
  • 100x   515Hz
  • 1Kx    5.26KHz
  • 10Kx  55.2KHz

This to me a fine, but can be further tweaked by using trimmer capacitors.


So what is the distortion?

I had some issues to find and load the drivers for my modified Creative EMU-0202 USB "Sound Card" (look at this post for more information), after I went to a new Laptop a while ago after a major W10 induced debacle. Most of the installed software had to be installed again, but I didn't need the FFT capabilities until now.

After some experimentation, here are the results with the PCB just lying on my desk. This is with the range setting at  x100 (100-1000Hz), and using jumpers instead of the frequency select potmeter, to eliminate the leads and the potmeter tracking differences. That puts the frequency at the top of the range at about 1.1KHz. I'm using a DIY 600 Ohm -10dB attenuator, and the E-MU0202 and the ARTA software is calibrated with it. Note that this is taken straight from the oscillator output, and not from a "real" output amplifier. I do not yet know what impact the 600 Ohm loading is for the circuit.



Not a bad result I think, but not near the specification of <0.0008% in the 20Hz-20KHz range.

After several hours trying, searching, testing and pulling some valuable hair, I now know why these results are too far away from the original specification. First of all the settings in the ARTA software.

Second, the 600 Ohm -10dB pi attenuator I was using to feed the E-MU with a lower input signal is indeed loading the oscillator circuit and is the cause for the higher THD distortion. Rather than showing all the previous results I made, I'm now reverting to the setup with the 100K loading of a potmeter at the output of the oscillator circuit so I can reduce the signal amplitude. 

This is the result:


The specification is <0.0008% THD so we're significantly below that figure now.

As a reference, I also made a measurement using the Victor Mickevich oscillator, and that shows this:



It seems my measurement setup is OK, apart from the larger amount of noise. Earlier measurements from a few years ago using the same modified E-MU0202 and oscillator, but with older versions of the software and drivers and a different laptop, produced seemingly better results so something is a little different.


I also tried my Arduino frequency counter, and although it works fine, just taking the input through a capacitor from the circuit output produces a lot of harmonics, so it needs a separate buffer amplifier. The oscillator prototype itself also needs a buffer amplifier, so I'm going to add that and see how the counter behaves then.

Here is a measurement using the potmeter to adjust the frequency to a precise 1KHz.


Apart from a little bit more noise (six long leads to the potmeter) there is no difference to the THD, so I'll continue with the potmeter installed from now on, and revisit the possible effect on the THD by the tracking tolerance later.


Output amplifier circuit

Because of the loading on the circuit by as little as a scope probe (added noise) and the sensitivity to loading the circuit with an output impedance (adding harmonics), I quickly put together an output amplifier circuit. In hindsight, I should have added that to the prototype, but I didn't...



I am now using the Arduino based counter to show the frequency so I don't need to use my DMM or DSO anymore, reducing the amount of loading and adding noise. With the potmeter at the output, I can now set the voltage level for the E-MU 0202 so it does not show harmonics. The input voltage to the E-MU needs to be around 1Vrms to have the least amount of distortion.



Distortion and the supply rails

Form what I can gather, there is no need to have tracking supply rails with a high accuracy. I could reduce the positive supply by 1V without  a change in the THD. However, the circuit is more critical to the negative supply. If I lower that by 1V, the is a 0.002% change in the THD+N. Lowering both rails to +/- 15V has an even larger effect. I initially thought that the increase of the rails from 15 to 17V was due to the Option2 output amplifier, but I now think that they raised the rails to get a little better THD result.


Power Supply

I've finished a simple textbook separate mains fed power supply for the prototype that has the +/- 17V rails and also the +5V for the counter, and later the relay/reed switch section.

I'm using a toroid transformer that has two separate 24VAC windings.

To get the +/- 17V rails, I'm using the LM317/377 adjustable voltage regulators, and added a trimmer to adjust them. The 5V rail is tapped from the transformer in a way to reduce the loading or digital influence. That voltage is too high for a normal LM7805, so I'm using another LM317 that can have input voltages up to 60V to get the 5V. 

The grounding for this prototype is simple. Later on I will probably split the two windings and create separate supplies for the +17V and -17V, and use a star ground at the output connector for the analog circuits. The digital circuits (the Arduino Nano and the relays/reed switches) will be kept on the 5V rail and that DGND will be as separate as possible.




Running an FFT of the +17V rail with a DC blocker shows that there is a bit more work to be done:


The 50Hz mains comes through, and there is coupling back to the rails from the (1KHz) frequency of the generator.

Granted, it's all just lying on my desk without any shielding from my other equipment (10MHz master clock, and 2 x 10MHz GPSDO) or the quite noisy environment (switching power supplies, DSO, DMM, WiFi router and WiFi transmitter).

After some thinking about the power supply, I decided to make a detour and give the SG505 a more worthy supply. This quick-and-dirty-put-together supply was a failure, so I ripped it apart. 

I have been aware for years of the so called "Superreg" design from Walt Jung from a few decades ago. He designed it predominantly for audio projects, but hey, if it's good enough for critical hi-end audio applications, it should also be adequate for the SG505. At least that is my current thinking.

I don't want to add that project to this blog post, so I'll start a new dedicated one. Superreg


My current test bench



The new SuperReg Power Supply

Details can be found in a dedicated blog post, but here are the first results, using the new supply:


And here are the first results:


This is much more like it, that problem is now seems solved! Kudo's to Walt Jung for a great design.

BTW, I replaced the two 220uF capacitors on the prototype rail input to 22uF versions because the SuperReg does a better job regulating with them. The supply sense leads are soldered directly to the pins of these two capacitors on the bottom of the PCB.

BTW, I don't trust the reported THD+N number very much but I will try to get to that later. Visually, it looks excellent with no visible second harmonic and only a smidgen of a third.

Because I ran into issues with the +5V supply that I added to the SuperReg board, I spent quite some time to get a handle on that. That process can be followed in the post about the SuperReg, towards the bottom.

Now that I have fixed those issues, I can come back here and continue.

Below is the Output Amplifier section that I added earlier, to separate the measurements from the generator itself. I now also added a circuit that creates some separation from the generator output for the Arduino Nano counter input. The transistor circuit is actually a sinewave to square wave convertor, and I also use it to drive the opto-coupler.


And here is the result:


There is a little bit more evidence of harmonics and there is some more mains related 50Hz coming through, but that is no wonder with my current hodge-podge of circuits lying on my desk.

However, there is something strange about the reporting of the ARTA software, the THD looks to be wrong (not even showing here), but the THD+N is in the ball-park. 



On the left is the new SuperReg supply, next to it is the Arduino Nano and the TFT display functioning as a frequency counter, and to the right of that is the circuit with the opto-coupler and the driver circuit. Both boards are lying on top of the E-MU 0202 sound card. The actual output amp proto board connects directly into the E-MU input.

It's actually surprising that this setup functions as well as it does.

If it turns out that the Counter circuit still is responsible for adding harmonics, I will add a switch on the front panel to disconnect it when I need to make really "pure" measurements. Time will tell.


Switching to the REW software

Because I have been struggling to get meaningful data from the ARTA software, I now switched to the Room Acoustic Software Package called


REW version 5.31.3 (REW) I had been using that package to measure room acoustics with a measurement microphone some time ago, and I also found that it supports FFT's.

The calibration information for the software is mostly for setting up room acoustics with loudspeakers and a microphone but I tried the calibration following the online information the best I could. After some testing and trying, I'm now getting this response:



The THD numbers for the individual harmonics and for the total harmonics (0.00019%) almost seem too good to be true. The original specification for the SG505 in the range of 20Hz-20KHz is <= 0.0008% (-102 dB). Unfortunately, they do not specify the THD+N which I measure at 0.0082%. 

I like this software much more and I also think that this is pretty good performance for my setup, so I can now start to check and try a few things and see what difference they make.


I did another run with the Arduino based counter attached, and this is the result:


More harmonics so this calls for a disconnect during further testing, and I will address this challenge later.


Measuring SG505 distortion with a QA304 Audio Analyzer

The Tektronix manual only shows the THD numbers, and there is no picture of an FFT, so it's hard to compare. Fortunately, there is somebody that posts video's on YouTube about this and other units that are of interest. One of them is this one where he measures the distortion of the SG505 with an QA403 Audio Analyzer: YouTube

Here is the result of that tool measuring a SG505:


In that same video he also measures the SG505 Option 2, and the SG502.


And here is the THD report in detail:


Hard to read, I know, but it shows: THD: 0.00027% and THD+N 0.00040%.

This is taken from the output of the SG505 amplifier, and it shows a lot more harmonics.

I'm taking my measurements from the generator isolated with a simple 1x buffer amp just lying around on my desk. THD: 0.00019% (hardly any visual harmonics) and THD+N 0.0084% (a lot comes from the mains related lower frequency range). 

The THD of the prototype is great and I already knew I need to work some more on the noise.


Distortion and the JFET selection

I promised earlier that I was going to try a few different J-FET's and see what the effects are on the generator, more specifically, the harmonic distortion. So far, I had been using the original Tek 151-1021-00 or FN815. I have a few more THT devices and a few SMD devices. I'll start with the TFT versions because I have a socket on the PCB. 

Note that the numbers in the REW rapport fluctuate a bit so I'm using the average number I see in the results below, the numbers in the picture can be a bit different, depending on when I take the screen shot.


151-1021-00/FN815

The original one.

2nd harmonic: 0.000054%, 3rd harmonic 0.000060%
THD 0.00019% and THD+N 0.0084%.


2N4391

According to the Curve Tracer, this J-FET comes very close to the FN815. I have two in a TO-92 metal can version. Unfortunately, I don't know anymore where I got them from. The markings are all on the top of the can and show from top to bottom; PN, 2N4391, m8614. This one may be difficult to get, could be expensive and several variations are no longer manufactured.



First one:
2nd harmonic: 0.00018%, 3rd harmonic 0.000078%
THD 0.00027%, THD+N 0.0084%

Second one:
2nd harmonic: 0.00021%, 3rd harmonic 0.000070%
THD 0.00027%, THD+N 0.0084%

Excellent results.

MMBF4391LT1G

I also have five of these in an SMD package (minimum ordering qty), recently purchased from LCSC.com. I'm just trying one of them.

2nd harmonic: 0.00019%, 3rd harmonic 0.000057%
THD 0.00027%, THD+N 0.0087%

Excellent results.

BF256B

I have a number of them in the TO-92 plastic case. This is not a candidate at all, but just for kicks...

Did not work at all, sinewave does not start.


2N5457

I have two of them in the metal can and had pretty high hopes it would be a candidate.

Did not work at all, sinewave does not start.


J112

Plastic TO-92 package.

First one:
2nd harmonic: 0.00019%, 3rd harmonic 0.000053%
THD 0.00027%, THD+N 0.0083%

Second one:
2nd harmonic: 0.00023%, 3rd harmonic 0.000050%
THD 0.00027%, THD+N 0.0065%

Excellent results.


J113

Plastic TO-92 package.


First one:
2nd harmonic: 0.00021%, 3rd harmonic 0.000051%
THD 0.00028%, THD+N 0.0084%

Second one:
2nd harmonic: 0.00021%, 3rd harmonic 0.000055%
THD 0.00029%, THD+N 0.0084%

Third one:
2nd harmonic: 0.00023%, 3rd harmonic 0.000057%
THD 0.00029%, THD+N 0.0084%

Fourth one:
2nd harmonic: 0.00023%, 3rd harmonic 0.000063%
THD 0.00029%, THD+N 0.0085%

Fifth one:
2nd harmonic: 0.00022%, 3rd harmonic 0.000060%
THD 0.00028%, THD+N 0.0085%

All of the J113's need about 1-2 seconds after power-up before the sinewave starts-up. All the other J-FET's are instantaneous starters.

Very good results.


MMBFJ201

I also have 5 each of these J-FET's in an SMD package (minimum ordering qty) that I'm going to try later on.

Did not work at all, sinewave does not start.


Conclusion so far:

There are several candidates, even some inexpensive ones like the J112 and the J113 with good results, but the best one is the 151-1021-00, of course, and luckily, the 2N4391 and the SMD version, the MBF4391LT1G, also inexpensive, which is even a tad better comes very, very close with excellent results. 

The MBF4391LT1G would be my favorite one.


Distortion and the potmeter tracking

This effect turned out to be more difficult to measure than I anticipated due to the significantly changing THD numbers that are reported by the ARTA software. Changing the value of one of the potmeter halves is more difficult that I anticipated, due to the minute rotation change and the large change in frequency.  To get a better visual handle on this, I used my DSO in the X-Y mode and use the two input channels to look at the output of the two 90 degree phase shift Opamps. It should produce a circle, which it does, but you can't really see enough of a change relative to the changing distortion numbers. In my opinion, it is safe to say that the closer the specification for the tracking is, the better the distortion numbers will be. The overall tolerance of the 10K potmeter value is less important. If needed you could add small resistor values at the bottom and/or top of the potmeters to create equal minimum and maximum values without disturbing the tracking.

I have now switched to the original MOD 100 potmeter took it out of my SG502. I first verified the specifications of +/- 0.5% linearity. Apart from the first several 100 Ohms, this is indeed pretty close:



Setting the resistance precisely is very finicky, you really need the reduction contraption. I have it, but it needs a stable mechanical setup. I had that in the SG502, and either need to butcher it, or create a new setup.

In any case, with it, the results are now: 

2nd harmonic: 0.00030%, 3rd harmonic 0.000054%
THD 0.00035%, THD+N 0.0078%

So no significant changes at 1KHz.


Effect of the timing capacitors on the distortion

I selected the best matching capacitors out of a set of 10 or even 20. For the 1KHz frequency that I have been using so far, I used the 100nF capacitor for the range of 100Hz to 1KHz, using the end of the range. I measured them again, and they are currently both 110.28nF.

As long as they are the same, the actual values do not change the distortion numbers. The other capacitors are 1.034uF and 1.034uF, 9.975nF and 9.975nF and lastly 100.25pF and 100.25pF, so match to well below 1%.

It seems there is nothing to improve here.

FFT with the range selection at 100Hz to 1KHz (end of the range) and the MOD 100 potmeter as a new reference:


2nd harmonic: 0.000043%, 3rd harmonic 0.000073%
THD 0.00016%, THD+N 0.0070%


Switching to the 1KHz to 10KHz range, now using the beginning of the range, the FFT shows this.


2nd harmonic: 0.000049%, 3rd harmonic 0.000096%
THD 0.00018%, THD+N 0.0077%

A little higher numbers.


Here is the 10KHz FFT:


2nd and 3rd are not specified.
Overall THD 0.00029%, THD+N 0.014%

The upward slope above 10KHz is most likely the E-MU 0202 at the end of it's intended audio range.


Output Amplifier

After trying to get the noise and the harmonics further down, I realize now that I need to have a better output amplifier than the simple output buffer I'm using now. There is too much noise injected into the E-MU that I need to quiet down. I already tried putting the whole circuit in a tin can, to no avail.

So, back to the drawing board and figure out what I'm going to use. There are two options, use the standard SG505 output amplifier, or use the Option 2 output amplifier but in a single ended version.

I decided on the more simple solution, and re-build the SG505 output amp.

Here is the schematic for it:


It follows the original schematic, with one difference. The calibration potmeter is now 5K, instead of the original 2K. I tried and tried, but I could not get the calibration done with the 2K. Something is probably reducing the input by another circuit, like the driver for the sync amplifier. 

For the initial tests, the circuit that drives the counter is not connected.

I used the previously used output amp board, and added the new components. To the right of the board is the output level potmeter with a switch to activate the calibration level of either +10dB or 0dB at the output, when terminated into 600 Ohm. 



I'm not sure yet what the exact function is of the JFET in the feedback loop, I've asked Bud if he could shed some more light on it's function. I don't have the original 151-1025-00 part number (listed as an SPF3036), so I tried two different JFET types (2N4391 and the 2N5457), they both seem to work fine and I didn't see a difference between the two.

Eventually, I got it all working according to the documentation, but the harmonic distortion, and the mains related hum is significantly higher plus the noise floor goes up with higher frequencies.  

In retrospect, for this measurement, I did not put the generator in the cookie box, and did not ground the box to the circuit ground, which would have eliminated all the hum and noise. See measurements below.


Bummer, in all aspects this is a failure and a setback. I had high hopes that I could improve matters, those hopes flew out of the window shattering it on the way out. I need to re-think this. Bruce and team would have never designed an output amplifier that makes things worse so something is obviously wrong with my setup.


Revisiting the shielding, using a metal cookie box that earlier did not seem to do much, had a surprisingly positive effect this time:

Spoiler alert, the BNC connector was pressed to the metal of the box by accident. I now have a secure grounding of the box to the circuit ground.


OK, so the hum and noise is solved by shielding, now what to do about the increase in harmonics on the right wing? 

If (big if) I can convince myself that a proper PCB layout would really solve it, I would go ahead and make one, but I'm not fully convinced at this moment. I need to investigate this a bit more. 

In the original layout of the SG505, the output adjustment potmeter and the calibration switch (blue below) is positioned very close to the output amplifier section, while I have pretty long leads. The potmeter is PCB mounted, and the switch has short wires going to the PCB. BTW, I'm pretty sure that the original PCB has only two layers (I'm missing the usual layer indicators) and definitely has no ground planes on either side.


That potmeter/switch is part of the gain setting, and located in the Opamp feed-back loop. I need to see if that has an effect, but that will have to wait a few days. We have guests and I also have other commitments.

After trying a number of things to get this output amplifier adhering to the specifications, I asked my friend Bud, and he even used LTspice to get some more insights of what this circuit does. Eventually, I asked about this circuit on the diyAudio.com forum and quickly learned about the patent that Bruce got for it. 

Have a look here for an explanation of the patent and that circuit. So that question is answered, but my circuit still does not work right. It may very well be that I'm using an incorrect JFET, and that the circuit is picky about a particular type. The original 151-1025-00 is used in many Tek designs, so my assumption is that it's not an exotic one. The listed equivalent part is the SPF3036, and according to some post about this part, it can be replaced by the equivalent 2N4416. According to the major part houses, the recommended replacement is the J111. I have tried the J112 and the J113 without much success, so I ordered a couple of the J111 that will arrive in a few days.


Using a Notch filter to look at the FFT details

Now that I've arrived at ppm level THD numbers, I need to use a better way to get a handle on the harmonic distortion, and get a better look at changes or improvements. The classical way to help the digitizing analyzer (my EMU-0202), is to reduce the principle frequency by at least 40dB to give the input circuitry of the EMU a better chance of looking at the harmonic details (extend the dynamic range). I have built an active 1KHz Twin-T notch filter many years ago, and more recently upgraded it, so I need to wipe the dust off my audio tester setup.



The instrument at the bottom of the stack is a combination of the Victor Mickevics 1KHz reference oscillator on the left, and the Dick Moore active Twin-T notch filter on the right. Above it is the Pete Miller sound card interface that I do not need for this project, and the top box is of course the heavily modified EMU 0202 "sound card".

With the much higher details that are now required, I needed to put the Twin-T and the reference oscillator in their own metal enclosures, and improve on the power supply. More details can be found on a dedicated blog post here. In short, I now use a string of 9V batteries as the main power source and use a regulator to provide the input voltage. This is followed by a dual shunt regulator already on Victor's oscillator, and I copied his design to the Twin-T. In both cases they supply the very quiet +/-15V rails. The metal enclosures keep the noise out.

It all took a while to sort it out, here is a picture of the mess on my desk while building and testing the power supplies...



Here is the result of the new setup stack:

Twin-T on top, below it the 1KHz Victor oscillator, resting on the E-MU 0202 digitizer. There are no nice looking face plates yet, I don't really need them, that's maybe a project for another time.


So how well does it work now?


Here is the new setup with the Victor oscillator feeding the Twin-T, which has tuned out the fundamental frequency by about -85dB giving the E-MU 0202 DAC an improved range. It shows that Victor's oscillator has a -85.66 dBV harmonic distortion, of mainly the 2nd harmonic, the others are not even visible, which is outstanding. Also note the total absence of mains related hum and the very low noise floor at -130dB. 

BTW, the upward bump of the noise floor left and right of the principle frequency seems to be a "function" or side effect of the Twin-T. 

I think I'm ready now to use this more worthy setup on the SG505 prototype...



Not quite what I expected and hoped for. The prototype with the output amp and the SuperReg is inside the cookie box, the box is connected to the circuit ground and that eliminates all hum and noise. I can now clearly see them being lifted out of the noise so I can focus on reducing the harmonics or see the effects. BTW, this is with the J113 J-FET in the output amplifier. I tried the J111, J112, J113, 2N4381 and the 2N5457, again, unfortunately, they all have the virtually same 2nd (-81.7 to -81.9) and 3rd (-87.1 to -87.3) harmonic distortion. I have not been able to lay my hands (yet) on the 2N4416/PN4416, the LSK170B or the 2SK1065-5 JFET's.

Just to put things in perspective, below is a measurement on a real SG505 with a QuantAsylum QA403 Audio Analyzer.


The harmonics are about -20dBV lower than what I measured below without the Twin-T. What is of interest is that compared to Victor's oscillator, the SG505 harmonics are clearly visible in both measurements.

The higher harmonics are not visible at all in my prototype, but they are clearly visible on the real SG505. The output amplifier is the cause of the noise level rise at higher frequencies, absent from the real SG505.

Even without the Twin-T, the first three harmonics are clearly visible.

THD is 0.0092%, 2nd harmonic is 0.0080%, 3rd is 0.0043% and the 4th is 0.0013%.

Just for reference, and to show why I'm still puzzled by the rather poor performance of the output amp, here is the output of the oscillator with only a -10dB 600 Ohm attenuator as a load.


It's a little hard to see, but the THD is 0.00021%, 2nd harmonic is 0.00016%, 3rd is 0.00013% and 4th is 0.000038%. 


Improve the matching of the timing capacitors

I now did a much better job of matching the timing capacitors to see the effect and they are now at about 1% of each other, which is the limit of my dedicated capacity meter.  

To see the effect of the timing capacitor matching, I switched between the 100Hz-1KHz range and the 1KHz-1-KHz range and re-adjusted the frequency to 1KHz in both settings. 

Compare these numbers to the measurement above. 

The 1KHz in the 100-1KHz range now shows a THD of 0.00019%, 2nd harmonic is 0.00016%, 3rd is 0.00011% and 4th is 0.000039%. 

The 1KHz in the 1KHz-10KHz range now shows a THD of 0.00025%, 2nd harmonic is 0.00016%, 3rd is 0.00018% and 4th is 0.000044%. 

There is only a very slight improvement, so the matching is actually less important than I originally thought.


Using the Twin-T notch filter with only the generator

Not using the -10dB attenuator, but now using the Twin-T notch filter will increase the dynamic range for the E-MU and will show more details:


BTW, you can't reduce the fundamental below the 2nd harmonic because the REW software is getting confused and does not know which is which.


THD adjustment modification

Bob Cordell mentioned in one of his postings on the diyAudio Forum, that he added an adjustment to his THD analyzer to get a more optimal THD distortion level surrounding the JFET in the AGC circuit. 

I also added that modification and was pleasantly surprised by the amount that I could lower the second Harmonic. 

Here is that modification. I just cut a few traces and added the 1K 20-turn trimmer Manhattan style.


The 1K trimmer R21 is used to adjust the balance of the Gate voltage. Theoretically, the optimum result is with the Gate voltage at 50% of the VDS voltage, but that is apparently not always the case.

I was expecting and hoping for a small improvement of a few dBV, but while adjusting the trimmer the 2nd H kept dropping lower and lower with every turn and eventually allowed me to drop it by a whopping amount!


Before: Overall THD  0.00021%, 2nd harmonic 0.00016%

After: Overall THD is 0.00015%, 2nd harmonic 0.000069%

That also reduces the tight specification for the two 10K0 resistors to 1%, but keeping the +/-25ppm/C.

Thanks Bob!


Using a commonly available JFET

I swapped out the original Tektronix 151-1021-00 JFET, and used the MMBF4391 instead.

After re-tuning the 2nd H distortion a bit, I now have the following results:

After: Overall THD is 0.00016%, 2nd harmonic 0.000062%.

The results are almost exactly the same so this is a good alternative.


Trying new Opamps

I've ordered a few of the OPA1655DR Opamps, to replace the three NE55534 Opamps in the generator, and the one in the output amplifier.

All the measurements I'm showing so far are straight from the generator to a 600 Ohm -10dB attenuator and then to the E-MU 0202, bypassing the output amp.

I installed the three OPA1655 Opamps in the generator and made a new measurement.


These "super" Opamps did not bring the anticipated or hoped for results.

THD went from 0.00016% to 0.00018%, a little higher

2ndH from 0.000062% to 0.000047% , a decent improvement

3rdH from 0.00012% to 0.00016%, a little bit higher

It seems that these more modern but also much more expensive Opamps are not worth it. Several people have tried a list of other Opamps with similar disappointing results. On the other hand, it also shows what an excellent result was obtained by carefully building the circuitry around the old but venerable NE5534's by the original SG505 design team.

I will leave the OPA1655 in place for now, but for the next revision PCB, I will switch back to using the NE5534.


New Output Amp Opamp

Now that the OPA1655's arrived, I soldered one on a DIL carrier to try it in the output Amp and see if it makes a difference there.

For reference, here is amplifier with the NE5534 result and the already tuned 2ndH:



THD is 0.039%, 2H is 0.032%, 3H is 0.021%, 4H is 0.0066% and H5 is 0.00098%.

What is interesting is that the 2ndH trimming does nothing. It shows that the 2ndH created by the output amp is dominant.

So here is the output amplifier with the OPA1655, after trimming the 2ndH (that works again):


A rather dramatic improvement I think.

THD is now 0,0014%, 2ndH is 0.00059% and 3rdH is 0,00038%, 4thH is 0.00056% and 5thH is 0.00018%. This is getting much closer to just the generator output, and is very promising.

Mind you, this is still the protoboard build with only a socket for a THT JFET, so I hope to be able to wring some more performance out of this circuit when it's on a proper PCB layout with ground planes and a way to test a few other SMD JFET's.

After an hour worth of warm-up time, I could re-adjust the 2ndH further down again, with even better values:
THD is now 0,0012%, 2ndH is 0.00013% and 3rdH is 0,00033%, 4thH is 0.00056% and 5thH is 0.00018%. 


With this result, I can now go ahead and add the output amplifier section to the main board.


Enclosure and Front Panel

I'm going to use the same enclosure as I used for the SG502, which is a TEKLA KL-22. This is a black plastic enclosure with a metal front panel and back panel. I would have liked to use a full metal enclosure but the ones I found where either too small, too low, or too large and mostly all of them had the wrong dimensions to use a front panel.

I designed a Front panel PCB for The KL-22 , so it has a nice looking feel for the instrument. Here is the 3D viewer result of the first prototype:


The rectangle in the top is the cut-out for the LCD display that will show the frequency. The size of that rectangle will most likely change a bit based on the visual location of the pixels. There are no mounting holes on the display board, you have to find a way to somehow glue it to the back of the front panel.

All the holes are isolated from the front and back ground poor to add some more strength and EMI blocking. I will order the black solder mask with white silkscreen lettering as I usually do for my front panels.

New PCB Layout

I have also started to create a new layout for the main board, and added the relay's for the range switching on it, as well as the output amplifier. 

Here are the circuits for the frequency range selection, using a simple rotary switch located on the front panel.

This is the frequency setting for the phase shift amps.


Here are the dampening circuits for the AGC and the Peak Detector.


And here is the circuit for the frequency multiplier rotary switch:





Maybe a new Power Supply?

I'm very happy with the Jung SuperReg, but it is a bit of an overkill for this instrument. I'm now looking into testing a dual shunt supply that I also very recently used for my Twin-T notch filter and the Victor Mickevics oscillator. I'm using Victor's design to start with. I've used LTSpice to learn more about the principle and I think I now know enough to be dangerous and feel brave enough to give it a try. I also need to add the 12V rail for the relay's and the 5V for the Arduino and LCD display.

This will decide whether I'm going to add the components to the main PCB, or create a separate one, and then add the Arduino counter circuit to it.




Stay tuned, there will be more to come now that I have a fully functioning prototype...


A Github repository is available here it will be updated with information during the project.