Search...
Menu

Setup and Getting Started (px4)

Firmware Upgrade

Upgrade the RTK firmware (version number: 1.8.79). This firmware is compatible with the dual antenna orientation function of the PX4 firmware Download Link.

Prerequisites: The flight controller is running PX4 firmware, using CAN communication, and the flight controller has successfully recognized the RTK module.

Method: Copy the downloaded new RTK firmware (binary file with .BIN suffix) to the root directory of the flight controller's TF card, insert the TF card into the flight controller, and power on the flight controller. The flight controller will automatically transfer the firmware to the RTK module and upgrade it.

Check whether the upgrade is successful: remove the memory card and you can see a file named XX.bin in the ufw directory of the TF card.

Firmware upgrade note: Using this method to upgrade the firmware will cause all CAN communication devices connected to the flight controller (such as onepmu) to be flashed with the same firmware. You need to unplug or power off the CAN devices connected to the flight controller. After the firmware upgrade is complete, remove the memory card and delete the RTK firmware.

CAN communication

Flight control parameter configuration

UAVCAN_ENABLE is set to Sensors Automatic Config

UAVCAN_SUB_GPS set enable (default parameter)

EKF2_GPS_CTRL Check Dua antenna heading to enable dual antenna heading data)

EKF2_GPS_POS_X  Y/Z sets the X, Y, and Z axis offsets of the main antenna relative to the center of gravity of the aircraft (unit: meter). For example, if the antenna is fixed 25cm to the right of the center of gravity of the drone, configure EKF2_GPS_POS_Y to 0.25

Note:

The X-axis typically refers to the longitudinal axis of the drone, i.e., the forward and backward direction of the vehicle. When the main antenna is located forward of the drone's center of gravity, this parameter should be entered as a positive value.

The Y axis typically refers to the lateral axis of the drone, i.e., the left-right direction of the vehicle. If the main antenna is located to the right of the drone's center of gravity, this parameter should be entered as a positive value.

The Z axis typically refers to the vertical axis of the drone, that is, the up-down direction of the vehicle. If the main antenna is below the center of gravity of the drone, then this parameter should be entered as a positive value.

UAVCAN_PUB_RTCMSet to enable

UAVCAN_PUB_MBDSet to enable

After the settings are completed, restart the flight controller. If the flight controller does not recognize the RTK module, please check whether the memory card is connected to the flight controller.

Configuring RTK direction deviation

Find the RTK device node in the parameter table, Component X (X is the node ID), and set GPS_YAW_OFFSET as shown below.

If the main antenna is in front of the aircraft, the value is 0; the value increases in a clockwise direction. When the main antenna is on the right side of the aircraft and the slave antenna is on the left, the offset value is set to 90 degrees.

RTK heading confirmation

Check the yaw data of GPS_RAW_INT in the mavlink monitoring interface of Analyze Tools. If it is consistent with the flight controller's nose pointing, it means that the GPS_YAW_OFFSET setting is correct.

The hdg value of GLOBAL_POSITION_INT and the yaw value of GPS_RAW_INT are consistent, indicating the aircraft heading using RTK direction data.

 

Serial communication

Note: If you need to use UART communication, the flight controller must use firmware version 1.16.0 or above.

Use Uprecise software to configure the serial port output, connect the RTK to the computer, select the port point to connect, the baud rate will be automatically identified, and the raw data will be displayed.

 

Select to enter the following command in the configuration command line and press the ENTER key on the keyboard:

FRESET
GPGGA COM2 0.2 
GPRMC COM2 0.2
AGRICA COM2 0.2
GPGSA COM2 0.2
GPGST COM2 0.2
UNIHEADINGA COM2 0.2
config com2 230400
Saveconfig

Configuration Notes:

  1. You can only enter one line at a time. Press ENTER to enter another line.
  2. After sending FRESET, the port baud rate is reset to the default 115200. If the original connection baud rate is 230400, the port baud rate must be selected back to 115200 after sending FRESET.
  3. After sending [config com2 230400], the original data will be temporarily garbled. Click Disconnect, select the baud rate 230400 and then click Connect. Finally, enter Saveconfig

Flight controller parameter configuration

The UART interface of OneRTK UM982 is connected to the GPS2 interface of the flight controller. The interface definition is shown in the figure

GPS_1_config    Set to gps2
GPS_1_PROTOCOL Set to NMEA (generic)
SER_GPS2_BAUD Set to 230400 8N1
EKF2_GPS_CTRL  Set to 15, check Dual antenna heading
GPS_YAW_OFFSET  If the primary antenna is forward, set the heading offset to 0. Angles increase clockwise, so if the primary (master) antenna is on the right side of the vehicle and the secondary (slave) antenna is on the left, set the offset to 90 degrees.
EKF2_GPS_P_NOISE     Set to 1
EKF2_GPS_V_NOISE     Set to 0.6

Previous
Setup and Getting Started (ardupilot)
Next
Building a Ground RTK Base Station
Last modified: 2025-08-05Powered by