Building KuupKulgur's On-Board Flight Computer

Introduction

We are the KuupKulgur team at Tartu Observatory, University of Tartu. KuupKulgur is a student-developed lunar rover prototype and a platform for developing modular technologies for future lunar surface missions.

As the rover has become more capable, its electronics architecture has also had to evolve. One recent step was the development of a dedicated on-board flight computer that can sit directly inside KuupKulgur’s common electronics stack and take responsibility for lower-level communication and subsystem tasks.

This work was carried out by Ants Kärner as part of his Bachelor’s thesis at University of Tartu, Estonia.

KuupKulgur’s electronics stack during integration testing. The flight computer is installed in the left-hand PCB stack and communicates with the rover’s main computing system.

Your project

In an earlier architecture, KuupKulgur’s main computing element had to connect directly to multiple subsystems and handle many smaller hardware-level tasks itself. This increased integration complexity and also made the main computer a larger single point of failure.

The goal of the new flight computer was to move some of these responsibilities onto a dedicated embedded controller. The board needed to fit the rover’s existing electronics stack, connect to the common internal bus, provide CAN and SPI communication, include an IMU and remain useful as a development platform for later space-grade hardware.

Firmware development was part of the project as well. The existing code was ported from the older ASF4 framework to MPLAB Harmony v3, CAN support was added, and the communication interfaces were tested under different workloads.

Electronics and design

The flight computer is a 96 x 96 mm four-layer PCB built around an ATSAMV71Q21 ARM Cortex-M7 microcontroller. The format is based on KuupKulgur’s common stack template, with board-to-board connectors allowing several rover electronics modules to be stacked together.

The board connects to two CAN interfaces and two SPI interfaces on the rover bus, provides GPIO, and brings UART and I2C connections out to headers for development and testing. It also carries an IAM-20680HP IMU.

KiCad render of the KuupKulgur flight computer. Development-oriented silkscreen labels identify interfaces, configuration jumpers and the IMU axes directly on the PCB.

A few choices were made specifically to keep development practical. Most of the board operates at 3.3 V, and the CAN transceiver was changed to a TCAN3404-Q1 so that an additional 5 V supply was not required just for the transceiver. The high-speed SPI, UART, CAN and I2C traces were length-matched, while the PCB stack-up uses ground planes and a dedicated 3.3 V power plane.

The ATSAMV71 was also selected with future hardware in mind. It provides an affordable development platform while remaining relatively close to Microchip’s radiation-hardened SAMRH71. Moving the firmware to MPLAB Harmony v3 therefore also creates a better path toward a later radiation-hardened implementation.

The 96 x 96 mm KuupKulgur electronics-stack template used as the mechanical basis for the flight-computer PCB. Shared connector locations allow several subsystem boards to use the same stack format.

The communication tests produced a useful result. In several UART configurations, the updated firmware achieved 100% packet transmission reliability. Comparable routing tests reached about 4205 useful bytes/s over UART and 4096 useful bytes/s when the packet path included CAN, showing that CAN itself introduced relatively little overhead in this setup.

Longer tests were more revealing. When 10,000 packets were transferred while additional tasks were active, packets began to be lost because the routing task could no longer empty the interface buffers quickly enough. The physical interfaces were capable of higher throughput; the limiting factor was the firmware scheduling strategy.

This gave us a clear direction for the next iteration: move more of the communication system toward interrupt- and message-driven execution instead of periodically running tasks that spend much of their time sleeping.

Tips, tricks & offers

A surprisingly simple improvement was putting more information directly onto the PCB silkscreen. Debug headers are labelled by function, configuration jumpers show their possible states, and the IMU axes are marked directly on the board. These details cost almost nothing but make bring-up and debugging much easier when several people are working on the same hardware.

Another lesson is to test embedded communication for much longer than a simple loopback demonstration. Short tests confirmed that CAN, UART, SPI and I2C worked, but sustained packet-routing tests were what exposed the scheduling bottleneck. Testing the interface and testing the complete software architecture are two different things.

CTA

The next step is to continue improving the packet-routing architecture and integrate the flight computer more deeply with the rest of KuupKulgur.

If you have experience designing FreeRTOS-based communication routers with several simultaneous interfaces - particularly CAN, SPI and UART - we would be interested to hear how you structure task scheduling, buffering and interrupt-driven communication to keep the system reliable under sustained traffic.