Author Topic: Educational function generator kit  (Read 38832 times)

0 Members and 1 Guest are viewing this topic.

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #125 on: December 15, 2013, 01:26:03 am »
Because of the bias and levels on the differential amplifier, it ends up being a sort of symmetric pseudo-logarithmic amplifier. And a logarithmic curve can actually be fit surprisingly well to a sine wave - here's sin(x) plotted on log-log axes with a fit. (Sorry about the large size.)

I'm going to have to properly work through the math to write up the explanation for the text, so I'll post that when I've finished.

The circuit is modified for higher bandwidth from NatSemi/TI's app note AN-263 (Sine Wave Generation Techniques), supposedly by Jim Williams, under "Sine Approximation - Logarithmic Shaping". The author claims distortion of 0.35%, which is -50dB. It works great - I just tweaked it more carefully and got the 2nd, 3rd and 4th harmonics all under -60dB; the 5th, 7th, 9th and 11th come above that just a bit (also attached).
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #126 on: December 15, 2013, 01:55:22 am »
Even better, here's hyperbolic tangent (e2x-1)/(e2x+1), which is a much closer fit and is likely to be (or at least, be similar to) this "symmetric pseudo-logarithm".

Note that this only works at small voltages, which is why the voltage gets divided down by a bunch (anywhere from 22 to 45, depending on the trimmer) and then reamplified at the end.

MATLAB says that for a perfect tanh(t) scaled to fit exactly inside sin(t), maximum distortion is -73dB:

Code: [Select]
>> x = -pi/2:0.005:pi/2;
>> y_sine = sin(x);
>> y_tanh = tanh(x)/tanh(pi/2);
>> distortion = y_tanh - y_sine;
>> distortion_db = 20*log(abs(distortion));
>> max(distortion_db)

ans =

  -73.7206
« Last Edit: December 15, 2013, 02:15:48 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #127 on: December 15, 2013, 08:46:18 pm »
Holy shit! It's layout time already! :scared: :scared: :scared: Schematics attached.

There are still a couple circuit sections that are untested, but I'm waiting for parts in the mail. The layout will take a long time and these sections will be relatively quick, so I might as well get started; I won't lose much time if I have to modify or even redo them. I have left most connections to the MCU hanging, as almost all of them can go to any pin, and I will connect them as I see how they fit together on the PCB.

One preemptive explanation: I've chosen six 'standard' decoupling capacitors and given them letter names, which are listed in a table on the first page. In the schematics they are just defined by the letter name. I'm aware it's not the best practice in general; I chose to do this because it will make indexing the parts for the kit easier. Also, I realize that test points are a bit scarce. As the layout is going to be tight, I am going to try to fit in "natural" testpoints (places where it is easy to fit a scope probe without a dedicated spot) as much as possible, and add proper ones only when necessary. The exception is on the VCO outputs, which have high rise time and require careful probing.

I was originally going to use 0603 passives; earlier I changed my mind and went to 0805; I am changing my mind again, as the main board will be rather closely packed. With all I've got to fit on here, y'all are lucky I'm not using 0201... >:D The PCB will be a 100mm x 100mm four-layer.

Please critique, criticize, give helpful advice, or insult at will. :-+

One more change to make, after which I'm not going to bother repacking the schematic as PDFs for you - I am changing the JFET used in the VCO to an MMBF4416. Two reasons: 1) They're a bit cheaper, and I just bought 100 to include with the kits. 2) Their footprint is more common than that of the BF545, but also, the BF545 is specified as a symmetric JFET and will still work even in this "wrong" footprint. This way the PCB should be compatible with a wider variety of JFETs if I have to make substitutions (they do seem to be thinning out).

Edit: Well, here we go. Mother of God that's a lot of components! :scared:
« Last Edit: December 16, 2013, 01:39:19 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #128 on: December 18, 2013, 06:02:54 pm »
Hey, look what arrived today!

Rev A of the comparator. I've had rev B in my hands, assembled and working for some time now...

I hate international post......
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #129 on: December 24, 2013, 09:01:15 pm »
Speaking of the comparator......

I am looking at removing it and using a standard comparator IC. It will clean up the PCB to remove a daughterboard, and remove the cost of the board (and assembly time - it was a complex board!!). I wanted it for educational purposes, but I do have at least one other differential pair.

Of course, the HP-designed one I'm using now has some nice advantages (in particular, very nice symmetry even when operated near its frequency limit) which are proving hard to replicate with an IC.


