Hi Julia community,
I’m Ignatius Rivaldi, research engineer working at UNSW ACSER: Australian Centre for Space Engineering Research (ACSER)
We flew our GPS receiver payload, Harry v3 on Waratah Seed-1 6U cubesat developed by our collaborator, ARC Training Centre for CubeSats, UAVs, and their Applications (CUAVA)
After several public announcements and a presentation at ASRC 2024 , this is our first data from our Kea GPS receiver navigating in space:
(The TLE was propagated by SatelliteToolbox.jl and plotted by Makie.jl)
LinkedIn post by our PI, Andrew Dempster on LinkedIn: To you, this might look like an ordinary image of a GNSS receiver… | 23 comments
Why Julia
Part of the process of hardware integration between our GPS payload and WS-1 bus is verifying whether the RF chain works before we launch it into space. In orbit, our FPGA-based Kea GPS receiver will process the GPS signals into navigation solutions. But, if something breaks, it will be hard to debug.
Our payload can be configured to dump raw intermediate frequency (IF) samples from its RF frontends at data rate of about 2 MB/s . We can then run a software receiver on the IF samples to verify that our RF frontends can successfully receive GPS signal. A good guide of this can be found in Daniel Estevez’s post: Timing SDR recordings with GPS – Daniel Estévez
There are a lot of open source GPS software receivers out there:
This is based on GNU Radio framework , and this is the most featureful open source GNSS software receiver out there. It can process GPS L1,L2,L5, Galileo, Beidou, GLONASS including Galileo navigation message authentication,
at real time on embedded hardware such as Raspberry Pi. The issue is that to support those functions and as it is using GNU Radio, it is written in some extremely involved C++: Fundamentals - GNSS-SDR
This is written in Matlab, have similar functions as GNSS-SDR. Because it is written in Matlab, it is much easier to modify and extend compared to GNSS-SDR.
Unfortunately, Matlab doesn’t encourage the user to write performant code, from hiding how their JIT compiler worked, to having multithreading support as a paid $1800 DLC. The worst sin is that in 2024, Matlab doesn’t have an official function of reading interleaved complex binary file, leading to Matlab users using some very inefficient and error-prone method of reading complex data or third-party solution that implements complex file read in C.
All of these papercuts leads to this software receiver taking 30 minutes! to process 40 second of IF data, while GNSS-SDR runs in only 10 seconds
We have a very fast software receiver that’s hard to extend, and a very slow software receiver that’s easy to extend. Sounds like a two-language problem to me
Then I found this from @zsoerenm :
This is perfect for my application,as I can:
- Read any complex file is just a
mmap("complex.iq", Complex{Float32})
away, no matter what the real datatype is, fromUInt8
toFloat64
, with it just working by the power of parametric polymorphism and multiple dispatch - see the assembly output of Julia compiler by
@code_native
, - benchmark by BenchmarkTools.jl,
- profile by VS code
@profview
, - use Tracy.jl ,the profiler that game devs uses
- use LIKWID.jl to measure FLOPS
- use Bumper.jl to reduce memory allocations and GC
Threads.@threads for
is free!
Now we have a GPS software receiver that’s as easy to modify as the Matlab receiver, but nearly as fast as GNSS-SDR
Julia running in space!
Julia can also run on Raspberry Pi CM4, the processor I used on our GPS payload computer. Unfortunately, precompilation delay means that its not practical to run the GPS signal processing script in space - every watt matters in space.
In space, we also capture IF data for us to do postprocessing in ground. But the IF data doesn’t fit into a single 1-2 minute satellite downlink pass, so I wrote a small Julia script to chunk the IF file on the payload computer into multiple smaller chunks, which can be downloaded over multiple passes. Which is then recombined at the ground, then postprocessed using JuliaGNSS
| WS-1 GPS payload | WS-1 cubesat bus | Groundstation
Kea -> Julia script -> S-band radio to ground -> JuliaGNSS
This is the output of one of our IF captures that was chunked by Julia script in space, and postprocessed by JuliaGNSS at ground:
JuliaGNSS can receive and decode 3 GPS satellites:
This is the first time I know of that Julia is running in space