Satellite positioning using USRP B205mini-i and GNSS-SDR

category: Gnss
tags: Lattepanda Sdr

Introduction

GNSS-SDR is a software defined radio (SDR) project that processes to perform positioning with GPS (Global Positioning System) and other positioning satellite system (GNSS) signals. In the positioning using the sample data attached to this, the coordinates are displayed immediately, but in the positioning using my own SDR, the coordinates could not be specified by repeating the satellite search.

At this time, using the SDR receiver Ettus Rearch USRP B205mini-i (hereinafter abbreviated as B205) that can be purchased for about 100,000 yen, we finally succeeded in positioning with GNSS-SDR.

Ettus Research USRP B205mini-i

This is the surface of B205. There are three SMA connectors on the left side of the photo, from the top are the external clock input terminal REF, the receive terminal RX2, and the transmission and reception signal terminal TRX. When this SDR is used for reception only, we use the terminal of either RX2 or TRX, and GNSS-SDR uses RX2 terminal.

Ettus Research USRP B205mini-i

The back side had a simple structure with only the JTAG terminal.

Preparation

I connected the B205 to a Latte Panda, a single board computer, and installed the driver software and GNSS-SDR on it, and connected the GNSS antenna to the B205. GNSS antennas usually have a built-in low noise amplifier (LNA). To supply power to this LNA, it is necessary to supply 3.5 to 5 volts to the antenna terminal. I used a power-passing RF splitter (Mini-Circuits ZAPD-2DC-S+) to power the antenna with the GNSS receiver u-blox ZED-F9P at the power-passing terminals.

Ettus Research USRP B205mini-i

The Latte Panda Alpha 800s has an M.2 SSD and Ubuntu 20.04.3 LTS installed. I logged in to this computer with ssh and installed the GNSS-SDR and B205 driver software as an administrator.

apt update; apt -y upgrade
apt install -y gnss-sdr uhd-host

The version of GNSS-SDR installed by the apt command was 0.0.11, which was a little older than the current 0.0.15. I completed the steps from the Quick-Start Guide to My first position fix in Getting Started on the GNSS-SDR home page.

Positioning

B205 is the official support hardware for GNSS-SDR, but I had a hard time getting GNSS-SDR to work.

From the published configuration file example, we need to modify SignalSource.subdevice for use with B205. Also, although many options are set in this configuration file, it repeated satellite search and I finally could not be obtained the coordinate.

Therefore, from this sample setting, I removed options such as false alarm of signal acquisition (ACQUISITION GLOBAL CONFIG), and I added an option to monitor the positioning status (MONITOR CONFIG). I didn’t change the filter settings. Then I saved this in a file as uhd.conf.

[GNSS-SDR]

;######### GLOBAL OPTIONS ##################
GNSS-SDR.internal_fs_sps=4000000

;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=UHD_Signal_Source
SignalSource.device_address=
SignalSource.sampling_frequency=4000000
SignalSource.freq=1575420000
SignalSource.subdevice=A:A

;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner

;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Pass_Through
DataTypeAdapter.item_type=cshort

;######### INPUT_FILTER CONFIG ############
InputFilter.implementation=Fir_Filter
InputFilter.input_item_type=cshort
InputFilter.output_item_type=gr_complex
InputFilter.taps_item_type=float
InputFilter.number_of_taps=11
InputFilter.number_of_bands=2
InputFilter.band1_begin=0.0
InputFilter.band1_end=0.48
InputFilter.band2_begin=0.52
InputFilter.band2_end=1.0
InputFilter.ampl1_begin=1.0
InputFilter.ampl1_end=1.0
InputFilter.ampl2_begin=0.0
InputFilter.ampl2_end=0.0
InputFilter.band1_error=1.0
InputFilter.band2_error=1.0
InputFilter.filter_type=bandpass
InputFilter.grid_density=16
InputFilter.sampling_frequency=4000000
InputFilter.IF=0

;######### RESAMPLER CONFIG ############
Resampler.implementation=Pass_Through

;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=8
Channels.in_acquisition=1

;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.item_type=gr_complex
Acquisition_1C.coherent_integration_time_ms=1

;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex

;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder

;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables

;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.iono_model=Broadcast
PVT.trop_model=Saastamoinen
PVT.flag_rtcm_server=false
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
PVT.rtcm_tcp_port=2101
PVT.rtcm_MT1019_rate_ms=5000
PVT.rtcm_MT1077_rate_ms=1000

