dev20120225 orientation warning!!!

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
nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

dev20120225 orientation warning!!!

Post by nhadrian »

Hi all,

I have just uploaded and tested dev20120225 and I saw that there is a serious orientation and axis change in this dev!
There are x-y axis swaps and sign changes in the specified board configs too!!!

So I recommend anybody to check the working of all sensors in GUI before taking off!!!!!

BTW, I'm using quadrino board but with separate HMC5843 so I had to consider the MAG orientations. So now everything works fine, even alt hold with MS5611 (in at least in my living room) .

BR
Adrian

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: dev20120225 orientation warning!!!

Post by rbirdie001 »

Yes, I confirm that everything in sensors orientation was changed!
For me (Crius board - ITG3205,BMA180,HMC5883) worked this configuration surely test it before takeoff!
#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;}
Just a question - is it a purpose or just a mistake?
Roman
Last edited by rbirdie001 on Sun Feb 26, 2012 11:49 pm, edited 1 time in total.

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: dev20120225 orientation warning!!!

Post by KeesvR »

This is what Alex wrote in the changes:

- sensors spec code alignment
viewtopic.php?f=8&t=1259
be careful, some errors might remain
some orientation need to be redefine in config.h for individual sensor BB
setups, but it's cleaner


So its not a mistake.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: dev20120225 orientation warning!!!

Post by Alexinparis »

right :)
It's not a mistake.
It's something I should have done months ago to ease the integration of more sensors with the right interpretation from the specs.
I know it will have some side effects for custom BB boards, but it's only a one time change.

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: dev20120225 orientation warning!!!

Post by Th0rsten »

For CRIUS SE this is in Shared:

#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;}

Change the MAG -Z to Z?

MacArell
Posts: 6
Joined: Tue Sep 06, 2011 8:15 am

Re: dev20120225 orientation warning!!!

Post by MacArell »

Hi, changes are like this:

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

New:
#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;}

Work with me, after broken 2 props in 2 time, not same orientation change for ACC and GYRO, but now work fine thank ;)

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: dev20120225 orientation warning!!!

Post by Th0rsten »

Sorry, but your NEW is in the current Shared Branch. So nothing to do for me.

MacArell
Posts: 6
Joined: Tue Sep 06, 2011 8:15 am

Re: dev20120225 orientation warning!!!

Post by MacArell »

My example before was for you can see changes, you can see my personal orentations:
my old:
#define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = -Y; accADC[PITCH] = X; accADC[YAW] = Z;}
#define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = X; gyroADC[PITCH] = Y; gyroADC[YAW] = Z;}
#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = -X; magADC[PITCH] = Y; magADC[YAW] = -Z;}

my new:
#define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = Y; accADC[PITCH] = -X; 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;}

User avatar
ciskje
Posts: 34
Joined: Sat Mar 26, 2011 12:24 am

Re: dev20120225 orientation warning!!!

Post by ciskje »

Also Miniwii with this version have wrong orientation:
Correct one is:

#if defined(MINIWII)
#define ITG3200
#define BMA180
#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;}
#endif

Dellow
Posts: 26
Joined: Tue Dec 20, 2011 12:38 am

Re: dev20120225 orientation warning!!!

Post by Dellow »

I'm struggling with this too!
I'm using Crius board with these settings

#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;}

Everything works as it should until the quad goes upside down. If you roll inverted, the compass heading flips 180° and if you pitch inverted the compass heading doesn't change, i.e. Quad pointing to North, roll inverted and it should still point North but instead points South. Quad pointing North and pitch inverted, heading should now be South but remains North.
All sensors show correct readings, ( roll right, mag roll, acc roll and gyro roll increase, mag Z and acc Z decrease etc) as in the faq.
I have tried every combination of orientation but none are correct. Is it me, or has the orientation been changed somewhere else in this sketch?
I have been changing it in def.h, is this correct.
I should also say that I had no problem when using 1.9.

I could do with a sanity check just so I know I haven't totally lost it!

Thanks for any help.

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: dev20120225 orientation warning!!!

Post by Th0rsten »

Have you tested the "build in" CRIUS_SE?
Sensor orientation has changed in latest DEV.
http://code.google.com/p/multiwii/sourc ... iWii/def.h

Dellow
Posts: 26
Joined: Tue Dec 20, 2011 12:38 am

Re: dev20120225 orientation warning!!!

Post by Dellow »

Thanks for the reply - yes, I'm using the standard Crius SE definition, and have tried pretty much everything else too.
What I don't understand is that all the sensor values are correct to the normal accepted levels as far as value change on deflection, but the orientation when inverted is not.

Dellow
Posts: 26
Joined: Tue Dec 20, 2011 12:38 am

Re: dev20120225 orientation warning!!!

Post by Dellow »

Have just tried version 2.0 preversion_1 with default Crius SE defines and still the same. Maybe it's my board?
Hoping someone else has this board and can confirm the behaviour of theirs.
Andy

ronco
Posts: 317
Joined: Thu Aug 18, 2011 2:58 pm

Re: dev20120225 orientation warning!!!

Post by ronco »

Hi,

ITG 3200's axis are inverted now

this works for me:

Code: Select all

#if defined(ITG3200)
  #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] =  Y; gyroADC[PITCH] = -X; gyroADC[YAW] = -Z;}
#endif


edit: it was -X -.-

regards felix
Last edited by ronco on Wed Mar 07, 2012 8:23 am, edited 1 time in total.

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: dev20120225 orientation warning!!!

Post by Th0rsten »

Hello Dellow :mrgreen:

Please test these settings für CRIUS_SE:

#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;}

Waldmensch
Posts: 31
Joined: Sat Dec 31, 2011 12:10 am

Re: dev20120225 orientation warning!!!

Post by Waldmensch »

I have updated the Page for "WMP Clone mounted on BMA020" with the orientation changes
http://fpv-community.de/wiki/index.php? ... ONE#Ablauf

johnm1
Posts: 2
Joined: Sun Mar 11, 2012 12:51 am

Re: dev20120225 orientation warning!!!

Post by johnm1 »

Th0rsten wrote:Hello Dellow :mrgreen:

Please test these settings für CRIUS_SE:

#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;}




I tried this change in 2.0 Pre 1 changing Y; magADC[YAW] = Z; from -Z
, It makes the compass flip 180 every 90 degree rotation on roll and pitch

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: dev20120225 orientation warning!!!

Post by Th0rsten »

Thanks for the reply.

#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = X; magADC[PITCH] = Y; magADC[YAW] = -Z;}
is the correct line. SE is like the "FREEIMUv035_BMP" as I learned a few days ago.

dynai
Posts: 32
Joined: Tue Mar 01, 2011 10:01 pm

Re: dev20120225 orientation warning!!!

Post by dynai »

hi,

i've been using my flyduino and FFIMUv1 now for a while on both MULTIWII and Megapirate as for me a change in Multiwiicode is way simpler to do on my own i changed the respective sensor-lines in the def.h file
reason for this, megapirate for some reason has a 90° counter-clock-wise changed orientation of the FFIMU Sensor Board.
Till now i just copied the Sensor-Orientations from the Aeroquad-Shield but as there has been some massive change that didn't work for me.

Here is the orientation i found out for a 90° CCW rotated FFIMUv1 (Megapirate compatible orientation)

Code: Select all

#if defined(FFIMUv1_90) // megapirate compatible
  #define ITG3200
  #define BMA180
  #define BMP085
  #define HMC5843
  #define ACC_ORIENTATION(X, Y, Z)  {accADC[ROLL]  =  Y; accADC[PITCH]  = -X; accADC[YAW]  =  Z;}
  #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] =  X; gyroADC[PITCH] =  Y; gyroADC[YAW] = -Z;}
  #define MAG_ORIENTATION(X, Y, Z)  {magADC[ROLL]  = -Y; magADC[PITCH]  =  X; magADC[YAW]  = -Z;}
  #define BMA180_ADDRESS 0x80
  #define ITG3200_ADDRESS 0XD0
