Author Topic: Using DACs - MCP4725 - Feedback required on my calculations please.  (Read 5935 times)

0 Members and 1 Guest are viewing this topic.

Offline VarysTopic starter

  • Newbie
  • Posts: 5
  • Country: nl
I`m mostly writing this topic to alert other designers about this.

I was using the MCP4725, thinking that a 12bit DAC would be good enough accuracy and resolution for my project. I wasn't aware however that these DAC's can easily have more than 5% output variances  between each IC.

So if you hook up a 3volts or 3000mV reference voltage to this DAC you would theoretically expect that writing an decimal value of 4000 would give you the analog value output of 2930,4mV 1.

However in practice I measured values between 2880mV and 2975mV == +- 2%.  (Measurements taken over 75 devices that I assembled.). Please note the +- sign, it does NOT mean approximately, but it means, for e.g. +-2%, it can go down by 2% and go up by 2% better said, it has an absolute error of 4%.

Which was to much variance to be acceptable for my project. Since I had no way to do a redesign, I had to do a device specific calibration using a DVM and store the calibration into the uP Flash memory. A 2 point calibration @100decimals and @4000 decimals did take away a lot of the error, but it was not enough for our project. I ended up doing a tree point calibration; @100,@2000 and @4000 decimals and extrapolate from there the correct output.

Because of this, I researched what specification I should look for, to minimize these output variances. These are the most important parts to watch for if you need accuracy: Gain error, Offset error, Integral nonlinearity error (acronym INL)  and Differential nonlinearity error(acronym DNL) . I found this paper from TI (Texas Instruments) very helpful for my understanding: http://www.ti.com/lit/an/slaa013/slaa013.pdf

Now I will start doing some calculations, and hope to receive feedback about it. I want to know if I do the calculations right.

MCP4725 - 12 bit resolution
Powering from 3.0 volts ==> Each LSB equals: 3volts divided by 12bit(4095) = 0.73mV for each LSB

Specs from datasheet:
INL Error +-14.5 LSB MAX ==> 29.00 LSB per part variation MAX ==> 29LSB equ 24.25mV
DNL Error  +-0.75 LSB MAX ==> 1.50 LSB per part variation MAX ==> 1.50LSB equ 1.01mV
Offset error 0.75% of FSR ==> FSR = 3.0Volts, 0.75% from 3 volts = 22.5mV
Gain Error +-2% MAX of FSR ==> FSR = 3.0Volts, 4% from 3 volts = 120mV

With this information I made this plot, is it correct?

And also one in percentages:



1This is calculated by 3000mV dividing by 12bit (=4095), and then multiplying the result by 4000.
2Please also note that these MCP4725 DAC's are not specified beyond the 100..4000 range (they make an really small footnote about this in the datasheet that the specs are not valid beyond this region). Luckily for me, I used the DAC exclusively around 200...3500 decimals.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Using DACs - MCP4725 - Feedback required on my calculations please.
« Reply #1 on: August 21, 2014, 11:23:35 am »
Quote
these DAC's can easily have more than 5% output variances  between each IC.

MCP4725 - 12 bit resolution

Two completely different concepts: accuracy vs. resolution.

Your calculation is directionally correct: it assumes those error terms are additive -> worst case scenario. In reality, they may offset each other, at least partially. But from a design perspective, it is prudent to assume no offset.
================================
https://dannyelectronics.wordpress.com/
 

Offline VarysTopic starter

  • Newbie
  • Posts: 5
  • Country: nl
Re: Using DACs - MCP4725 - Feedback required on my calculations please.
« Reply #2 on: August 21, 2014, 01:45:45 pm »
Quote
these DAC's can easily have more than 5% output variances  between each IC.

MCP4725 - 12 bit resolution

Two completely different concepts: accuracy vs. resolution.

Your calculation is directionally correct: it assumes those error terms are additive -> worst case scenario. In reality, they may offset each other, at least partially. But from a design perspective, it is prudent to assume no offset.

Thank you very much for your highly valued feedback.

In the meantime I compared several DAC's. Selected from their price starting from cheapest to the more expensive ones.

Would you all please look into it and feedback me for mistakes or anything?

Quote
Comparing DACs
Just some scratch paper comparing DAC converters currently on the market. I`m looking for a +-1% output accuracy without need to calibrate each device if possible. Resolution starting from 12bit is required. SPI or I2C has no preference. Price must be lower than 5 euro per part at 10pc quatities.

MCP4725 - 12 bit resolution *4095 steps* - Costs 0.79euro each @10pc
Powering from 3.0 volts ==> Each LSB equals 3v/12bit = 0.73mV

INL Error +-14.5 LSB MAX ==> 29.00 LSB per part variation MAX ==> 29LSB equ 24.25mV
DNL Error  +-0.75 LSB MAX ==> 1.50 LSB per part variation MAX ==> 1.50LSB equ 1.01mV
Offset error 0.75% of FSR ==> FSR = 3.0Volts, 0.75% from 3 volts = 22.5mV
Gain Error +-2% MAX of FSR ==> FSR = 3.0Volts, 4% from 3 volts = 120mV

