In the previous article, we explained the implementation of GPS and INS integration. In this article, which is FC16, we will cover RTK-GPS (Real Time Kinematic GPS). While standard GNSS accuracy is 1–3m, RTK is a technology that achieves cm-level accuracy and is being rapidly adopted for precision landing, surveying, and agricultural applications.
Operating Principle of RTK
Standard GNSS calculates position based on the flight time of signals from satellites (code ranging). The accuracy limit of code ranging is determined by signal bandwidth and noise, with 1–3m being the practical upper limit.
RTK significantly improves accuracy by adding carrier phase ranging. The wavelength of the GPS L1 signal is approximately 19cm, and by measuring the phase, a resolution of about 1/100th of the wavelength (a few mm) can be obtained.
The challenge with carrier phase ranging is Integer Ambiguity. While the phase can be measured in the range of 0 to 2π, the number of integer wavelengths (cycles) from the satellite is unknown. RTK determines (Fixes) this integer by having a base station (known position) and a rover (drone) observe the same satellites and calculating the difference between them (double difference).
The state where integer ambiguity is determined is called RTK Fix, achieving horizontal accuracy of 0.01m+1ppm and vertical accuracy of 0.02m+1ppm. The state where it is not determined is RTK Float, with horizontal accuracy of about 0.1–0.5m.
Double differencing cancels out atmospheric delays (ionospheric/tropospheric), satellite orbit errors, and receiver clock errors. The closer the base station and rover are (usually within 30km), the better these errors are canceled, improving accuracy.
u-blox F9P Configuration
The F9P is the current standard module for RTK support, and its integration with ArduPilot is the most advanced.
Key specifications of the F9P include support for GPS/GLONASS/Galileo/BeiDou, RTK Fix accuracy of 0.01m+1ppm CEP, Float accuracy of 0.1m CEP, a maximum update rate of 20Hz (RTK mode), up to 184 concurrent reception channels, and support for UBX/NMEA/RTCM protocols.
The SparkFun GPS-RTK2 (equipped with ZED-F9P) is easily accessible as an evaluation board, and configuration procedures are well-documented in the official ArduPilot documentation. The Ardusimple simpleRTK2B is also a pre-wired option for industrial use.
For F9P connection, connect UART1 to the ArduPilot GPS port and set the baud rate to 115200 or 230400. UART2 is the second port for receiving RTCM correction data from the base station; in a Moving Baseline configuration, connect the UART1 of the base F9P to the UART2 of the rover F9P.
The F9P USB port is used for configuration changes via u-center. If ArduPilot's GPS_AUTO_CONFIG is enabled, ArduPilot will automatically send optimal settings at startup. Since manual settings in u-center may conflict with ArduPilot's automatic configuration, perform them after disabling the automatic configuration.
RTCM Protocol and Message Types
RTCM is the standard protocol for RTK correction data. RTCM SC-104 version 3 is the current standard, which the u-blox F9P supports.
We will organize the main types of RTCM messages.
RTCM 1001/1002/1003/1004 are GPS observation data. 1001 is basic, 1002 is extended C/A, and 1004 is full (L1+L2) observation. The F9P recommends RTCM 1074 (GPS MSM4).
RTCM 1005 is the base station antenna coordinates (ARP). The absolute position of the base station is transmitted here. The rover calculates its relative position based on these coordinates.
RTCM 1077/1087/1097/1127 are the respective constellation versions of MSM (Multiple Signal Messages). MSM4 (1074/1084/1094/1124) is the full observation data for GPS/GLONASS/Galileo/BeiDou and is the standard message set for multi-constellation RTK.
RTCM 1230 is the GLONASS Code-Phase Biases, which must be transmitted when using GLONASS.
A common configuration is to set the transmission rate for RTCM 1005 to 0.1–1 Hz (since coordinates do not change, a low rate is sufficient) and to transmit MSM messages at 1 Hz. Sending all messages at a high rate will saturate the UART bandwidth.
Ground Reference Station Configuration: Fixed Base
This section explains the configuration of a fixed-installation reference station.
For physical placement, connect a GNSS antenna (a surveying-grade multi-band antenna is ideal) installed on a building rooftop or an open area to the F9P. Precisely survey and record the ARP (Antenna Reference Point) coordinates of the antenna.
The F9P's SURVEY_IN mode is used when antenna coordinates are unknown. It estimates its own position based on observations over a set time (minimum 60 seconds to several hours). Accuracy depends on the observation time; longer durations improve accuracy. For industrial applications, precise coordinates (cm-level accuracy) obtained through prior surveying are recommended.
There are two types of delivery paths for RTCM corrections: wired and wireless.
Wired connection involves connecting directly from the reference station to the drone's flight controller via UART or USB. Since this is limited by the distance the aircraft can take off, it is suitable for precision work within a range of a few meters to several tens of meters.
NTRIP (Networked Transport of RTCM via Internet Protocol) is a protocol for distributing reference station RTCM corrections over the internet. You can set up an NTRIP caster server or use public NTRIP services such as the Geospatial Information Authority of Japan (GSI) or CORSNET to receive correction data. ArduPilot's Mission Planner has a built-in NTRIP client that can forward internet-based correction data to the flight controller via MAVLink.
MAVLink RTCM Injection (GPS_INJECT_TO) is the transfer of RTCM correction data from the GCS to the flight controller. GPS_INJECT_TO=0 sends to all GPS ports, 1 to GPS1 only, and 2 to GPS2 only.
Moving Baseline: Yaw Estimation
Moving Baseline using two F9Ps enables yaw estimation using only GPS, without a compass.
The configuration involves mounting two F9Ps and GNSS antennas on the aircraft. One acts as the Base (GPS2) and the other as the Rover (GPS1), and the aircraft's yaw angle is calculated from the vector from the Base to the Rover.
In ArduPilot, the settings are GPS_TYPE=17 (Rover F9P) and GPS_TYPE2=18 (Base F9P). Enable Moving Baseline with GPS_MB1_TYPE=1.
The baseline length (distance between antennas) directly affects yaw accuracy. The approximate formula for yaw accuracy is:
σ_yaw ≈ σ_pos / L × (180/π) [deg]
σ_pos is the RTK Float accuracy (approx. 0.1 m), and L is the baseline length. For L=30 cm:
σ_yaw ≈ 0.1/0.3 × 57.3 ≈ 19 degrees
This is an approximation for the RTK Float state; for RTK Fix:
σ_yaw ≈ 0.01/0.3 × 57.3 ≈ 1.9 degrees
With RTK Fix and L=1 m, an accuracy of 0.57 degrees can be achieved. A practical baseline length for industrial applications is 30 cm to 2 m, determined by the balance between aircraft size and accuracy requirements.
Place the antennas either at the front and back or on the left and right sides of the airframe. The vector formed by the front-to-back placement determines the heading of the airframe. Mount the antennas at a high position to prevent mutual signal shielding, and keep them away from the flight controller (FC) and metal structures.
For EKF3 settings, set GPS_AUTO_SWITCH=2 to dedicate GPS2 to yaw estimation, and set COMPASS_USE=0 to disable the compass. This is a practical solution for compass-free design in large aircraft where compass interference is severe.
Practical Accuracy Verification
This section explains the procedure for practically verifying the accuracy of RTK-GPS.
For static accuracy verification, fix the airframe to the ground and acquire the F9P position log while in RTK Fix mode. If the standard deviation of GPS.Lat/Lng is approximately 0.01–0.02m horizontally and 0.02–0.05m vertically, it meets the RTK Fix specifications.
Evaluate the impact of multipath using FFT analysis of the static log. Regular fluctuations at specific frequencies indicate time-varying multipath, which requires a review of the antenna placement.
Dynamic accuracy verification involves comparison with surveying-grade GNSS or a precision laser tracker. Fly a known path and compare the F9P log with the survey results. Calculate the statistics of the horizontal RTZ (Along/Cross Track) error to determine the CEP value.
The RTK Fix rate is the time ratio of GPS.Status=6 (RTK Fix). A rate of 80% or higher in an outdoor open-sky environment is considered good. Since the fixed rate decreases in urban areas, evaluate the overall system effectiveness by combining the Fix rate and Float accuracy.
ArduPilot RTK-Related Logs
The log messages used to confirm RTK operation are organized below.
GPS.Status=3 indicates GPS 3D Fix, 4 indicates DGPS Fix, 5 indicates RTK Float, and 6 indicates RTK Fix. Check the transition of these values in the Flight Data logs.
GPS.HAcc (Horizontal Accuracy Estimate) and GPS.VAcc (Vertical Accuracy Estimate) are accuracy estimates output by u-blox. In RTK Fix, these are typically HAcc < 0.02m and VAcc < 0.05m. Since the EKF uses these values for the R matrix, the switching between RTK Fix and Float affects EKF behavior.
GPS.RtcmNumFrag (RTCM fragment count) indicates the arrival status of RTCM messages. If RTCM transmission is interrupted, the system will degrade to RTK Float or Single within a few seconds, making it important to monitor the RTCM arrival rate.
NKF4.SP (Position Innovation) should decrease in value upon switching to RTK Fix. If SP remains large even after RTK Fix, adjustment of EKF3_GPS_DELAY_MS or setting the antenna position offset (GPS_POS1_X/Y/Z) is required.
GPS_POS_OFFSET Settings
If the GPS antenna is located away from the center of gravity of the FC, offset correction is necessary.
GPS_POS1_X, GPS_POS1_Y, and GPS_POS1_Z are the offsets of the GPS1 antenna relative to the FC (in NED direction, in meters). For example, if the GPS antenna is placed 20cm in front of the FC:
GPS_POS1_X=0.20, GPS_POS1_Y=0.00, GPS_POS1_Z=0.00
EKF3 uses this offset to correct the GPS observation values to the center of gravity of the FC. When RTK accuracy reaches the centimeter level, this offset must also be set with centimeter-level precision to be effective.
The lever-arm effect of the antenna occurs when the GPS antenna moves in an arc as the airframe changes attitude, and that velocity component is mixed into the GPS velocity observation. EKF3 automatically performs lever-arm correction using the GPS_POS1 offset and attitude estimation.
Points to note for field operations
We will organize the design considerations for the practical operation of RTK-GPS.
The availability of NTRIP services depends on internet connectivity. In mountainous areas or at sea where signals do not reach, it is necessary to set up a fixed base station in advance.
RTK initialization time takes from a few seconds to several minutes until the Fixed rate increases. If RTK accuracy is required for precision landing or automatic takeoff, incorporate a warm-up time before takeoff into the design.
RTK accuracy degrades as the distance between the base station and the rover increases. Based on actual experience, accuracy is 1-2 cm at 10 km and 5-10 cm at 50 km. For long-distance missions, utilizing an NTRIP network is practical.
In multipath environments (urban areas, around buildings), the RTK Fix rate and the duration of the Fixed state decrease. Increasing the antenna elevation mask setting (GPS_MIN_ELEV) to exclude low-quality satellites is effective.
Summary
RTK-GPS achieves centimeter-level position estimation through carrier-phase ranging and RTCM corrections from a base station. The u-blox F9P has a proven track record with ArduPilot, and Fixed Base + NTRIP or yaw-free GPS-INS integration using Moving Baseline are practical design choices. Accuracy verification is performed by evaluating GPS.Status and GPS.HAcc logs, checking NKF4.SP innovations, and measuring the standard deviation of static logs. The GPS_POS1 offset setting is essential to leverage RTK accuracy. In the next installment, FC17, we will explain the implementation and sensor design for Precision Landing.
