The aircraft crossed a fence
The armed aircraft crossed a fence, and the line names which: “Max Alt fence breached”, “Circle and Polygon fences breached”. Max Alt: the height above home reached FENCE_ALT_MAX. Circle: the distance from home reached FENCE_RADIUS. Polygon: it left an inclusion area, or entered an exclusion area, drawn in the ground station. Min Alt: it sank to FENCE_ALT_MIN. What the aircraft does next is set by FENCE_ACTION. After a breach ArduPilot puts a second line 20 m farther on (100 m for a plane's circle) and acts again if that is crossed too.
What to do, most likely first
The limit is tighter than the flight needed; the defaults are 100 m up and 300 m out.
CheckCompare
FENCE_ALT_MAXandFENCE_RADIUSwith the height and distance of the flight you planned. Every waypoint of a mission must lie inside the fence too.FixLet the fence action finish and land. Before the next take-off set the limits for the flight you plan, with room to spare. Do not widen a fence in the air to silence it.
Wind or speed carried the aircraft over: it could not stop or turn within the margin.
CheckIn the log, look at the speed and the track just before the message.
FixFly slower near the edge and plan routes farther inside the fence.
The position or height estimate jumped (a GPS glitch, a drifting barometer), and the aircraft only appeared to cross.
CheckIn the log the position steps sideways or the height changes with no stick input to match, and GPS or EKF messages appear around the same time.
FixTreat it as a sensor problem: look up the GPS or EKF messages that came with it.
Home is not where you took off, so the circle is centred somewhere else.
CheckLook at the home icon on the map, in the ground station or in the log.
FixCheck where home is before every take-off; reboot at the take-off place if it is wrong.
A change of flight mode during a breach gives 10 s in which the fence does not act again (“Manual recovery started”). “Fence breach cleared” follows when the aircraft is back inside.
Parameters to look at
| Parameter | What it is |
|---|---|
FENCE_ACTION | Fence Action |
FENCE_TYPE | Fence Type |
FENCE_ALT_MAX | Fence Maximum Altitude |
FENCE_RADIUS | Circular Fence Radius |
FENCE_ALT_MIN | Fence Minimum Altitude |
FENCE_MARGIN | Fence Margin |
Where to do it:Failsafe ExplainerSetup & Tuning Guide