compass gyro orientation soldered

Post Reply
handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

compass gyro orientation soldered

Post by handsomejackuk »

Hi can anyone give me some advice on how is should be setting up my multiwii sketch with the following compass and gyro soldered on to board ?

I did realise at the time that they should be soldered on the same orientation, but as the boards design allowed for them to be put on at this way i thought it may be easier to adjust in software.. heres apic of the compass and gyro with the arrows indicated on board...

the board works great, and the compass gyros all work but i just wondering if this will affect performance at all with the sensors being mounts this way

ImageP1080643 by handsomejackuk, on Flickr




please advise thanks Al...

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: compass gyro orientation soldered

Post by Hamburger »

In the wiki you can find info on what the xyz values of the sensors should do. Simply experiment to find your orientation values for your board.

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: compass gyro orientation soldered

Post by kalle123 »

No problem.

Finish your work.

START: Make your settings in multiwii, compile the firmware and put it on your FC.

Connect the FC to multiwii gui and observe the movement of the sensors.

multiwii gui
multiwii gui


How should be the sensor axis directions be:

TILT the MULTI to the RIGHT (left side up):

MAG_ROLL, ACC_ROLL and GYRO_ROLL goes up
MAG_Z and ACC_Z goes down

TILT the MULTI forward (tail up):

MAG_PITCH, ACC_PITCH and GYRO_PITCH goes up
MAG_Z and ACC_Z goes down

Rotating the copter clockwise (YAW):

GYRO_YAW goes up

The copter stays level:

MAG_Z is positive ; ACC_Z is positive



Do the sensors one by one! (You can disable the other sensors by clicking on the color)

Make your changes according to your finding here in config.h
9.jpg


... then go to START again and see, if it is OK now. Else once again ;)

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

well well i didnt realise you could disable the sensors by clicking on them something new learnt...

still have to sort out the orientation though.. i have a fiddle tonite, i would have thought only the mag, or gyro acc need 90 degrees of alignment...

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

i have disabled the magnetometer in the sketch and just concentrating on the mpu 6050 now when i run the gui... it seems with my board, if i roll 360 degrees, the quadcopter diagram the thing with the four motors on... rolls pretty good. but if i pitch up or down once i get past 45 degrees of pitch, the roll starts to drift out. to the point at when i am 90 degrees of pitch roll is -90 degrees.. i just cant understand this...?

the mag is not even connected now and i have this large error.. any ideas please ?

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: compass gyro orientation soldered

Post by kalle123 »

The axes of your sensors must be aligned to the axis of your copter. And not with a deviation of 30° or 45°.

Make small movements, you don't have to move the copter 45° or 90°. And only look at one sensor at a time.

Try to find out, what is wrong. Make the adjustment in config.h and go to START again ...

br

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

i have connected to 5v now and not the usb cable.. and it does seem a little better, i have not got it installed in the copter yet, just bench testing it...

i have the orinetation at normal setting not at 30 or 45 degrees.... but there is definitely better precision on the pitch... the roll if i give it 360 degrees of roll, the pitch stays real good and only drifts a few degrees, but the pitch when past 90 degrees has a very severe influence on the roll..... maybe i am being a bit too fussy... i have also removed the magnetometer completely off the board now until i get the gyro sorted...

hey thanks for the help it is appreciated...

what i was going to ask in the config.h under the acc mag gyro allignment section... the y and x's is it just a case of adding a - negative sign in front of the axis, or can a figure be introduced to skew the board if needed..?

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

kalle123 wrote:The axes of your sensors must be aligned to the axis of your copter. And not with a deviation of 30° or 45°.

Make small movements, you don't have to move the copter 45° or 90°. And only look at one sensor at a time.

Try to find out, what is wrong. Make the adjustment in config.h and go to START again ...

br


Hi Kalle,

so reading some other posts on this... referrring to the mpu6050 chip only.. the statements in the Define force_acc_orientation , and Define Force_gyro_orientation settings, are only telling the multiwii software whether to make the x,y,z axis go +ve or -ve when the board is moved in a particular axis....

this is corrct for my mpu6050 at the moment with the magnetometer not on the board...

what i want to do is to rotate only the mpu6050 chips axis 90 degrees, or 270 degrees by software to allow for it to compensate for the magnetometers orientation when i put it back on the board...

or rotate the magnetometers axis 90 or 270 degrees..

any ideas how i just do that ?

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: compass gyro orientation soldered

Post by kalle123 »

Main thing is to find out for instance.

Is it like that

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

or is that OK?

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

or maybe

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

That YOU have to find out!

Normally Z axis stays there, but if the sensor board is upside down, it will be -Z ;)

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

OK I think i can see a bit more clearly now...i will try altering those values ? is it only for acc i need to alter though or is it for gyro too as the mpu 6050 has both... also i did wonder whether i could alter it like this too for 90 degrees orientation

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

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

so basically swapping over the roll and pitch axis.. variables...

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: compass gyro orientation soldered

Post by kalle123 »

handsomejackuk wrote:... is it only for acc i need to alter though or is it for gyro too as the mpu 6050 has both...


You have to check both!

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

ok i understand that a little bit more, so if i leave the define commands with the // so no settings take place no adjustments, i think it must take the settings from def.h as the boards definition... ( not all boards are the same )?

b.t.w. if i alter the x and y i.e. make roll x. and pitch y it does turn the board 90 degrees..

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

this is mad !!!!!

my roll, and pitch are working correct...but the artificial horizon the guage on the top with sky ( blue) and ground ( brown) is now reversed with the roll.....this is with default settings...

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: compass gyro orientation soldered

Post by kalle123 »

handsomejackuk wrote:this is mad !!!!!

my roll, and pitch are working correct...but the artificial horizon the guage on the top with sky ( blue) and ground ( brown) is now reversed with the roll.....this is with default settings...


ROLL and PITCH for what? Gyro, ACC?

That is NOT OK with the artificial horizon!

Remove in config.h the "//" to have the lines active. Don't have to mess around with def.h.

/* enforce your individual sensor orientation - even overrides board specific defaults */

If you decided to build your multiwii with separate sensors, you have to go through that.

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

Roll and pitch setting on the acc and gyro are as they should be... i.e going +ve when pitching forward and +ve when left side of board is lifted as per the wiki.... the numbers are all correct...

now on the dials on the right side of the screen the roll dial turns clockwise when i roll clockwise, and the pitch dial goes up when i point up...down when i point down... but the artificial horizons dial brown and blue dial when i tilt the board clockwise the dial turns antoclockwise...


hey thanks for being so helpful dont worry i will figure it out..


i have just reinstalled multiwii sketch from scratch and its still the same and shows the same on android multiwii ez-gui

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

Re: compass gyro orientation soldered

Post by handsomejackuk »

figured it out thanks....

i thought i was going mad... seems right now...

i just sure that the artificial horizon used to go the same way as the roll......

Image

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: compass gyro orientation soldered

Post by kalle123 »

Remember to have your sensor board leveled when power is applied (GYRO calibration) and also do a ACC calibration.

Good luck ;)

Don't be puzzled by the artificial horizon picture.

The red thing in the middle is misleading.

735.png
(15.32 KiB) Not downloaded yet


It is a left turn :)

Post Reply