Skip to content

Instantly share code, notes, and snippets.

@dole7890
Last active May 31, 2023 15:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dole7890/8df6453762a49df234091d51e3b85aaf to your computer and use it in GitHub Desktop.
Save dole7890/8df6453762a49df234091d51e3b85aaf to your computer and use it in GitHub Desktop.
Expanding the Receiver to BEIDOU B2a

Overview

This document provides a description of the work developed for GNSS-SDR during the Google Summer of Code (GSoC) 2018 program. The main objective of this project is to extend the capabilities of the GNSS-SDR software by providing an implementation of BeiDou B2a signals. Specifically, this project will be focusing on the telemetry decoding, and processing of observables and position, velocity, and time (PVT) components of the receiver, and will be merged with the acquisition and tracking portion of the receiver to provide a fully functional BeiDou B2a receiver.

Team

Team Member Function
Dong Kyeong Lee Developer
Damian Miralles Mentor
Antonio Ramos de Torres Mentor

Project

The current GNSS-SDR platform is a software defined receiver that supports GPS, GLONASS, and GALILEO Global Navigation Satellite System (GNSS) signals. It also partially supports BeiDou signals, but this is limited to the BeiDou B1l signal. This project will expand the software receiver to accommodate acquisition and tracking of BeiDou B2a signals that would further expand the receiver's capabilities in facilitating research on multi-constellation and multi-frequency receivers working iwth real signals. In addition, the demodulation of the navigation messages will open the door to innovation in multi-constellation receivers, addressing topics such as integrity, reliability, robustness, enhanced coverage, and high-accuracy positioning. Furthermore, the integration of BeiDou B2a observables into the position, velocity, time (PVT) solutions will allow the achievement of the aforementioned diverse range of applications and components.

To be more specific, this project is the second stage of the GNSS receiver, which comes after the acquistion and tracking of BeiDou B2a satellite signals. This project will be mainly divided into:

  1. Telemetry Decoding
  2. Observables Processing
  3. PVT using RTKlib

In essence, this project will be demodulating the BeiDou B2a CNAV2 navigation message, and integrating the BeiDou B2a observables into the PVT position.
(Note: The acquisition and tracking for BeiDou B2a code was developed at the same time as this project by Sara Hrbek for GNSS-SDR Google Summer of Code 2018 as well. link )

Description of Work

Code

Code developed during the summer will be integrated into GNSS-SDR as a single pull request. For the inspection of the code, the reader is referred to the development branch of the project called b2a_pvt. This branch is still under development until all the tasks in the to do list presented below is completed. The most significant commits in this project are highlighted below:

Below are some of the commits for this project

  1. 6858e36 First commit of GSoC program
  2. aba819e Added system parameters for telemetry decoding
  3. f2ae3fc Added the telemetry decoding unit conversions, and fixed bugs in the telemetry decoder
  4. 0c7c414 Added RTKlib and PVT parameters
  5. fcee003 Added CRC checks
  6. 7d91792 First successful build
  7. c25a468 Added CRC unit-test
  8. 6d77a42 Corrected user algorithms
  9. e64a818 Completed telemetry decoder unit tests
  10. e151f8c Added Rinex, PVT, RTKLib ephemeris conversion, and commented out bugs so that the system is operational, tests are working, and code builds properly. End of GSoC 2018 Coding.

BeiDou B2a Navigation Data

The reference used to develop the code was based on the BeiDou Navigation Satellite System Signal In Space Interface Control Document - Open Service Signal B2a - v1 The BeiDou B2a signal broadcasts the B-CNAV2 navigation message, so the message will be referred to as B-CNAV2 nav message for the remainder of this page.

Cyclic Redundancy Check (CRC)

The B-CNAV2 navigation message uses the CRC-24Q for the error detection of navigation messages. p1

For the CRC calculation, we use the PRN, MesType, SOW, and message data. (explained in the next section)
For the computation of the CRC computation, a ready-made code was used from another opensource project Global Positioning System Daemon - GPSD. The codes used were crc24q.c crc24q.h.

B-CNAV2 Navigation Message

The B-CNAV2 navigation message is broadcast on the B2a signal. More specifically, the B-CNAV2 message data are modulated on the B2a data component. The basic frame structure of B-CNAV2 is showned in the figure below. Each fram has a length of 600 symbols, and its symbol rate is 200 symbols per second, so the transmission of one frame lasts for 3 seconds.
p2

The first 24 symbols of each frame is preamble with the value of 0xE24DE8 in hexadecimal (111000100100110111101000 in binary). The MSB is transmitted first.
Each frame before error correction encoding has a length of 288 bits, containing Pseudorandom Noise (PRN), Message Type (MesType), Seconds of Week (SOW), Message Data, and CRC check bits.

Encoding/Decoding Method

