"Inconsistent compasses" error with APM Planner 2

I seem to face the problem already discussed here for other ground control software, but I’m afraid, I can’t solve it for APM Planner 2.

I’m trying to get ready for the first flight with APM Planner 2 (version 2.0.23-rc3, but I tried also latest stable versions) and Navio2. I seem to successfully calibrate Compass, Accelerometer and RC, but finally receive an error “Incosistent compasses” or less frequently “Compass not healthy”, which prevents arming.

I have Navio2 board installed pointing to the left side of the drone (as I assume, it’s 270°), so while calibrating the compass I choose “APM with On-Board Compass” and “Yaw 270” in the “Orientation” box, both “Enable” and “Auto declination” boxes are on, Degrees 0, Minutes 0, and then I push Live Calibration button and follow the instructions.

Typical results are (last my try):

Compass 1:
x: -248.102 y:-489.233 z:-18.286 dev id: 6
Compass 2:
x: 85.540 y: 134.495 z:-365.672 dev id: 9

Sometimes it even displays the position right at “Flight Data” screen (i.e. north direction is right and turning the vehicle changes it to right side), but the message persists. I also try to restart APM Planner 2 between checks and calibration tries, but it doesn’t really help. Tried to do it either by Wi-Fi or Ethernet. I tried also “Compass Motor Calibration” button, but it changes offsets to something absolutely insane.

Could you please help me with calibrating compasses in this exact ground control software, APM Planner 2? Maybe, I miss something in the configuration or calibration. Or the only option is to use it with Mission Planner?

You need to set AHRS_ORIENTATION instead of doing the misleadingly similar thing in Compass tab. The latter is intended to be used with external compasses that are not aligned to the vehicle.

Thank you for this advice. Could you please just suggest, where to set it in APM Planner 2? I’m trying to find this parameter in “Config/Tuning” - “Standard Params”, but there’s nothing like this.
I also tried to apply this advice, but can’t find these parameters there as well. Maybe it’s set somewhere in the config on Raspberry itself?

You need to select Advanced mode somewhere in the menus above. After that you can get access to all parameters. You can then change the above mentioned one in the new tabs that will pop.

Oh, thanks, didn’t notice it.

Removing compass orientation and adjusting AHRS_ORIENTATION and then re-calibration of compass and accelerometer haven’t helped yet, but I’ll try to remove all the settings and perform everything from the beginning. At least, the position on the “Flight Data” screen is right again.

By the way, are those settings mentioned in the link I’ve posted, namely:

COMPASS_EXTERN2 = 1
COMPASS_ORIENT2 = 8
COMPASS_PRIMARY = 1
COMPASS_USER2 = 1

are they necessary for the latest firmware version, or AHRS_ORIENTATION is enough to make it work?

AFAIK, AHRS_ORIENTATION should suffice. I’ll look into it more thoroughly tomorrow.

Well, I’ve redone all the calibration after clearing the settings in /var/APM on board and manually specifying AHRS_ORIENTATION, the position displayed is again almost right, but the check still fails. I disabled it for now, but hopefully there’s an option to have it set up correctly.

@george.staroselskiy do you have any updates on this? Unfortunately, skipping compass check doesn’t really help, as the copter tries to turn on its back right on taking off.

hi 4ernov,
usually instant flip on takeoff should indicate wrong AHRS_Orienatation (your Orientation should be 6 - if i’m correct ) or recheck if your motors are installed in the right order on Navio2 ( http://ardupilot.org/copter/_images/MOTORS_QuadX_QuadPlus.jpg )!

Thank you for suggestion! You’re right, my AHRS_ORIENTATION, following @george.staroselskiy’s advice, is 6 now (Yaw270), but the motors are indeed swapped, CW with CCW installed in the opposite order to the picture and documentation. Have missed it completely. Will reinstall it and check once again. Thank you!

another thing:
compass motor calibration with “insane values” does indicate you might have problems with the distance between navio2 and esc’s or wires to the motors; you might want to recheck if you can increase the distance(s) - you will get cleaner compass values; (although stabilize mode shouldn’t be affected by that)

Yes, I just meant, the calibration results were so, that the “Flight Data” screen shown as if the drone was moving. The values during calibration were quite limited, as far, as I remember.

Unfortunately, configuring motors to have right rotation directions also didn’t help — drone still flips on its back (through the right side). Will try to disable compass at all.

first disable any orientation set for the compass (but keep the AHRS_6);
check if the compass faces north if you point the front of your copter to the north;
now recheck again if the front right propeller is connected to RCOUT 1 on Navio2 and turns CCW and so on…;
(do not install the props dependant from the Navio2 - install it dependant from the true front of your copter)
TAKE CARE Motors SPIN!!:
to confirm the right position go to motortest ( Inital setup in MissionPlanner) test each motor with 5-10% for 1 second!

Thank you for the detailed checklist. Everything seems to be right as you’ve described, but yes, I’ve cleared the settings from var/APM and am performing all the checks and calibrations again.

Thanks for the suggestion on the motortest, didn’t know about it!

@panky, thanks again for your suggestions, I’ve checked all the things from the beginning and also finally reinstalled Navio2 to direct position and less close to ESC and power distribution board. Compasses are both still useless (tried calibrating in Mission Planner and APM Planner 2, but they print either “PreArm: Compass calibrated requires reboot” or, after the reboot, “PreArm: Compass not healthy”), but I seem to have sorted out the motor positions and now drone at least takes off normally.

But another issue appeared — I found, that Roll and Pitch seem to be swapped, as my controls of left/right and back/ahead are swapped. AHRS_ORIENTATION is reset to None now. I guess, it’s motors position again, so my question is: is there any mapping between A, B, C and D motors in Mission Planner’s Motor test and 1, 2, 3, 4? The first scheme I used was: A -> 1 (front right), B -> 3 (front left), C -> 2 (rear left), D -> 4 (rear right). The drone was quite stable after the take off, but, as I said, Roll and Pitch were swapped. After that I tried another scheme, which seemed to be right: A -> 1 (front right), B -> 2 (rear left), C -> 3 (front left), D -> 4. But it’s getting quite uncontrollable in this case, in that I can’t feel, what my Pitch and Roll controls do. So what connection scheme is right and what mapping of it is to Mission Planner’s Motor test?

motortest: i assume it’s the same as with hexacopter: A should be front right and continue clockwise to B (right back) to C (left back) to D (left front); so if you press test all in sequence it should start right front and go clockwise around;

to switch roll and pitch you should switch the channels on your transmitter! (for example switch channel 3 and 4)

Thank you for clarifying on motortest! Will try this scheme.

No, I mean, the mapping on RC Calibration page is right, so Roll on RC controls Roll on the page, and so do Pitch, I just meant, in flight the did incorrect things (Pitch make it fly left or right and Roll make it fly back and forth).

Well, finally, it flies and responses to control normally. Still don’t use compasses, but otherwise the setup seems to be fine.

1 Like

post a pic of your copter/navio;
check if compass values change significantly when motors spin!
try to remove all metal stuff/cables near to your navio;