|
|
View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
Calibrating an ADC |
Posted: Mon Oct 18, 2004 8:39 am |
|
|
Hi,
How can ADCs be calibrated ???
thanks
arun |
|
|
Ttelmah Guest
|
Re: Calibrating an ADC |
Posted: Mon Oct 18, 2004 9:35 am |
|
|
arunb wrote: | Hi,
How can ADCs be calibrated ???
thanks
arun |
Lots of different ways. You could read two 'known' voltages, and store the values, and use these to give a 'scale factor'. Alternatively, you could do it in hardware, by having Vref high and Vref low both adjustable, using a digital pot to adjust each voltage, then putting in your 'zero point' voltage, and adjusting the low Vref, till the correct 'low' reading is received (personally, I'd use '1', not '0' - this way you can tell if you ae below the zero reading). Then feed in the 'high point' voltage, and adjust the high Vref, till the correct reading is obtained.
Best Wishes |
|
|
John Morley
Joined: 09 Aug 2004 Posts: 97
|
|
Posted: Mon Oct 18, 2004 9:24 pm |
|
|
Hi,
I applied a couple of known voltages to the inputs of my A/D, and read the results. I then manually calculated the "scale factor" required to make the A/D readings agree with the known input, and hard-wired this factor into my code. Now, each time I read the A/D I apply the scale factor.
Code: |
float fADCorrection = 0.975; // empirically derived scale factor for A/D channels.
fVolts =(((float)iRawData/256)*15) * fADCorrection;
|
Fortunately, all channels had (roughly) the same scale factor, so I got away with only one value for all channels. Also, this technique only nulls "gain" errors, so if you have "offset" errors as well, you'll need to do more work. Fortunately, that was not really evident in my data collection.
Good Luck! _________________ John Morley |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Mon Oct 18, 2004 9:53 pm |
|
|
Hi,
Thank you for the reply.
I had something exactly similar in mind, but what I don't know is what should be values of the known voltages ??
Should I start with something as low as 50 mV and go up to 5 V ( or Vref value).
Also is the calibrating factor different for each known voltage value ??
thank you
arun |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
Re: Calibrating an ADC |
Posted: Tue Oct 19, 2004 8:07 am |
|
|
arunb wrote: | Hi,
How can ADCs be calibrated ???
thanks
arun |
Start by sampeling the minimum and maximum input values. Then use a form of the formula for a line y=mx+b.
Code: | Analog_Input_1_m=Analog_Input_1_High-Analog_Input_1_Low;
Analog_Input_1_m=0x10000000/Analog_Input_1_m; |
I use this arangement of the formula because it is least dificult to solve y=(x-b)*m
Code: | Analog_Input_1=((int32)(Analog_Input_1_RAW-Analog_Input_1_Low) * Analog_Input_1_m) >> 16; |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|