Background
The RELbot is an educational robot that is used as a platform for courses in the Robotics Master's programme at the University of Twente. These courses focus on different aspects of robotics, including real-time software development, SLAM, image processing, artificial intelligence, telepresence, and human-robot collaboration. The RELbot was designed to be modular in both software and hardware, allowing different courses to focus on different aspects of the robot.
The RELbots controller software can be split into three main categories based on the strictness of its real-time constraints.
* Soft real-time logic is executed as ROS2 nodes in a normal Ubuntu Linux environment on three cores of a Raspberry Pi 4B. Most courses focus on logic that falls in this category, like image processing and artificial intelligence.
* Firm real-time logic is executed in Xenomai on one core of the Raspberry Pi, in a firm real-time loop provided by the XRF2 framework. Logic that runs in this loop includes PID control and time-critical safety checks. One of the courses teaches students about real-time programming using this firm real-time loop.
* Hard real-time logic is executed on an FPGA, the Lattice ICE40 Hx8K, connected via an icoBoard. This includes motor control via PWM and counting the encoder pulses to track the motor position. None of the courses using the RELbot let students replace this logic.
The communication between the soft and firm real-time logic happens using a Cross-Buffer IPC channel. This IPC channel is wrapped in a ROS2 node on the soft real-time side, and is managed by XRF2 on the firm real-time side.
The firm real-time logic on the Raspberry Pi and the hard real-time logic on the Lattice FPGA communicate with each other via SPI.
One of the courses uses a different image on the Raspberry Pi, also running Ubuntu+Xenomai. This image is set up to connect to 20sim, allowing 20sim to generate a controller binary, upload it and run it. This course uses an additional sensor, connected via the Lattice FPGA, to measure the angle of a pole.
Xenomai was chosen to run the firm real-time logic because it is able to provide stricter timing guarantees than Ubuntu with PREEMPT_RT.
Problem
The Ubuntu+Xenomai image is difficult to maintain and upgrade, since upgrading to a new version of Ubuntu requires patching the new kernel to include Xenomai.
So far, attempts to patch Ubuntu 24.04 with Xenomai for the RELbot have not been successful, and it is a reccurring problem for every new Ubuntu version. It is also a factor when considering upgrading to a new version of the Raspberry Pi. Because upgrading is difficult and takes a lot of time, the software running on the Raspberry Pi gets outdated, forcing students to work with older versions of the packages and software they need during courses.
Objectives
1. To determine the most suitable alternative architecture to run the firm real-time control loop without Xenomai.
2. To design, develop and integrate a framework that implements this architecture, and allows the user to supply a custom firm real-time control loop.
3. To test and verify the implemented framework, and compare its performance to that of the current framework.
4. To document the developed framework, providing a user manual targeted at all users of the framework, including students, educators and maintainers of the RELbot.
The developed alternative architecture should be backwards-compatible with the practicals of all courses that do not specifically focus on implementing firm real-time logic within Xenomai. Because the Xenomai environment is currently used to teach students about real-time software development, the new architecture should provide alternate opportunities to educate students about this subject. The new architecture should continue to be modular, allowing students to implement a specific part of the RELbot, without needing to understand the parts that are not relevant for their current course. In this new architecture, the Ubuntu image should be easily maintainable, even if the image uses a different Ubuntu version than the architecture was originally developed for. Any added components should also be low maintenance, and it should be possible to manage and update the software running on any new components from the Raspberry Pi. These goals should be achieved without a noticable negative impact on the functioning of the RELbot. The new architecture should also be designed to accommodate future extensions of both the soft- and hardware of the RELbot, including those with firm real-time execution requirements. The alternate Ubuntu+Xenomai image that connects with 20sim does not fall within the scope of this project, but the design of the new architecture should still support the use of this image.
Some potential alternative architectures that will be considered are:
* Running the firm real-time logic on Ubuntu with PREEMPT_RT.
* Running the firm and/or hard real-time logic on one or more microcontrollers.
* Implementing the firm real-time logic on the Lattice FPGA.
Expected outcomes
1. A framework that provides users with the means to implement a firm real-time control loop without using Xenomai.
2. A functional reference implementation of the firm real-time control loop using the framework, that can be used in courses that do not focus on implementing this loop.
3. A way for the alternate Ubuntu+Xenomai image to keep control over the motors, and read the angle of the pole, without running the firm real-time control loop developed for the new architecture.
4. A validation of the framework, showing its performance is not noticably worse than the current implementation
5. A user manual explaining the general design and functionality of the framework, how to integrate it in the RELbot, and how to provide a custom firm real-time control loop.