The entire message is encoded using a 64-ary LDPC (96,48) encoding for error correction, so the navigation message excluding the preamble has 576 symbols and 288 bits. If we are to ignore the error correction, the first 288 bits correspond to the uncorrected data.
In this project, the error correction was not added to the code, so this will be a future work.

Data Format

There are a total of 8 Message Types. Message Type 10, 11, 30, 31, 32, 33, 34, and 40.
From looking at the MesType, we can determine which message type the navigation message belongs to.
Their bit locations are as follows
p3
p4

Navigation Message Parameters and Algorithms

The parameters can be broadly grouped into following subsections.

  1. Ranging Code Number: The identification of the satellites
  2. Message Types: The identification of which message type the messages belong to
  3. System Time Parameters: The time of the message
  4. Issue od Data: Indication of ephemeris or clock correction parameter updates and age
  5. Clock Correction Parameters: Clock corrections
  6. Group Delay Differential Parameters: Delay between the signal radiated and the output of the satellite's on-board source
  7. Ephemeris Parameters: Provides satellite orbit type parameters
  8. Ionospheric Delay Correction Model Parameters: Corrects the effects of the ionospheric delay for single frequency users
  9. Midi Almanac Parameters
  10. Reduced Almanac Parameters
  11. Earth Orientation Parameters
  12. BDT-UTC Time Offset Parameters: Relationship between BDT and UTC time
  13. BDT-GNSS Time Offset Parameters: Relationship between BDT and other GNSS time
  14. Satellite Integrity Status Flag: Provides integrity flag about data, signal and accuracy
  15. Signal In Space Accuracy Index: Accuracy of the orbital parameters and clock correction parameters
  16. Signal In Space Monitoring Accuracy Index: Variance of the estimated error of the signal in space accuracy

These have been assigned to 3 types (ephemeris, almanac, time) and processed for simplifcation.
For further details of these parameters, their conversion factors, and relevant user algorithms, please refer to the BeiDou B2a ICD.

Unit Tests

To ensure that all the above parameters are decoded correctly, unit tests were implemented for the navigation data decoding

  1. CRC Testing
  2. Parameter Testing: test if data decoding and unit conversions of all parameters are correct In order to carry out these tests, the navigation data was first processed using a MATLAB implemented version of the GNSS-SDR, then tested to check if the processing with the GNSS-DR matches the results.

An example portion of the code is as below unittest

Running the Unit Tests

In order to run the unit tests, we use the following commands

$ cd gnss-sdr/build
$ cmake ..
$ make
$ cd ../install
$ ./run_tests --gtest_filter=*Beidou*

This allows us to run all the unit tests for Beidou.
If we would like to look at the specific tests, we can simply use the following command

$ ./run_tests --gtest_list_tests

Unit Test Results

We can see that if we run the BeiDou B2a tests, the following unit tests have been successfully been passed
tests

RTKLib PVT

5 Channels were added to the GNSS-SDR for the RTKLib

  • 32: BeiDou B2a
  • 33: GPS L1 C/A + BeiDou B2a
  • 34: Galileo E1b + BeiDou B2a
  • 35: GPS L2C + BeiDou B2a
  • 36: GLONASS L1 C/A + BeiDou B2a

RTKLib Conversion

All the ephemeris parameters are converted to RTKLib compatible values rtkconversion

RINEX Output

The RINEX output format is set as the RINEX v3

Results

Unfortunately, due to the unavailability of BeiDou B2a data where there are more than 3 satellites outputted from the tracking loop, PVT performance of B2a satellites could not be confirmed. On the other hand, the other components were verified with unit tests, and the data decoding portion was successfully verified with actual B2a data.
After merging this code with the BeiDou B2a acquisition and tracking code, resolving remaining bugs, and following the future launch of BeiDou B2a satellites (There should be several more by the end of this year), the full performance of the code implemented in this project will be further analyzed.

Future Works

  • Debug issues with CRC checker (The CRC check has some bugs)
  • Debug issues with RINEX printer (The RTCM printer has some bugs)
  • Implement additional unit-tests for user algorithms
  • Merge code with acquisition/tracking code for BeiDou B2a
  • Eventually attain position solutions for assessment of the receiver

Conclusions

This was a fantastic experience to participate in the Google Summer of Code project. I was able to find out about, and contribute to an open source project, and develop a lot of coding skills by receiving a lot of guidance from my mentors. I plan to continue to work on this project even after the GSoC, so that the receiver will be fully functional for the public. Also, I will be interested in participating in more open source projects in the future! It was a great opportunity to both learn and contribute. All this was achieved thanks to my mentors, GNSS-SDR, and GSoC 2018 program. Thank you Google for this project, and an opportunity to develop an insight into the opensource community!

Reference

BeiDou Navigation Satellite System Signal In Space Interface Control Document, Open Service Signal B2a (Version 1.0), China Satellite Navigation Office December, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment