Using Arduino to Obtain Absolute Orientation from a 6-Axis Gyro

Click For Summary

Discussion Overview

The discussion revolves around obtaining absolute orientation from a 6-axis gyro for a model rocket project, focusing on the integration of accelerometer, gyroscope, and magnetometer data. Participants explore methods for real-time computation of orientation using Arduino, as well as the implications of sensor fusion and dynamics during flight.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant seeks guidance on how to combine data from 6 inertial axes and 3 magnetic axes to compute the rocket's orientation in a ground-fixed reference frame.
  • Another participant suggests using accelerometers to establish the vertical axis and magnetometers for local magnetic field orientation, followed by integrating 3D acceleration and rotation data to track the rocket's path.
  • Questions arise regarding the method of control for the rocket, with options including servos combined with thrust vectoring or fin angling.
  • There is uncertainty about whether integrating body rates yields true orientation, with inquiries on converting body rates to angular speeds in an inertial frame.
  • Some participants mention the potential use of MATLAB for sensor fusion and orientation calculations, noting that it may account for factors like the Earth's rotation and Coriolis force, though this may not be necessary for short-range rockets.
  • One participant indicates that their IMU module performs sensor fusion internally, expressing a desire to understand the underlying calculations.
  • Concerns are raised about how changing mass and moment of inertia during flight could affect control dynamics, even if it does not alter the integration of accelerations and rates for position and orientation.

Areas of Agreement / Disagreement

Participants express various viewpoints on the methods for obtaining orientation and the implications of sensor fusion, with no consensus reached on the best approach or the effectiveness of integrating body rates for true orientation.

Contextual Notes

Participants note limitations regarding the assumptions made in calculations, the proprietary nature of some IMU algorithms, and the potential impact of changing dynamics during flight on control responses.

Leo Liu
Messages
353
Reaction score
156
The gyro has 6 inertial axes and 3 magnetic axes. How do I make them work together to get the orientation of the rocket in the reference fixed to the ground? I found something from Matlab but I am not sure how it works: https://www.mathworks.com/help/fusi...sing-Inertial-Sensor-Fusion-and-MPU-9250.html. Also it doesn't suit my purpose since I would like to compute the absolute orientation in real time on the Arduino.

Could someone help me out please?

PS My end goal is to build a model rocket with attitude control, but for now I just want to record orientations and accelerations. I will be using Arduino for my project.

PS2 I realized the real question is how to obtain the absolute orientation from the gyro angular speeds.
 
Last edited:
Physics news on Phys.org
There are three perpendicular accelerometers.
There are three perpendicular rotation rate-meters.
There are three perpendicular magnetometers.

Start with the rocket vertical, and with a reference to North.
Use the accelerometers to find the vertical axis. Measure g.
Use the magnetometers to find local magnetic field orientation.
Record the zero values for the three rotation-rate channels.

Launch the rocket.
Measure 3D acceleration, and 3D rotation.
Integrate those to map the changing orientation and path of the rocket.
Check the computed orientation against the local magnetic field orientation.
 
  • Like
Likes   Reactions: berkeman
What method of control will you use?
Servos combined with thrust vectoring or fin angling?
 
Baluncore said:
Integrate those to map the changing orientation and path of the rocket.
Does integrating the body rates give the true orientation? How do I convert body rates to angular speeds under an inertial frame?
 
Lnewqban said:
What method of control will you use?
Servos combined with thrust vectoring or fin angling?
Haven’t decided yet. Most likely TVC without fins. But for now I just want to record data during a flight.
 
  • Like
Likes   Reactions: Lnewqban
Leo Liu said:
Does integrating the body rates give the true orientation? How do I convert body rates to angular speeds under an inertial frame?
No, there is a lot more to it. You can use the MATLAB link that you included or make your own code.
The MATLAB code might even adjust for a rotating Earth and Coriolus force, but that is not needed in a short-range rocket. On the other hand, it might not keep track of rotations of the rocket around its long axis if it is assuming that the rocket is asymmetric in that axis and a rotation does not matter.
 
FactChecker said:
No, there is a lot more to it. You can use the MATLAB link that you included or make your own code.
The MATLAB code might even adjust for a rotating Earth and Coriolus force, but that is not needed in a short-range rocket. On the other hand, it might not keep track of rotations of the rocket around its long axis if it is assuming that the rocket is asymmetric in that axis and a rotation does not matter.
My IMU module is actually able to do a sensor fuse though all the calculations are done in a black box. I have made this post to understand what's going on behind the scene, but I guess I will just use that for now. Thanks for the help.
 
Leo Liu said:
My IMU module is actually able to do a sensor fuse though all the calculations are done in a black box. I have made this post to understand what's going on behind the scene, but I guess I will just use that for now. Thanks for the help.
The actual sensor fusion and inertial reference calculations of a purchased IMU are likely to be proprietary. That being said, if you are interested in calculations of that general nature, MATLAB usually does a pretty good job of documenting their algorithms.
 
  • Like
Likes   Reactions: Leo Liu
The mass and the moment of inertia about different axes will change during flight, as fuel is consumed. That does not change the integration of the accelerations and rates, to get the position and orientation, but it will change the dynamics of the control response, needed to correct the flight path.
 
  • Like
Likes   Reactions: FactChecker

Similar threads

Replies
11
Views
24K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 15 ·
Replies
15
Views
5K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
10
Views
8K