Contact

Academic · BUT GEII · SAÉ

Robot Sumo

A second-year BUT GEII project to design an autonomous mini-sumo robot from the board up, with a servo turret of laser rangefinders, a custom ESP32-S3 board, and a driving policy trained by reinforcement learning in simulation.

Robot sumo is the second-year project of the BUT GEII in Bordeaux. Two autonomous robots are placed in a black ring 77 cm across, edged with a white band, and each one has to find the other and push it out without falling off itself. No remote control: once the start signal is given, the robot is on its own. The brief comes from the Tournoi National de Robotique Sumo, a competition held around Nîmes since 2005, and the school runs it like a real contract, with a client specification, a design dossier, a manufacturing dossier and review meetings at every step.

The constraints are tight. The robot must fit in 100 × 100 mm, weigh under 500 g, run on a small 2-cell LiPo, see its opponent from at least 25 cm, survive bright tournament lighting and camera flashes, and cut its motors and blink an LED if the battery drops below 6.6 V. What makes it fun is that, inside those rules, everything is up to us: the sensors, the board, and above all how the robot decides what to do.

Role
Electronic architecture, KiCad board, firmware, and the match simulators used to design the strategy.
Constraint
100 × 100 mm, under 500 g, 2S 500 mAh LiPo, opponent detection at 25 cm, battery cut-off at 6.6 V, 15 minutes of fighting.
Result
A finished main board, firmware for every block, and a learned driving policy that wins about 74 % of simulated matches against eleven opponent styles, up from 55 %.

Choosing what the robot sees

Most mini-sumo robots look straight ahead with one or two fixed sensors and spin until something shows up. We wanted the robot to keep its eyes on the opponent while the chassis does something else, so the main idea of the design is a turret: three laser time-of-flight rangefinders mounted on a small servo, angled at −22°, 0° and +22°. Together they cover a 69° fan, and the servo swings that fan ±140° around the front, so the robot can watch almost the whole ring without turning its body.

We compared ultrasonic and time-of-flight sensors before settling on the VL53L3CX. Ultrasound needs 5 V, is bulky and its beam is too wide to tell where the opponent is. The VL53L3CX reads up to 3 m, costs less than its sister part, and can separate several targets in one measurement, which helps tell the other robot apart from something behind it.

The rest of the perception is more classic: four CNY70 reflective sensors at the corners watch for the white edge whichever way the robot is moving or being pushed, an MPU6050 inertial unit feels rotations and impacts, and an infrared receiver waits for the referee's start signal. On the bench, a single CNY70 read 2.44–2.93 V over the black ring and 0–0.98 V over the white band, so there is a comfortable gap to set a threshold.

Before any of it touched the robot, we ran the real embedded code on a computer with simulated sensor data. Fed synthetic rangefinder frames, the tracking code locks onto an opponent at 25 cm within two readings, ignores a wall 1.5 m away outside the ring, stays quiet on an empty ring, and passes all 55 scenarios of its test suite. The start code only accepts a real button press from the referee's remote and ignores held-down repeats, noise, and the infrared pulses of an opponent's rangefinders.

The board

Everything comes together on one board we designed in KiCad, as a four-sheet hierarchical schematic: microcontroller, power, sensors and the root sheet tying them together. At its centre is an ESP32-S3 module soldered directly on the PCB, which runs both the turret tracking and the wheel decisions. A Pololu DRV8835 carrier drives the two GM9 gearmotors, a buck converter makes 5 V for the servo, and a low-noise linear regulator makes the 3.3 V for the logic and sensors.

The power section answers the specification point by point. A P-channel MOSFET right after the battery connector blocks reverse polarity. A second one, commanded by the toggle switch, switches the whole robot without the motor current ever flowing through the switch itself. A voltage divider lets the ESP32 watch the battery, and a dedicated transistor cuts the servo's ground until the firmware explicitly enables it, so nothing twitches at power-up.

Every block was checked before committing to it. We simulated the battery divider in ngspice with the resistor tolerances to see where the 6.6 V threshold really lands, ran the motor driver on an Arduino to measure the motors (300 mA rolling, 670 mA pushing against an obstacle), and worked out the power budget: to last the required 65 minutes of continuous driving, the robot has to average under 0.46 A. KiCad's electrical and design-rule checks now come back clean, after a last round of fixes on the layout.

The board has since been made and populated: the ESP32-S3 module in the middle, the motor driver carrier on the left, the rangefinder connectors on the right, and the power stage along the bottom edge. Nearly all of the routing is on the top layer, with the tracks fanning out from the module to each block.

Putting it together

The board sits on top of the mechanical base supplied by the school, between the two wheels, with the turret rising above it on its servo. The three rangefinders sit about 9 cm off the ground, tilted 10° down so they see the opponent's body rather than the ceiling. At the front, a low wedge scoops under whatever it pushes. Everything has to stay inside the 10 × 10 cm footprint, and the 3D model is what we used to check the fit and to give the simulator real dimensions.

Teaching it to fight

The part we spent the most time on is strategy. A robot that has never been built cannot be tested in a real ring, so we wrote a simulator. It started in MATLAB, with the ring, both robots, their motors, the three rangefinder cones, the IMU and the edge sensors all modelled, and with the actual C++ tracking and wheel code compiled into it, so the simulation runs the same code the robot will. We then ported it to native C++ to play tens of thousands of matches.

The simulator keeps a strict line between the truth and what the robot knows: the controller only ever receives sensor readings, never the real positions. On top of it we built a first hand-written controller as a state machine. The robot searches with its turret, stalks the opponent towards a safe flank, attacks when contact is confirmed and the edge is far enough, and disengages when it is the one being pushed. Edge recovery overrides everything else as soon as a corner sensor sees white. Every rule change was tested on the same random matches as the previous version, 76,800 at a time, and kept only if it won more without falling out more. That controller never left the ring without contact, but it only won about 42 % of its matches.

Learning beats the rules

So we tried letting the robot learn. A small neural network, two layers of 64 neurons and about 18,000 weights, looks at the last ten sensor frames and outputs the left and right motor commands. It never sees where the opponent really is, only what the robot's own sensors report. It first learns by imitating the hand-written controller, then improves on its own with reinforcement learning (PPO), playing simulated matches on a GPU PC.

A first version on an easier simulator quickly beat the hand-written rules, so we made the simulator harder: eleven opponent styles, from aggressive pushers and evasive runners to ambushers that wait before striking and robots with a front blade that scoops under you. The current training run has gone through 2,100 rounds and 369,600 matches in about 27 hours. Every few rounds the network is tested on 396 fixed matches and 396 new ones it has never played, and only the best network so far is kept.

On those unseen matches, the win rate went from 55 % for the imitation network to 74 % for the best one, with fewer ring-outs, and it is never allowed to do worse than the hand-written controller on wins or ring-outs. It now beats chargers and weavers around 90 % of the time. Ambushers and blade robots are still the hard cases, at roughly 30–40 % and 50 %, because they give the rangefinders very little warning before contact.

The trained network exports to a plain C++ file that matches the Python version to within 0.0000005, small enough to run on the ESP32-S3. For the turret prototype, we also wrote SumoScope, an iPhone app that connects to the robot over Wi-Fi and shows live what the turret sees and how it is tracking.

What comes next

The board is built. The next steps are to mount it on the robot, measure the real rangefinders on an opponent's body and under camera flashes, set the edge-sensor threshold on the final board, and time the network on the ESP32-S3. Training is still running in the background. Grip, motor spread and timing are things a simulator can only guess, and the network will only replace the hand-written controller once it has proven itself on a real ring.

Documents & links

Let’s build
something together.

[email protected]