Sensor orientation

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
Sebbi
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany
Contact:

Sensor orientation

Post by Sebbi »

Hey,

from trying out some algorithms on the raw sensor data I noticed some inconsistencies, mainly regarding the MPU6050 and sensor orientation. In def.h it reads:

Code: Select all

  #define ACC_ORIENTATION(X, Y, Z)  {accADC[ROLL]  = -X; accADC[PITCH]  = -Y; accADC[YAW]  =  Z;}
  #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] =  Y; gyroADC[PITCH] = -X; gyroADC[YAW] = -Z;}
  #define MAG_ORIENTATION(X, Y, Z)  {magADC[ROLL]  =  X; magADC[PITCH]  =  Y; magADC[YAW]  = -Z;}


However, as this is a single IC (acc & gyro), how can the orientation be this "wrong"?

Is this for historical reasons, so pitch/roll come out right in getEstimatedAttitude()?

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Sensor orientation

Post by Noctaro »

Hey,
as far as i know the definitions can be set to enable all kinds of breakoutboards.
You may use a breakout board with the same sensors and hardware but other sensorplacement.
Or maybe you choose to mount your sensors upside down.
I think thats why we have to keep it definable.

It ´s well described in the faq, if you are not sure how sensordata should react to copter movement.
-> http://www.multiwii.com/faq#How_should_ ... directions

greetz Noc

Sebbi
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany
Contact:

Re: Sensor orientation

Post by Sebbi »

Thank your for your answer, but that is not what i meant. I have the MPU6050 and it's sensors are in one, single IC ... or in other words, they are perfectly aligned. But MultiWii seems to need other orientations to correctly calculate the attitude and heading (maybe because of the original Wiimote sensors?). And that is a little bit weird when you want to try other algorithms on the sensor data ;-)

Post Reply