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

Click For Summary

Discussion Overview

The discussion focuses on calculating pitch and roll angles relative to a velocity vector using data from an Inertial Measurement Unit (IMU) that includes an accelerometer and gyroscope. The context involves determining these angles in 3D space, particularly in relation to the motion of an object (a frisbee) during a throw, while accounting for an unknown initial yaw.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes the IMU's setup, including the integration of accelerometer and gyroscope data to derive a velocity vector and orientation in Euler angles.
  • Several participants request clarification on the term "IMU" and seek a datasheet for better understanding.
  • Another participant suggests that pitch and yaw can be derived from the gyroscope's direction vectors using dot products, but notes that the choice of vectors depends on conventions.
  • A participant questions the correctness of using arccosine with specific vector components to calculate angles, seeking confirmation on the method.
  • One participant outlines a method for determining initial orientation using accelerometer data when the IMU is stationary, and describes a process for tracking rotations during flight.
  • A later reply raises concerns about the complexity introduced by the IMU being fixed to a rotating platform, suggesting that this may complicate the calculations due to potential centripetal effects on the accelerometers.

Areas of Agreement / Disagreement

Participants express various viewpoints on the methods for calculating pitch and roll angles, with no consensus reached on the best approach. There are differing opinions on the implications of the IMU's mounting and its effects on the data collected.

Contextual Notes

Participants highlight potential complications due to the IMU being fixed to a rotating platform, which may introduce additional factors that need to be considered in the calculations. The discussion also reflects uncertainty regarding the effects of centripetal forces on the measurements from the accelerometers and gyroscopes.

FGD
Messages
46
Reaction score
12
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.

ConvertAccelXYRotationsToPitchRoll.jpg
 
Last edited:
Physics news on Phys.org
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.
 
  • Sad
Likes   Reactions: 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.
 
  • Like
Likes   Reactions: berkeman

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 49 ·
2
Replies
49
Views
4K
Replies
6
Views
4K
  • · Replies 6 ·
Replies
6
Views
11K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
14K