Absolute output error 5.7% maximum or -2.4% to 3.3%.
Please note: I assumes those error terms are additive -> aka worst case scenario. In reality, they may offset each other, at least partially.(thanks for the note @dannyf)

Note: Datasheet makes exception that specs are only valid from decimal value 100 to 4000, beyond that, there is no way telling what the accuracy is. Otherwise, don't use this DAC if you use it below 100 or above 4000 unless you don't care about unspecified accuracy.

AD5620b (b-grade) - 12 bit resolution - Costs 4.21euro each @10pc
Powering from 3.0 volts ==> Each LSB equals 3v/12bit = 0.73mV

Relative accuracy: +-1 (is this INL??)  ==> +-0.73mV ==> 1.46mV per part variation
DNL: +-0.25 ==> +-0.18mV ==> 0.36mV per part variation
Offset error: +-9mV==> 18mV per part variation possible.
FullScale error: +-0.85% FSR Max ==> +-25,5 mV ==> 51mV per part variation possible
Gain error: +-0.85% FSR max ==> +-25.5mV ==> 51mV per part variation possible
Zero-code error: 8mV ==> This parameter is useful to know that you do not select this part if you need to go below 8mV, because there is a change the output won't make it below 8mV.

0.73mV INL + 0.18mV DNL + 9mV OffSet + 25.5mV FullScale error = +-35,41mV
For 3000mV reference 35.41mV is +-1,18%
Absolute output error 2,36% maximum

MAX5705BAUB - 12bit resolution - Costs 1.11 euro each @10pc
Powering from 3.0 volts ==> Each LSB equals 3v/12bit = 0.73mV

INL : +- 0.25 ==> +-0.18mV ==> 0.36mV per part variation
DNL: +-1.00 ==> 1.46mV per part variation
Offset error: +-5mV ==> 10mV per part variation
Gain error: +-1.0% of full scale ==> 60mV per part variation
Zero scale error: 0 to +10mV
Full scale error: +-0.5% of FS ==> 30mV per part variation ==> why can this be less than gain error? Wasn't it gain error + gain error = full scale error?
Bonus/Pro: this one also includes internal precision reference.

0.18mV INL + 0.73mV DNL + 5mV offset + 60mV gain = +-65,91mV
For 3000mV reference 65,91mV is +-2,19%
Absolute output error 4.4% maximum

AD5641BKSZ - 14 bit resolution *16383 steps* - Costs 4.00 euro each @10pc
Powering from 3.0 volts ==> Each LSB equals 3v/14bit = 0,183mV

INL: +-4 LSB ==> +-0,732mV
DNL +-1 LSB ==> +-0.183mV
Offset error : +-10mV
Gain error: +-0.037% of FSR ==> +-11.1mV

0,732mV INL + 0.183mV DNL + 10mV Offset + 11.1mV gain = +-22,015mV
For 3000mV reference 22,015mV is +-0,734%
Absolute output error 1,47% maximum

AD7849A - 14 bit resolution *16383 steps* - costs 16.50 euro each @10pc
Powering from 3.0 volts ==> Each LSB equals 3v/14bit = 0,183mV

INL: +-5 LSB Max ==> +-0,915mV
DNL: +- 0.25LSB Max ==> +-0,04575mV
Gain Error: +-4LSB Max==> +-0,732mV
Offset error: +-6 LSB Max.==> +-1,098mV

0.915mV INL + 0.04575mV DNL + 0.732mV Gain + 1.098mV offset = 2,79075mV
For 3000mV reference 2,79075mV is +-0,093025%
Absolute output error 0,18605% maximum -WOW!-

AD5621b - 12 bit resolution - costs 1.94 euro each @10pc
Powering from 3.0 volts ==> Each LSB equals 3v/12bit = 0.73mV

INL (finally, this datasheet actiually calls it INL instead of only Relative Accuracy)
INL: +1 LSB max ==> +-0.73mV
DNL: +- 0.5 LSB max ==>+-0,365mV
Offset error: +- 10mV
Gain error: +-0.037% of FSR ==> +-11.1mV

0.73mV INL + 0.365 DNL + 10mV offset + 11.1mV Gain = 22,195mV
For 3000mV reference 22,195mV is +-0,74%
Absolute output error 1,48% maximum
Note: This one is a look alike of the AD5641 above, almost identical accuracy.

Please note that a gain and offset error are more easily calibrated by doing a 2 point measurement. INL error is more difficult to calibrate since it acts non-linear over the entire output so you will have to do multiple point measurement and try to extrapolate from each calibration to cover the INL error.
 

Offline Neilm

  • Super Contributor
  • ***
  • Posts: 1559
  • Country: gb
Re: Using DACs - MCP4725 - Feedback required on my calculations please.
« Reply #3 on: August 21, 2014, 06:54:20 pm »
Are you taking the accuracy of the reference into your consideration? I had an application a few years ago where the noise and variation on the reference caused significant issues with the performance of the unit
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
Tesla referral code https://ts.la/neil53539
 

Offline VarysTopic starter

  • Newbie
  • Posts: 5
  • Country: nl