#endif


what i dont understand, no mather if i use my code changes or if i have the FFIMU in its intended direction (y-dirction on the board pointing to the "front) if i ROLL the copter NORTH becomes SOUTH, if i PITCH it NORTH stays NORTH :shock: :?: :?: :?: shouldn't it be the other way round?

i don't understand this please help

kind regards

Christoph

shaddi
Posts: 2
Joined: Fri Apr 08, 2011 1:41 pm
Location: Munich, Germany

Re: dev20120225 orientation warning!!!

Post by shaddi »

Anyone using the MiniWii-Board from Jussi?

I had to change the Sensor-Orientations for the actual MW 2.0 to the following:

Code: Select all

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


was:

Code: Select all

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


Can anybody confirm this?

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

Re: dev20120225 orientation warning!!!

Post by Noctaro »

shaddi wrote:Anyone using the MiniWii-Board from Jussi?

I had to change the Sensor-Orientations for the actual MW 2.0 to the following:

Code: Select all

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


was:

Code: Select all

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


Can anybody confirm this?


Hey, look at GUI and compare it to http://www.multiwii.com/faq#How_should_be_the_sensor_axis_directions

greetz Noc

shaddi
Posts: 2
Joined: Fri Apr 08, 2011 1:41 pm
Location: Munich, Germany

Re: dev20120225 orientation warning!!!

Post by shaddi »

Yes, it works correctly. I hoped that somebody with a miniwii-board can confirm this configuration :)

werkstattonline
Posts: 2
Joined: Sat Mar 31, 2012 5:28 pm

Re: dev20120225 orientation warning!!!

Post by werkstattonline »

Hello everyone

I was really exited and wanted to try the new version of Multiwii. I have seen that sensor orientation has been changed so that you don t have multiple orientation settings for a sensor.

But I am using a simple ITG3205 only config. After uploading I realised that the orientation is wrong now (roll/pitch movement exchanged). Is this a bug :?:

Is this an error or do I have to change every board in my copters so that the orientation is correct again?
That would be pretty stupid. :o

Isn t it possible to define the ITG3200 orientation as it was before (ITG3200 as an own "sensor board")

Thanks for your help and sorry if this has already been answered

robjames
Posts: 9
Joined: Thu Dec 22, 2011 8:28 pm

Re: dev20120225 orientation warning!!!

Post by robjames »

Go near the bottom of config.h and change the GYRO_ORIENTATION define to this :

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

Make sure it shows proper movement in GUI before flying .

werkstattonline
Posts: 2
Joined: Sat Mar 31, 2012 5:28 pm

Re: dev20120225 orientation warning!!!

Post by werkstattonline »

Hi Rob

Thanks for the message. Before I saw your tip, I made an own board with different gyro orientation. But your solution is much simpler.

Maybe this should be written somewhere, so that everyone can easily find it.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: dev20120225 orientation warning!!!

Post by Alexinparis »

It is explicitly written in Change.txt

Board and sensors orientation:
This was something that was not well coded at the beginning.
viewtopic.php?f=8&t=1259
This mod should not affect board definitions (a remapping of axis was done)
About individual sensor orientation: is not the same and it’s normal,
there is no bug to correct here.


Multiwii is not a plug&play soft ;)

droopy0025
Posts: 1
Joined: Fri Jun 15, 2012 4:03 pm

Re: dev20120225 orientation warning!!!

Post by droopy0025 »

I have an y6 scorpion y650 copter and the crius se multiwii board.

the frame has an prefab mount for my board only problem is that the orientation is rotated by 45 deg.
what code do i need to reorientate the board 45 degree. It could be CCw or Cw as long as i know how to rotate.

thanks Sam

Post Reply