EKF Compass Variance

I know this issue is being discussed various times and given multiple solutions. But I am facing this error in some peculiar way. Any help is much appreciated.
I have Pixhawk 2.1 Cube with here GNSS GPS in a hex-rotor using Copter-3.5.5.
I enabled two internal and one external compass. It calibrates fine but when I take off I get the variance error. I then changed the compass to only external (the here module). Again same error seconds after take off. Then changed to only internal compass and re-calibrated again but same error. The error comes 3 to 4 secs after takeoff.
It is worth mentioning that I am using this configuration and flying since 3 weeks without any such error and it came up all of sudden today. I actually got the EKF mag error on pre-arm. I searched web and came to know that it is due to bad compass calibration so I calibrated my compass again. This changed the mag value to ~500 (Acceptable). But, when I took off the copter showed compass variance error and turned upside down. I changed compass module too but same story repeated.
I even disconnected the uav connections and only calibrated flight controller (with compass and telemetry only and no escs) and then moved the flight controller with hand. I figured out that when I move the flight controller fast, it gives variance error. When I place it still or move it very slowly, the error vanishes.
The documentation says that this error is due to difference of estimated direction and compass heading but doesn’t provide a solution…!


I am having a similar error with a Crazypony Pixhawk. Did you ever find a solution?

  1. Double check if you have correct firmware for your board. I once had pixhawk 1 firmware on pixhawk 2 somehow and got these errors
  2. If you have external compass, select only one compass (the one externally mounted). If no external compass, then make sure your wiring are apart from flight controller. The magnetic effect of current affects compasses. Try using Aluminium foils if that helps.
  3. Remember that selecting more than one compass does not help reduce error. The FC still uses first compass as primary and just ignores all others.
  4. You can always reset the parameters to default and reinstall firmware. That might be last resort.
1 Like