Go Down

Topic: offset calibration of adxl345 (Read 9041 times) previous topic - next topic

kaljuan

hello guys! sorry for being a bother again

ive been using sparkfun's http://www.sparkfun.com/products/10121. as of the moment i am accessing the accelerometer and trying to perform offset calibration. the datasheet says that to do this you should align one axis in the direction of gravity which is downwards. i do this and get the following RAW data:


Accelerometer in X direction 10 points:
14 , 17 , 16 , 16 , 16 , 16 , 16 , 17 , 15 , 16


Accelerometer data in Y direction 10 points:
5, 4, 5, 5, 5, 5, 4 ,5 ,4, 5, 5



both the above data are good right? i just average them and get an idea of what my offset in the x and y axes are.

the problem is with my z-axis. the plan is to align the z-axis in such that it is perpendicular to the up/down direction so that it will register 0g since gravity is purely downwards.

i tilt the board such that the x-axis is in the direction of the gaxis and here are the z direction accelerometer values that  i get


Accelerometer data in Z direction 10 points:
-144, -143 , -143 , -144 , -143 , -143 , -141 , -143 , -142, -144



i then tilt the board so that the y-axis is now in the direction of the gaxis. i get the following data


Accelerometer data in Z direction 10 points:
-42 , -42 , -42 , -43 , -41 , -44 , -40 , -44, -41  ,-43



which of the two sets of z-axis data should i then average and use as the offset data for the z-axis?

thank you!

PaulS

Quote
the problem is with my z-axis. the plan is to align the z-axis in such that it is perpendicular to the up/down direction so that it will register 0g since gravity is purely downwards.

In most coordinate systems, Z is parallel to the up direction. When the accelerometer is sitting on a table, the Z data should be constant.

kaljuan

thanks. ive rechecked other people's codes and it seems that they are performing the calibration online. what i am planning to do is take the offset data offline. which would be more efficient for you?

fax8

Have a look at http://www.analog.com/static/imported-files/application_notes/AN-1077.pdf .. they do explain calibration of the device using the internal test feature.

Also, have a look at this other document where they do mechanical calibration (moving the device in the various positions).. http://www.st.com/stonline/products/literature/an/17353.pdf

Also, I've seen some code similar to the above on file accel_cal.py in the ADXL345 arduino driver. This is pretty obscure to me right now what does is do.. so I asked for help to their developers here.

Also, check out my 9DOM orientation filtering implementation and my FreeIMU 9DOM board!

Go Up