by Dallas Downing.
RoboCup is an international, annual convention meant to promote robotics research through a number of robot-based competitions. The primary goal of RoboCup is to field a team of fully autonomous humanoid robot soccer players against the World Cup winners–and win–by 2050. This challenge is quite complex, so different competitions are held within RoboCup to address each major aspect of this ultimate goal. One of these competitions is Small Size League (SSL), which is focused on multi-agent coordination and control. RoboJackets’s RoboCup team participates in this competition.
The SSL games are between two teams of eleven robots. Competitive teams outperform the opposing team by making smarter plays and reacting quickly to the ball and other team’s movements.The robots themselves must fit within a cylinder about 7 inches wide and about 6 inches tall. This creates three main challenges for the RoboCup team: 1) the robot must be able to react quickly; 2) the internal components must be small and fit closely together; and 3) the tech has to be easy to recreate to make a uniform team of eleven robots (plus backups). Because of these requirements, the RoboCup team develops and maintains one of the most sophisticated technology stacks in RoboJackets. Today we look at some of the technology RoboCup uses in its robots and how it was developed.
The overall setup for a SSL match is fairly simple. Cameras mounted above the field send a live feed of the match to the base station. The robots are identified by unique dot patterns on the top face of each robot. The base computer determines where the ball is and where to send each robot on the field. The computer connects to the robots via radio signals to send a path for the robot to follow. Inside the robot, a microcontroller unit (MCU) collects feedback from a number of different sensors, like an inertial measurement unit (IMU), and uses them to calculate the motor controls needed to follow that path. It also controls the dribbler motor and kicker solenoid, which are used to manipulate and kick the ball.
Each robot has four circuit boards that perform specific functions in this process. The control board is the primary board of the system, containing sensors, power distribution, and motor control components, and connects to the various motors. The kicker board, below the control board, controls the kicker solenoid and holds the large capacitors used to activate it. The radio board contains the wireless chip used to connect to the computer. An FPGA (field-programmable gate array) sits at the center of the control board (underneath the radio board) and coordinates sending commands and receiving the data from the motors in parallel. It connects to the mTrain, which plugs directly into the control board to access all of these other components. The mTrain board is the MCU and primary “brain” of the system, performing the major calculations necessary for controlling the robot.
If you have never heard of the mTrain before, it’s because it is not a commercially available MCU. The mTrain was developed by RoboJackets to be a completely custom microcontroller that could tackle many of the issues specific to the RoboCup robots. Prior to mTrain, the team used an mbed controller (specifically the NXP LPC1768), a popular microcontroller platform created by ARM. After the 2017 competition in Japan, it became clear to the team that they needed a more robust motion control system for the robots. Joseph Neiger, software team lead at the time, said, “Since everything hangs on being able to move, we were forced to improve our motion control. Due to the frequency of the data streams (20hz) versus the actual motion control loop frequency (200 hz), it was extremely difficult to make any progress on just tuning the loops better.” Throughout 2017 and 2018, the team attempted more complex motion control techniques, but began to hit the technical limits of the mbed. During the 2018 Montreal competition, they were able to get the robots to move quickly but without enough precision to control the ball well. “We couldn’t do better without data coming out of the mbed,” said Joseph, “and we couldn’t get data out without crashing it or reducing the frequency until it was basically useless.”
Almost immediately following the Montreal competition, development started on a new MCU that was faster and more powerful. The team picked a STM32 microcontroller, which is a 32-bit microcontroller meant for high-performance embedded systems. This was an upgrade from an ARM Cortex-M3 processor, found on the mbed, to an ARM Cortex-M7 processor, which gives the new chip several advantages. Primarily, it supports accurate vector calculations and hardware for floating-point calculations. The increased accuracy and speed of the chip meant that higher frequency data stream motion control was achievable. The new chip also supports more connections and faster connections with peripheral devices. In particular, the STM32 can support three serial peripheral interface (SPI) buses, while the mbed supports only two. This is important because the MCU needs a dedicated bus for the FPGA and radio board. A dedicated connection allows a higher bandwidth of data which in turn allows a higher frequency control loop. The remaining SPI bus can be used for the other devices like sensors without slowing down the main components. The team also added 256 MB of flash memory (ROM) and RAM to prevent the memory limits they were reaching with the mbed.
The new STM32 chip was very promising, but a lot of work was needed to make it work. The board for the chip was developed throughout the fall of 2018 and firmware development began in 2019. Unfortunately, many basic drivers and board support packages needed to be written specifically for the mTrain board. The mbed’s advantage was that the mbed API has almost a decade of development and debugging, making it easy to get support online. Without that same support for the STM32, writing the new firmware was a challenging learning process for the team. “As with all embedded devices, getting low level things working without any sort of insight is a very painful process,” says Joseph. In the months leading up to the 2019 competition in Sydney, the team had to quickly rework their firmware to make the robots operational. “Most of the development at this stage was whatever I needed to get working to get robots moving,” says Joseph, “It was very much a mad dash to the end and figuring bugs out on the fly.”
Currently, the mTrain project is a multi-team collaboration between RoboCup and RoboRacing. Development on the board itself is complete, but some work still remains for the API. Arthur Siquiera, the current electrical lead for RoboCup, says they are continuing to work on making the firmware more stable and developer-friendly for future members. The API has been named the mJackets API, with the goal of developing a common platform for STM32 MCU firmware development, not just for the mTrain. Being an open source project means that the work done by RoboJackets members is available to any developers looking to use any STM32 chips.
While the 2020 RoboCup has been rescheduled for 2021, the team is hoping to be fully prepared for the competition with the mTrain powering their new robot fleet.
Read more about the technology RoboCup uses in their previous Team Description Papers.