MAVLINKHUD

Overview

The LGR parameter group configures the Retractable Landing Gear management system.

ArduPilot can autonomously manage the deployment and retraction of landing gear to improve aerodynamics in flight and ensure safety during landing.

Key Concepts

1. Automatic Deployment (LGR_DEPLOY_ALT)

The landing gear will automatically deploy (descend) when the vehicle descends below this altitude (meters) above ground.

2. Automatic Retraction (LGR_RETRACT_ALT)

The landing gear will automatically retract (lift) when the vehicle climbs above this altitude after takeoff.

3. Weight on Wheels (WOW)

Some advanced airframes use a sensor (LGR_WOW_PIN) to detect when the aircraft is actually touching the ground, preventing the gear from retracting while the vehicle's weight is on it.

Parameter Breakdown

  • LGR_ENABLE: Master switch.
  • LGR_STARTUP: Behavior at boot (Deploy, Retract, or No Change).
  • LGR_OPTIONS: Bitmask for behavior (e.g., override deployment during emergency landing).

Integration Guide

  1. Pin: Map a servo output to Landing Gear (Function 29).
  2. Enable: Set LGR_ENABLE = 1.
  3. Config: Set the deploy/retract altitudes based on your operational needs.
  4. RC: Map an RC channel to Landing Gear (RC Option 29) to allow manual override.

Developer Notes

  • Library: libraries/AP_LandingGear.

LGR_DEPLOY_PIN

Default -1

LGR_DEPLOY_PIN: Chassis deployment feedback pin

Description

Pin number to use for detection of gear deployment. If set to -1, feedback is disabled.

Values

  • Range: -1 to 55 (GPIO Pin Number)
  • Default: -1 (Disabled)

Description

This parameter assigns a GPIO (General Purpose Input/Output) pin to read a limit switch or sensor that detects when the landing gear is fully deployed (down and locked).

  • Usage: Connect a microswitch or hall sensor to this pin.
  • Function: When the pin enters the state defined by LGR_DEPLOY_POL, the autopilot confirms the gear is down. This can be used to prevent landing if the gear fails to deploy.

Source Code

ardupilot/libraries/AP_LandingGear/AP_LandingGear.cpp

LGR_DEPLOY_POL

Default 0
Range 0 1

Landing Gear Deployment Polarity (LGR_DEPLOY_POL)

Description

LGR_DEPLOY_POL defines the logic of the landing gear deployment signal.

  • 0: Normal.
  • 1: Inverted.

Tuning & Behavior

  • Usage: If your landing gear retracts when it should deploy (and vice versa), toggle this parameter. This is often necessary when using different brands of electronic retracts.

LGR_ENABLE

Default 0
Range 0 1

Landing Gear Enable (LGR_ENABLE)

Description

LGR_ENABLE activates the logic for controlling retractable landing gear.

When enabled, you can control the gear manually via an auxiliary switch or allow the autopilot to handle it automatically during takeoff and landing.

  • 1: Enabled. Enables landing gear logic and makes other LGR parameters visible.
  • 0: Disabled. Landing gear system is inactive.

Tuning & Behavior

  • Default: 0.
  • Setup: You must also assign a motor output to the landing gear function by setting SERVOx_FUNCTION = 29.

LGR_OPTIONS

Bitmask
Default 3
Range 0 3

Landing Gear Options (LGR_OPTIONS)

Description

LGR_OPTIONS defines when the autopilot should move the landing gear without pilot intervention.

  • Bit 0 (1): Retract after Takeoff. Automatically pulls the gear up once a safe climb is established.
  • Bit 1 (2): Deploy during Land. Automatically lowers the gear when the aircraft begins its final approach or reaches a specific altitude.

Tuning & Behavior

  • Default: 3 (Both Auto-Retract and Auto-Deploy enabled).
  • Altitude Trigger: Use LGR_DEPLOY_ALT and LGR_RETRACT_ALT to fine-tune exactly when these actions occur.

LGR_STARTUP

Default 0
Range 0 2

Landing Gear Startup Position (LGR_STARTUP)

Description

LGR_STARTUP determines the physical position of the landing gear immediately after the flight controller boots up.

This is a safety-critical setting. If the gear defaults to "Retracted" while the drone is sitting on the ground, it could cause damage to the gimbal or airframe.

  • 0: WaitForPilotInput (Default). The gear stays exactly where it was until the pilot flips the gear switch on the transmitter.
  • 1: Retract. The gear will immediately attempt to pull up upon power-on. (Not recommended for ground starts!)
  • 2: Deploy. The gear will immediately attempt to extend upon power-on.

Tuning & Behavior

  • Recommendation: Use 0 (Wait for Input) or 2 (Deploy) for most multirotors.

LGR_WOW_PIN

Default -1
Range -1 103

Weight on Wheels (WOW) Feedback Pin (LGR_WOW_PIN)

Description

LGR_WOW_PIN tells the autopilot if the drone is physically sitting on its landing gear.

This requires a physical switch or sensor (Weight-on-Wheels / WOW) mounted on the landing gear strut. When the gear is compressed by the weight of the aircraft, the switch triggers. This provides a high-certainty "On Ground" signal that the autopilot can use for safety, such as preventing the motors from spooling up or disabling high-gain stabilization while taxiing.

Tuning & Behavior

  • -1: Disabled (Default).
  • 0-103: Physical GPIO pin number.
  • Requirement: Requires LGR_WOW_POL to be set correctly for your specific switch type (Normally Open vs Normally Closed).

LGR_WOW_POL

Default 0
Range 0 1

Weight-On-Wheels Polarity (LGR_WOW_POL)

Description

LGR_WOW_POL calibrates the autopilot for your specific Weight-On-Wheels (WOW) sensor hardware.

A WOW sensor (like a microswitch on the landing strut) tells the autopilot if the aircraft is physically supported by the ground.

  • 0: Low. Signal is 0V when there is weight on the wheels.
  • 1: High. Signal is 3.3V/5V when there is weight on the wheels.

LGR_DEPLOY_ALT: Landing gear deployment altitude

Description

Altitude where the landing gear will be deployed. This should be lower than the LGR_RETRACT_ALT. If zero, altitude is not used for deploying landing gear. Only applies when the vehicle is armed.

Values

  • Range: 0 to 1000
  • Units: m
  • Increment: 1
  • Default: 0

Description

This parameter automates landing gear deployment based on altitude.

  • Function: When the vehicle descends below this altitude (in meters above home), the landing gear will automatically deploy.
  • Safety: Useful for ensuring gear is down for landing even if the pilot forgets.
  • Constraint: Must be set lower than LGR_RETRACT_ALT (Retract Altitude) to prevent rapid toggling (hysteresis).

Source Code

ardupilot/libraries/AP_LandingGear/AP_LandingGear.cpp

LGR_RETRACT_ALT: Landing gear retract altitude

Description

Altitude where the landing gear will be retracted. This should be higher than the LGR_DEPLOY_ALT. If zero, altitude is not used for retracting landing gear. Only applies when the vehicle is armed.

Values

  • Range: 0 to 1000
  • Units: m
  • Increment: 1
  • Default: 0

Description

This parameter automates landing gear retraction based on altitude.

  • Function: When the vehicle climbs above this altitude (in meters above home), the landing gear will automatically retract.
  • Usage: Set this to a safe height (e.g., 10-20 meters) to automatically clean up the airframe after takeoff.
  • Constraint: Must be higher than LGR_DEPLOY_ALT to prevent rapid toggling.

Source Code

ardupilot/libraries/AP_LandingGear/AP_LandingGear.cpp