DIY Kinematic GPS Using RTKLIB

This is a post that has been a long time coming. Over the winter break, one of the projects I took on was to build a survey-grade GPS system that could calculate its position using either Real Time Kinematics (RTK) or Post Processed Kinematics (PPK). These technologies allow a user to achieve GPS measurements accurate to <10cm resolutions or in some cases even sub-centimeter accuracy. In comparison, a traditional GPS module found in a phone or quadcopter would get an accuracy of 2.5m at best.

How does it work?

Before we start discussing kinematics, we first need to look at how GPS systems work. To avoid a giant wall of text, I will leave you with a very well made video below which discusses how GPS works. If you already know how the GPS receiver uses trilateration to calculate its position, you can feel free to skip the video.

To get a higher accuracy than standard GPS, we need to add some sort of correction which will improve the signal. A common example of this is the Wide Area Augmentation System, or WAAS, which uses a set of surveyed base stations to correct the natural positioning drift caused by ionospheric delay. The correction signals are calculated by measuring how far the GPS base stations drift from their actual surveyed position and transmitting this signal to a geostationary satellite. The geostationary satellite then rebroadcasts this signal back to the earth’s surface on the same frequency as standard civilian L1 GPS. The end result is a positioning solution that is accurate to approximately 1m which is good enough for instrument approaches in manned aircraft.

A similar technology, Local Area Augmentation System, does the same corrections but instead of using a satellite to rebroadcast the signal it uses VHF frequencies to transmit the signal. The accuracy can be improved slightly to 0.9m using such a system but the range of the correction signal can be quite limiting.

The problem with the above systems is that they rely on “time of flight” measurements to calculate their position. That is, they know how long it took the signal to travel from the satellite to the receiver. This gives a decent positioning accuracy but the precision is limited largely by the hardware being used to gather the timing information.

Kinematic based solutions put themselves apart from traditional measuring systems in that they rely on the carrier wave of the signal instead of the time of flight. This means they are measuring positioning differences using the phase shift observed from the base compared to the rover. The further apart they go, the more the phase angle increases which can be used to calculate the position of the rover with respect to the base. The result is an accuracy of anywhere from 0.5cm to 20cm. The main limitation however is the range as most systems are going to have a good accuracy within only a few miles of the base station

The Hardware

To start off, I had to find a suitable receiver module capable of outputting raw timing information. This was actually more difficult than I thought as the market tends to be either littered with clone modules that are missing critical components or extremely expensive with solutions like the Emlid Reach costing upwards of $700 per unit. Eventually I found the uBlox NEO-M8T which fit the bill and only cost about $75 from CSG shop. I also ordered their high performance amplified GPS antenna for an extra $20. After it arrived, I had it connected to my computer by USB and receiving satellite signals in a little less than 20 minutes.

The Software

As I began doing my research on the subject, I discovered an open source project known as RTKLIB. Designed by a university student in Japan, the project integrates functions for both real time and post processed kinematics and is very well documented. The project has many forks that each have their own purpose, but for this post I will be primarily discussing the Demo5 fork which seems to have a lot more recent development than the original RTKLIB project.

In the image above, you can see all of the windows that RTKLIB has to offer. The main one we will be focusing on here is the RTKNAVI window which is the component used to do RTK calculations. It has 3 segments with the left most one showing the current position and what kind of solution it has. The middle segment shows the base and rover satellite count and signal strength and the right most segment shows the ground track over time.

Since I only have one GPS receiver, I had to use internet based corrections. My initial tests with the Indiana CORS network ended poorly as they use an unusual proprietary communications protocol to access their NTRIP caster. I was simply unable to find a mount point using RTKLIB, so I had to find an alternative. This is where RTK2GO comes into play. It is a free and open source alternative to the CORS network which gives users the ability to run their own base stations and upload the data to their network. It appears to be especially popular in Europe but the United States doesn’t have anywhere near as many stations available through their servers. The closest station is in Auburn Hills, Michigan. This town is almost 250 miles away, so I don’t expect the corrections to be precise but it should work for testing to see if I can get an RTK fix.