Re: Using DACs - MCP4725 - Feedback required on my calculations please.
« Reply #4 on: August 22, 2014, 07:06:07 am »
Are you taking the accuracy of the reference into your consideration? I had an application a few years ago where the noise and variation on the reference caused significant issues with the performance of the unit

Thanks for your reply :).

Good one that you mention it, seen that the DAC is just as accurate as the reference voltage is.

I selected [MAX6103EUR] reference for this project, it costs only 0.66 euro @10pc. It has min/max output voltage range respectively 2.988 3.012 for the 3v reference.  Meaning that the output voltage has a tolerance of 0,0004%.

I design for 10 to 50 degrees, delta of 40 degrees, with 65ppm this is 2600ppm. 1ppm = 3uV so multiplying this by 2600 gives me 7.8mV absolute change. Right? If so, this adds another 0.26% to the output voltage range. Also I take into consideration the output noise for freq. below 10hz, which is specified at 35uV p-p.

 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Using DACs - MCP4725 - Feedback required on my calculations please.
« Reply #5 on: August 22, 2014, 11:03:01 am »
One way for you to achieve higher accuracy than the worst case scenario from the datasheet is to re-calibrate the output: you can let the chip output a series of values and measure the values with a meter. After that, you can adjust the output in software so that the "correct" value is shown on the output.
================================
https://dannyelectronics.wordpress.com/
 

Offline diyaudio

  • Frequent Contributor
  • **
  • !
  • Posts: 683
  • Country: za
Re: Using DACs - MCP4725 - Feedback required on my calculations please.
« Reply #6 on: August 22, 2014, 11:26:28 am »
I`m mostly writing this topic to alert other designers about this.

I was using the MCP4725, thinking that a 12bit DAC would be good enough accuracy and resolution for my project. I wasn't aware however that these DAC's can easily have more than 5% output variances  between each IC.

So if you hook up a 3volts or 3000mV reference voltage to this DAC you would theoretically expect that writing an decimal value of 4000 would give you the analog value output of 2930,4mV 1.

However in practice I measured values between 2880mV and 2975mV == +- 2%.  (Measurements taken over 75 devices that I assembled.). Please note the +- sign, it does NOT mean approximately, but it means, for e.g. +-2%, it can go down by 2% and go up by 2% better said, it has an absolute error of 4%.

Which was to much variance to be acceptable for my project. Since I had no way to do a redesign, I had to do a device specific calibration using a DVM and store the calibration into the uP Flash memory. A 2 point calibration @100decimals and @4000 decimals did take away a lot of the error, but it was not enough for our project. I ended up doing a tree point calibration; @100,@2000 and @4000 decimals and extrapolate from there the correct output.

Because of this, I researched what specification I should look for, to minimize these output variances. These are the most important parts to watch for if you need accuracy: Gain error, Offset error, Integral nonlinearity error (acronym INL)  and Differential nonlinearity error(acronym DNL) . I found this paper from TI (Texas Instruments) very helpful for my understanding: http://www.ti.com/lit/an/slaa013/slaa013.pdf

Now I will start doing some calculations, and hope to receive feedback about it. I want to know if I do the calculations right.

MCP4725 - 12 bit resolution
Powering from 3.0 volts ==> Each LSB equals: 3volts divided by 12bit(4095) = 0.73mV for each LSB

Specs from datasheet:
INL Error +-14.5 LSB MAX ==> 29.00 LSB per part variation MAX ==> 29LSB equ 24.25mV
DNL Error  +-0.75 LSB MAX ==> 1.50 LSB per part variation MAX ==> 1.50LSB equ 1.01mV
Offset error 0.75% of FSR ==> FSR = 3.0Volts, 0.75% from 3 volts = 22.5mV
Gain Error +-2% MAX of FSR ==> FSR = 3.0Volts, 4% from 3 volts = 120mV

With this information I made this plot, is it correct?

And also one in percentages:



1This is calculated by 3000mV dividing by 12bit (=4095), and then multiplying the result by 4000.
2Please also note that these MCP4725 DAC's are not specified beyond the 100..4000 range (they make an really small footnote about this in the datasheet that the specs are not valid beyond this region). Luckily for me, I used the DAC exclusively around 200...3500 decimals.


Few months back I came across gerrysweeney blog and seems he had the same issues with a MCP4822 DAC
http://gerrysweeney.com/fully-programmable-modular-bench-power-supply-part-7/
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17200
  • Country: us
  • DavidH
Re: Using DACs - MCP4725 - Feedback required on my calculations please.
« Reply #7 on: August 22, 2014, 03:47:16 pm »
One of the first things I do when evaluating converters is check the integral non-linearity.

An INL of up to +/- 14.5 counts rounds up to 32 counts so 5 bits are lost from the original 12 making it a 7 bit DAC which is a lot more consistent with the offset and gain errors.

A lot of that may be calibrated out if you want to spend the effort but the best you can expect to do is less than 11 bits because the DAC is not monotonic and I would halve that again making 10 bits the maximum performance I would expect under the best conditions.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf