In this post, I'll be talking about the triaxial (3axes) Accelerometer coordination and
and how to convert from bodyframe to global frame or which is also called earth frame
When you are starting with Sensortag Acceleromater for phone application developement or
for developing a specific product or to feed your curiousity, You have to do the following
1. Scan through the user guide (buhh!)
2. Accelerometer GaTT commands
3. look into KXTI9 datasheet
I'll get into the Gatt commands later on. At the moment coordination is on demand.
Yes, so, well... Lets strip the Tag down
On the left is Sensor tag without casing and ofcourse on the right is with casing @@
Te chip as given in the datasheet ( and as how it looks in reality :D)
Look at pin 1 (the dot), for reference
The Coordinates as shown in data sheet. Z+ is pointing towards you
Now, based on the first photo I posted, This is how the coordinates are (Z+ is pointing at you)
Mounting your SensorTag
I prefer testing the acceleration data when the sensor is mounted in the following position
Because the acceleration data will be closer to 0 , if not 0......Except the Z axes will be giving ∓1g as an output because it is aligned with the global frame.
Why X axis and Y axis ..Closer to 0
As you can see from the casing of Sensortag, it is not sharply straight , it has a slope on it (to contain the coin battery). Therefore, I prefer the position on the left, where the circuit within is more aligned with the table. Yet, I have to admit, I did some tests on other SensorTags, and some gave different values then 0 . So, it might not apply for all SensorTags. I guess the reason is the chip's factory process error or how it is glued on the circuit.
Global frame : Also called Earth frame or Inertial frame or reference frame. It has the following coordinate (0,0,1) where 1 is the gravity (9.8 m/s/s). It is also a high assumption in most cases; because it isn't exactly 1 all around the globe; as Earth has a Spheroid shape (it is almost a sphere, but not quite).
Accelerometer KXTI9 outputs acceleration of the body frame plus global frame in digital hexadecimal format.
Body frame : is the cooordinate I discused earlier, coordinate of the chip on the circuit.
This step is necessary if you want to obtain a clean Accelerometer data without the gravity component. So, you have to align it well with the global frame and get 0 output at the X, Y axes and 1 in the Z axes. If it isn't aligned , the 1g will cross on the X and Y axes and will interfere with their readings.