Variable gain amplifier for a function generator - Page 1
Forum section: electronics / projects

author: Saitama
author_rank: Contributor
timestamp: May 17, 2024, 06:29:24 pm
content: 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 itdatasheet for AD9833:https://www.analog.com/media/en/technical-documentation/data-sheets/ad9833.pdf

author: RoGeorge
author_rank: Super Contributor
timestamp: May 17, 2024, 07:17:40 pm
content: 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.pdfhttps://www.analog.com/en/products/ad835.htmlAnother 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.

author: Saitama
author_rank: Contributor
timestamp: May 17, 2024, 07:24:20 pm
content: 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

author: Kleinstein
author_rank: Super Contributor
timestamp: May 17, 2024, 07:41:56 pm
content: 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.

author: ledtester
author_rank: Super Contributor
timestamp: May 17, 2024, 07:44:01 pm
content: 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 generatorshttps://youtu.be/925X0RDUy9w#103: Some changes to my OPA541-based power amplifier for function generatorshttps://youtu.be/ERJ9Om-eBqo

author: David Hess
author_rank: Super Contributor
timestamp: May 17, 2024, 10:58:55 pm
content: Quote from: Kleinstein on May 17, 2024, 07:41:56 pmBefore 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.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 17, 2024, 11:32:15 pm
content: Quote from: Saitama on May 17, 2024, 06:29:24 pmOTA 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 18, 2024, 05:45:34 am
content: 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.

author: moffy
author_rank: Super Contributor
timestamp: May 18, 2024, 06:59:19 am
content: 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%3DYou could have it followed by a fixed gain amplifier.

author: David Hess
author_rank: Super Contributor
timestamp: May 18, 2024, 12:38:28 pm
content: Quote from: moffy on May 18, 2024, 06:59:19 amSome 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.