Integrating a 77 GHz Altitude Radar with ArduPilot & PX4: Technical Guide

LintechTT > Articles  > Integrating a 77 GHz Altitude Radar with ArduPilot & PX4: Technical Guide

Integrating a 77 GHz Altitude Radar with ArduPilot & PX4: Technical Guide

R Radar Integration Notes

Technical Guide · MAVLink v2.0

UAV Sensing · Step-by-Step Tutorial

Integrating a 77 GHz Altitude Radar with ArduPilot & PX4

Wiring, parameter setup, live altitude monitoring, and remote radar configuration — verified on a Pixhawk 6C with both ArduPilot and PX4.

Protocol · MAVLink v2.0
ArduPilot · Copter 4.6.3
PX4 · 1.16.1
Ground stations · Mission Planner 1.3.81 / QGroundControl 5.0.8

This guide walks through the complete setup of a downward-facing 77 GHz radar for UAV ranging and altitude hold. It covers hardware mounting and wiring, the exact parameter values for both major open-source autopilot stacks, how to watch live rangefinder data during flight, and how to read and change the radar’s own parameters through the flight controller’s MAVLink forwarding. Every step is illustrated with screenshots from the tested setup.

At a glance

Flight controllerPixhawk 6C
Avionics interfaceUART (TELEM2)
Data protocolMAVLink v2.0
Serial baud rate115200 bit/s
MountingLevel, antenna down
Power5 V FC output / 12 V recommended

01Overview & what you’ll need

The radar is primarily used for UAV ranging and altitude holding. It emits data over the UAV’s MAVLink v2.0 link and is supported natively by the open-source ArduPilot and PX4 platforms — no proprietary bridge is required.

Autopilot Pixhawk 6C
Serial port TELEM2
ArduPilot Copter 4.6.3
PX4 1.16.1
Mission Planner 1.3.81
QGroundControl 5.0.8

Why this guide is structured this way

Sections 3 and 4 are independent — follow the one matching your autopilot. Section 5 applies to both, and explains how to reach the radar itself once MAVLink forwarding is enabled.

02Mounting & wiring

2.1 Mounting

For altitude-hold operation the radar must be installed horizontally beneath the UAV, with the antenna facing straight down. Route the cable toward the front or rear of the airframe.

Correct horizontal mounting of the altitude radar under a UAV
Mount the radar level, with the antenna facing downward.

Important

Nothing may obstruct the area below the antenna. Even a small obstruction in the beam path will degrade detection performance.

2.2 Wiring

The example below uses a Hex X7 flight controller. Connect the radar’s serial port to the TELEM2 port on the autopilot. Connect RX to TX and TX to RX, and bond the radar ground to the aircraft ground.

Radar connector pinout
Port layout on the Hex X7 flight controller.
TELEM2 pinout: 5V+, TX, RX, CTS, RTS, GND
TELEM2 pinout: 5V+, TX, RX, CTS, RTS, GND.
Radar wiring diagram to flight controller
Radar connector: VCC (5–24 V DC), GND, TX, RX.
Radar wired to the X7 flight controller TELEM2 port
Radar wired to TELEM2: RX/TX crossed, grounds tied together.

Power note

The flight controller outputs 5 V by default. Once the radar is connected, that rail may become unstable. A separate 12 V supply for the radar is recommended — refer to the radar product manual for the exact voltage range.

03ArduPilot setup

Hardware Pixhawk 6C
Firmware ArduPilot Copter 4.6.3
GCS Mission Planner 1.3.81
Port TELEM2

