A fence was crossed (ERR FAILSAFE_FENCE)
What ArduPilot says:
- ERR FAILSAFE_FENCE (Subsys 9)
The code is the sum of the fences crossed: 1 the ceiling (FENCE_ALT_MAX), 2 the circle around home (FENCE_RADIUS), 4 a polygon or circle drawn in the ground station, 8 the floor; so 3 is ceiling and circle together. A line such as “Max Alt fence breached” names them too. The copter does what FENCE_ACTION says: 0 report only, 1 RTL or else Land, 2 Land, 3 SmartRTL or else RTL or else Land, 4 Brake or else Land, 5 SmartRTL or else Land. More than 100 m beyond the fence it lands whatever the action. On the ground it disarms.
What to do, most likely first
The fence is smaller than the flight you meant to make: by default the circle is 300 m and the ceiling 100 m.
CheckCompare
FENCE_RADIUSandFENCE_ALT_MAXwith the distance and height in the log at the moment of the breach.FixBefore take-off, either plan the flight inside the fence or set the fence to the area you mean to stay in.
Wind or speed carried the aircraft through the fence in a mode flown by hand.
FixTurn back earlier and keep a margin for the wind. After the fence acts you may take over by changing the flight mode.
The position or height estimate jumped (a GPS glitch, barometer drift), so the aircraft only appeared to cross.
CheckThe path in the log shows a sudden step, not a steady approach to the fence.
FixFind the cause of the jump: see the GPS, EKF or barometer messages around that time.
When you change the flight mode during a breach, the fence leaves you alone for 10 s to fly back inside, then acts again. With FENCE_OPTIONS bit 0 set, mode changes are refused until the breach is over (“in fence recovery”).
Parameters to look at
| Parameter | What it is |
|---|---|
FENCE_ENABLE | Fence enable/disable |
FENCE_TYPE | Fence Type |
FENCE_ACTION | Fence Action |
FENCE_ALT_MAX | Fence Maximum Altitude |
FENCE_RADIUS | Circular Fence Radius |
FENCE_MARGIN | Fence Margin |
FENCE_OPTIONS | Fence options |
Where to do it:Failsafe ExplainerMission Energy Check