In the above image, you can see some of the effects I was expecting. When the GPS module gets a fix (shown in green on the ground track), the drifting slows down significantly. It still drifts by several meters but this is likely caused by the absurdly long distance between the base and the rover. Since making this post I have ordered another receiver set so I can set up my own local corrections base and fix this issue.

Going Wireless – Adding Telemetry

Having RTK is great, but if you need to run wired cables between the base and rover you would be better off using tape measures. To get around this, most commercial RTK systems use either cellular or radio based communications to bridge the gap. I opted to use some spare telemetry modules I have had laying around for some time and modify them to better suit my needs.

The modules in question are a pair of Digi 9XTend modules which came in enclosures from a few crashed Precision Hawk Lancasters. These are transparent link modules that present themselves to the computer and GPS module as nothing more than a cable connecting the two points and are capable of pushing up to 1W of power at 115200 baud. An image of the telemetry module and the NEO-M8T can be seen in Figure 4.

By default, these boards were designed to run off of an external battery pack which ran an internal 5v regulator. I instead felt like having the rover powered off of USB power since USB battery packs are cheap and easily found online. I traced out the entire board in different colors of sharpie to identify the purpose of each line and quickly figured out that a simple adjusting of a jumper could change it over to USB operation.

After tracing out all of the connections on the circuit board I realized there was a lot of wasted space on the board as can be seen in figure 5. I marked it off using purple sharpie to make note of it in later steps.

With all of the free space available, I began to think about how easily I could make this smaller and portable. A few minutes with a dremel left the board open enough to fit the GPS module in the same enclosure as the telemetry module. Figure 6 shows my planned layout but the SMA antenna connector on the GPS module will have to rotate 90 degrees to point out the hole.

The next step was to break out the soldering iron and attach the GPS module to the telemetry module board. This was a simple task which I’m not going to go too heavily into details about but the GPS module can be seen in figure 7. The UART and power lines from the GPS module were connected to the telemetry module and the serial connector used to connect the telemetry module to USB was disconnected. The final result can be seen in figure 8 where the entire system is contained within a single enclosure the size of a deck of cards. This self contained unit will only need an external USB battery bank and a GPS antenna to be operated in the field.


To sum it all up, I have built a system that is capable of using RTK corrections to get a high precision positioning solution. The self contained unit I built could serve as either the rover or the base station depending on the use which makes this a very versatile system. I plan to put RTKLIB on a raspberry pi for field use and test it against a commercial RTK system in the coming weeks. Future applications could also include this being added to the Matrice 100 for increased accuracy in mapping missions.

digi xbee pro 9xtend

Digi XTend® ۹۰۰ MHz

۱ Watt Long-Range OEM RF modules

  • ISM 900 MHz operating frequency
  • ۱۰۰ mW – 1 Watt power output (up to 40 mile range*)
  • ۲۵۶-bit AES Encryption
  • Available with DigiMesh®
  • Available in smaller, lower power XBee Surface Mount form-factor

XTend 900 1W RPSMA 40 Miles Range XTEND XBEE Wireless Telemetry Module

 XTend 900 1W RPSMA 40 Miles Range XTEND XBEE Wireless Telemetry Module factory  XTend 900 1W RPSMA 40 Miles Range XTEND XBEE Wireless Telemetry Module factory  XTend 900 1W RPSMA 40 Miles Range XTEND XBEE Wireless Telemetry Module factory

Product Details:

Place of Origin: CHINA
Brand Name: LXXTECH
Model Number: LXX-0403

Payment & Shipping Terms:

Minimum Order Quantity: ۱
Price: Good price
Delivery Time:
Payment Terms: TT ,paypal,ESCROW
Supply Ability:

Detailed Product Description

XTend 900 1W RPSMA 40 Miles Range XTEND XBEE Wireless Telemetry Module


–  The XTend Modem packs a ton of RF punch into a small, low-power, easy-to-use, and reliable module. Outdoors, with line-of-sight, this module can communicate at up to 40 miles; indoors it can still do up to 3000ft. The module transfers a standard asynchronous serial data stream, operates within the ISM 900MHz frequency band and sustains up to 115.2kbps data throughput. The module comes with an attached RPSMA antenna connector.
– The XTend module utilizes FHSS (Frequency Hopping Spread Spectrum) agility to avoid interference by hopping to a new frequency on every packet transmission or re-transmission. Its transmit power is software adjustable from 1mW to 1W—the maximum output power allowable by governments that use 900MHz as a license-free band. The XTend module is approved for use in the United States, Canada, Australia and other countries (contact Digi for a complete listing).
– No configuration is necessary for out-of-the-box RF communication. The XTend module’s default configuration supports a wide range of data system applications. Advanced configurations can be implemented using simple AT or binary commands.


– Supply voltage: 2.8 – 5.5VDC regulated
– Frequency band: 902 – 928MHz
– Serial data interface: 3V – 5V CMOS UART – No configuration required
– Transmit current: 730 mA (@ 5V, 1W TX Power Output)
– Receive current: 80 mA (@ 5V, 1W TX Power Output)
– Indoor/Urban range (w/ 2.1 dB dipole antenna): Up to 3000 feet (900 m)
– Outdoor RF line-of-sight range (w/high gain antenna): Up to 40 miles (64 km)
– Transmit power output (software selectable): 1mW – 1W (0 – 30 dBm)
– Throughput data rate (software selectable): 9,600 or 115,200 bps
– RPSMA antenna connection

 جهت راهنمایی با شماره ۰۹۱۲۰۸۵۵۵۳۰ تماس بگیرید.

XTAB – XTend to XStream adapter board

Here are some photos of the two XTend Adapter Boards-with and without Accessories-(p/n: XTAB and XTAB-A). The XTABs create an XStream footprint for the XTend OEM module. Following are some explanations of the part numbers.

Note: Digi no longer sells these adapter boards.

۱ – XTAB installed on XIB-R with JM2R6-CR3-7I antenna cable

۲ – Top of XTAB (back) and XTAB-A (front)

۳ – Bottom of XTAB (left) and XTAB-A (right)

۴ – XTAB-A installed on XIB-R

۵ – Expanded view of XTAB-A installed on XIB-R
  • The XTAB has no RF connector. This board is generally used when the XTend XT09-MI module will be used with an antenna or RF cable with an MMCX RF connector.
    If an RPSMA connector is required we offer a 7″ MMCX to RPSMA-female RF cable (p/n: JM2R6-CR3-7I). The MMCX connector can be plugged into the XTend module, and the bulk-head RPSMA-female connector (just like on the XStream OEM module) can mount at any location on the enclosure.
  • The XTAB-A comes with an RPSMA-female RF connector in the same place as on the XStream OEM module, plus an MMCX to MMCX RF connector cable to connect the XT09-MI to the XTAB-A. This can be used to make an XT09-MI module look just like an XStream OEM module (plus an additional < 0.100″ height), complete with RPSMA-female antenna connector in the same place.

Warning: The above photographs show the XTend module plugging into the XStream Interface Board (XIB-R). This is only functional if the transmit power of the XTend module is turned down to 100mW (ATPL=2). The XIB-R’s voltage regulator is limited to only 250mA source current, so it cannot support the XTend module at higher transmit power levels.

Note: Usage of XTAB and XTAB-A boards should not be considered a permanent solution. We are unsure how long they will be offered. Use them as a temporary solution while redesigning a PCB, prototyping with XTend modems, or testing.

Please do not hesitate to contact Technical Services with any questions you may have on these products.