3.1 Ground station parameter setup

  1. Open Mission Planner and connect the flight controller with a USB cable to a port on the computer.On the desktop, open This PC → Manage to identify the COM port currently in use.
    Checking the connected COM port in Windows Device Management
    Find the COM port assigned to the flight controller.
  2. Click the upper-right corner of Mission Planner, select that port and set the baud rate to 115200, then connect.
    Mission Planner port and baud rate configuration
    Port selection and 115200 baud rate.
  3. Open the Config / Tuning tab and locate the full parameter tree. Use the search box on the right to find the parameters you want to edit.
    Full parameter tree in Mission Planner
    Full parameter tree and search field.
  4. Search for the keywords in Tables 1 and 2 — for example RNGFND or SERIAL — and set each parameter to the listed value.
    Table 1. Interface parameter configuration
    Parameter Value Description
    SERIAL2_BAUD 115 Baud rate 115200 bit/s
    SERIAL2_PROTOCOL 2 MAVLink v2 is preferred
    SERIAL2_OPTIONS 1024 Setting this bit disables MAVLink routing and reduces telemetry bandwidth usage. To modify radar parameters remotely, set this bit to 0.
    Table 2. Altitude radar parameter configuration
    Parameter Value Description
    RNGFND1_TYPE 10 Set to MAVLink protocol
    RNGFND1_MIN_CM 50 Minimum detection distance used by the flight controller, in cm
    RNGFND1_ORIENT 25 Set the radar orientation to Down
    Editing interface parameters in Mission Planner
    Interface parameters written in Mission Planner.
    Editing rangefinder parameters in Mission Planner
    Rangefinder parameters written in Mission Planner.
  5. Power-cycle the flight controller so all parameters take effect.

Two easy-to-miss details

The values above are recommended starting points and may be adjusted to your application. RNGFND1_MAX_CM and RNGFND1_MIN_CM do not limit the radar’s physical measurement range. RNGFND1_ADDR must match the radar’s sensor ID, otherwise no data will be received.

3.2 Altitude-hold tuning

  1. Connect the ground station and select the flight controller device.
    Selecting the flight controller device in Mission Planner
    Connected flight controller in Mission Planner.
  2. At the bottom of the Flight Data main screen, click Debug to open the real-time rangefinder data window.
    Opening the real-time rangefinder debug view
    Real-time rangefinder data window.
  3. Double-click that window to open the display this dialog, then check rangefinder1.
    Selecting rangefinder1 in the display dialog
    Enable the rangefinder1 data item.
  4. Return to the real-time window. Using the lower-right controls or the debug view, you can now observe the UAV’s flight altitude live.
    Live altitude readings from the radar in Mission Planner
    Live altitude data reported by the radar.

04PX4 setup

Hardware Pixhawk 6C
Firmware PX4 1.16.1
GCS QGroundControl 5.0.8
Port TELEM2

4.1 Ground station parameter configuration

  1. Open QGroundControl and wait for it to connect to the vehicle automatically.
    QGroundControl connected to the vehicle
    QGroundControl connected over TELEM2.
  2. Open Vehicle Configuration, find the full parameter tree and use the search field on the right to look up the parameters to change.
    Vehicle Configuration parameter tree in QGroundControl
    Vehicle Configuration and full parameter tree.
  3. With the parameters open, use the search box at the upper left. Search for a keyword such as MAVLink and modify the parameters listed in Table 3.
    Searching parameters in QGroundControl
    Search and edit parameters.
    Table 3. PX4 parameter configuration
    Parameter Value Description
    MAV_0_CONFIG TELEM 2 Select the serial port. Restart the flight controller after setting it, otherwise the serial baud-rate parameter cannot be found.
    MAV_0_FORWARD 0 Setting this bit disables MAVLink routing and reduces telemetry bandwidth usage. To modify radar parameters remotely, set this bit to 1.
    SER_TEL2_BAUD 115200 8N1 Serial baud rate
  4. Apply the basic parameters from Table 3 as shown, then power-cycle the flight controller.
    Setting MAV_0_CONFIG in QGroundControl
    Assign the MAVLink instance to TELEM2.
    Setting serial baud rate in QGroundControl
    Set the serial baud rate.

Restart after changing the port

MAV_0_CONFIG must be written and the flight controller rebooted before SER_TEL2_BAUD becomes available. If the baud-rate parameter seems to be missing, this is almost always the cause.

4.2 Altitude-hold tuning & live data

  1. Select the flight controller device, then click Analyze Tools to open that view.
    Analyze Tools menu in QGroundControl
    Analyze Tools menu.
    Analyze Tools screen in QGroundControl
    Analyze Tools screen.
  2. Open the DISTANCE_SENSOR message in MAVLink Inspector to see the UAV’s flight altitude.
    DISTANCE_SENSOR message in MAVLink Inspector
    Live altitude in the DISTANCE_SENSOR message.

Displaying radar data on the main screen

  1. Add a display item by opening the display-configuration screen.
    Adding a display item in QGroundControl
    Add a new display item.

    Double-click a parameter to reconfigure that display item.

    Reconfiguring a display item
    Select the item to reconfigure.
    Display item configuration dialog
    Display item configuration.
  2. Change the data type to DistanceSensor.
    Selecting DistanceSensor as displayed data type
    Select the DistanceSensor data type.
  3. Change the orientation to the ground-facing radar. If the radar firmware faces down, leaving a different orientation selected will show no data — the GCS setting must match the radar’s firmware orientation.
    Radar orientation values
    Value Orientation
    RotationNode Forward
    RotationYaw90 Left
    RotationYaw180 Backward
    RotationYaw270 Right
    RotationPitch90 Up
    RotationPitch270 Down
    Choosing the radar orientation in QGroundControl
    Choose the orientation that matches the radar firmware.
  4. The radar data is now shown on the main screen.
    Radar altitude displayed on the QGroundControl main screen
    Altitude data on the main flight view.

05Reading & editing radar parameters

The radar’s own parameters are reachable through the flight controller’s MAVLink forwarding. You must enable forwarding first, connect to the radar as a separate MAVLink device, make the change, and then disable forwarding again.

5.1 Using Mission Planner

Connect to Mission Planner

Connect the flight controller to the computer over USB, open Mission Planner (MP), select the matching COM port and connect.

Mission Planner COM port connection
Connect Mission Planner to the flight controller.

Enable forwarding on the flight controller

Turn on forwarding for the serial port linking the radar and flight controller — otherwise the radar’s parameters cannot be reached. Using TELEM2 as the example: set SERIAL2_OPTIONS to 0, write the parameter, and reboot the flight controller.

Setting SERIAL2_OPTIONS to zero in Mission Planner
Set SERIAL2_OPTIONS = 0 and reboot.

Connect to the radar

For a radar with SYSID:50, select the radar entry COM6-50-GENERIC when connecting in Mission Planner.

Selecting the radar COM port in Mission Planner
Select the radar device.
Mission Planner successfully connected to the radar
Successful connection to the radar.

Read the radar parameters

Open Config / Tuning and find the full parameter tree. If the radar’s parameters do not appear, click Refresh Params on the right.

Radar parameters shown in Mission Planner
Radar parameters after refresh.
Radar parameter reference
Parameter Description
RADAR_SYSID Radar system ID
RADAR_SENSORID Sensor ID
RADAR_ORIENT Radar orientation (0: Forward, 4: Backward, 6: Left, 2: Right, 24: Up, 25: Down)

Modify a radar parameter

As an example, change RADAR_SYSID to 51; other parameters follow the same procedure.

  1. Enter RADAR_SYSID 51.
    Entering a new RADAR_SYSID value
    Enter the new value.
  2. Write the parameter.
    Writing radar parameters in Mission Planner
    Write the parameters.
  3. Reboot the radar for the change to take effect.

Disable flight-controller forwarding

After editing, set SERIAL2_OPTIONS back to 1024 to turn forwarding off. Setting this bit disables MAVLink routing and reduces telemetry bandwidth usage.

5.2 Using QGroundControl

Connect to the ground station

Open QGroundControl and wait until the automatic connection completes.

QGroundControl automatic connection
Wait for the automatic connection.

Enable forwarding on the flight controller

Enable forwarding on the serial port linking the radar and flight controller. With TELEM2 as the example, set MAV_0_FORWARD to 1, write the parameter, and reboot the flight controller.

Forwarding-related parameters
Parameter Value Description
MAV_0_CONFIG TELEM 2 Select the serial port. Restart the flight controller after setting it, otherwise the serial baud-rate parameter cannot be found.
MAV_0_FORWARD 1 Setting this bit disables MAVLink routing and reduces telemetry bandwidth usage. To modify radar parameters remotely, set this bit to 1.
SER_TEL2_BAUD 115200 8N1 Configure the baud rate of the serial port connecting the radar to the flight controller
Setting MAV_0_FORWARD to one in QGroundControl
Set MAV_0_FORWARD = 1 and reboot.

