EKF Lane Switch - problem with yaw

Yesterday on the RTL leg of a 20 minute photo map mission, my copter experienced two EKF lane switches related to yaw.

Tremendous kudos to the dev team for making such robust software that got my copter back home safely! (The copter even landed with one leg back on the square meter takeoff pad!)

Before putting this copter back in the air again, I’d like to try to identify - and rectify - what might have caused this problem.

From my novice vantage, I can’t tell if there might have been a hardware issue such as a loose wire on the CAN connection to my Here3, or a glitch in the Arducopter firmware.

If someone could please take a look at the log and help me learn what might have happened?

Many thanks!

I don’t know if there is any connection with it, but here is our experience and a few related threads.

1 Like

Your compass calibration is a bit off. It is easy to fix though using the magfit tool: Refining Calibration Parameters using a Flight Log — Copter documentation
Here is a fit using magfit on your log:

The tool gives the following parameters you should apply:


just save those to a file then load the parameters using MissionPlanner or another GCS.

Thank you Andrew for taking a look at my incident. I really appreciate it!

Yes, I’d been negligent on not keeping my compass calibration up to date. My bad.

I have five of follow up questions - I’ll put two in separate posts for the benefit of future searches.

  1. Is there anything in the data that suggests a causal relationship with the lane change? I had flown 3 identical missions within the past week and had not experienced an EKF3 incident.

  2. I stopped using MagFit when the “compass learn” feature was released. Can you comment please on the relative merits of these two compass calibration approaches?

  3. I had read the article you referenced about a year ago - it’s a good time for a review - thanks for reminding me about it. The video about MagFit is the only thing I’ve ever seen that documents MagFit. There are a host of possible options on MagFit. Can you direct me to where to find information on how to select the correct options?

  4. As I understand the EKF3 Lane Change capability, it occurs when an EKF error reaches a limit. There are parameters that adjust this sensitivity - but I can’t find anything to graph in the log file that shows the EKF error values over the course of a flight. It would be helpful to track this - particularly after an experience such as mine.

  5. Am I correct in recalling that it was one of your students who created and programmed the EKF3 lane change capability? Well done! The docs list the parameters involved in EKF3 lane change, but there is no advice or direction on how to set them. Mine are still at default settings. It would be helpful if there were instructions on when and how to adjust these parameters.

Once again - thank you for your kind assistance!

BTW - studying up on the “soft iron effect” that the COMPASS_DIA_xxx parameters address, I found this helpful article: