Author Topic: Function generator - signal quality opinions?  (Read 14986 times)

0 Members and 4 Guests are viewing this topic.

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Function generator - signal quality opinions?
« on: September 22, 2013, 12:14:34 am »
I'm still working on my analog function generator. (My goal eventually is to put it together as a PCB + BOM + manual with full, instructional "theory" sections as a beginners' "lesson kit").

Currently, this is what I'm getting out of the VCO. I could possibly completely scrap the design and start over and get something a bit better, but this is the best signal I'm able to get with the current design. The top traces are my oscillator, and the bottom traces are, for comparison, the output of my old Simpson function generator at a similar frequency. Clearly, the Simpson is no better than mine, but I'm still not 100% happy with it.

I may be able to get it a little better - part of the distortion is adjusted with a trimmer capacitor, and my "trimmer" is currently a couple twisted wires that I move with my hands.... so I make no claim of having used the proper tongue angle.

What do you all think? Should I expect a "perfect" triangle wave at upwards of a megahertz, or is that acceptable?

Apologies for the shitty photos...
« Last Edit: September 22, 2013, 12:19:06 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline sub

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: Function generator - signal quality opinions?
« Reply #1 on: September 22, 2013, 01:17:44 am »
They look suspiciously like reflections---does the time between the two peaks vary with frequency?

Edit: Actually, time between them is a touch too long, unless you have 5m of coax connecting your generator to the oscilloscope.
« Last Edit: September 22, 2013, 01:20:16 am by sub »
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #2 on: September 22, 2013, 01:30:32 am »
Nope, just a P6137 clipped onto the buffered output.

The time between the two peaks is pretty constant. The amplitude of the glitch is inversely proportional to the size of the integrating capacitor, so my guess is that there is some constant-charge nastiness from the control signal being coupled onto the integrating cap two different ways, and the propagation delays of the two paths are slightly different.

On the next frequency range down (470pF / 200kHz) it's almost invisible on the CRO and quite small on the DSO (fades into the noise without significant averaging).

I can try playing with the FET buffer stage a bit, in case some of it is from the non-constant load at the comparator input.

I'll probably follow the triangle-sine converter with a steep low-pass filter set just above the top frequency to at least nip it out of the sine.

I will attach a schematic in a bit.
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: Function generator - signal quality opinions?
« Reply #3 on: September 22, 2013, 01:39:36 am »
Here's a schematic. It's a bit rough, this is the version I made the quick prototype board from (I did update it to include my various bodges, though...)
« Last Edit: September 22, 2013, 01:42:15 am by c4757p »
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: Function generator - signal quality opinions?
« Reply #4 on: September 22, 2013, 02:43:07 am »
Quote
Should I expect a "perfect" triangle wave at upwards of a megahertz,

That would be a function of your design.

Quote
or is that acceptable?

That would be a function of your intended application.
================================
https://dannyelectronics.wordpress.com/
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #5 on: September 22, 2013, 02:52:28 am »
Well obviously... but sometimes when a single person is working on a project, designs get revised. I was just wondering whether people thought it was worth the trouble to try to clean it up more. It's clearly acceptable to some people, since the performance roughly matches that of a commercial function generator, and I wasn't sure whether I wanted to put in the extra work to go beyond that.

I'm sure with lots of time and hard work, one could generate a 50 MHz clean triangle wave. But if 99% of people agree that 99% of the time they'd have no use for such a thing, I won't bother.

My suspicion is that above 100 kHz or so, nobody really uses triangles and I just need to make sure sine and square are clean. But I wanted to check with people before I went ahead with this.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1783
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: Function generator - signal quality opinions?
« Reply #6 on: September 22, 2013, 03:37:39 pm »
Here's a schematic. It's a bit rough, this is the version I made the quick prototype board from (I did update it to include my various bodges, though...)

I didnt do a full analysis of your design, but I do have a question after a cursory look.  What are you doing with Q4 and Q5 at the bottom of your integrating cap?  Why aren't you simply leaving it at a fixed bias (GND, etc.)? Seems like that might mess around with your peaks and valleys, since it looks like it messes with the reference side of the integrating cap each time the comparator toggles the current source/sink diode bridge/switch.
YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #7 on: September 22, 2013, 03:43:01 pm »
Without that block, the comparator output couples through the diode bridge a bit and distorts the signal, shifting each half-period up and down with the square wave output. Those invert the square wave and add that in an equal amount to offset it. (An idea stolen from inspired by the 3312A.)

You can see the distortion I'm talking about in the output from the Simpson, which does nothing to fix this.

I had the same suspicion (figuring that the inverted square wave would have a slight phase offset), but I completely disconnected that block (removing CV1 and R28) and the double peak didn't go away. (It does do its intended job quite well, though :-+)

Another thing I investigated was whether there was some problem caused by coupling noise into the power supply (as you can see, the integrating cap goes to -15V, not ground). Nope, connecting it straight to ground doesn't fix it either. (The reason it goes to -15V is to allow polarized caps to be used for the very slow ranges)
« Last Edit: September 22, 2013, 03:48:24 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: Function generator - signal quality opinions?
« Reply #8 on: September 22, 2013, 04:07:16 pm »
For comparison I make some photos from an enertec schlumberger 4433 analog 20MHz function generator.

When I build my dummy load with a darlington transistor I found that it's working better with a base resistor. It's basically the same circuit as your current sources.
Are the TL071 fast enough? Or it doesn't matter?
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #9 on: September 22, 2013, 04:17:23 pm »
Well, that is definitely much better than mine! Hmm...

The TL072 shouldn't have to be fast, as long as it is slow enough! :P The current from the transistors is a function of the base voltage, so as long as that stays reasonably fixed, the current should as well. There's always current flowing through both sources, so as long as the feedback capacitors are there and the op amps don't try to follow every tiny little glitch, they should be able to keep up with anything within the frequency response of the transistors.

All the various function generators I looked at also used slow op amps for the current sources, except the aforementioned 3312A which uses a somewhat more complicated circuit with a bunch of discrete transistors.
« Last Edit: September 22, 2013, 04:21:16 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1783
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: Function generator - signal quality opinions?
« Reply #10 on: September 22, 2013, 04:19:46 pm »
Without that block, the comparator output couples through the diode bridge a bit and distorts the signal, shifting each half-period up and down with the square wave output. Those invert the square wave and add that in an equal amount to offset it. (An idea stolen from inspired by the 3312A.)

You can see the distortion I'm talking about in the output from the Simpson, which does nothing to fix this.

I had the same suspicion (figuring that the inverted square wave would have a slight phase offset), but I completely disconnected that block (removing CV1 and R28) and the double peak didn't go away. (It does do its intended job quite well, though :-+)

Another thing I investigated was whether there was some problem caused by coupling noise into the power supply (as you can see, the integrating cap goes to -15V, not ground). Nope, connecting it straight to ground doesn't fix it either. (The reason it goes to -15V is to allow polarized caps to be used for the very slow ranges)

Ok, got it.  I wonder if it has something to do with charge storage in the switching diodes. Hmmm.  Also, be careful with large polarized caps for the slow ranges - dielectric soakage in aluminium electrolytics will distort the waveform.

For what it's worth, I've never had a need for a triangle waveform faster than a few MHz. Sines, squares and pulses - yes. But not really triangles.  Although, sawtooths are a different story, and might also 'hide, the double peak.
YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #11 on: September 22, 2013, 04:28:19 pm »
Also, be careful with large polarized caps for the slow ranges - dielectric soakage in aluminium electrolytics will distort the waveform.

Yep, I saw that. The larger, the worse.

The current is pretty low, so the capacitors don't need to be huge for even very slow frequencies - in the final version, I may move that back to ground and use film caps for the high ranges, since they don't need to be ridiculously large (and expensive).

Although, sawtooths are a different story, and might also 'hide, the double peak.

The sweep generator will have a pretty versatile sawtooth oscillator, a bit easier to work with for typical sawtooth applications because of the different controls (precision thresholds which are independently variable). I may investigate the possibility of increasing its frequency up to the same frequency as the rest of the function generator, then give an option to bypass the main VCO and feed the sawtooth to the output amplifier instead.
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: Function generator - signal quality opinions?
« Reply #12 on: September 22, 2013, 04:33:08 pm »
Hmm.... possibly a simple fix:

What if I just increase the current and the integrating capacitor, both roughly tenfold? I did say that with a 10x higher capacitor, the distortion was lower! :-DD

I think I investigated that earlier and found that the current source transistors got undesirably hot. I may have to just answer that with a good, solid "screw it" - it's an analog circuit with lots of discrete parts, of course it's not efficient!

(That LM7171 gets quite warm anyway, so efficiency was gone a long time ago...)
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1783
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: Function generator - signal quality opinions?
« Reply #13 on: September 22, 2013, 04:35:12 pm »
The smaller your charging/discharging currents are, the more effects you'll get with charge injection from the switching diodes, no?
YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 

