Is there a way to suppress EKF failsafe on launch

Hello everyone! I’ve been bumbling my way through learning ardupilot with a few crashes along the way and have come across something I can’t quite work out how to solve (but hasn’t caused a crash yet, I’m looking ahead, this must mean learning).

I have a plane that needs quite a high-g launcher to get it going. I’m manually flying it at the moment and on launch it is getting an EKF failsafe that starts when launch initialises and lasts for about 5 seconds post initial acceleration.

I’d love to be able to auto launch this and then go on with a mission, but I can’t seem to find any way to suppress the EKF failsafe on launch. I see how I can suppress it completely, but I don’t want to remove that safety barrier.

Is there a setting or trick I am missing?

Thanks in advance!

In order to be able to offer useful help, it is necessary that you provide a log (.bin) from which conclusions can be drawn.

Hello all, I hate having dead end threads so figured I would put something in here that other people may find useful.

Lano, sorry for not replying to you, this was a general case question, not a specific issue that would be solved by putting my logs up.

I was hoping that there might have been a parameter level trick to get around this, but I cannot seem to find anything and talking to others off the forum my fears are confirmed. I believe this problem could be solved through minor modifications to the code and compiling a bespoke version. My thoughts on how I would solve this are as follows:

  1. Change EKF_CHECK_ITERATIONS_MAX in the Arduplane ekf_check.cpp file from 10 (1 second) to something like 30 or 50 (3 or 5 seconds). It would be nice if this was a configuration parameter rather than a hard coded variable, but it is what it is. Note, this would dramatically reduce the systems sensitivity to EKF failures and may result in a vehicle ending up a significant distance off course prior to activating the fail safe. Call it the brute force method.
  2. ekf_check.cpp already includes a “ekf_check_disabled” parameter that appears to be only applicable to quadplanes (I’m not sure why, and if anyone wants to weigh-in I’d love to be educated). It would be fairly simple and elegant to include some code that suppresses the EKF failsafe when in a launch mode such as:
    if (plane.flight_stage == AP_FixedWing::FlightStage::TAKEOFF ) {
    ekf_check_disabled = true;
    }

You could even go as far as combining both methods and have a relaxed EKF (say 5 seconds with FS_EKF_THRESH == 1) during launch and then tighten it back up (1 second, FS_EKF_THRESH == 0.8 || 0.6) for all other stages of flight.

There are probably a myriad of other ways. Both these ways could have a user facing parameter to enable their use without having to compile custom versions. If I trusted my coding ability I might have a crack at it.

In conclusion, it appears relatively simple to do, but not as simple as a user parameter.

I hope that provokes some thoughts.

A Lua script might work in lieu of custom firmware. You might test whether the EKF parameters in question require reboot to take effect. If the effect is immediate, scripting is the easiest way to manage this.

G’day Yuri, thanks for the reply.

I had tossed around an idea to write a script that would auto transition from some kind of DCM based dead reckoning mode (eg Acro[locking] with throttle at 100%) to AUTO when the failsafe clears; or if the failsafe doesn’t clear a few seconds after launch to kill the engine and terminate the launch.

I haven’t had to implement it yet, but it’s something I will consider.