Author Topic: Educational function generator kit  (Read 38395 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 #100 on: November 08, 2013, 04:35:22 pm »
In the current iteration I am using a PIC18F46K20. I'm not too concerned about whether the builder can program it - I'm using a QFN to save space, so I am going to solder the MCU and program it myself. I don't see much of an educational advantage to making programming the MCU part of building the kit - there's no education in "connect USB, connect ISP, type 'make program', voilĂ ".

But yes, I am programming it in C. No assembly, no C++, and Microchip hasn't released an Ada compiler yet ;)
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 #101 on: November 13, 2013, 08:37:13 pm »
PCBs for the amplitude modulator and comparator are in. (I got the comparator rev. B boards first... ::))






Sadly, not much else has happened in the interim, unless "endless schoolwork" counts. That should let up soon, though.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Educational function generator kit
« Reply #102 on: November 14, 2013, 11:34:26 am »
Hallelujah !

Finally someone who draws proper schematics !

How i could have missed this topic until now is a complete mistery ...

Now, i stead of the obsolete 1496 try an ne603 or ad630. Those are analog multipliers.
Work great for modulation and gain adjustment

I havent looked at all schematics as i found this topic literally 2 minutes ago.

Standby for comments...
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #103 on: November 14, 2013, 11:39:58 am »
Eh, I picked the 1496 for a reason (simple internal circuit, so I can write a section explaining how it actually works). It is old, but it doesn't seem to be headed for total obsolescence yet.

Hallelujah !

Finally someone who draws proper schematics !

^-^ Just so you know, after putting quite a bit of work into them, this made me smile.

Quote
I havent looked at all schematics as i found this topic literally 2 minutes ago.

Standby for comments...

 :scared: :-DD

I have a schematic for the output amp that I have not posted yet (it's not 100% complete but I will add it later today). Most of the other small pieces of schematic scattered around this thread have not been changed much, other than integrating them into a large, multipage schematic. I will see what I can put together for a total dump of my progress so far in between my classes today.
« Last Edit: November 14, 2013, 11:45:49 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8518
  • Country: us
    • SiliconValleyGarage
Re: Educational function generator kit
« Reply #104 on: November 14, 2013, 11:55:38 am »


Hallelujah !

Finally someone who draws proper schematics !

^-^ Just so you know, after putting quite a bit of work into them, this made me smile.

Seriously, after all the usual tripe and bloodwurst schematics on the internet consisting of scattered loose components wit netnames slapped on their pins , hairballs with wires running through ic symbols and discombobulated schematics with parts under any possible random angle possible and cubistic schematics where every component is a square box, these are a breath of fresh air

LISTEN UP INTERNET : THIS IS WHAT SCHEMATICS SHOULD LOOK LIKE.

I,ve gone quickly over some things. But will study them in detail tonight. One thing i noticed : your prolific usage of massive wet electrolytics .... That needs a makeover with a shotgun. Ssst , be vewey vewey quiet, i'm hunting wectrowitics...
« Last Edit: November 14, 2013, 11:58:13 am by free_electron »
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #105 on: November 14, 2013, 12:00:20 pm »
They're cheap! The alternatives are ceramic, tantalum and film:

Ceramic: voltage coefficient. The analog section runs at +/-15V. Nope.
Tantalum: more expensive, shorter life, catch fire. Nope.
Film: uh, nope.

Most places don't need so many. The AM board has a bunch of local rails that needed decoupling.
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 #106 on: November 14, 2013, 12:37:36 pm »
More schematics:

- Amplitude modulator, again. In B&W to get around a couple KiCad color plotting bugs |O And a few annotations have been changed
- Output amplifier. This is untested. In particular, the rise time limiter has not been tested at all, and the offset circuit is wrong (non-flat frequency response makes it useless). Also, the feedback loop is a bit long and may need to be compensated. I'll test this circuit next week after my exams...
- Switchable attenuator. Not much to see here
- Block diagram. Also incomplete, but at least shows the general pattern.
- Peak detector, for measuring min and max for display.
- Power supply
- Range switch. This has one error that I know of (no "all deselected" / 5 MHz setting). I'm sure my capacitor choices are up for some criticism! :scared: But that's why I'm posting!
- Phase locker/synthesizer/synchronizer. One incomplete part: R/C filter has not been selected. I may end up needing multiple R's, actually, for different ranges.
- VCO.
« Last Edit: November 14, 2013, 12:44:23 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: Educational function generator kit
« Reply #107 on: November 15, 2013, 01:53:18 am »
So the final product will have 2 boards ?

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #108 on: November 15, 2013, 01:57:53 am »
Two primary boards. In order to build the comparator inside the VCO from discrete parts, and have it perform as well as I want it to, I had to place it on a separate board which plugs into the main board. The amplitude modulation option adds a third board due to its size. I am really hoping the modulation generator option will not require a fourth board, but I cannot promise that yet. The add-on boards are all pretty small; the main board is 100mm by 100mm.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: Educational function generator kit
« Reply #109 on: November 15, 2013, 02:06:39 am »
Uh .. oh 4th boards, but don't worry, trust your judgment & wisdom  ;), I will just sit tight here lurking & waiting  to hear the final green light from you.  :-+

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #110 on: November 15, 2013, 02:09:01 am »
:-DD Hey, it's a lot to fit onto a board!
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: Educational function generator kit
« Reply #111 on: November 15, 2013, 02:15:14 am »
Since the construction is similar to those "shields" thingy  >:D, may be you should consider to name it something like ... "AnalogUino" ... "FunGenUino" ... <puked a lot while typing these> ...  j/k :-DD

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #112 on: November 26, 2013, 07:52:42 pm »
Wow. What a busy semester. I finally got a chance to build and test one of these damn PCBs...

I am happy to say that the performance is significantly better on the PCB than in the prototype. The prototype had a bandwidth of 15 MHz, with noticeable loss starting a bit before 1 MHz. I've only tested this one up to 6 MHz (different signal source, didn't bother switching as I will do a full characterization later tonight), and the response had a slight dip at 1.5 MHz, which recovered, and no real dropoff was present all the way to 6 MHz. I'll decide tonight after taking more measurements whether I want to add a compensation network for that dip. Noise is also much lower, though I haven't yet measured that properly either.