;######### MONITOR CONFIG ############
Monitor.enable_monitor=true
Monitor.decimator_factor=50
Monitor.client_addresses=127.0.0.1
Monitor.udp_port=1234
GNSS-SDR.telecommand_enabled=true
GNSS-SDR.telecommand_tcp_port=3333

Then, according to the procedure for creating the GNSS-SDR monitor program, I compiled the program monitoring-client and prepared the shell script gnss-sdr-harness.sh.

Once you’ve done this, run GNSS-SDR in the background of a regular user. This is because we keep session during a long time until the coordinates can be identified and we would like to remove visible satellite search messages (Tracking ... and Loss ...) not to miss the important messages.

nohup ./gnss-sdr-harness.sh gnss-sdr -c uhd.conf &
tail -f nohup.out | grep -v Tracking --line-buffered | grep -v Loss

In my case, I was able to identify the coordinates about 2 hours and 46 minutes after the program started.

Initializing GNSS-SDR v0.0.11 ... Please wait.
Logging will be written at "/tmp"
Use gnss-sdr --log_dir=/path/to/log to change that.
[INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5
[INFO] [B200] Detected Device: B205mini
[INFO] [B200] Operating over USB 3.
[INFO] [B200] Initialize CODEC control...
[INFO] [B200] Initialize Radio control...
[INFO] [B200] Performing register loopback test...
[INFO] [B200] Register loopback test passed
[INFO] [B200] Setting master clock rate selection to 'automatic'.
[INFO] [B200] Asking for clock rate 16.000000 MHz...
[INFO] [B200] Actually got clock rate 16.000000 MHz.
[INFO] [B200] Asking for clock rate 32.000000 MHz...
[INFO] [B200] Actually got clock rate 32.000000 MHz.
Sampling Rate for the USRP device: 4000000.000000 [sps]...
UHD RF CHANNEL #0 SETTINGS
Actual USRP center freq.: 1575420000.000297 [Hz]...
PLL Frequency tune error 0.000297 [Hz]...
Actual daughterboard gain set to: 50.000000 dB...
Setting RF bandpass filter bandwidth to: 2000000.000000 [Hz]...
Check for front-end LO: locked ... is Locked

...(snip)...

Current receiver time: 1 min 21 s
Loss of lock in channel 0!
Tracking of GPS L1 C/A signal started on channel 0 for satellite GPS PRN 01 (Block IIF)
New GPS NAV message received in channel 4: subframe 2 from satellite GPS PRN 16 (Block IIR)

...(snip)...

Current receiver time: 2 h 45 min 58 s
First position fix at 2021-Dec-06 15:15:30.500000 UTC is Lat = 34.41xx [deg], Long = 132.44x [deg], Height= xx.xxx [m]
Position at 2021-Dec-06 15:15:30.500000 UTC using 4 observations is Lat = 34.41xxxxxxx [deg], Long = 132.44xxxxxxx [deg], Height = xx.xxx [m]

While positioning is success, the terminal screen will display a New GPS Nav message ... message every 6 seconds and a Position ... message every 1 second.

We can monitor the positioning status by opening another terminal and executing ./monitoring-client 1234.

gnss-sdr-with-usrp-b205-mon

We can also observe the status of GNSS-SDR by running nc -C localhost 3333. This -C option is for setting the line feed code to “CR/LF”. You can monitor the UTC time, coordinates, speed, and direction from outside by typing tatus as a command. Enter exit to exit. Other commands include reset, standby, coldstart, warmstart, and hotstart.

Conclusion

I had a lot of trouble, but finally I was able to perform GNSS positioning with my own SDR. Being able to adjust the receiver parameters by myself deepened my understanding of positioning and made it fun. Also, I felt the potential for new signal confirmation that commercial receivers do not support.

I also tried Nuand bladeRF as an SDR receiver for GNSS-SDR, but as reported in the issue, it seems that there is a difficulty in gain adjustment. I manually set the gain using the bladeRF-cli command, saved the received data in a file, and tried positioning with GNSS-SDR, but this time I was troubled by a buffer overflow. In addition, buffer overflows occurred frequently in GNSS-SDR operated on B205 and Raspberry Pi 3B.

I will enjoy GNSS-SDR for a while.


Related article(s):