Author Topic: Variable gain amplifier for a function generator  (Read 694 times)

0 Members and 1 Guest are viewing this topic.

Offline SaitamaTopic starter

  • Contributor
  • Posts: 33
  • Country: ge
Variable gain amplifier for a function generator
« on: May 17, 2024, 06:29:24 pm »
Hi!
I am trying to make a function generator from AD9833 module (datasheet is below the text), an arduino and some discrete components.
The AD9833 is a cool little IC, which can generate sine, square and triangle waves with frequency up to 10Mhz (although at such frequency the output seems to be quite distorted) and those parameters can be set from an arduino via SPI.
As every proper digital function generator has, I want mine to have the ability to set the amplitude as well as offset. To add a DC offset to a signal is a not a difficult task, but setting the amplitude digitally has proved to be a bit of a challenge for me. I have done some research on this topic and found that some solutions exist in forms of voltage controlled amplifiers (VCAs) and programmable gain amplifiers (PGAs).

In the end, it seems logical to get more info on this topic before I start to tinker around with some transistors, so if you have any suggestions on which videos, forums or books to visit I would be glad to hear it :)

datasheet for AD9833: https://www.analog.com/media/en/technical-documentation/data-sheets/ad9833.pdf
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6452
  • Country: ro
Re: Variable gain amplifier for a function generator
« Reply #1 on: May 17, 2024, 07:17:40 pm »
Interesting project.  :-+

First thing I would do, would be to search for schematics of commercial signal generators, and take a peek to see how it is usually done.

If not, first idea that comes to mind would be to use an analog multiplier, where one input comes from the AD9833, and the other is a DC voltage coming from another DAC you control with the MCU.  Some analog multipliers can add an offset, too, (they can output X*Y+Z) like this one:
https://www.analog.com/media/en/technical-documentation/data-sheets/AD835.pdf
https://www.analog.com/en/products/ad835.html

Another part that requires attention will be the output amplifier.  I've heard current-feedback amplifiers would behave better than voltage-feedback amplifiers, and in theory they can be more stable with capacitive and inductive loads, but so far I didn't try to build a signal generator in practice.
« Last Edit: May 17, 2024, 07:21:46 pm by RoGeorge »
 
The following users thanked this post: Saitama

Offline SaitamaTopic starter

  • Contributor
  • Posts: 33
  • Country: ge
Re: Variable gain amplifier for a function generator
« Reply #2 on: May 17, 2024, 07:24:20 pm »
Thanks for the reply!
Just as you said, I am trying to look into commercial signal generators and how they work under the hood by watching some of Dave's teardown videos.
I didn't know that analog multipliers were a thing, but they seem really useful at a glance. I will definitely read up on them :)
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14463
  • Country: de
Re: Variable gain amplifier for a function generator
« Reply #3 on: May 17, 2024, 07:41:56 pm »
Function generators started out linear. Going more digital with DDS and arbitrary waveform is a newer thing that has now essentially replaced the classical analog generators.
In the old days a simple generator was build around a chips like XR2206 or ICL8038. They are new obsolete (a chinese clone of the XR2206 is still available), but they can still make interesting reading.

For the variable gain / amplitude there are severa options. One a an analog multiplier or variable gain amplifier. Another is digital switching the gain, e.g. with a muliplying ADC. Another way for a fine adjustment is changing the DAC reference of the DDS chip - some chips allow this (e.g. AD9834, but not the 9833).

It often makes sense to seprate the fine adjust and extra coarser (e.g. 20 dB or a factor of 10) steps, e.g. with switches or relays. An attenuator at the output reduces the amplifier noise.
 
The following users thanked this post: Saitama

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3108
  • Country: us
Re: Variable gain amplifier for a function generator
« Reply #4 on: May 17, 2024, 07:44:01 pm »
Here are some videos on one person's (thehwcave) experience with using an OPA541 module you can get on Aliexpress:

Building an OPA541-based power amplifier for function generators
https://youtu.be/925X0RDUy9w

#103: Some changes to my OPA541-based power amplifier for function generators
https://youtu.be/ERJ9Om-eBqo
 
The following users thanked this post: Saitama

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16895
  • Country: us
  • DavidH
Re: Variable gain amplifier for a function generator
« Reply #5 on: May 17, 2024, 10:58:55 pm »
Function generators started out linear. Going more digital with DDS and arbitrary waveform is a newer thing that has now essentially replaced the classical analog generators.

Before DDS, there were digitally controlled synthesized function generators.  HP had several which were fully documented, and I think Tektronix had one.  It looks to me like the HP 3314A used a Gilbert cell multiplier in combination with relay switched attenuator stages.
 
The following users thanked this post: Saitama

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1664
  • Country: au
Re: Variable gain amplifier for a function generator
« Reply #6 on: May 17, 2024, 11:32:15 pm »
...
As every proper digital function generator has, I want mine to have the ability to set the amplitude as well as offset. To add a DC offset to a signal is a not a difficult task, but setting the amplitude digitally has proved to be a bit of a challenge for me. I have done some research on this topic and found that some solutions exist in forms of voltage controlled amplifiers (VCAs) and programmable gain amplifiers (PGAs).
OTA and Analog Multipliers can give you variable gain, but they have not-wonderful distortion specs, and you probably want to avoid niche parts in the signal path.

You may be better to look at DDS parts a slight step up from AD9833, eg like the AD9834, which has a current-set gain pin.
That is set by a DC current outside the high speed path, so you could vary 2:1 or maybe 10:1 there, and add simple resistor dividers + Analog Mux, on the output amplifier.

Another choice could be to vary the VCC of the AD9833, as it specs just over 2:1 Vcc range, so a low cost DAC could set Vcc for fine adjust, and dividers could set range.
Level translators might be needed on the data paths.

 
 
The following users thanked this post: Saitama

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3549
  • Country: nl
Re: Variable gain amplifier for a function generator
« Reply #7 on: May 18, 2024, 05:45:34 am »
One of the options is to use a "multiplying DAC". In it's simplest form you input the DDS waveform at the reference input of the DAC, and then the output of the DAC is still the output. This way you use the DAC effectively as a potentiometer. But you have to be careful which DAC you use. Some expect a DC input or minimum voltage at the input.
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1893
  • Country: au
Re: Variable gain amplifier for a function generator
« Reply #8 on: May 18, 2024, 06:59:19 am »
Surprisingly, I tested some low value smallish panel mount potentiometers, 500R and got about 10MHz BW out of something like this: https://au.mouser.com/ProductDetail/Bourns/53RAA-R25-A08L?qs=sGAEpiMZZMtC25l1F4XBU6Mqmc1en5GrNWdUgHFxs08%3D
You could have it followed by a fixed gain amplifier.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16895
  • Country: us
  • DavidH
Re: Variable gain amplifier for a function generator
« Reply #9 on: May 18, 2024, 12:38:28 pm »
Surprisingly, I tested some low value smallish panel mount potentiometers, 500R and got about 10MHz BW out of something like this: https://au.mouser.com/ProductDetail/Bourns/53RAA-R25-A08L?qs=sGAEpiMZZMtC25l1F4XBU6Mqmc1en5GrNWdUgHFxs08%3D

Some circuit configurations are better than others for getting the maximum bandwidth out of a poteniometer.  Typically amplitude and offset are implemented as part of an inverting amplifier, so with a low impedance at every terminal of the potentiometer, the effects of parasitic capacitance are minimized.  At even higher speeds, the poteniometer is used as part of a transmission line attenuator.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf