Plane Flyaway recovery: RTL loiter then flew away


What happened?
Why did this plane just head away after RCloss-failsafe=RTL-loiter-(land?)? it just headed away and climbed aggressively. i >thought< that the geofence turned it around and brought it back into range for RC reconnect, but the flight log shows that wasn’t the case - which means geofence would not have prevented a flyaway if the RC was out of range or inoperable. i finally got the RC to reconnect (apparently from viewing flight log) and, it appears, that i switched to “mission” on the RC xmitter that caused a turn around and return.
my intent was for the plane to rtl, loiter, then auto land.
Any help is appreciated.
Flight log
edit: observation: The GF_ACTION was set to Return. The plane was in Return Mode when it crossed the fence. Hence, no effect on the plane as it continued in Return mode in the wrong direction. It wasn’t until a mode switch to “mission” (from RC xmitter switch) toggled the mode that the plane was able to be recovered. This is certainly problematic, as geofence RTL should be an absolute failsafe to prevent flyaways. until then, i may consider changing the GF_ACTION to “hold” (“mission” is not available), but that is worriesome in the case of the RC xmitter dying and the plane running out of battery/gas in a hold.
…AND…it is interesting that the toggle to “mission” mode recovered it, THEN the mode was toggled to RTL mode (RC xmitter?) and the return is returning to the correct home.
it almost looks like the plane headed for the last incomplete waypoint in the mission, after the RTL loiter, but was locked into a heading hold and could not turn when it arrived. somehow it resorted to climbing like an angel to try and resolve.


well, tried again a few flights. no joy. the plane will return, loiter, and proceed to fly away, completely ignoring any landing or mission points. a couple times the plane headed off in a completely ambiguous direction until i reconnected RCx and toggled to mission mode. when i tested with return type set to find mission and land, and recovered the flyaway with the RCx (mission), it headed straight for the landing point ignoring any mission points - of course this meant it would land off the runway and i had to abort into stabilize mode.
changing the GF_ACTION to hold worked. the fence halted the flyaway and the plane circled until an RC xmitter command instructed it otherwise
unless someone can point to something im doing wrong, this is a serious bug.
another thought… would the fact that home is near the land waypoint be a problem? is the FC considering “land” already accomplished as it circles “home” nearby?
1.8.2 stable pixhack v5


OK, i found something that works but, be warned, the aforementioned config still causes flyaways. my plane did not get away because it is slow. if i had a faster plane or MC, it may have been lost.
I found that putting a FIXED WING LANDING PATTERN in the mission FROM the preset “pattern” icon/button, then setting the RTL mode to head for the landing 1st (NOT head directly to home), causes the plane to go to that loiter-to-land pattern and subsequently line up to the runway and land correctly. That preset FW landing pattern is very nice - much nicer than basic waypoint and land. thx to the coder!
However, even with this fw landing pattern in place and working as such, if i tried to use the RTL mode that just flies directly to home, with the RTL conditions set to loiter for (time) 45sec then land, the plane would loiter for 45secs, then proceed to fly away in the direction of its choice. BUG!
i have yet to test without a landing point at all, to see if the 3rd RTL mode will actually fly backwards to the takeoff point to land.
…Edit: now i have tested the 'RTL by way of takeoff waypoints"… the plane follows the waypoints back to the “takeoff” WP, the climbs to RTL altitude and returns to the loiter over home for the prescribed time (45sec in this case), then proceeds to fly away.
yep, --> any time the plane RTL’s to home to loiter, then has to land by that same RTL command, it will fly away.


I’ll take a look at what’s going on here. Realistically the generic landing after return without a planned mission landing is rarely going to be a safe thing to do.


@1Gump I’ve opened an issue on github to investigate.


First note - the geofence action did work, but simply put you back into return mode.


thx @dagar for the response.
I was unaware that the “pattern” menu had a planned mission landing. i thought i had the landing ‘planned’ because i had entered a waypoint (not loiter) followed by a “land” waypoint from the basic waypoint menu. i had already flow various missions successfully, including landing, with this strategy. i had no idea my “land” waypoint was different than the “pattern” one. I only discovered this when testing failsafe scenarios.
I’m confused… when i looked at the geofence crossing (log), nothing happens until a little past the fence, then the mode turns to “mission” with a corresponding RC mode trigger. the plane only turns around when this happens. also, just before this mode change, the RC stick inputs begin showing various level changes (without affect because of RTL mode), which is correct as i was trying hard to get RC control again (including flipping mode switches).
… after the plane does a 180 turn in mission mode, it travels a little while towards a waypoint, but goes back to RTL mode, then Stabilize mode. I’ll have to look again, but i think all those latter “modes”, including RTL, were initiated by the RC xmitter mode switch?
…in other words, I’m not seeing how geofence worked. geofence was set up to RTL when violated. why did the plane only turn when “mission” mode activated? and how did geofence initiate mission mode?
also, keep in mind that NEITHER landing setups worked after the RTL to home. if the plane came home 1st, the next thing it did was fly away, regardless of landing type.