# DJI - Lost GPS mid-flight?



## adamhiram (Jul 2, 2019)

I'm curious if anyone with a DJI drone has ever completely lost GPS signal while in the air.  This question is probably better suited to a drone forum, but I figured a bunch of members here have them as well and might have some insight.

I had a recent flight with my Spark (with remote) where it had a good GPS signal and no compass issues prior to taking off.  I took it up to just shy of 400', flew about 1/4 mile away, maintaining line of sight, then flew back.  However while almost directly overhead and down to about 100', it suddenly lost the GPS signal and started drifting at full speed until it was completely out of sight over the trees.  Since landing wasn't an option and I lost track of its position, I opted to just take it higher until it found a signal, which it did.  I used RTH and was able to land safely.

I'm not sure what was stranger, suddenly losing a GPS signal mid-flight with no nearby obstacles, or the fact that its immediate reaction to losing GPS is to take off as fast as possible in a random direction.  I'm just glad it was over the tree line or it definitely would have been lost.

Has anyone else experienced this before?  I did some research before posting and it doesn't seem all that uncommon, but the only semi-useful information I was able to find was to do a thorough pre-flight check before taking off, which doesn't really help once it is in the air.


----------



## tirediron (Jul 2, 2019)

I've not had it in clear sky; I do find that it's receiver isn't great and if it's sheltered by high land, trees, etc it can be sketchy.  How many satellites were in view at the time?


----------



## 480sparky (Jul 2, 2019)

I use GPS Test Plus to verify actual GPS signal and number of satellites in view.


----------



## smoke665 (Jul 2, 2019)

So maybe Farmers Insurance "Hit & Drone" commercial may have merit? LOL




 

Was there heavy cloud cover that day that might have blocked the satellite signal? Im curious when you say you went up and got a signal. Its not somehow reading GPS location off cell towers?


----------



## 480sparky (Jul 2, 2019)

smoke665 said:


> .......... Its not somehow reading GPS location off cell towers?



GPS doesn't come from cell towers.  It comes from satellites in orbit.


----------



## adamhiram (Jul 2, 2019)

tirediron said:


> I've not had it in clear sky; I do find that it's receiver isn't great and if it's sheltered by high land, trees, etc it can be sketchy.


Clear skies and zero obstructions - my area used to be flat farmland before suburban sprawl took over.



tirediron said:


> How many satellites were in view at the time?


While I couldn't tell you how many satellites were in view at the moment it lost signal and took off at full speed, it usually sets a GPS home point at around 9 satellites, and can see 11-13 before taking off if I wait 1-2 minutes.  I just validated this and got similar results - home point set at 9, 13 visible after 1 minute, 15 visible at a height of 100'.

I found this explanation from DJI's forum to be pretty insightful - apparently you need at least 6 satellites from the same constellation to set a home point, and the app doesn't differentiate between them when it shows the count.  I suppose that means when I need 9 to set a home point, I am likely seeing 6 from one constellation and 3 from another.  It would be nice if I could see at least 14 before taking off, guaranteeing at least 7 from the same constellation, but I usually top out at around 11-13 on the ground.



> Your P4 pro receives signals from US GPS satellites and Russian Glonass satellites.
> To get a good GPS location fix, it needs to have 6 satellites of one kind.
> The display in the app does not show the split between US and Russian satellites.
> If you had 5+5 = 10 sats you would not have had an acceptable GPS position fix.
> ...


----------



## smoke665 (Jul 2, 2019)

480sparky said:


> smoke665 said:
> 
> 
> > .......... Its not somehow reading GPS location off cell towers?
> ...



I realize that but unless your view to the sky is impaired, you don't loose satellite signal, and going "up" doesn't increase the signal strength, unless your coming out from under an obstruction. Since he said it was "above" the trees, I would assume he had a clear view of the sky.


----------



## adamhiram (Jul 2, 2019)

smoke665 said:


> ... going "up" doesn't increase the signal strength, unless your coming out from under an obstruction. Since he said it was "above" the trees, I would assume he had a clear view of the sky.


Agreed.  It still doesn't make much sense to me why it would take off at full speed when it lost GPS signal, although this doesn't seem to be uncommon.  I assume it had a weak signal and was drifting as a result, although I would expect it to stop compensating for the (very low) wind velocity once it switched to ATTI mode.


----------



## smoke665 (Jul 2, 2019)

adamhiram said:


> Agreed. It still doesn't make much sense to me why it would take off at full speed when it lost GPS signal, although this doesn't seem to be uncommon.



And this is what scares the crap out of me with Amazon's plan to deliver packages via drones. I thought they were typical drones like the hobbyists fly. Then I saw one on stage next to a speaker for Amazon. Those things are bigger than a man!!!!! Of course I'm sure theirs are much more sophisticated, and would NEVER just take off at full speed, just because they lost GPS signal, or have electrical or magnetic interference that would cause them lose track of where they are....wink, wink.


----------



## adamhiram (Jul 2, 2019)

smoke665 said:


> Of course I'm sure theirs are much more sophisticated


I was very glad to see that at a lower level, there is a lot more logic involved in determining GPS signal health than simply counting satellites.

Also from DJI's forums:


> It is not only the number of sats seen at a given moment at a given locaten, it is also, among other requirements, the distribution of the sats in orbit. (GDOP)
> Therefore, as an example, DJI's Mobile SDK does not look at the number of satellites. DJI is using it's own GPS health (0-5) as a reference:
> 
> Have a look:
> ...



That being said, I am still at a loss how losing GPS lock got translated into "fly at maximum speed in a random direction"!


----------



## adamhiram (Jul 3, 2019)

I should have taken my own advice and just checked the DJI forums first.  I'm glad to have learned more about how GPS health works, that was definitely informative.  The fly-away issue seems to be pretty common, especially with earlier firmware versions, although it appears to be ongoing.  I found dozens of threads from people experiencing this issue, some of which were dismissed as user error, others were validated with flight logs and provided a replacement by DJI.  Hopefully this doesn't happen again, but I will say for the 3rd time that immediately taking off at full speed in a random direction is a very bizarre response to losing a GPS signal - at worst, I would expect it to switch to ATTI mode and possibly drift with the wind.  Thanks for the responses!


----------



## adamhiram (Jul 9, 2019)

After doing more research, I think I may have found the culprit.  It never occurred to me that rebar in my concrete patio might be interfering with the compass, since it never has before, and on most of it, it doesn't.  But in one specific spot, which happens to be the place I have frequently been taking off from, there is very strong magnetic interference.  Simply moving it over a few feet solved this issue, and strangely enough, I can't find any other areas on the patio with any significant interference except that one specific spot.  Here is the compass interference measurement before and after moving the aircraft.





And for reference, this is what the flight record looks like when this error happens.  I'm not sure what I'm supposed to do when it tells me to restart the aircraft at a height of 169', but I do know it's pretty absurd logic to automatically take off at 31mpg in Atti mode with no GPS, compass, or IMU.  If anything, it should have hovered in place and drifted with the wind.


----------



## adamhiram (Aug 29, 2019)

Okay, this seriously can't be normal.

Pre-flight check

IMU accelerometer and gyroscope bias excellent (very low)
Compass interference excellent (very low)
GPS locked with 10 satellites
At a height of 391 ft directly overhead, and only 1:20 into my flight, these errors start popping up:

Compass Error.  Exit P-GPS Mode
IMU heading error.  Please restart the aircraft.
Weak GPS signal.  Positional accuracy may be compromised.  Please fly with caution.
Abnormal compass function or GPS signal detected.  Aircraft switched to ATTI mode.
By the time I was able to regain control, it had drifted off course by a quarter mile with no line of sight.  I was able to navigate back by finding familiar landmarks in the live feed and quickly landed, but again, this seems highly unusual.  I have had countless other flights in the same area with no issues, this just seems to happen from time to time.


----------



## adamhiram (Aug 30, 2019)

Well, I finally found an explanation, and unfortunately it appears to be a common bug with the Spark with no real fix.  It sounds like the best course of action is to try to avoid strong cross-winds, switch to sport mode if it starts to fly away, and look for familiar landmarks to fly back in ATTI mode if the aircraft is still in range.  Explanation here.



> The bottom line and the result, no matter what was the real internal cause (which, I guess, we will never know because DJI will not tell us) is the same: cross-wind -> elliptical path -> yaw error -> other confusion and errors -> ATTI -> fly-away.


----------



## TreeofLifeStairs (Oct 22, 2020)

adamhiram said:


> Well, I finally found an explanation, and unfortunately it appears to be a common bug with the Spark with no real fix.  It sounds like the best course of action is to try to avoid strong cross-winds, switch to sport mode if it starts to fly away, and look for familiar landmarks to fly back in ATTI mode if the aircraft is still in range.  Explanation here.
> 
> 
> 
> > The bottom line and the result, no matter what was the real internal cause (which, I guess, we will never know because DJI will not tell us) is the same: cross-wind -> elliptical path -> yaw error -> other confusion and errors -> ATTI -> fly-away.



Does this seem to be an isolated problem with just the spark or all dji drones?


----------



## adamhiram (Oct 22, 2020)

TreeofLifeStairs said:


> Does this seem to be an isolated problem with just the spark or all dji drones?


This thread is from last year, so my memory might be a bit rusty.  I recall this issue occurring occasionally with other models as well, but seeming to be a more common issue with the Spark.  My solution is to do a more thorough pre-flight check now, including checking all sensors ahead of time and waiting for more GPS signals, and keeping a close eye on the wind speed.  Rather than assuming I can overpower the wind to return, I just don't fly in heavy crosswinds.  I don't know for certain that that was ultimately the culprit, but I also haven't had a flyaway since.


----------

