Clarify Magnetometer

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
JohnyGab
Posts: 144
Joined: Sat Oct 29, 2011 4:41 am

Clarify Magnetometer

Post by JohnyGab »

It look like I'm not able to follow all the evolution of the code.

I always tough that, to calibrate your MAG, you need to press on the calibration button into the GUI, then move the Quad around 360 on each axis ( Yaw, Pitch Roll ), and I tough that was it.
I'm doing that in my basement, maybe its the problem?

Is there something more then just..moving the quad arround?

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

Re: Clarify Magnetometer

Post by KeesvR »

Move it away from big metal objects, in my case a freezer.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: Clarify Magnetometer

Post by shikra »

Also check orientation - mine was not right...
And recal if you change

Can see whats likely to change by looking at mine...
This was 1.9
#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] = -Y; magADC[PITCH] = X; magADC[YAW] = Z;}

This is 2.0
#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;}

JohnyGab
Posts: 144
Joined: Sat Oct 29, 2011 4:41 am

Re: Clarify Magnetometer

Post by JohnyGab »

after all that says, just to be sure.

Is this still true :
How should be the sensor axis directions
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

...WHAT ai MAG_Z, MAG_Y and MAG_X as they are Roll pitch yaw now.

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

Re: Clarify Magnetometer

Post by Alexinparis »

shikra wrote:Also check orientation - mine was not right...
And recal if you change

Can see whats likely to change by looking at mine...
This was 1.9
#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] = -Y; magADC[PITCH] = X; magADC[YAW] = Z;}

This is 2.0
#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;}


If you use a sirius board, there are already the good define for this board in the current 2.0.
no need to define it one by one like you did.

LenzGr
Posts: 166
Joined: Wed Nov 23, 2011 10:50 am
Location: Hamburg, Germany
Contact:

Re: Clarify Magnetometer

Post by LenzGr »

I actually wonder about the same thing than JonnyGab. So far, I simply clicked the MAG calibration button, but did not do anything else - I just left the copter sitting on the bench. I have an "allinone" board and I noticed that the compass does no longer indicate the appropriate compass heading in the GUI with the current 2.0 development version. However, enabling the compass in flight noticeably helps with keeping the copter from yawing into one direction. I guess I need to verify the MAG_ORIENTATION definitions for the allinone board again.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: Clarify Magnetometer

Post by shikra »

when you press mag calibrate you should move it around a complete 360 in each axis. If just leave it still will not work!

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: Clarify Magnetometer

Post by shikra »

Alexinparis wrote:
If you use a sirius board, there are already the good define for this board in the current 2.0.
no need to define it one by one like you did.


Thanks Alex - its weird because I don't know what version def I had but it didn't have the correct Sirius def...
I have downloaded several of the prever - can only think something didn't overwrite correctly.
Is strange because in the zip files they look good. i never figured out why, but its good in 2.0

I also see that I no longer have mag declination errors in 2.0 (when tilted it stay very true) at least for realistic acc angles. Excellent....

Post Reply