I am a junior aerospace engineer and what I am trying to do is getting the acceleration component which is perpendicular to the earth - no matter how the plane is oriented or rotated.
If the plane would always be horizontal (for e.g. on a road) I would just read the Z component of sensor readings and that'd be it. But when the plane is in the air it is different because obviously it can rotate in all directions. What I do know about the aircraft in every moment is it's attitude (roll angle, pitch angle and yaw angle - basically the angles around each axis) and accelerations (X,Y and Z axis). What I need now is a mathematical tool that would take this data and return the acceleration towards the earth.
What do you suggest?