CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Calibrating an ADC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Calibrating an ADC
PostPosted: Mon Oct 18, 2004 8:39 am     Reply with quote

Hi,

How can ADCs be calibrated ???

thanks
arun
Ttelmah
Guest







Re: Calibrating an ADC
PostPosted: Mon Oct 18, 2004 9:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 18, 2004 9:24 pm     Reply with quote

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

View user's profile Send private message Send e-mail

RE:
PostPosted: Mon Oct 18, 2004 9:53 pm     Reply with quote

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

View user's profile Send private message

Re: Calibrating an ADC
PostPosted: Tue Oct 19, 2004 8:07 am     Reply with quote

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;
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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