Function Generator

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
Hi All,

I have browsed the internet looking for simple signal generator designs and borrowing a little from here and a little from there, I added a few things and came up with this. I am not great with (and still learning) analog circuits so I just wanted to post it and have the Pro's here take a look at the analog side and maybe make some overall suggestions.

So this AD9833 module is rated for somewhere between 12MHz to 14MHz output max. I understand that as the frequency increases, opamps of different slew rates can distort the wave and the faster you go it won't be perfect. I selected the LT1363 because it has a slew rate of 1000V/uS, 70MHz bandwidth, and output current is typical 60mA-ish with short protection. Based on this it seemed like a good choice?

  1. Q1 and Q2 provide a lower impedance output, I'm thinking 2N3904/2n3906 pair might be good? Always open to suggestions.
  2. Relay is to change from a variable offset to a GND centered offset.
  3. R4 is panel mounted to control gain (output V)
  4. R16 is a trimpot on the PCB to center the output to zero volts when the input is zero
  5. R8 is the only way I could think of varying the transistor output voltages but it doesnt look right to me. Plus I should probably have some way to set the bias for that pair but idk how to go about it.
  6. D2, R10, and C10 are intended to provide a way for the microcontroller to read the output voltage (via measuring the upper half and doubling it) I know this is only accurate with a centered offset and I have to adjust for the drop of the diode. Though I wonder how lower voltages would read as the output voltage gets close to D2's Vf.
  7. I foresee and issue where if R4 is set to 0 ohms, U8 becomes a voltage follower and Vin=Vout, it would be nice to be able to go lower than Vin.
  8. Should I remove R5 and connect the inverting pin directly to the GND/Offset adjust?
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,234
Hi Mf 1185,
Looks an interesting project.
One point I would check is this clip from the LT1653 d/s, compared to your planned loading of the output pin,
E

Coaxial cable can be driven directly, but for best
pulse fidelity a resistor of value equal to the characteristic
impedance of the cable (i.e., 75W) should be placed in
series with the output. The other end of the cable should
be terminated with the same value resistor to ground. The
response of a cable driver in a gain of 2 driving a 75W cable
is shown on the front page of the data sheet
 

Attachments

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
Before starting any design efforts it is usually wise to have some understanding of the requirements the design is supposed to deliver.
This project is intended to be used as a signal generator for the bench. Nothing crazy, I just tried to expand a little on it capability compared to other people's projects that seem to taper off at higher frequencies and use a graphic display so I can display the waveforms on it instead of the common 16x2 approach.

Hi Mf 1185,
Looks an interesting project.
One point I would check is this clip from the LT1653 d/s, compared to your planned loading of the output pin,
E

Coaxial cable can be driven directly, but for best
pulse fidelity a resistor of value equal to the characteristic
impedance of the cable (i.e., 75W) should be placed in
series with the output. The other end of the cable should
be terminated with the same value resistor to ground. The
response of a cable driver in a gain of 2 driving a 75W cable
is shown on the front page of the data sheet
Interesting, I don't quite understand fully why that is. Is it because of higher frequencies used? I've played with audio circuits but those don't go nearly as high. I'll change the 220 ohm to 75 ohm and be mindful of the resistor connection on the other end of the cable. Thanks!
 

MisterBill2

Joined Jan 23, 2018
16,589
I suggest that prior to starting the design of a piece of equipment like this, that the TS take a look at the published circuits of some decent quality equipment with similar performance capabilities. Quite often others designing similar equipment have some very useful insights. There are a lot of them available at the "Schematics for free" website. I have found it very useful in that regard.
 
Last edited:

ronsimpson

Joined Oct 7, 2019
2,797
R6 should be 50 ohms to drive 50 ohm coax.
Q1, Q2 buffer has bad crossover distortion.
R4 Pot in the feedback loop will cause high frequency problems because a pot has inductance and capacitance.
We commonly use a 1x, 10x switch in the amplifier.
I put a low pass filter on the output of the AD9833 to remove the clock frequency. (removed the filter for square wave)
It is common to use a "TTL" buffer for TTL square wave output. Separate connector.
Think about a LC filter on the AD9833's supply so the micro's noise does not get into the output.
 

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
@ronsimpson Thanks so much for the suggestions! Attached schematic is revised:
"
R6 should be 50 ohms to drive 50 ohm coax. Fixed
Q1, Q2 buffer has bad crossover distortion. Removed them, ill figure that out externally
R4 Pot in the feedback loop will cause high frequency problems because a pot has inductance and capacitance. Changed to Fixed
We commonly use a 1x, 10x switch in the amplifier. Added a Level pot though I'm not sure which value is ideal
I put a low pass filter on the output of the AD9833 to remove the clock frequency. (removed the filter for square wave) Added
It is common to use a "TTL" buffer for TTL square wave output. Separate connector. Schmitt triggers added with relay switching
Think about a LC filter on the AD9833's supply so the micro's noise does not get into the output.
"
R2 selects a 5V or 3v3 Square wave output, R3 selects Square or (other) waveforms after the filter.

Not sure exactly how to tackle that last one. I separated the +5Vcc to the display for similar reasons, the Arduino nano module has it's own regulator on it so the +5v to the AD9833 comes directly from the 7805 up top. The Vin to the Arduino is separate, do you think the noise still get in? The low pass filter on the output of the AD9833 module is calculated to be around 15MHz, I think that should cover up to and including it's 24MHz clock frequency.
 

Attachments

ronsimpson

Joined Oct 7, 2019
2,797
On the 74AHC1G14, I would vary the power supply (2 to 5V) and not have the relays and two buffers. Maybe use a low power three pin adjustable regulator and pot. What is the output voltage of the AD9833? Is enough to drive the 74AHC1G14?

On your relays, the diode should be across the relay not across the transistor.

VR2 causes the output impedance to be very high. I think you want to push power to the output. Maybe move the pot to the input of the LT1363

I did not know the AD9833 has its filter inside. That is good.
 

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
On the 74AHC1G14, I would vary the power supply (2 to 5V) and not have the relays and two buffers. Maybe use a low power three pin adjustable regulator and pot. What is the output voltage of the AD9833? Is enough to drive the 74AHC1G14?

On your relays, the diode should be across the relay not across the transistor.

VR2 causes the output impedance to be very high. I think you want to push power to the output. Maybe move the pot to the input of the LT1363

I did not know the AD9833 has its filter inside. That is good.
(checks datasheet) welp...absolutely not lol. Vout is 0-0.7V and I believe the datasheet on the inverters indicate 2V threshold. The adjustable 2v-5v is an excellent idea! Though I don't know a simple way of implementing that. I guess I could add another LT1353, give it a single polarity supply from the output of a LM317 or other adjustable regulator. Those are pricey OpAmps though. Is there an easier way to do that?
 

ronsimpson

Joined Oct 7, 2019
2,797
The waveform generators I have used have a "TTL" output for the square waveform.
It is not clear to me what the output voltage is when in "MSB or square wave" mode. I wish I know that.
 

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
The waveform generators I have used have a "TTL" output for the square waveform.
It is not clear to me what the output voltage is when in "MSB or square wave" mode. I wish I know that.
Do you mean waveform generator IC's? Or like the benchtop equipment ones? This is my first project with a AD9833-type IC.

Also I added the buffer for the TTL side of things and moved the level adjustment to the input side.
 

Attachments

ronsimpson

Joined Oct 7, 2019
2,797
LT1363: pin2, I think it should connect to the top end of R11. I think the "-" input should be at 0.35V or about 1/2 the output voltage. Relay pin 12 that goes to ground probably should go to 0.35 volts also.
 

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
The output of the IC swings from near 0V to 0.7V.
Say the output amplifier has a gain of 10.
The output on the connector is 0 to 6V.
I think you want a waveform that goes from -3 to +3V.
View attachment 304210

OH I see, if that's the case then I have to think of a way to center the offset. I assumed the function generator IC did that but now that you mention it, I don't see how that would be possible considering it has a single polarity supply. I have been refreshing myself on opamps so I will try to come up with something. I assume that if I use a capacitor to block DC to the input of the opamp and try to center bias the input after that with resistors, it will affect the waveform at higher speeds right?

Thank you for your input on this btw, I know you can just buy one of these things but I wanted to build this myself for the learning experience (with a handy tool as a result) and you have been very helpful.
 

MisterBill2

Joined Jan 23, 2018
16,589
You do not need to block the DC to the op-amp to add an adjustable offset voltage. The op-amp will need to have both negative and positive supplies, and the offset adjustment input will need some experimenting if the amplifier is providing some gain for the signal.
 

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
Ok I misunderstood what was said earlier and I think I have a better idea now. The analog side doesn't look good to me, so let me run this by you guys. I followed this differential amplifier (posted as an answer to another question of similar offset nature):

1696525135899.png

Put the formula in an excel sheet and calculated the range of the offset and resistor values and came up with this:

1696525325525.png

RA = level, RB = offset. I did the calculations assuming 0.7V max was coming out of the AD9833. The 860 ohm resistor in the voltage divider is to trim off the excess offset voltage that would push the output past the limits of the positive side rail (if the wiper of RB is all the way to -12V, I calculated the output to be around a -10.81V offset, which I think would be ok).

Once I nail this one down I can attack the square wave side with the same approach. I am still thinking about how I want to the outputs to be switched so I'll get back to that. Could I bother someone to maybe double check my math on this? Also thoughts are welcome.


***UPDATE: Just checked my sheet and I forgot a zero in the feedback loop resistance, so that means my values are way off. So pretend the 33K is 3.3K and the 4.7K is 470 Ohms. Sorry! Also, do I need the resistor between the wiper of RB and pin 3? The one that matches Rf?
 
Last edited:

Thread Starter

Metalfan1185

Joined Sep 12, 2008
170
My LT1363's came in so I did some testing. Calculated what I was looking for and then built it on a breadboard. These are the values I have now. My measurements are as follows:

Vin ranges from -0.352V to 0.3845V, and the output ranges from -11.26V to 11.32V

I still need to bias the 0-0.700V to plus/minus 0.350V. Could a DC blocking capacitor do it given the wide frequency range?

IMG_20231011_143231.jpg

Now if I put an AC signal into the input and change Rd (the resistor between pin 2 to GND). Will that adjust the AC offset without changing the amplitude Vpp of the output? I got all these values with DC on the input, I just varied it one polarity to the other with the input variable resistor.
 
Top