I've also been experimenting with removing components - I've already eliminated the entire offset compensation section (that will be done by the MCU instead, which I have decided not to make optional; it's just too damn useful), and a couple small capacitors, as well as consolidating a couple resistor values. Might go electrolytic hunting tonight at well. The only one that's absolutely 100% necessary is C12 (coupling capacitor for the carrier); everything else is decoupling. Specifically, C1 and C2 (right at the power input) can probably be removed, and C14 (which bypasses the local -8V rail) can probably be removed, as the load on that rail is roughly constant current. I think C6 will be necessary (bypasses the 2V ceiling for the modulation percentage pot; this will need LF decoupling), and C9 may be necessary as this bypasses VCC for the modulator. C10 has a relatively small AC load and may be unnecessary as well, though removing it may un-flatten the frequency response a bit. I may be able to change C6 to a 10uF MLCC, as the voltage is small, but that would require modifying the PCB, which I don't want to do as I already have nine good ones.
« Last Edit: November 26, 2013, 08:10:45 pm 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 #113 on: November 28, 2013, 12:29:25 am »
Where's the biggest BW limitation?
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 #114 on: November 28, 2013, 12:37:08 am »
Both gain stages - the dual BFS17W differential amp and the LM7171. In those configurations they end up giving about equal contributions (as planned). The tightest bandwidth restriction is probably the LM7171, though it's close - lots of gain here, so even a large GBW product is used up fast!

I must update - the higher BW was a mistake, due to the amplitude flatness of the signal generator I was using being much worse than I thought it was. I fully exercised it last night, but didn't have time to analyze the data properly. BW is about the same, actually. Noise has definitely gone down though, which I am very happy about.

There is a roughly constant-amplitude 2nd harmonic distortion that ends up summed with the output, which wasn't nearly as bad in the prototype, so I'm going to have to look into that. Something to do with matching in the bias section before the MC1496, I suspect - I might need to use 1% resistors there.
« Last Edit: November 28, 2013, 12:51:03 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 #115 on: December 11, 2013, 01:47:11 am »
Damn, it's been a long time again. I promise, I'm still working on this!

Got the 100 MHz RF oscillator working perfectly! :-+

Oh, wait. It doesn't have one. |O

The present output amplifier has proved damn near impossible to stabilize, despite being damn near impossible to destabilize in simulation... Stupid parastics! :) I'm all out of ways to increase phase margin... On to attempt #2. Instead of an op amp driving a huge feedback loop around the output buffer (yes, that's not the best idea), I'm going to try to use a simple common emitter or cascode-type amplifier. The lack of feedback-controlled offset can be adjusted by the MCU, since the offset is controlled by DAC anyway, and the lack of feedback-controlled gain doesn't matter since the amplitude isn't a precision setting anyway.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: Educational function generator kit
« Reply #116 on: December 11, 2013, 01:59:51 am »
Just to let you know, there are lurkers here (at least me) and enjoying your updates ....  >:D

