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?
Clarify Magnetometer
Re: Clarify Magnetometer
Move it away from big metal objects, in my case a freezer.
Re: Clarify Magnetometer
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;}
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;}
Re: Clarify Magnetometer
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.
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.
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Clarify Magnetometer
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.
Re: Clarify Magnetometer
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.
Re: Clarify Magnetometer
when you press mag calibrate you should move it around a complete 360 in each axis. If just leave it still will not work!
Re: Clarify Magnetometer
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....