...eh, never mind. All the comparators I can find that meet my specs need a level translator to work properly here, and by the time I'm done I've only replaced the one diff pair with the comparator IC. Discrete comparator it is!
« Last Edit: December 24, 2013, 09:32:49 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline echen1024

  • Super Contributor
  • ***
  • Posts: 1660
  • Country: us
  • 15 yo Future EE
Re: Educational function generator kit
« Reply #130 on: December 24, 2013, 09:45:42 pm »
If you need help with assembly, ship the boards to me. I enjoy hand soldering SMD and am due to have a reflow oven here quite soon
I'm not saying we should kill all stupid people. I'm just saying that we should remove all product safety labels and let natural selection do its work.

https://www.youtube.com/user/echen1024
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #131 on: December 24, 2013, 09:46:51 pm »
Well, it is a kit... ;)
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline echen1024

  • Super Contributor
  • ***
  • Posts: 1660
  • Country: us
  • 15 yo Future EE
Re: Educational function generator kit
« Reply #132 on: December 24, 2013, 09:50:43 pm »
Well, it is a kit... ;)
So I guess reflow would destroy the purpose of it  :). And yes, I know that the end user is supposed to assemble it.
I'm not saying we should kill all stupid people. I'm just saying that we should remove all product safety labels and let natural selection do its work.

https://www.youtube.com/user/echen1024
 

Offline quantumvolt

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: th
Re: Educational function generator kit
« Reply #133 on: December 25, 2013, 03:37:35 am »
I've been following your thread and admire your work. And I have been thinking about the size of the components and boards. Your last picture is very revealing - the depth of 2x daughter boards is some 3 keys on a PC keyboard.

My eyesight, my hands and my soldering tools will not be able to succeed in assembling this. I will still follow the project - but if it is to supplement/replace my XR2206 and ad hoc Wien/phase shift oscillators, I will wait and see until there maybe are assembled boards :D.

Continued good luck - it takes a bit to design this from scratch.
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #134 on: December 25, 2013, 03:51:54 am »
Yep. That one is done with 0603. The second revision uses 0805, but the main board is still 0603.

Now... if I get it finished and find there is space available, I may upgrade to 0805. I currently have the parts on a relatively coarse grid in most areas, though only about 40% of them are in their "final" locations. But still, assembling this is not for the faint of heart or eye. There are a couple ridiculously minuscule packages which will be pre-soldered (the AD9838, for instance, is only available in a 0.5mm QFN, I had to use the high-thermal-performance version of the THS4222, which is very small, and even the MCP4728 - MSOP-10 - may be small for some), but that still leaves a shitload of 0603.

By the way - I just eliminated an entire schematic page: the peak detector (for amplitude reading). The MCP4728 DAC had one channel unused, so I combined that, a single comparator and a pin change interrupt on the MCU into a sort of "peak-responding SAR ADC". That will free up some PCB space, so an upgrade to 0805 becomes a bit more likely.

Here's an update on the layout effort so far.

Four-layer boards, by the way, are the best thing to happen to a guy who's anal-retentive about grounding. That entire unbroken ground plane layer is the stuff of wet dreams...
« Last Edit: December 25, 2013, 04:17:34 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline marshallh

  • Supporter
  • ****
  • Posts: 1462
  • Country: us
    • retroactive
Re: Educational function generator kit
« Reply #135 on: December 25, 2013, 10:21:53 pm »
Mail to me and I'll throw it on my spectrum analyzer. You might even get it back  :box:
Verilog tips
BGA soldering intro

11:37 <@ktemkin> c4757p: marshall has transcended communications media
11:37 <@ktemkin> He speaks protocols directly.
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #136 on: December 26, 2013, 11:18:17 pm »
I don't have a final price yet, as I haven't put together the BOM script that I want to use and I haven't really finalized the design, but I received a question about pricing today, so I will answer it.

As I'm a "starving college student", I cannot afford to buy a huge batch of parts right away in the beginning, so the first few buyers will have to source many of the parts by themselves. I've bought a few bunches of jellybeans, and plan to buy a couple more, so you can enjoy the cost benefits of those. These are:
- MMBT3904
- MMBT3906
- MMBD4148
- 1N4001
- MMBF4146
- LM1117 in SOT-223 (There's only one... but I bought a long tape of them cheap a while ago and haven't used many, so I might as well share! There is another 1117 but it must be TO-220 for dissipation)