Take your time ironing out those problems.

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #117 on: December 11, 2013, 02:12:22 am »
I am too. I love this kind of stuff - much better than the shit we're doing at school. I spent all today preparing a seven-page writeup of a low battery indicator. Nice to sit down to this for a change after that.

Speaking of seven-page writeups, I've got to get to work on the text. So far all I've got is that section on BJTs.
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 #118 on: December 11, 2013, 04:38:21 pm »
Jesus. I swear, next time I need an RF oscillator - forget Mr. Colpitts, the LM7171 is much more reliable. ::)

Getting it to work was reasonably simple. I am happy to say that I'm so far doing a good job of proving Danny wrong:

Quote
sqrwave risetime: no longer than 10ns, probably around 5-6ns

Let me be the very to say that if you could indeed design and implement something like that fully in the analog domain, you would have no problem work at any test equipment company as a senior person.

 ;) ;)

To be very sure I hit the 10ns limit, and the 5ns goal, I've been designing for 3ns. As usual, real life isn't quite as good as simulation, so I'm getting 4.5ns. :-+

That's at low amplitude, though. The only source I have for the real signal (high rise time and high amplitude) is the comparator module itself, which is presently tied up with the VCO doing some other tests, so I didn't have an appropriate signal source. That will come a bit later.

The ringing and overshoot are a bit worse than I'd like, but that can easily be attributed to layout. In the "final" PCB, I'll leave a few empty footprints for compensation networks of various types, so I can design those around the final layout without changing the board. (Though the likelihood of a 100% successful first prototype run of the main board is not very high, I admit.)

Some of the overshoot will be from the signal generator itself, as well as the fact that the signal came down a long cable and was not terminated 100% perfectly.

A discrete transistor-based solution was difficult because of the low overhead (output needs to span -10V to 10V before the termination, and the rails are -15V and 15V) - it had to be biased very carefully, and I'm really not a fan of "precision biasing". Recipe for failure IMHO. But taking the output buffer out of the feedback loop did the trick. 7171 stays.

I'll say this: you know you have a high-speed op amp when it doesn't work properly until you trim the leads on the feedback resistors! :D

The rise time limiter works perfectly as well, though I didn't doubt that (I more or less wanted it present in the prototype to ensure that it did not limit anything when switched off.)
« Last Edit: December 11, 2013, 04:40:17 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 #119 on: December 11, 2013, 09:38:02 pm »
Since I've decided to make the MCU a required item, and I had a couple channels available in a 12-bit DAC used to set the offset voltage, I decided to restructure the frequency control. It's digital now. The MCU will implement a control loop around that to get a precise frequency (this may allow me to eliminate the PLL FPGA :-+) and also symmetry. That has removed an entire quad op amp, a trimmer, two front-panel pots, two entire auxiliary rails (+/- 12V) and a shit-ton of resistors from the VCO as well. Hell yes!

There is still a range selector. I have no clue how I'd go about removing that.

