Methods to scale an analog voltage digitally - Page 1
Forum section: electronics / projects

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2022, 08:04:26 am
content: HiI want to design a simple Sin wave generator (a sin wave with harmonics, the max harmonic frequency is about 10KHz) with a help of a FPGA or an ARM MCU and an external DAC like DAC8411IDCKR, the sine frequency is under 10KHz, I want to scale the output voltage from +-1mvpp to +-10Vpp, the problem is I do not know how to control the output amplitude to cover this range, is there any clever circuit to use another DAC to control the output?Note that I do not want to shift the bits to left or right in my first stage DAC to lower the amplitude and lose resolution.

author: moffy
author_rank: Super Contributor
timestamp: October 31, 2022, 08:10:38 am
content: Use a DAC to feed the reference input of a multiplying DAC.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2022, 08:27:49 am
content: thanks for the feedback, do you suggest any part numbers?I have lots of very low cost DAC's like PT8211, IS there anything that can be done with them?

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 31, 2022, 08:33:03 am
content: Another option is to use a voltage or current controlled amplifier. You can use a filtered PWM signal to control the gain.Something like a VCA810.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2022, 08:50:00 am
content: Quotecan I achive output voltage from +-1mvpp to +-10Vpp ?Thanks for the update, I wonder How do function generators do it?

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 31, 2022, 09:04:59 am
content: Quote from: ali_asadzadeh on October 31, 2022, 08:50:00 amI guess it depends on how you setup your scaling. With PWM you can probably get some fine control depending on the counters and carrier frequency, but if you can do a linear scaling from +/-1mVpp to +/-10Vpp is the question. You need 14 bits to do this.I just mentioned the VCA810 as an example, because it was the first to pop up on google with "voltage controlled operational amplifier" search.The reference input of a multiplying DAC can also be driven with a filtered PWM signal, but the question is if the output of the DAC can reach the wanted +/-10Vpp.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2022, 09:44:58 am
content: QuoteFor 16bit we have PT8211 DAC,it's under 0.5$ in single QTY,QuoteThere is some op-amp circuits inside the DAC8411IDCKR datasheet, that shows how you can do it.

author: moffy
author_rank: Super Contributor
timestamp: October 31, 2022, 09:47:40 am
content: The DAC7802 might be suitable, dual 12 bit multiplying, 5v supply and REF input can be +/-10v.

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 31, 2022, 10:03:58 am
content: Neither of the two DAC's you mentioned (PT8211, DAC8411IDCKR) have a separate reference input so the multiplying DAC option is not possible with these, so search for a suitable voltage controlled operational amplifier to make the output.You need something behind the DAC8411IDCKR anyway to get your +/-10Vpp.With the PT8211 being a dual channel you could even make it such that you have gain and DC offset control.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2022, 10:19:16 am
content: Thanks for the feedback, I think the harder part of the problem is +-1mv not the +-10V

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 31, 2022, 10:22:57 am
content: Yes that is for sure. You have to carefully design it to not have it drowned in noise.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2022, 10:28:30 am
content: Given the needed specs, I'm hoping that we could solve it with this ultra low cast DAC (PT8211), with some celever Ideas.

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 31, 2022, 10:32:15 am
content: Sorry not my expertise. I'm probably like you a more digital minded engineer. I know a bit about analog but designing a low noise amplifier is out of my league

author: Ian.M
author_rank: Super Contributor
timestamp: October 31, 2022, 11:02:04 am
content: Consider adding a ÷100 attenuator feeding its own carefully screened low level output buffer + a relay to select between the full output and the ÷100 output. Your digital scaling then only has to handle the range 0.1V to 10V, which is much easier to do. Trim the digital scaling value for the low range for best amplitude match where the ranges meet.

author: srb1954
author_rank: Super Contributor
timestamp: October 31, 2022, 11:05:32 am
content: Quote from: ali_asadzadeh on October 31, 2022, 10:19:16 amMost function generators have a switched attenuator on the output typically having steps of 10dB, 20dB and 30dB to reduce the signals down to the mV range. With all attenuators stages switched in circuit you get a total of 60dB or a voltage division ratio of 1000:1.The attenuator is typically manually switched by the user but you could use relays or electronic switches to control the attenuator stages under S/W control.

author: MasterT
author_rank: Frequent Contributor
timestamp: October 31, 2022, 01:24:28 pm
content: Another option is Digital Volume Control, basicaly audio volume potentiometr. Advantages:- excelent dynamic range- low noise- low distortion , compare to any multiplying DACDisadvantages:- log scale- and you still would need post regulator buffer amplification stage to get +-10VNJU72341, BD3464FV etc

author: CaptDon
author_rank: Super Contributor
timestamp: October 31, 2022, 02:04:45 pm
content: Some generators have a steady output at around +/- 1 volt (and possibly a +/- 1 volt offset capacity. They then have a digitally controlled attenuator creating a +/- .1volt to +/- 1 volt output. This feeds a low impedance output buffer amplifier with a unity gain feedback circuit to achieve the +/- .1 to 1 volt function with a selectable 10Db voltage = 20Db power gain to get +/- 1 volt to +/- 10 volt output. The rest is done with relay switched attenuators and as always they are designed to feed a 50 ohm terminated output. If the output is terminated at high impedance the output voltage will be double (if within the capabilities of the output amplifier). Note also that with many generators that are only capable of +/- 10 volt outputs the output will begin to flat top and square off with to much d.c. offset. Look for the schematics of the B&K 4070 digital 20Mhz generator which is identical to the Telulex SG-100. These are some very versatile generators which feature arbitrary waveform functions also. The 50 ohm internal circuitry needs fused protection from large external voltage connections, like if you accidentally connect the generator output to 30 volts or more on your Unit Under Test.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: October 31, 2022, 02:07:51 pm
content: Thanks for all the feedback, I was searching the web and just saw this link,https://kassu2000.blogspot.com/2015/10/vca.htmlIs this working?

author: Terry Bites
author_rank: Super Contributor
timestamp: October 31, 2022, 06:12:19 pm
content: VCAs give you continuous control whereas a DAC or digipot has discrete steps. How fine do you want to go? A 16 bit DAC like a DAC8571 will let you get down to near 15ppm!

author: David Hess
author_rank: Super Contributor
timestamp: November 01, 2022, 12:37:26 am
content: What kind of distortion and noise levels do you want? Are you expecting to propagate the 16 bit performance of the DAC8411 to the output at the lowest output levels?Achieving 16 bit performance though an analog solution like a multiplier is not realistic. Good analog multipliers can make 12 bits though. If you want to pursue this method, consider a part like the AD633 multiplier which will do exactly what you want.I think a digital solution using a resistor string DAC will be higher performance, but preserving output noise at low output levels may require a switched output attenuator. The attenuator attenuates the signal *and* the noise so dynamic range is preserved.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 01, 2022, 08:11:41 am
content: QuoteThat's the plan, any circuit or app note do you suggest?

author: David Hess
author_rank: Super Contributor
timestamp: November 01, 2022, 08:51:28 am
content: Quote from: ali_asadzadeh on November 01, 2022, 08:11:41 amWhat would absolutely work is how they did it in the past. The reference voltage to the DAC is adjusted over maybe a 4:1 to 2:1 range as a vernier, and the output is adjusted with switched attenuator sections, but that is not voltage control.The next best thing might be to use a multiplying DAC or one of those resistive string DACs after the audio DAC. This is not voltage control either, but at least it is digital control and available. This requires the output to be buffered which will add to the noise, but maybe not enough to matter.Both of these require the audio DAC to have an adjustable reference for fine control.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 01, 2022, 10:10:14 am
content: Thanks David for the tip, I don't care about violtage control, I want to have control over software(I mean digital control), AM modulation comes to my mind too.

author: David Hess
author_rank: Super Contributor
timestamp: November 01, 2022, 06:25:51 pm
content: I checked a couple "digital potentiometers" which could be used for the output attenuator. They have the needed bandwidth, have a noise of about 9nV/SqrtHz, and distortion better than -90dB. The noise level means that the buffer's noise level is not so important because there are many suitable JFET audio operational amplifiers that are as good or better than that.https://www.analog.com/en/ad5293I am not sure about the output configuration. The digital potentiometer can be used as a resistive attenuator but this means using a non-inverting operational amplifier for buffering which will suffer from common mode distortion. The inverting form shown at the top at the following link should be lower distortion, but probably is not needed. The various Baxandall configurations might still be preferred because they give a more logarithmic control response, so the steps can get smaller at lower output levels.https://www.renardson-audio.com/hp2-amp.htmlTest instruments of the past did some pretty funky things with attenuator sections and poteniometers. Take a look at some old audio function and signal generator schematics where output attenuators were used.