ERROR COMPASS VARIANCE interesting behavior

During process of checking what could be wrong with my copter I started to test compass.
All test are done on bench (so no GPS fix). Copter 3.5.1.

Internal compass (only one enabled), mag calibration completed with fitness strict, no way to get rid of compass variance error (MP correctly shows world directions).

External compass (only this one enabled), mag calibration completed with fitness default (didn’t complete on strict), no errors (MP correctly shows world directions) unless I rotate copter 90 degress to W, then error is on again and EKF for mag is red and after few seconds display in MP starts drifting to N and EKF went to orange and green. Same story when I turn from W back to N.

How is it possible that copter pointing to W displays N?

Wrong external compass orientation?
I think even if the internal one is disabled, it can still tell if the orientation is different between them.

I don’t think so, both points correctly to N and after turn left to W etc.
I’m using pixhawk lite, I didn’t touched internal compass orientation, external one is beitan 880 set to roll 180.

1 Like

You need to disable the built-in magnetometer, using only an external magnetometer.

It’s disabled, I did all tests with only one mag enable so there was no interference between results

I have had an incorrectly labeled GPS and it acted very similar… I was able to initially calibrate it, but when rotating the copter I got errors and wrong direction.
It looks like the label on the GPS antenna will be upside down in the correct orientation (based on pictures on the banggood website). So, if you set the copter with the front on the ground and the rear in the air, you can read the label.

Copter Rear
|
Cirocomm
|
Copter Front


If that’s all correct, are you in a magnetic free environment when you’re calibrating? It’s best to do it out in a field away from anything metal or magnetic… I have speakers in every room of my house, and can’t get a good calibration anywhere inside.

Beitian 880 is quite popular so I don’t belive this is an issue (cables goes to the back).

Also directions are correct copter points to N (confirmed with “compass” in mobile phone and from google maps) after turning left MP displays correctly W and then slooooowly drifts to N with lot of errors.

Sure env is very dirty in sense of magnetic elements. I’ll recalibrate outdoors soon but I don’t belive that this is a cause of weird behavior.

You can check correct orientation by monitoring mx, my, mz in ‘Flight Data’ -> ‘Status’ while moving the UAV.

I think he’s got the orientation correct… At least for the external one… (cables to the rear is correct).

Wait, I just re-read one of his posts that says “external one is beitan 880 set to roll 180.”.

You usually don’t have to set any rotation on an external compass… Most of them have the magnetometer on the bottom, so the orientation is different from the flight controller… But the code knows they’re all that way and automatically compensates. Basically, checking the box to say it’s an external compass tells the flight controller to use the usual external compass orientation. You don’t need to also set the rotation (unless you’re doing something unusual).
Put the external compass orientation back to the default, and try again.

1 Like

Ok, that was stupid mistake, both compasses are set to normal now.
Both are changing in same direction (checked on tuning chart).

I tried to verify mag corectness by following http://ardupilot.org/copter/docs/common-compass-setup-advanced.html#checking-compass-orientation but this is beyond my ability to understand english.

  1. When I move nose down mag z is decreasing till negative
  2. Turning copter clockwise decreases x & y but then values raises

So can someone translate official instruction into plain english? :slight_smile:

Hi Piotr,

it is actually quite easy to check in MP-> Flight Data → Status:
Set your compass calibration values to 0 and set a correct board orientation and external compass orientation (‘sometimes’ the external mag have wrong orientation labels). Check if you have correct board orientations (AHRS_ORIENTATION and COMPASS_ORIENT(2):

  1. if you are in Northern Hemisphere and your UAV level, check mz and mz2, both must be positive. If mz and/or mz2 is negative you need another board orientation.

So it seems you got this right.

  1. orientate your copter facing north (or any other direction) and remember the value for mx and mx2 in the level position. Now simulate pushing only elevator stick forward (= same direction, but nose down) the mx and mx2 values must increase (for example from 100 to 300 or from -250 to -150 etc.). If the values are getting smaller (400 to 100 or -100 to -300 etc.) you need another board orientation.
  2. similar to 2) remember the value for my and my2, keep the orientation, but this time roll the copter to the right (simulate right aileron stick input) and check for increasing values.

If you yaw the copter clockwise or counter clockwise the mx,mx2,my,my2 values must increase and decrease because you change the orientation (mz and mz2 don’t change). You should check if mx and mx2 increase or decrease at the same time and my and my2 increase or decrease at the same time (mx/my and mx2/my2 should run ‘parallel’, only in an ideal world they would have identical values)

Once you have correct board orientations you must do the compass calibration.

Thanks a lot, now it makes sense, and my both mags are set correctly.

sir can solve my problem

Are you asking about theArtificial Horizon?
when the aircraft tilts to the right, the horizon tilts to the left. Tilt your head to feel it.

When I MOVE MY PIXHAWK LEFT IT SHOWS RIGHT DIRECTION AND WHEN MOVE MY PIXHAWK RIGHT IT SHOW ME LEFT AS SHOW IN THE FIG .PLS HELP EVEN WHEN I CONNECT TO THE TERMINAL WHEN I CONNECT TO THE PIXHAKW IT SHOWS LIKE THIS IN THIS VIDEO. I CONNECT RESET IN TERMINAL AND ALSO I CAN NOT TYPE SETUP .PIXHAKW Garbage IN TERMINAL PLS HELP.
1 PROBLEM

2.PROBLEM
the artificial horizon moves in relation to the mode

problem with pixhawk

Hi, have you calibrated the accelerometer ?
Have you done a compass calibration?
If you tilt the copter to the Right, the artificial horizon tilts to the Left.

1 Like

I have the same problem. It presents me “error compass variance” alert. I have made the calibration in different spaces, in the office, in the park, in open space but always the same result. I have the
compass oriented like the pixhawk but I do not know what parameter to put in ‘compass_orient’. These are set to zero.
I appreciate your help

Don’t put any parameter in compass orient. The default condition will worlk if you have the module pointed in the same direction as the FC. This was the point being made in the previous posts. Disable all but the primary compass on the compass setup page by unchecking the “use this compass” box(s).

I have already disabled the other compasses, I have only left the main compass (External). But I still have the message “error compass variance” when I turn north and east