offset adjust for ADXL345

Hello

I am using ADXL with +/2g setup. Without adjust OFSX,OFSY I am getting raw numbers below mounting with perfect ref block.

12 o’clock x = 280.0 y = 27.0

3 o’clock x = 10.0 y = 281.0

6 o’clock x = -245.0 y = 11.00

9 o’clock x = 25.0 y = -242.0

Numbers are stable, so don’t need to think about average or filter. (I think)

If I adjust using OFSX/SY for 6 o’clock to be perfect as -256.0 , 0.0, I don’t get 256, 0.0 @ 12 oclock. so as

3 or 9 o’clock doesn’t get 0.0 for the X (about 3deg off)

I also noticed that number you put in OFSX/SY changes 3~4 by 1. is this mean cannot do fine tuning or I am doing wrong?

What do I need to get correct 90, 0, -90, 0 ?

Please help me out.

Thank you.

http://learn.adafruit.com/adxl345-digit … rogramming

this looks relevant

-Mark

Thank you, but this is not to solve the issue. This is just how to get min/max.

As I wrote, I already reading numbers.

My ? is how to digest these to get angles right for full rotation.

I am using only X and Y data to get X axis only.

Before, start play with OFSX/SY, I was rotation the PCB itself to get 0 deg @ 3 o’clock.

When I did that, it does not make 0 deg @ 9 o’clock and off @ 12 or 6 too. (obvious that you can see).

The chip should be calibrated at factory . so that made me big ? mark in my head.

What do I need?

Offset calibration removes offsets on each axis. If you still have an offset of +/-lsb, that’s to be expected.

Once you’ve got offsets removed you need to remove any misalignment btw the actual sensing axes and the board or whatever you have it mounted to. All the references I have are for the more general 3 axis case. I’ll see if I can’t find one for a 2 axis case.

FWIW I don’t think Analog Devices does any such calibration. Afterall it would need to be done again as the IC can’t be expected to be perfectly aligned to it’s PCB, nor that to any case it’s mounted in.

I did some work on calibrating 2D magnetometers a while back, and the basic idea works very well for accelermeters, too. You probably won’t need the rotation correction, but you certainly need to correct for different gains and offsets on the X and Y axes https://forum.sparkfun.com/viewtopic.php?f=42&t=36399