Go Down

Topic: ADXL345 information/help/problem/guidance etc :) (Read 4 times) previous topic - next topic

ocelotrevs


Quote
Any pointers?


Middle school geometry.



That was never my strong point.
Do we need to relate the bit resolution in terms of a g unit, then relate that to a degree value. So a 10 bit resolution gives a sensitivity of 0.1 degree of sensitivity.
Or does it relate to the mg/LSB value. So if a value of 4mg/LSB is given, then the sensitivity is 0.25 degrees?

lesto

we can calculate orientation (from -90° to 90°) on one axes by

asin(val);

where val HAVE to be from -1 to 1, so

maxValue = 1024
half=maxValue/2; //because we have value from 0 to 1024, 0 is -G, 1024is +G and 512 is 0G
val = (rawRead-half)/half; //the /zero assure that we will have a result in range of -1, +1

(notice you have to use acos if this axis is parallel to gravity vector, so asin for x and y, acos for Z)

now we have to set our precision. with a precision of +-4g, 1g = 512/4 = 128LSB so 1LSB = 1/128 G
precision now is asin(0) - asin(1/128)
asin of 0 is 0 (how convenient!)
asin of (1/128) is 0.44°, so 0.44° is your precision


but we don't need 4g, because any value above 1G is just noise from acceleration, so we can use the lowest resolution witch is +-2G, 1G= 512/2=256LSB, so 1LSB=1/256
asin(1/256) = 0.22°
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

dhenry

The number to look for is the sensitivity figure. This particular chip has the max sensitivity ratings of 256lsb/g, so each "bit" corresponds to 1/256g. or 90/256 ~= 0.4 degree, in theory.

In reality, you would be lucky to get to within 2-3 degrees.

lesto

sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

AWOL

Small angle sine approximation doesn't work that well for angles in degrees.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up