Electronics and Control - STM32 robot competition

Another appearance of the Jetson Nano powered RC car, but this time with all the ML stuff stripped. I was able to resurrect the project by proposing it as my semestral work in the Electronics and Control course. This course was centered around working on an actual practical project in a lab with supervision from Siemens and STMicroelectronics employees.

The part I liked was that the course was graded according to the ranking in the final competition of the robots accomplishing some of the 13 possible tasks. The point was to decide in which task an individual would like to compete at the beginning of the course and then create a robot with a set of skills needed to complete those tasks. Not only that, but 5 additional mandatory tasks needed to be completed with deadlines spread two weeks apart throughout the course. To qualify for the final ranking, one had to complete these and then was ranked based on the number of completed tasks.

It was the perfect opportunity for the 4x4 RC platform to make an appearance.

The Robot

Steering is managed by a standard servo, and motion is powered by a stepper motor, equipped with a micro-step driver for smooth operations. While a sensor-equipped BLDC motor could have been a preferable choice for its efficiency, the stepper motor was selected as a cost-effective alternative. Powering the vehicle is a 3S Lithium battery.

It has an array of seven time-of-flight (ToF) sensors positioned around the perimeter of the vehicle. Additional functionalities include Bluetooth connectivity, a microphone, an accelerometer, and a line sensor. This rich set of features supports various tasks I aim to accomplish with this vehicle:

  • Spartakiada: Synchronized movement based on whistle commands
  • Slalom: Navigation through a course marked by obstacles.
  • Swing: Balancing on a moving platform.
  • Parking: Automatic parallel parking.

Historical Context and Initial Development

The project initially started around two years ago as a testbed for experiments with space navigation and object classification. It was based on an STM32F4 microcontroller and an NVIDIA Jetson Nano, which processed the input from a front-facing camera. This setup utilized the MobileNetV2 model to recognize and categorize objects in real-time at around 20fps, allowing for dynamic adjustments such as wheel orientation based on object positions.

Despite functioning perfectly by the end of that summer, the onset of the university semester significantly reduced the available time to advance the project, causing it to be shelved until recently.

Hardware Modifications and Setup

Upon revisiting the project, several hardware adjustments were necessary. Originally assembled without a 3D printer, the current setup is much more refined, relying on various platforms and brackets rather than adhesive tapes and glue. Here’s an overview of the high-level block diagram:

  • Power Supply: Everything is powered by a model 3S battery, with the stepper motor and nucleo (with the shield) directly connected to it. A 5V regulator is used for the servo, and the rest of the components, including sensors and microcontrollers, are powered by 3.3V from the shield.
  • Sensors: The vehicle features seven ToF sensors; three in the rear bumper and four in the front. These sensors communicate over I2C, and due to their fixed addresses, I integrated smaller F1 processors to emulate additional I2C ports for managing these sensors.

Firmware and Software Enhancements

The vehicle’s firmware includes a custom communication library, initially tested and now deployed in this project. This library focuses on simplicity, modularity, and reliability. The physical interface layer abstracts UART communication, simplifying integration with other systems. However, higher-layer fragmentation, similar to simplified TCP, is still under development to improve data transmission reliability, especially over Bluetooth.

On the software front, a small Python application runs on a connected computer, managing the vehicle through a GUI built with Tk. This setup allows for mode switching, manual control via keyboard, and real-time sensor data reporting. The communication library is wrapped with Python bindings to handle virtual serial ports internally while Python manages high-level command objects.

This project showcases not just technical expertise in robotics and programming but also the challenges and solutions in reviving and upgrading a complex system over time. Through this venture, I’ve explored various aspects of mechanical and electronic design, software engineering, and practical problem-solving in robotics.

Additional material

Poster providing a basic overview (Czech) and the final presentation slides (also Czech) with some additional drawings.

Results

I managed to score third in the overall competition, because the car only managed to complete 3 of the 4 tasks, failing in the slalom. However, I managed to get to the top of the execution ranking, especially thanks to the advanced handling of the communication and overall control of the model.


Last updated on May 17, 2022