"Arm: Waiting for Nav Checks" error + yaw drift when copter is still


When trying to arm my pixhawk with my RC controller, I get an error “Arm: Waiting for Nav Checks”.
From looking at the code this could be due to AHRS not being healthy because of an underlying EKF issue.
I’ve enabled EKF logging with LOG_REPLAY but both EKF1 and EKF2 are logging null values which seems to indicate that the EKFs haven’t started (confirmed on Mission Planner HUD where the EKF seems to be off).
Simultaneously the yaw calculated by the pixhawk behaves strangely: I rotate the copter from pointing East to pointing West, the yaw then displays 271 degrees but instead of stabilizing at 271 the yaw increases gradually to 309 over a period of 30 seconds all this while the copter is sitting still on the floor, see yaw graph below:

A couple of things that might be linked to that problem:

  • I have some metal in the frame that distorts the magnetic field but this has been taken care of by setting the soft iron parameters,
  • pixhawk setup is flipped (AHRS_ORIENTATION=8)
  • external compass is rotated by -45 degrees (COMPASS_ORIENT = 7)
  • strangely AHRS_EKF_TYPE shows up as 2 in Mission Planner but its value is “1” in the logs (I have double checked this with several reboots)

This arming issue started happening once I upgraded my pixhawk to V3.4.2 (6076bdfc) up from V3.3-dev (21ed8600)).
Log file can be downloaded here: https://drive.google.com/file/d/0B5T_8q1N9T26dnVuUDRuVUM1OVE/view

Any idea on what’s creating the problem?

Hi Clem,

Our group are facing the same problem with yours now. Have you solved that problem?
We tested every pixhawk board we have and all of them are having yaw drifting problem just as what you have shown in the fig. We thought about adding a external compass but it seems that it didn’t help in your case.

hi, one more with this inquiries… you finded the solution?

yes I solved it. Try to search “compass” in the full parameter list of Mission Planner or APM planner and increase the weight of compass in yaw. That would help with the drift problem, and if you want to have a short response time try to get into the code of EKF and tune the gain of yaw error.

ah, ok, thanks you very much… i am try

you know wath is the name of parameter to modify. thanks

@johan_esteban_perez and @Guangyi_Liu in my case the problem was that the external compass had about 10 degrees pitch angle relative to the Pixhawk board. I had to change the code in the EKF2 mag fusion file at line 777 (file is here: https://github.com/ArduPilot/ardupilot/blob/ae6df4fc0404656926683ce603fb774ee98e9d11/libraries/AP_NavEKF2/AP_NavEKF2_MagFusion.cpp )

    stateStruct.quat.to_euler(euler321.x, euler321.y, euler321.z);
    euler321 = euler321 - _ahrs->get_trim(); // <---- added this line
    predicted_yaw = euler321.z;

This is a dirty workaround, a clean way to do it would be to add a custom value to the COMPASS_ORIENT parameter. Not sure you’re having the same problem but hope that helps.