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

Acceleration CALIBRATION

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



Joined: 23 Jul 2007
Posts: 103

View user's profile Send private message

Acceleration CALIBRATION
PostPosted: Sat Sep 08, 2007 5:09 am     Reply with quote

While searching the web for better method of calibrating adxl330 accelerometer, I came across a procedure as shown in the quote from the following flash forum: http://forum.chumby.com/viewtopic.php?id=270
It does conflict with the procedure discussed already here. These guys are calibrating +-3g adxl330. I'm confused, can someone who is familiar with accelerometer calibration tell me if this procedure is right or not.
thanks

Quote:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The Z axis appears to show rotation. This can be seen by slowly turning in a circle while watching the Z value. It also shows acceleration as a component of one of the other axis, when acceleration is fast enough.

x0 = (x1 + x2)/2;
y0 = (y3 + y4)/2;
z0 = (z1 + z2)/2;

Gives us the mathematical average of the most variance and should show the midpoint of deflection.

The accelerometer in the wii appears to be different than the Chumby accelerometer in a couple of significant ways.
1. Physical orientation
2. Actual operation (sensitivity - which is a function of implementation)

So... Trying to figure out what we don't know from what we DO know
1. X axis - max value is when Chumby is screen up. Regardless of how someone is holding a Chumby in a room, the max X value is when the screen is up and the min valus is when the Chumby is screen down. The midpoint (~2000) occurrs when the Chumby is on its side and the screen is oriented such that you can read it from across the room.
2. Y axis - Max value is when Chumby is on it's RIGHT side. Min value is on LEFT side. midpoint in middle.
3. Z axis - This will be the key axis for telling the difference for when you are tilting the X axis either towards you or away from you (as nothing in the Y axis will help you, here...). The problem here is that these values will be different depending on what your 'rotation' about the Chumbys imaginary Z axis is...

So the real problem for Chumby acceleromer usage as a pointing device or 'in game navigator' is in figuring out how to take the Z axis data and intelligently compare against Z axis history to derive the significanve of X axis tilts.

were read directly from the X axis output of the Chumby, while rotating the Chumby to it's
Max value (screen up - 2400) = 1g
Min value (screen down - 1600) = -1g
and the median of the two, Chumby screen facing the wall 2000 = 0g

We do the same for the Y-axis by reading Chumby's Y output while leaning 90 degrees left, 90 degrees right and straight up.

To actually calibrate Chumby, we will need to take some X,Y and Z values while Chumby is oriented in different ways...
This allows us to derive what we don't know from what we do know.
We know that there is 1g of force acting to pull everything down to earth.
So, if we take readings of the accelerometer at each axis's min/max values, we can do some math that gives these values some significance.
For the X Axis
((Max X value) - (Min X Value))/2g = sensitivity
(2400-1600)/2 = 400/g
(The 2 is because we are at +1g@2400 and -1g@1600, encompassing a full 2g)

So what we just figured out is that the X axis reads ~2000 at 0g and that 400 in either direction makes 1g, or -1g

SO - To read acceleration directly from the X or Y axis (assuming we have the same calibration values for Y)
X-axis acceleration (g)= (RAW_X - 2000)/400

Where:
RAW_X is the actual Accelerometer X reading
2000 is the median, 0g value read during calibration
400 is the ((Max X value)-(Min X Value))/2g = sensitivity equation result
and is measured in g.


"For the X Axis
((Max X value) - (Min X Value))/2g = sensitivity
(2400-1600)/2 = 400/g
(The 2 is because we are at +1g@2400 and -1g@1600, encompassing a full 2g)"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I've to correct the other values to be(for x-axis):
--------------------------------------------------
voltage/0gADCCounts=1.65/652 =0.002530675

- For an Accelerometer reading of 805, the real voltage measured is (805 x 0.002530675) = 2.04V
- For an accelerometer reading of 652, the real voltage measured is (652 x 0.002530675) = 1.65V
- For an accelerometer reading of 523, the real voltage measured is (523 x 0.002530675) = 1.32V


I've to correct the other values to be(for Y-axis):
--------------------------------------------------
voltage/0gADCCounts=1.65/675 = 0.002444444

- For an Accelerometer reading of 812, the real voltage measured is (812 x 0.002444444) = 1.98V
- For an accelerometer reading of 675, the real voltage measured is (675 x 0.002444444) = 1.65V
- For an accelerometer reading of 523, the real voltage measured is (523 x 0.002444444) = 1.28V


I've to correct the other values to be(for Z-axis):
--------------------------------------------------

voltage/0gADCCounts=1.65/675 = 0.002462697

- For an Accelerometer reading of 803, the real voltage measured is (803 x 0.002462697) = 1.98V
- For an accelerometer reading of 670, the real voltage measured is (670 x 0.002462697) = 1.65V
- For an accelerometer reading of 530, the real voltage measured is (530 x 0.002462697) = 1.31V

for x-axis:
((ADC_max X value) - (ADC_min X Value))/6g = sensitivity
(805 - 523) / 2 =141/g

for y-axis:
((ADC_max_X_value) - (ADC_min_X_Value))/6g = sensitivity
(812 - 523) / 2= 144.5/g

for z-axis:
((ADC_max_Z_value) - (ADC_min_Z_Value))/6g = sensitivity
(803 - 530) / 2 = 136.5/g
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Are
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