Jump to content
I2Cdevlib Forums

Recommended Posts


I am a college student working to build a UAV.  I selected the MPU6050 as my IMU because it seems to have a pretty substantial community around it.  Time to test that! 

Does anyone know how to invert the orientation of the IMU sensor in order to change its frame from a quadcopter to a UAV?  I have attached photos below.  I have tried flipping the physical sensor and playing with the offsets but that has not yielded anything useful.  

I have designed a complicated quaternion attitude controller dependent on the AC orientation and it would be a real pain to have to redo all of my work because of a IMU coding issue.  I have the MPU6050 connected to a raspberry pi, which runs the controller, and am using an Arduino Due to control the motors/servos.  

Any help with this would be greatly appreciated!  

AC Orientation.png

Quad Orientation.png

Share this post

Link to post
Share on other sites

Do you want to change the axes or simply the positive and negative rotation sides? In the code you have on the file MPU6050_6Axis_MotionApps20.h the formulas for the Euler angles and the Yaw pitch and roll etc... in case of yaw pitch and roll you'll have ypr[0], ypr[1] and ypr[2] respectively. switch them if you want to change the axes (not sure about the implications) and if it's just a matter of positive and negative rotation, put a "-" before the formula like ypr[0] = - "copy the rest". you can find the formulas if you locate in the file "dmpGetYawPitchRoll"

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now