# Getting position data from 9-axis IMU

I want to track the movement of a person in a 2D plane using a 9-axis IMU. The size of the plane in which the movement is not bigger than 6 by 6 meter.

The IMU is mounted on the head of the person and there is unfortunately no possibility to add other sensors or change the sensor location. The IMU provides acceleration with removed gravity, the rotation rate and the current attitude in Euler angles. The sample rate of the IMU is about 25 Hz

My first approach was to simply do a double integration on the acceleration with the acceleration being transformed to the global coordinate system using the Euler angles.

Since that gave me no useful result, I tried the Kalman Filter. At the moment I am ignoring the attitude and rotation rate. To the system dynamics matrix I added that the velocity is the acceleration integrated and the position is the velocity integrated and the acceleration integrated twice.

That didn't work either and the position I got when walking 6 steps in a straight line was approximately where I started with the value of the calculated position not deviating more than .6 m from the start at any time.

My next idea would be to take the attitude into account, but I don't really know how to approach this. Should I use the raw attitude to apply that to the raw acceleration to transform the acceleration to the global space or do it in another way?

In addition, I don't really know how to do the math to convert the attitude to a rotation matrix and apply that to the acceleration while still using matrix operations.

Do you have any tips on how I can move forward in this project? Is there a better approach than using a Kalman Filter? Is it even reasonable to think that this might be achievable with my current setup?

Any help and pushes in the right direction are greatly appreciated. Thanks in advance.

• "The IMU provides acceleration with removed gravity" -- what? Do you mean the IMU provides acceleration with gravity subtracted out? How? You can't subtract out gravity unless you have a lot more information available than just the typical "inside Einstein's elevator" information you get from just an IMU. Dec 10, 2022 at 15:34
• The data I get is from headphones which provide motion data via an API. The data from the API doesn't contain the total acceleration, but instead the user acceleration and the gravitation in different datasets. I have access to both, but don't need to subtract the gravity myself Dec 11, 2022 at 13:54
• That means that the IMU is doing some unknown processing itself, to separate the two. And because it physically cannot be perfect, it is imperfect. You're basically getting the headphone company's opinion of truth. Assuming that you do figure out how to get position information, that opinion of truth may well turn out to be worse than just getting the raw IMU output -- because you know what the raw IMU output means. Dec 11, 2022 at 16:48