# Calculating Pitch and Roll Relative to a Velocity Vector from IMU Data

• I
• FGD
FGD
I have an IMU that includes an accelerometer and a gyroscope. The IMU is moving through 3D space while rotating around it's z axis(yaw). Here's what I know so far:

1. Velocity Vector: I have a 3D velocity vector (x, y, z) that was integrated from a resting position using the accelerometer data.
2. Orientation: I also have an orientation in the form of euler angles, which has been integrated from the gyroscope data, starting from a rest position.
3. Unknown Initial Yaw: The initial yaw around the Z-axis is unknown.
At a specific point in time, I want to calculate the Pitch and Roll angles relative to the velocity vector.

My question is: How can I determine the pitch and roll angles of the IMU relative to its velocity vector given this information? Are there specific formulas or methods that account for the unknown initial yaw?

Below is a 2D diagram that will hopefully help with understanding what I am trying to accomplish. My end goal though is in 3D space.

Last edited:
What's an IMU? I can guess, but it's best if you would define your terms. Can you link to the datasheet?

berkeman said:
What's an IMU? I can guess, but it's best if you would define your terms. Can you link to the datasheet?
This is the IMU. https://www.adafruit.com/product/4464. Nothing fancy.

berkeman
Pitch and yaw should be available from the 3 gyroscope direction vectors. So, these axises are defined relative to the IMU board. Pitch and yaw angles are obtained from arccosine of dot products of pairs of these vectors. Which vectors depend on your convention choices.

Also, the up vector comes from the acceleration vector.

Paul Colby said:
Pitch and yaw should be available from the 3 gyroscope direction vectors. So, these axises are defined relative to the IMU board. Pitch and yaw angles are obtained from arccosine of dot products of pairs of these vectors. Which vectors depend on your convention choices.

Also, the up vector comes from the acceleration vector.
Is this correct? "arccosine(opposite/hypotenuse) using opposite = dot product(x, roll) and hypotenuse = dot product(y, pitch)?

Below is exacly what I am trying to accomplish.
Initial Orientation and Tracking During the Throw:

1. Determining Initial Orientation:
• At the start of the throw, while the IMU (Inertial Measurement Unit) is stationary, I calculate the initial orientation using the accelerometer data. This is based on the ratios of the accelerometer readings to the gravity vector (assuming the IMU is at rest and thus only measuring gravity at this point).
• This initial orientation is relative to the IMU's coordinate system.
2. Tracking Rotations During Flight:
• Once the throw begins, I continuously integrate the gyroscope data to track the rotations of the IMU over time.
• Since the IMU is mounted on a frisbee, I want to determine the exact pitch and roll of the frisbee relative to the throw direction at the moment it leaves the hand.
3. Calculating Relative Tilt:
• To find this tilt, I plan to:
• Compute the difference in angles between the velocity vector (direction of the throw) and the accelerometer data at the moment of release.
• Use this difference to rotate around the disc surface and derive the pitch and roll angles relative to the throw direction.

I missed that the IMU is fixed to a rotating platform. This will make things significantly more complicated. If the unit is off the center of rotation, the accelerometers will have centripetal components. I have no idea off the top of my head what the effect on the gyroscopes will be. I don’t think this is a common use case for IMUs.

berkeman

Replies
2
Views
2K
Replies
3
Views
655
Replies
6
Views
3K
Replies
2
Views
4K
Replies
4
Views
3K
Replies
2
Views
365
Replies
34
Views
1K
Replies
6
Views
9K
Replies
1
Views
5K
Replies
1
Views
2K