PCBs will be $12 total, or $10 if you omit the amplitude modulator option. They are the main 4-layer board, the comparator, the amplitude modulator, and a small board to hold the front panel buttons (and LEDs if I use any, though I haven't fully designed the panel).

I didn't do a full, proper BOM, as mentioned. I did assemble a list of all semiconductor components, as well as other major parts (enclosure, front LCD, range switch, all the "schmick" capacitors on that switch, and the PCBs). Attached. The total for those came to $84. Expect another $20-$30 for miscellaneous passives and connectors (I did forget the chunky inductors and caps in the power supply, though I am working on cutting them down a bit). The power source will be any 18V-20V 12W+ brick, so a $10 replacement laptop charger will do just fine.

Keep in mind that I have not yet worked hard at cutting the cost. I do hope to shave a good bit off, and I have a few good spots in mind.

That brings the total as of today to around $140.
« Last Edit: December 26, 2013, 11:20:08 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #137 on: December 26, 2013, 11:19:21 pm »
Mail to me and I'll throw it on my spectrum analyzer. You might even get it back  :box:

Even better, mail me the spectrum analyzer so I can take the measurements I need. You might even get it back :box:  >:D  ;)
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #138 on: December 30, 2013, 04:04:30 am »
Good news and semi-bad news.

Good news: I finally completed testing everything as well as I can and it all works. Of course, I can't test it all integrated until I have a PCB. The VCO was incredibly layout-sensitive w.r.t. signal distortion, and it took a few etched prototypes to get it right.

No plots unfortunately. My only camera was missing when I did them and I couldn't be bothered to use the slow-as-molasses DSO. I'll redo the tests for inclusion in the Theory of Operation, of course.

Semi-bad news: I am taking a one week holiday from this damn thing. I swear to god, I dreamed about PCB layout last night. It's a lot of work for one guy. I need a short break or I will quickly become incapacitated by all these f*$@ing trees and be unable to see the bloody forest |O
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #139 on: January 05, 2014, 04:53:36 pm »
My PSU kit ended up more of a success than I thought... so until I get them finished and shipped, it is going to take precedence over this one. I'll still resume work tomorrow (one-week break will be over), but if both of them have tasks to be done, it will come first.

Sorry to anyone who thinks this means I'm giving up. Hell no I'm not, I've sunk a lot of work and money into this already! :D But I'd rather this take a bit longer to finish, than to work on it exclusively and finish nothing else.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline echen1024

  • Super Contributor
  • ***
  • Posts: 1660
  • Country: us
  • 15 yo Future EE
Re: Educational function generator kit
« Reply #140 on: January 05, 2014, 05:51:53 pm »
My PSU kit ended up more of a success than I thought... so until I get them finished and shipped, it is going to take precedence over this one. I'll still resume work tomorrow (one-week break will be over), but if both of them have tasks to be done, it will come first.

Sorry to anyone who thinks this means I'm giving up. Hell no I'm not, I've sunk a lot of work and money into this already! :D But I'd rather this take a bit longer to finish, than to work on it exclusively and finish nothing else.
Which PSU kit is this?
I'm not saying we should kill all stupid people. I'm just saying that we should remove all product safety labels and let natural selection do its work.

https://www.youtube.com/user/echen1024
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #141 on: January 05, 2014, 05:57:11 pm »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #142 on: January 08, 2014, 12:56:57 am »
Sorry to anyone who thinks this means I'm giving up. Hell no I'm not, I've sunk a lot of work and money into this already! :D But I'd rather this take a bit longer to finish, than to work on it exclusively and finish nothing else.

I have to apologize very sincerely for this, but I am at least temporarily giving up. This is quite simply too expensive for me to continue at the time, in both time and money, and probably will be for at least a couple months. :( As fun as this project is, I have yet to find a money tree in this forest where I live.

I will certainly keep going with simpler, less ambitious kits, though. The power supply is coming along quickly, and I've got an idea already for the next. I have a hint: the idea came to me after seeing the recently posted teardown of a Keithley SMU.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
Re: Educational function generator kit
« Reply #143 on: January 08, 2014, 01:05:02 am »
at least temporarily giving up

Keyword highlighted, I have shelved many projects for a variety of reasons.  When you get back to it, it will be with a freshened spark and new/enhanced ideas.

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #144 on: January 08, 2014, 01:07:02 am »
Definitely. I've had a few ideas rolling around in my head that would require ripping up most of the project as I have it, and I didn't want to implement them because - well, they'd require ripping up most of the project as I have it. I'll come back with lots of fresh ideas - I already have some.

When I do come back to this, I'm going to redesign it to follow the HP 3325A's plan - all-analog signal path, but all-digital controls. Everything will be integrated into the design from the beginning (e.g. no separate AM module, as the AM circuitry will be used as the main amplitude control). Though I am considering a full multi-board solution, with each system block on a separate PCB, to avoid 1) ridiculously small parts and 2) a ridiculously dense board.
« Last Edit: January 12, 2014, 02:34:15 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf