Author Topic: Educational function generator kit  (Read 39056 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 #50 on: October 04, 2013, 08:28:51 pm »
Updated VCO schematic.

Opinion question: For the sake of schematic legibility and tidiness, would it be acceptable to follow an older style and use simple component values (like 3904 rather than PMSS3904, 12V rather than BZX84C12, etc...), and then put a proper part number as a hidden field which exports to the BOM?
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 #51 on: October 05, 2013, 02:28:10 am »
Somewhat offtopic, but was the second picture taken with a scope camera?
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 #52 on: October 05, 2013, 02:29:00 am »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline Jebnor

  • Regular Contributor
  • *
  • Posts: 170
  • Country: ca
  • Absolutely! Yes, kind of, sort of, not really, no.
Re: Educational function generator kit
« Reply #53 on: October 05, 2013, 05:51:19 am »
Pointless nitpick: Your prototyping construction method is more correctly called dead bug construction, it wasn't invented by Jim Williams. ;)
Sometimes called "Ugly Construction" too.
Before this, there was a typo.
 

Offline Everton

  • Contributor
  • Posts: 19
  • Country: ca
Re: Educational function generator kit
« Reply #54 on: October 06, 2013, 04:36:35 am »
Hi,

I'm new to the forum and am interested building this function generator.
I'm just trying to follow along on the VCO but seem to need a little help understanding the circuit.

I'm trying to understand the delta VC business which drives the current source and sink.  It looks to me that the position of RV1 is what determines delta VC which means that this would be a constant, which in turn would setup a constant current sink and source. Is this correct?

Incidentally, I think there may be a sign mistake on the formulas at U2A and U2B non-inverting input.  I would expect it to be (Vref -DeltaVc)/2 and (-Vref-Vc)/2 respectively.  Unless I'm missing something.
Similarly on the inverting inputs, I would expect to see (Vref -IsrcRsense-Vc)/2 and (-Vref+IsinkRSense+VC)/2.

Now since the inverting and non-inverting terminals of both U2A and U2B are at different potentials wouldn't the opamp saturate?  I see that there is a little capacitance in the feedback loop, but will 10pF keep this from happening?
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 #55 on: October 06, 2013, 04:50:11 am »
You're right. The symmetry control selects Delta Vc, and this adds to one source and subtracts from the other, to keep the overall frequency nearly constant.

Incidentally, I think there may be a sign mistake on the formulas at U2A and U2B non-inverting input.  I would expect it to be (Vref -DeltaVc)/2 and (-Vref-Vc)/2 respectively.  Unless I'm missing something.
Similarly on the inverting inputs, I would expect to see (Vref -IsrcRsense-Vc)/2 and (-Vref+IsinkRSense+VC)/2.

Nope. Remember that a voltage divider between two potentials averages them - a sum and then a division.
U2A inverting: voltage divider between Vc and (Vref - IsrcRsense), giving the average of the two: (Vc + Vref - IsrcRsense)/2
U2A noninvering: v. div. between DVc and +Vref, giving (DVc + Vref) / 2
U2B noninverting: v. div. between Vc and -Vref, giving (Vc + -Vref)/2 = (Vc - Vref)/2
U2B inverting: v. div. between -DVc and IsinkRsense-Vref, giving (IsinkRsense-Vref-DVc)/2

The op amps won't saturate. Consider U2A. Assume Vc = 3V, DVc = 0V, and there's only 500uA flowing (too little: 3V/3k9 should give 769uA). Then the voltage at the inverting input will be higher (lower drop in R19, bringing it nearer to Vref). This will cause the output to drop, increasing the (negative) base-emitter voltage of Q1 and increasing the current.
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 #56 on: October 06, 2013, 02:09:18 pm »
Finally conquered the goddamn MC1496.... that's the one thing that was slowing me down, so this should start moving a bit faster soon. Schematics tonight.
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 #57 on: October 07, 2013, 03:48:55 am »
Right.  Got it.  That wasn't my brightest moment!

The only other thing I am not clear on is the what the purpose of the varicap.  When the inverting output of the comparator is low it would appear in parralel with C11 allowing the slope of the rising ramp to be adjusted, but I don't quite follow what the effect is when the comparator flips.  It would cause the input to the buffer to jump up (like a voltage doubler),  but why do we want this?

Thanks
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 #58 on: October 07, 2013, 04:05:35 am »
You're right. This is because the diodes in the bridge act as small capacitors when switched off, allowing a bit of the comparator square wave to be coupled onto the integrating capacitor. You can see that a bit in the scope display a couple posts up, though it is a bit hard to make out through the ringing. The variable capacitor couples the inverse on as well so they can cancel out.

(Note that "varicap" refers to a variable capacitance diode: increasing the reverse bias widens the depletion zone, decreasing the cathode-anode capacitance. A cool device, but none in here! That's just a variable capacitor, a trimmer capacitor or "trim cap".)
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 #59 on: October 07, 2013, 02:55:56 pm »
Provisional schematic for the amplitude modulator. I still have some component values to play with, gains to optimize, blah blah blah... so it will definitely change. (And I'd like to try to get the carrier fully DC-coupled, though the modulator is so sensitive to tiny differential voltages that it's not easy at all.)
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 #60 on: October 07, 2013, 06:11:56 pm »
Spec change: Working with higher frequencies below VT and tons of GBW makes PCB layout that is both compact and good difficult. Rather than cramming everything into one tiny PCB with a thick powder coating of tiny SMD passives, the AM section will be removed to a separate PCB which will be an option for those who want amplitude modulation capability.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Educational function generator kit
« Reply #61 on: October 07, 2013, 06:51:31 pm »
When I get some free time, I will see how fast I can go using DMA to feed the DAC on a STM32 chip.

Stay tuned.
================================
https://dannyelectronics.wordpress.com/
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #62 on: October 07, 2013, 08:17:41 pm »
I'd be interested to see that - but don't forget, the whole point of this is a look at analog electronics!
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Educational function generator kit
« Reply #63 on: October 08, 2013, 01:30:57 am »
I wrote a set of routines that sets up the dac, the dma and then use a timer to trigger the dma transfer. On a 24Mhz STM32 chip, easily running 1Khz output (256 points per cycle), and output waveforms are user selectable - I wrote sine, triangle, staircase, inverted staircase and square wave. Waveform is very clean.

One issue I see: the frequency steps at the higher end of the frequency range can be significant. To avoid that, you have to increase the number of points per cycle. However, that lowers the upper end of the reachable frequencies. Essentially, it is a DDS with fixed phase accumulator. The only way for you to alter the frequency is to slow down or speed up the clock.

Not as practical.
================================
https://dannyelectronics.wordpress.com/
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2366
  • Country: de
    • Frank Buss
Re: Educational function generator kit
« Reply #64 on: October 08, 2013, 01:44:28 am »
The DAC of the STM32 series is very limited, worst case full scale settling time is 6 us. But you could use an external DAC with some clever usage of the SRAM interface (for the larger STM32 parts), as I've tried:

https://plus.google.com/u/0/117017735090421436012/posts/jQidPgbtKoW

8 MHz sample frequency with the 144 MHz clocked microcontroller is no problem.

But maybe start another thread for your project, this thread is about an analog function generator.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #65 on: October 08, 2013, 02:24:02 am »
A lot of those cheap-ass DDS generators floating around eBay are an 8-bit micro with a CPLD and a "DAC" (pile of resistors). Seems to be a quite usable architecture and not much more expensive than a decent 32-bit micro.

I've got the modulator properly working on breadboard right now, but the breadboard implementation is limited - the circuit's a bit too complex to build on one without assloads of parasitics everywhere, and in a circuit where 40mV at one point counts as "full scale", it really makes a difference. Just finished a quick PCB that I'll etch and test tomorrow, so more scope shots soon.
« Last Edit: October 08, 2013, 02:26:55 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 #66 on: October 08, 2013, 06:21:50 pm »
Modulator prototype is done and it works great! Sort of..... somehow I managed to connect it wrong and the modulation input is inverting... :palm: That shouldn't be hard to fix, though.

Scope capture is a 10 MHz carrier modulated by a 1.4 kHz sine wave. I'll do more analysis (linearity, distortion, noise floor, suppression...) once I get the inversion rectified.
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 #67 on: October 08, 2013, 07:16:27 pm »
Just a copper bridge on the PCB... More tests coming. Here's a ~2 MHz carrier with 1 kHz modulation, triggered on the modulation signal on top, and triggered on the carrier on the bottom. The modulation signal is superimposed on the upper edge of the output, though it's a bit hard to make out here.

|O I just spent ten minutes trying to track down the source of a low-level, roughly 100 MHz oscillation.... finally threw the DSO at it and turned on FFT... it's not 100 MHz, it's 94.3, 100.9 and 106.1 MHz... three local radio stations...

Side question: does anybody have a TDS-300 series DSO that occasionally freezes while trying to save a hardcopy to disk? I'm kind of hoping there's a software bug and I don't have some failing memory or something.
« Last Edit: October 08, 2013, 07:37:56 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 #68 on: October 08, 2013, 09:06:49 pm »
Rough plot of the response of the modulator (both the level response of the signal and the frequency response of the carrier). The bandwidth isn't what I was hoping for, but I just ran it in LTspice and confirmed that the simulation showed the same behavior. It looks to be mostly due to the B-C capacitance of the discrete differential amplifier drawing more current from the relatively high impedance (470 ohm) outputs of the modulator. I had originally planned for that to be a DMMT3904W matched pair, but I used a not-so-matched pair of transistors out of the bin to test the circuit and it works fine, so I will probably experiment with replacing them with RF transistors like BFS17W. (I could also decrease the output impedance and increase the modulator's bias current to compensate, but I don't want to risk distortion.)

Edit - sorry about the PDF, that was obnoxious :-[
« Last Edit: October 08, 2013, 09:14:49 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline sync

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Educational function generator kit
« Reply #69 on: October 08, 2013, 09:40:28 pm »
Nice work!

I just noted that the MC1496 is really fast. 300MHz bandwidth. I was searching for a way to do amplitude control up to 200-300MHz. I will try it. They are dirt cheap. Thanks!
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #70 on: October 08, 2013, 09:44:40 pm »
I suspect getting it to work at that frequency would involve immense difficulty. Don't forget, the output is differential and very, very small - you need a differential amplifier with lots of gain to get a usable signal. Mine has a differential gain of 100 across two stages to get 10 Vpp, so you'd need a GBW of 30 GHz... less of course if you don't need such a large amplitude, but it would still not be easy.

As for applications for this chip... I'm kind of wondering now how accurate of an analog multiplier you could make out of it. (The kind used for doing math at low frequency/DC, not modulation at RF) Analog Devices charges a small fortune for their multipliers... The Gilbert cell circuit can work as a full four-quadrant multiplier for very tiny voltages. It looks like the transistors in the 1496 are quite well matched, so maybe with a decent precision op amp to amplify the output, you could do a good job. You'd probably need a second op amp to shift one of the inputs up to a roughly 6V common mode bias, but with a bit of voltage divider cleverness it wouldn't have to be anything amazingly precise.

Too bad there are only 24 hours in a day.
« Last Edit: October 08, 2013, 10:00:20 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline sync

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Educational function generator kit
« Reply #71 on: October 08, 2013, 10:46:16 pm »
I suspect getting it to work at that frequency would involve immense difficulty. Don't forget, the output is differential and very, very small - you need a differential amplifier with lots of gain to get a usable signal. Mine has a differential gain of 100 across two stages to get 10 Vpp, so you'd need a GBW of 30 GHz... less of course if you don't need such a large amplitude, but it would still not be easy.
I want something between 0.1-1Vpp. For the differential amplifier maybe an AD8130 works. I have some laying around. It's for a simple heterodyne sweep generator inspired by this http://hem.passagen.se/communication/meny.html and the Wavetek 2001. But the project have a big probability to fail ;D

Quote
As for applications for this chip... I'm kind of wondering now how accurate of an analog multiplier you could make out of it. (The kind used for doing math at low frequency/DC, not modulation at RF) Analog Devices charges a small fortune for their multipliers... The Gilbert cell circuit can work as a full four-quadrant multiplier for very tiny voltages. It looks like the transistors in the 1496 are quite well matched, so maybe with a decent precision op amp to amplify the output, you could do a good job. You'd probably need a second op amp to shift one of the inputs up to a roughly 6V common mode bias, but with a bit of voltage divider cleverness it wouldn't have to be anything amazingly precise.
Looking at the MC1496 internal schematic I think the DC levels changes with temperature. So it will drift. But I'm not a EE. I have no clue.
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #72 on: October 08, 2013, 10:51:20 pm »
The DC levels will drift like hell, but the differential levels should not, as long as the transistors are close together on the die and stay at the same temperature. Of course, the amplifier which subtracts the output will have to have a good CMRR.

Replacing the 3904s with BFS17W worked a treat, so I'll put together a full plot now of the linearity and frequency response. I had attempted to do noise plots as well, but the signal was below the noise floor of the DSO - I'll redo them, since the BFS17W has a higher noise figure.

I miss my Rigol. This TDS-380 is very noisy...

Dear Santa, this year for Christmas I would like a dynamic signal analyzer and a spectrum analyzer, please! I've been a good boy!
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline sync

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Educational function generator kit
« Reply #73 on: October 08, 2013, 11:15:30 pm »
Dear Santa, this year for Christmas I would like a dynamic signal analyzer and a spectrum analyzer, please! I've been a good boy!

Good luck!

btw: I think you can use a sound card as poor man DSA.
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Educational function generator kit
« Reply #74 on: October 08, 2013, 11:24:35 pm »
Screw the DSA, I want a GPIB adapter... there's nothing quite as fun as stepping the signal generator through 100 combinations of modulation amplitude and carrier frequency and writing down each output amplitude... Except perhaps knowing it's got a nice little port on the back that could automate it all...

Whole bunch of plots coming soon-ish.

OK, plots added - more to come.
« Last Edit: October 09, 2013, 02:02:14 am 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