Autonomous Weight Collection Robot Competition (RoboCup)
ENMT301 Mechatronics Design Project · Team of 3 · Teensy 4.0 / ARM Cortex-M7
Summary
Designed and built a fully autonomous weight-collecting robot for RoboCup 2025 — a 2-minute head-to-head competition in a 2.4 m × 4.9 m arena. The robot uses 8 Time-of-Flight sensors with weighted fusion, a three-layer hierarchical state machine, dual independent pickup mechanisms, and real-time task scheduling running on a 600 MHz ARM Cortex-M7. Our team of three owned the complete mechanical, electrical, and software system.
Competition Overview
RoboCup 2025 was a head-to-head autonomous robotics competition. Two robots operated simultaneously, competing to collect 1 kg, 0.75 kg, and 0.5 kg steel weights while avoiding dummy weights and arena obstacles. Scoring rewarded target weights loaded on board, weights delivered to base, and capturing a roaming "snitch" robot — with penalties for collecting dummy weights.
Robots had to operate fully autonomously using a Teensy 4.0 (ARM Cortex-M7) microcontroller, navigate unknown obstacle layouts, and handle terrain features including ramps and 25 mm speed bumps.
System Architecture
The system combines dual independent pickup mechanisms, an 8-sensor ToF array with weighted inverse-variance fusion, a hierarchical multi-layer state machine, and real-time task scheduling — architected for reliability under competition pressure rather than academic complexity.
The three main subsystems operate as a pipeline: the sensor array feeds fused distance data into the state machine, which drives motor and pickup control outputs. Each layer runs on a TaskScheduler with precise execution intervals: sensor reading at 20 ms, sensor fusion and state machine at 50 ms, motor control at 20 ms, and pickup system at 100 ms. Total loop execution time: ~4–10 ms at 600 MHz.
Hardware
Core: Teensy 4.0 — 600 MHz ARM Cortex-M7, 1 MB Flash, 512 KB RAM, high-speed I²C and PWM, Arduino framework via PlatformIO.
Sensor array (8 × ToF): 4× VL53L1X forward navigation sensors, 2× VL53L1X side mirror sensors, 2× VL53L0X precision pickup sensors. An SX1509 I²C GPIO expander controlled XSHUT lines for independent sensor initialisation. The array enabled continuous 20–50 Hz distance measurement with weighted fusion for stable steering bias control.
Drive system: Differential tracked chassis with 2× PWM-controlled drive motors and independent left/right pickup motors using servo-style 1000–2000 μs control signals.
Software Architecture
The firmware runs a three-layer hierarchical state machine. The top-level Robot State Machine selects between Navigate, Pickup, and Emergency Stop modes. Inside Navigation, the robot transitions between Forward, Turn Left/Right, Reverse, and Wall Follow states. Inside Pickup, it sequences through Detect → Approach → Collect → Verify → Complete. This prevented blocking behaviour and ensured deterministic transitions under competition stress.
Sensor fusion grouped forward ToF sensors into left/right clusters using weighted inverse-variance averaging: weighted_distance = Σ(reading_i / variance_i) / Σ(1 / variance_i). Outputs — forward clearance, side clearance, steering bias, and emergency stop detection — reduced oscillation and produced smooth differential steering corrections.
Dual Pickup System
Independent left and right collection mechanisms each used a VL53L0X sensor for precision weight detection at a 100 mm threshold (emergency stop at 150 mm). Hysteresis-based confirmation prevented false triggers, with automatic release on weight loss and timeout protection. Achieved 95% pickup reliability when calibrated.
My Contribution
Within the team of three I focused on embedded systems architecture, state machine design, sensor fusion implementation, real-time task scheduling, pickup system control logic, and debug tooling and calibration systems. I also contributed to mechanical redesign after competition testing revealed clearance-related failure modes — directly linking mechanical geometry to sensor misclassification behaviour.
Links & Artifacts
GitHub repository — full firmware, architecture, and documentation.
Key Skills & Tools
Embedded & Firmware
- ARM Cortex-M7 (Teensy 4.0) at 600 MHz
- Real-time task scheduling (TaskScheduler)
- Hierarchical state machine design
- I²C peripheral management (SX1509 GPIO expander)
- PWM motor and servo-signal control
- Interrupt-driven and deterministic firmware
Sensing & Algorithms
- VL53L1X / VL53L0X Time-of-Flight sensors
- Weighted inverse-variance sensor fusion
- Differential steering bias control
- Hysteresis-based detection and confirmation
- Emergency stop and timeout protection
Systems & Tools
- C++ (Arduino / PlatformIO)
- CAD and 3D printing for rapid fabrication
- Bluetooth and live calibration tooling
- Git version control
- Mechanical–electrical integration