Author Topic: How can I control amp gain digitally?  (Read 2266 times)

0 Members and 1 Guest are viewing this topic.

Offline SaitamaTopic starter

  • Contributor
  • Posts: 40
  • Country: ge
How can I control amp gain digitally?
« on: March 25, 2021, 11:49:50 am »
Hello!
I'm making a function generator with an AD9833. The output voltage is 0.65v and it needs an amplifier with variable gain to be useful. I thought of using a digital pot, but they are hard to get a hold of where I live and I read that they can't handle high(ish) frequencies. Then I searched internet and found about VCOs (Voltage controlled amplifiers), so I tried making one. The idea was to have a fixed gain amplifier and a voltage divider at the input; I used a MOSFET as a low side resistor (I hooked up a pot at the gate) and while turning the pot, the voltage did really change! The problem was that the output signal was DC and not what I started with. I am stuck on this part and I would really appreciate a tip or two.
Thanks for reading!
 

Offline werediver

  • Contributor
  • Posts: 24
  • Country: nl
Re: How can I control amp gain digitally?
« Reply #1 on: March 25, 2021, 04:07:10 pm »
I used a MOSFET as a low side resistor (I hooked up a pot at the gate) and while turning the pot, the voltage did really change! The problem was that the output signal was DC and not what I started with.

Can you show a circuit diagram corresponding to your experiment?
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 16332
  • Country: de
Re: How can I control amp gain digitally?
« Reply #2 on: March 25, 2021, 04:16:08 pm »
There are several options to vary the amplitude. A voltage controled amplifier is one idea. This usually is a special ready made chip. A DIY solution could be somthing like a long tailed pair differential amplifier with a variabe current level. Some gilbert cell mixers (e.f MC1496) can also be used this way.

The are some multiplying DACs that are reasonable fast (e.g. up to a few MHz) that can be used. There are also some readimade switchable / programmabe gain amplifiers. On can do the gain switching (usually a few coarse steps) with parts like CMOS switches (e.g. 4053 ). Besides gain one can also build switchable attenuations. Especially for the coarse part relays are an option too.
For fine adjustment some DDS chips allow to change the reference voltage over a limited range.
 
The following users thanked this post: Saitama, werediver

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: How can I control amp gain digitally?
« Reply #3 on: March 25, 2021, 04:39:33 pm »
the AD9833 is is many ways a rather bad choice, missing amplitude control is one of it; I'd go with the AD9834 which allows amplitude setting via an adjustable current source, so it can be done with a DAC; digital pots are not very RF-capable. other option like already said is a VCA, that could be controlled by a DAC
 
The following users thanked this post: Saitama, werediver

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 18809
  • Country: us
  • DavidH
Re: How can I control amp gain digitally?
« Reply #4 on: March 25, 2021, 05:23:47 pm »
Gain is usually better controlled by using switched attenuator sections and fixed gain amplifiers because varying the gain of the amplifiers directly also changes their frequency response.
 
The following users thanked this post: perieanuo, Saitama, werediver

Offline prosper

  • Regular Contributor
  • *
  • Posts: 125
  • Country: ca
Re: How can I control amp gain digitally?
« Reply #5 on: March 25, 2021, 06:13:46 pm »
I'm (slowly) working on the same thing. ( https://github.com/prosper00/STM8-AD9833-Function-Generator ) - An AD9833 controlled by an MCU. I decided that I didn't really NEED digital amplitude control at all, so I did it simply using a pot to set the gain of my op amp stage.

In the future, I intend to build a peak detector circuit, and run the output of that to my uC's ADC, so that I'll be able to display to the user what the amplitude is currently at. I suppose I could then replace the pot with a FET of some sort, and use that as a voltage controlled resistor that I could then drive with a DAC or maybe filtered PWM... It wouldn't be very linear, but with the ADC watching things and providing feedback to the mcu, it might be feasible.
« Last Edit: March 25, 2021, 06:17:39 pm by prosper »
 
The following users thanked this post: Saitama

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 16332
  • Country: de
Re: How can I control amp gain digitally?
« Reply #6 on: March 26, 2021, 07:50:08 am »
The way of measuring the actual amplitude at the output and than readjust the amplitude is common in higher grade RF generators. However one still needs some controllable gain.
For the coarse part switchable attenuators are often the best choice. Some extra attenuation at the output, so behind the final amplifier has some benefits: it gives some additional protection and an attenuator can give a more constant output impedance also to high frequencies (though not so much a problem with the moderate frequencies of the AD9833 or similar). Digital control includes manually operated switches  :popcorn:.
 
The following users thanked this post: Saitama

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4702
  • Country: nl
Re: How can I control amp gain digitally?
« Reply #7 on: March 27, 2021, 05:37:18 pm »
I once was interested in AD9850 (or was it AD9852?)
It also has a current input for setting the amplitude and with a (DC) DAC it could be regultated to quite low values, but this is not good practice.

Better is to have an amplitude range in some limited range, and then use some attenuators after the signal is generated. These also attenuate noise, and maintain a decent sine wave.
You only need a few of these. For example a -10dB, a -20dB and a -40dB relais based attenuators, get you down to -70dB without loosing signal quality. And you only use the amplitude control to fill in the gaps between the attenuators.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf