← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The fence's altitude limits contradict each other

Stops itMissions, fence, rally points, terrain

What ArduPilot says:

With the fence on, ArduPilot checks the two altitude limits, even when no altitude fence is selected in FENCE_TYPE. FENCE_ALT_MAX (100 m by default) must not be negative. FENCE_ALT_MIN (-10 m by default) must not be below -100. The maximum must not be below the minimum. And the gap between them must be more than twice FENCE_MARGIN (2 m by default), otherwise “FENCE_MARGIN too big” is shown: no height would be left to fly in.

What to do, most likely first

  1. One of the two limits was typed with the wrong sign or in the wrong unit.

    CheckRead both. FENCE_ALT_MAX is metres above home and positive. FENCE_ALT_MIN is metres above home too, and is negative only when flying below the take-off point is allowed.

    FixSet FENCE_ALT_MAX to the ceiling you want (the documented range is 10 to 1000 m) and FENCE_ALT_MIN below it.

  2. The two limits are closer together than twice FENCE_MARGIN.

    CheckSubtract: FENCE_ALT_MAX minus FENCE_ALT_MIN must be more than 2 × FENCE_MARGIN, which is more than 4 m with the default margin.

    FixMove the limits apart. Lower FENCE_MARGIN only if the aircraft really can stop within that distance.

  3. The fence parameters came from another aircraft's file.

    FixSet FENCE_ALT_MAX, FENCE_ALT_MIN and FENCE_MARGIN for this aircraft and this field, rather than keeping somebody else's.

Both limits are heights above home, where the aircraft was armed.

Parameters to look at

ParameterWhat it is
FENCE_ALT_MAXFence Maximum Altitude
FENCE_ALT_MINFence Minimum Altitude
FENCE_MARGINFence Margin
FENCE_TYPEFence Type
The code that sends it

Invalid FENCE_ALT_MIN value

libraries/AC_Fence/AC_Fence.cpp AC_Fence::pre_arm_check_alt() · Open in ArduPilot Copter-4.7.1

FENCE_ALT_MAX < FENCE_ALT_MIN

libraries/AC_Fence/AC_Fence.cpp AC_Fence::pre_arm_check() · Open in ArduPilot Copter-4.7.1

FENCE_MARGIN too big

libraries/AC_Fence/AC_Fence.cpp AC_Fence::pre_arm_check() · Open in ArduPilot Copter-4.7.1

Invalid FENCE_ALT_MAX value

libraries/AC_Fence/AC_Fence.cpp AC_Fence::pre_arm_check_alt() · Open in ArduPilot Copter-4.7.1

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