← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

A fence was crossed (ERR FAILSAFE_FENCE)

Act nowFailsafes and emergencies in flight

What ArduPilot says:

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

  1. 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_RADIUS and FENCE_ALT_MAX with 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.

  2. 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.

  3. 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

ParameterWhat it is
FENCE_ENABLEFence enable/disable
FENCE_TYPEFence Type
FENCE_ACTIONFence Action
FENCE_ALT_MAXFence Maximum Altitude
FENCE_RADIUSCircular Fence Radius
FENCE_MARGINFence Margin
FENCE_OPTIONSFence options

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer