EKF Failsafe right after AUTO Takeoff

Hi everyone,

We had this very weird behavior: the drone triggered an EKF Failsafe followed by a GPS Glitch message right after the takeoff. This happened with this specific drone, out of 8 other similar units. In discussion with the Ardupilot team, they asked about the compass calibration and suggested some values from a magfit calculation (thank you so much @peterbarker !).

After adjusting the compass parameters with the suggested values, we had a second event in a row, identical to the first one. With the log from the second event, Peter noted the follwing:

your DroneCAN GPS units - what sort of GPS are they? They seem to be lying terribly about their accuracies, and not agreeing with each other on where your vehicle is! Your config has them 60cm apart, but the position they’re feeding back into the vehicle is ~5m apart! They are claiming to have 1.3m/1.6m accuracies. The EKF doesn’t mind getting noisy data - but if you systematically lie to it as these GPS units are doing it does tend to get annoyed. Could you supply some photos of your GPS install, please? Do you have any transmitters co-located with the GPSs?

We do have 4G antennas nearby, but this is alse pretty much the standard for the rest of the fleet and also very similar to other models we have. The GPSs are mounted on the lateral arms of an hexa.

Then I asked if mechanical vibrations could be the cause, and Peter replied:

When the vehicle starts to move it does rapidly start to get errors. This could be vibration, but I discussed that with tridge earlier and we thought that unlikely (you need very high vibration frequecies to annoy the clock crystals on the GPS units for it to happen AFAIK).

One of the GPS units has it’s cable running too close to the main power cable (where all the drone’s electrical current is flowing), and indeed the GPS cable extension could have the shielding compromise. In fact, you can see the offset before takeoff and the latitude value diverging exactly when the current raises:

So basically I see three hypothesis:

  • Very high frequency vibration on this specific drone, caused by some difference on the airframe;
  • Nasty interference from the main power cables;
  • Faulty GPS hardware (one of them).

Our next step will be either re-routing the GPS cable or using a soft mount to compare. If anybody can see any other clue in the attached logs, please let me know.


  • Cube Orange
  • Dual Here3 using blend configuration
  • 25kg MTOW Hexa - T-MOTOR MN705 propulsion

Important notes

  • The drone did some successful flights before, but ErSc values were always higher than usual;
  • The GPS receivers are hardmounted, but just like the rest of the fleet;
  • The satellite number was normal for both receivers;
  • The position the GPS receivers are feeding back into the vehicle is ~5m apart! They are claiming to have 1.3m/1.6m accuracies;
  • 00022.BIN is the log from the previous normal takeoff;
  • 00023.BIN is the first event;
  • 00024.BIN is the second event.



Hi, Did you try:

  1. switch GPS units (which is good)
  2. any log about vibration, which suggest abnormal?
  3. how about parameters corrected by magfit, still issue existed?
  4. Any pictures about GPS mount,which is as you said might close to power cable or other antenna etc.???

Edit: Please also check GPS - How it Works — Copter documentation to eliminate those interference issues.

Hi @lida2003 !

Thanks for replying this post.

Regarding your questions:

1- will do it tomorrow. But firstly I’ll check if there is a lat/long discrepancy before the flight, like on the two last takeoff attempts.

2- vibration is within the normal but, as I have a soft mount for the cube, I’m adding a second one, hardmounted, just to compare with another drone later on. Basically I’ll check if there’s an actual huge difference regarding vibrations.

3- Yes, it happened before and after magfit calibration.

4- In the picture attached you can see the GPS mount and the black LTE antenna inside. But this is the very same setup we’ve been using and we neved had such anomaly. I don’t have a picture from the inside right now, but the batteries cables pass close to one of the GPS cables. But still, I still think that if the current was related we would get this issue before.

Well, There is some info for you to consider.

  1. Shielding is good for GPS unit, just take a look at this youtube video about RF knowledge.

I have tested it and bring 18 stars to 23 stars. 四轴飞控DIY Mark4 - 优化后续二-CSDN博客

  1. We will have good signal strength when antenna’s electric beam angle faceing the transmitter or receiver.
  • GPS antenna(white) is good, as it’s facing the sky (transmitting signal from GPS satellites)
  • LTE antenna(black), I’m NOT sure.

most LTE base station is on top of the building or iron tower, which might be 50~100meters???. If we fly above this height I think it’s better to facing downward.It depends on flight mission and RF electric beam angle of the antenna.

LTE module I think you are using for video and telemetry. It sends quite a lot of RF signals.
Make sure: 1) LTE signal frequecny is not close to GPS signal, check this GPS - How it Works — Copter documentation for GPS signal frequency; 2) Just do NOT faceing the LTE antenna toward GPS antenna, which I think will cause interference.

  1. I checked Cube Orange , which has one magnetometer on board. So please check if there is any powerline close to the magmeter.

And you can try to use an external magmeter (Most GPS with I2C has the magmeter), and disable onboard magmeter. Verify if the on board magmeter cause the issue.

Just FYI.

Do you have a link to those logs?
CAN connections are meant to more immune to outside interference, and suits long cable runs.
If both GPS units are connected directly to the Cube CAN sockets, and you’ve got a telem radio too, there can be power +5v issues. Are you running at least on of the GPS units from a 5v BEC?

Hi @xfacta

I cannot believe I posted it without the link… :upside_down_face:
My bad!

Both are using the CAN socket form the Hex Kore board, but there isn’t a telem radio.


Update on the subject

Firstly I checked all the logs to make sure that nothing changed between log 0022 to log 0023. Nothing changed, and flight 0022 was just a few hundred meters straight and then SmartRTL. After landing, drone was rebooted, a new takeoff was commanded and log 0023 happened.

Yesterday at the test field we ran the following tests:

  1. Not changing anything and just arming without propellers and not attempting to takeoff. (Log 0026)
    Result: lat/long deviation between the GPS receivers at the same level as logs 0023 and 0024.

  2. Re-routing the left GPS cable (which was running close to the main power cable) and just arming without propellers and not attempting to takeoff. (Log 0027)
    Result: Apparently (not conclusive), lat/long deviation between the GPS receivers a little bit better than logs 0023 and 0024.

  3. With the new cable routing, attempt and actual takeoff.
    Result: Same behavior, EKF failsafe. (Log 0029). As soon as current increase, GPS[0].Lat diverges from GPS[1].Lat.

4- Replacing the GPS[0] with a new unit. (log 0031).
Result: Normal takeoff.

5- Adding full payload.
Result: Normal takeoff.


Next step: keep flying it in our test field to check with any similar behavior repeats.

What scares me: The GPS receiver didn’t give us much clue that something was wrong, besides higher ErSc values. The EKF Failsafe straight after takeoff could be extremely dangerous as the wind can take the drone about 5 meters from the original position before landing again.

No pre-arm was showed. What could we do to prevent such dangerous situation?

It seems GPS[0] had bad EMC characteristics.


Both GPS receivers were opened for a deeper investigation.

What we found:

  • Compared to the other unit, the “bad” had a battery with less tension 1.7V against 2.4V. After we let them charge to 2.7V, the “bad” unit discharged much faster than the other.
  • We found a damaged capacitor (C5) inside the bad unit (see below). It is unlikely to be damaged during the opening process, because of its position.


  • We resoldered this capacitor and put it back to fly in our test field. This time, it flew normally and the log was showing a normally healthy GPS. Maybe the C5 was exactly some kind of frequency filter.

So, apparently we found the direct cause, but still need to understand why/how this capacitor was damaged like that.