Offline sync

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Function generator - signal quality opinions?
« Reply #14 on: September 22, 2013, 04:36:07 pm »
The current from the transistors is a function of the base voltage, so as long as that stays reasonably fixed, the current should as well.
Is the current really only a function of the base voltage? There is a VCE jump when switching. Have you look at the voltage drop of R18, R19 + R29? Are they constant or are there transitions while switching?
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #15 on: September 22, 2013, 04:39:10 pm »
That was close to next on my list of things to check, after I'm done drudging through my homework... The behavior was pretty good in SPICE, but, as we all know...



(Maybe I shouldn't be posting about this while I've got homework...)
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: Function generator - signal quality opinions?
« Reply #16 on: September 22, 2013, 04:52:41 pm »
Quote
My suspicion is that above 100 kHz or so, nobody really uses triangles

Outside of power engineers (pwm generation), that's probably true.

What you may want to check is if there are other issues at work that contribute to the weird triangle waveform - it is too unclean to stop looking into it now.
================================
https://dannyelectronics.wordpress.com/
 

Offline sync

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Function generator - signal quality opinions?
« Reply #17 on: September 22, 2013, 05:18:40 pm »
My suspicion is that above 100 kHz or so, nobody really uses triangles and I just need to make sure sine and square are clean.
Do you want to use a sine shaper? Then the fidelity of the triangle should matter, right?
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #18 on: September 22, 2013, 07:32:43 pm »
Yes, and that's what I'll look at next. Those peaks are very quick, I'm hoping that a bit of filtering on the output of the shaper could smooth them out.

But now I am leaning towards redesigning the VCO.
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: Function generator - signal quality opinions?
« Reply #19 on: September 22, 2013, 10:07:00 pm »
The current from the transistors is a function of the base voltage, so as long as that stays reasonably fixed, the current should as well.
Is the current really only a function of the base voltage? There is a VCE jump when switching. Have you look at the voltage drop of R18, R19 + R29? Are they constant or are there transitions while switching?

Bingo! :clap:

This is just a quick measurement I took for now, I have to leave the house and don't have time to really try to fix it. (But it gives me time to consider how I want to do that!)

The top trace is (inverted) -513uA/div charging current. Yep, that's a huge spike. I think I'll confirm this is the source of the problem by replacing the current sources with simple resistors and seeing if the behavior changes to match a resistive profile.

I wonder if a small choke could help smooth it... or if that would cause back EMF issues... I can't try it in SPICE, because every time I try to add anything inductive to this circuit, LTspice bitches about singular matrices... so I'll have to wait until I get home
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: Function generator - signal quality opinions?
« Reply #20 on: September 22, 2013, 10:11:49 pm »
Quote
I'll confirm this is the source of the problem

Whenever you put capacitance / inductance on the output, you are asking for trouble.
================================
https://dannyelectronics.wordpress.com/
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Function generator - signal quality opinions?
« Reply #21 on: September 22, 2013, 10:15:40 pm »
That's what I figured.

Bob Pease's lying computer thinks it's found a solution (or rather, thinks it agrees with HP's solution in the 3312A), so I'll get out the soldering iron tonight when I get back home... (Larger feedback capacitor - 220pF, 1k base resistor, and 10nF to ground from the base)
« Last Edit: September 22, 2013, 10:28:59 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: Function generator - signal quality opinions?
« Reply #22 on: September 22, 2013, 11:36:39 pm »
Got home quicker than I thought, so I tried it. It worked... kinda. I think I just need to tweak the values. More on that later.

The HP schematic also shows small capacitors on the current source outputs, which I thought was stupid, but I tried it anyway, and I wasn't disappointed by the stupidity. Even 10pF completely lopped off the tops of the triangles. I have no idea why they have those.

I tried increasing the current and capacitance like I suggested and it actually got worse, as well as making the comparator uncomfortably toasty, and reducing the maximum operating frequency.
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: Function generator - signal quality opinions?
« Reply #23 on: September 23, 2013, 12:15:22 am »
I open the Enertec 4433. I looks like it uses two current mirrors connected to the diode switch. Unfortunately I have no documentation. Maybe I will reverse engineer it.
 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1783
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: Function generator - signal quality opinions?
« Reply #24 on: September 23, 2013, 12:29:20 am »
I wonder if it is due to the collector-base capacitance (miller capacitance) of the current source transistors.  If so, then maybe try using a cascode stage for the current sources, if you have the voltage headroom. 
YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->