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

Link to comment
Share on other sites

  • 3 months later...

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"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...