I know that removes FM. Sorry for anybody who was really wanting it :( I'll put it back if I can find a reasonably simple way, but currently I am quite frightened at how much I'm going to have to squeeze onto a PCB and looking to trim off the fat. It will still do sweep, as the DAC is fast enough for this. Don't know if I'll be able to pull off something more complex with just the MCU and DAC, but I will definitely experiment with it once I have a full prototype.
« Last Edit: December 11, 2013, 09:51:38 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 #120 on: December 13, 2013, 01:05:45 am »
Hmm... testing the triangle->sine shaper, and holy hell does the THS4222D get hot. Typical temperature rise for the SOIC package at +/-7.5V is 61 degC! :scared:

Good thing they offer a version with a thermal pad. I'll be using that.

This is coming along more quickly now. :-+ I still have to finish testing the shaper and waveform switch, and I have to test the peak detector, and that's it for the main FG. Then, I have to design the secondary (modulation) signal source, which shouldn't be hard since I only need 100 kHz top frequency and 2Vp-p amplitude. After that it's layout time.

And I still have to do the text. *groan*
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline Everton

  • Contributor
  • Posts: 19
  • Country: ca
Re: Educational function generator kit
« Reply #121 on: December 13, 2013, 03:16:19 am »
I am enjoying following along as you build this up (and will likely build my own once the bugs have been ironed out).  However, I am curious to see the text once you write it up.  I think I understand most of the schematics you've posted, but am curious to see how much has escaped me, it hour me knowing it!
If you don't have the time to do it right, where are you going to find the time to do it over?
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #122 on: December 13, 2013, 02:00:12 pm »
I think I will use an AD9838 monolithic DDS generator for the modulation waveform. Very simple, small, and hey, it's only $5. It just needs a filter and op amp for output and an analog switch to select between the triangle/sine and square outputs.

I am not a huge fan of using such dedicated chips. Who knows how long ADI will be making that for? So to avoid having to respin the PCB if it goes away, I will include a small footprint for a "bodge board" to be added later if I have to re-implement the circuit. It might be easier, especially if I end up making a lot of these, to run off an additional little 3x3cm 2-layer PCB than to redo the main 10x10 4-layer, especially since whatever I'd replace it with would almost certainly take up more space.
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 #123 on: December 14, 2013, 03:29:47 pm »
Success! Here's the sine output. Also, the HEF4053 which I am using as a switch does a fine job of blocking the square wave edges from the sine, which I was a bit worried about.

I'll add the schematic for the shaper/switch section in a few minutes when I get back to my other computer.

Some of the remaining distortion is accounted for by my impatience with the trimmers...... the FFT on my TDS380 is slow and I wasn't too concerned with sitting there tediously tweaking it until all the harmonics disappeared.

I am looking into the possibility of building FFT into the microcontroller for an "assisted calibration" mode. One of my project goals was that it could be assembled and tested with nothing more powerful than a 20 MHz scope, and that does not include FFT capability or a distortion analyzer. Of course, you could just eyeball it, but that's not very good. Shouldn't be too hard to sample the waveform with the frequency down around 100 Hz / 1 kHz and display the relative amplitudes of the 2nd and 3rd harmonics.

Edit: Schematic attached.

2nd edit: Just noticed the incorrect pin numbers on the 4053. E should be 6. Corrected, but not reuploaded.

Wow. This is suddenly coming together pretty quickly. I've got to get an AD9838 so that I can test that section, and I can test the peak detector in the meantime (that one should work just fine, though it might need a bit of HF compensation to work properly for fast waveforms).

I may also be able to bring FM back in, and still use the DAC for frequency control, just by summing the FM signal with the DAC outputs.
« Last Edit: December 14, 2013, 04:00:49 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline Everton

  • Contributor
  • Posts: 19
  • Country: ca
Re: Educational function generator kit
« Reply #124 on: December 15, 2013, 12:57:25 am »
I must be missing something here.  It appears to me that you are feeding a triangle wave into a differential amp with an active load to create a sine wave.  What is causing his to form a proper sine wave?  At first I thought you the gain would be non linear due to varying Re, but that would not create a sine wave.  also, seeing that you are using an active load,  I don't honk this would happen anyway.

Please explain s I am confused!

Thanks
If you don't have the time to do it right, where are you going to find the time to do it over?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf