RTL causes Fly Away with range sensor I2C Maxbotix - safety warning

Just want to share my bad experience with this. Use a Pixracer with Arducopter 3.5.5 attached an I2C Maxbotix range sensor. Did some testing wiht Terrain follow option activated and had some problems certainly due to the low distance reported by the range sensor. Here’s the still opened issue: https://github.com/ArduPilot/ardupilot/issues/4697
In these tests, I had 2 times the same problem, drone fly away on RTL triggered by low battery. I was lucky to get the drone back on manual command.
So I decided to stop Terrain follow mode. Jus did a manual flight with RNGFND_TYPE=2 and setting RNGFND_MAX_CM=250. Was working great, until the battery failsafe was triggered. At this point, the drone climbs and exceed the geofence limit that was set to 30 meters, until batteries were empty, crash…
In my point of view, this is a really troublesome problem, that should be corrected ASAP. I’m sure there is a lot of other priorities set in the defined milestones, but this bug is deceitful, because causing a fly away triggered by a FAILSAFE situation.
So my question is: How could it be possible for a drone to fly out of the Geofence limits? If RTL couldn’t work as it should work, this is a problem that has to be reported.

Hello,
Sorry for your problems… could you share a dataflash log in order to track down what was wrong ?

Maybe a printscreen of the errors?

So if someone could give me matching errors related to
Subsys 6 ECode 1
Subsys 9 ECode 1
Subsys 3 ECode 4

it could help me.

The error codes are defined in ArduCopter/defines.h.

They are:

  • Subsystem 6: Battery failsafe
    ** Error code 1: Failsafe triggered

  • Subsystem 9: Geofence failsafe
    ** Error code 1: Failsafe triggered

  • Subsystem 3: Compass
    ** Error code 4: General error code: unhealthy

thanks, but I still not understand why these errors cause a fly away.

this I can understand, gps and compass had been totally destroyed in crash…

hello, something is wrong with your zip … I cannot parse the log …

oh, try this one: https://www.dropbox.com/s/svk3fkln7wuf0tx/2018-03-06%2010-46-12.bin?dl=0
FYI I have an authorisation from the related administration to fly in this area…

I didn’t found problem on param nor logs. I try to replicate the problem on SITL with your param but didn’t append. I am not sure that the terrain follow was activated … Did you have the mission file you used ?
It could be something with the relative and terrain altitude.
I notice that you get a high baurate connexion on serial5, did you had a companion computer connected ?

it was not, this is a different flight. In this flight, not an Auto flight, I just have the Maxbotix sensor activated and the incident occurs when the RTL was auto triggered because of battery failsafe…

Hi, tried again to connect this sensor, I have a warning that I never had before, mayby it can help:
"PreArm: RTL_ALT above rangefinder max range"
RTL_ALT by default is 1500, didn’t touch it and RGNFND_MAX_CM is 700. But with this sensor, I indicate 300 or even 200.
Using 3.5.5, never had this message before, just uninstall and reinstall this sensor.