Select the radar and open its parameters

For a radar with SYSID 50, select that vehicle, then click Vehicle Configuration to open the parameter screen.

Selecting the radar vehicle in QGroundControl
Select the radar device.
Radar selected in QGroundControl
Radar connection established.
Vehicle Configuration tab in QGroundControl
Open Vehicle Configuration.

Read the radar parameters

Click the parameters on the left to see all radar parameters.

Radar parameter list in QGroundControl
Radar parameters in QGroundControl.
Radar parameter reference
Parameter Description
RADAR_SYSID Radar system ID
RADAR_SENSORID Sensor ID
RADAR_ORIENT Radar orientation (0: Forward, 4: Backward, 6: Left, 2: Right, 24: Up, 25: Down)

Modify a radar parameter

Again using RADAR_SYSID → 51 as the example:

  1. Enter RADAR_SYSID 51.
    Entering RADAR_SYSID 51 in QGroundControl
    Enter the new value.
  2. Save the parameter.
    Saving radar parameters in QGroundControl
    Save the parameters.
  3. Reboot the radar for the change to take effect.

Disable flight-controller forwarding

Set MAV_0_FORWARD back to 0 when finished. Setting this bit disables MAVLink routing and reduces telemetry bandwidth usage.

06Troubleshooting / FAQ

Why is no altitude data showing up after wiring everything correctly?

Check three things in order: (1) the radar antenna faces down and is unobstructed; (2) RX and TX are crossed and the ground is connected; (3) the orientation setting matches the radar firmware — in QGroundControl, a ground-facing radar requires the Down orientation. A mismatch there suppresses data entirely.

Why can’t I find the serial baud-rate parameter in PX4?

Write MAV_0_CONFIG = TELEM 2 first and reboot the flight controller. SER_TEL2_BAUD only appears after that restart.

Why can’t I read or change the radar’s own parameters?

Enable MAVLink forwarding on the serial link first: SERIAL2_OPTIONS = 0 on ArduPilot, or MAV_0_FORWARD = 1 on PX4. Write the value and reboot the flight controller, then connect to the radar as a separate device. Remember to turn forwarding off again after editing.

Do the MIN / MAX CM parameters limit the radar’s real measuring range?

No. RNGFND1_MAX_CM and RNGFND1_MIN_CM only constrain what the flight controller uses; they do not change the radar’s physical measurement capability. They are recommended values and can be adjusted to your needs.

The flight controller’s 5 V rail seems unstable — what should I do?

Power the radar separately. The flight controller supplies 5 V by default, and adding the radar can destabilize that rail. A separate 12 V supply is recommended; confirm the allowed voltage range in the radar product manual before wiring.

What happens if the radar sensor ID doesn’t match?

RNGFND1_ADDR must be consistent with the radar’s sensor ID. If it is not, the flight controller will not receive any data from the radar even though the serial link is healthy.

07Setup checklist

  • Radar mounted level under the UAV, antenna facing down, beam path unobstructed.
  • Serial wiring: radar TX → FC RX, radar RX → FC TX, common ground; separate 12 V supply if needed.
  • ArduPilot: SERIAL2_BAUD=115, SERIAL2_PROTOCOL=2, SERIAL2_OPTIONS=1024, RNGFND1_TYPE=10, RNGFND1_ORIENT=25; flight controller rebooted.
  • PX4: MAV_0_CONFIG=TELEM 2, MAV_0_FORWARD=0, SER_TEL2_BAUD=115200 8N1; flight controller rebooted after the port assignment.
  • Live altitude verified in Mission Planner’s rangefinder window or QGroundControl’s MAVLink Inspector / main-screen display.
  • Radar parameters changed only with forwarding enabled, then forwarding disabled again and radar rebooted.

With these steps completed, the radar is ready to provide reliable height data for altitude hold on either ArduPilot or PX4.

Based on the MAVLink open-protocol debugging manual · Verified with ArduPilot Copter 4.6.3 and PX4 1.16.1