Robocon 2024 - War Dragon R1
Jan - June 2024
Role: WD R1 SW Senior, Game Rule/FAQ/Appeal PIC
Technologies: STM32, RTOS, PID, Trapezoidal & Bézier Pathing, C, Embedded Systems
🏆 About ABU Robocon 2024
📄 Official Theme & RulesThe theme for ABU Robocon 2024 was "Harvest Day". Two teams (red and blue) compete in a 3-minute match. Each team operates two robots: a manual/semi-automatic Robot 1 (R1) and a fully-automatic Robot 2 (R2).
The R1 robot (our focus) is responsible for planting seedlings in Area 1 and navigating the complex Harvesting Zone (Area 2) to collect and shoot balls into Area 3. Precision and speed are critical.
Below is the official theme video explaining the rules in detail:
Overview
As the Senior Software Engineer Lead for War Dragon R1, I was responsible for both technical development and team management. I led four junior software engineers through multiple iterations of robot design for R1. The robot featured a tunnel through its centre to pass over balls in Area 2, requiring extremely precise navigation. I developed a novel Track Following Pathing system to enable this.
Mentoring Junior Software Engineers
From January to June, I guided the R1 software team through three generations of the robot:
- Gen0 (Jan-Feb): I wrote the framework for most programs and let juniors fill in the details. This helped them learn the overall structure while I maintained consistency across modules.
- Gen1 (Mar-Apr): Once juniors understood the basics, I let them design the structure for Gen1, giving them experience in architectural decisions. I also oversaw Fiery Dragon R1 to ensure a smooth transition.
- Gen2 (May-June): I delegated full tuning responsibility to the juniors, only stepping in when they were absent. This allowed them to make decisions and develop ownership of the robot.
Every night after leaving the lab, I sent detailed progress reports and to-do lists so everyone knew what was happening and what needed to be done. This kept the team motivated and focused.
Technical Contributions - Software
1. Area 1 Seedling Planting Pathing
Our robot had four seedling clamps on one side, allowing us to grab and plant seedlings in groups of four. The system supported fully automatic pathing with manual override at any point. Paths were split into five states: Start Zone, Seedlings 1-4, Seedlings 5-8, Seedlings 9-12, and Area 2. Using a combination of trapezoidal and Bézier paths, we enabled flexible strategies like “plant 12 → Area 2”, “plant 4 → Area 2 → plant 8”, etc. The robot could retry quickly using auto paths from Area 2 back to Start Zone.
2. Area 2 Track Following Pathing (Innovation)
R1 had a tunnel in the middle of the robot so that it could move past balls without touching them. This limited movement to a very strict, straight line with only a few cm tolerance. I invented a Track Following Pathing system to allow the robot to move along these low-tolerance paths while switching rows quickly.
- Straight lines: PID control perpendicular to the line kept the robot within tolerance, while trapezoidal motion controlled parallel movement.
- Curved arcs: For switching between rows, the robot followed circular arcs. PID maintained constant radius from the arc centre, while tangent speed was controlled manually (joystick) or automatically.
Three modes:
- Semi-Manual: Driver controls speed, robot stays on track. At intersections, joystick input triggers automatic track switching via arcs.
- Semi-Auto: Driver selects a destination ball, robot finds the shortest path using a hard-coded recursive algorithm and traverses with trapezoidal speed.
- Full-Auto (not used in competition): Pre-computed optimal paths for all 924 ball combinations using recursive brute force on a computer, then uploaded to the robot. This was inflexible but provided a theoretical optimum.
3. Shooter Regression
To accurately shoot balls from any position in Area 2 to any target in Area 3, we developed a regression model. After 200+ test shots, we plotted distance vs. flywheel velocity and applied linear/polynomial regression. The resulting formula allowed the robot to compute the required flywheel speed on the fly.
4. Laser / Line Sensor Positioning
To compensate for inaccurate XY-encoders caused by slopes and obstacles, we used six DT-50 lasers and three line sensor bars. The line sensors had 8 elements spaced 12 mm apart, achieving 6 mm accuracy by interpreting patterns (e.g., 00011000 = centred, 00011100 = +6 mm). Sensor fusion combined laser, line sensor, and IMU data to recalibrate position even when some sensors were blocked.
5. Red-Blue Field Flipping
Due to left-right symmetry, we attempted to flip all sensor inputs and actuator outputs to write code for only one side. Challenges included non-symmetrical robot design, different theta flipping requirements for Area 1 (θ → -θ) vs Area 2 (θ → 90°-θ), and fine-tuning offsets. Ultimately, only Area 2 used this feature.
Test Results & Performance
Overall, R1 was a success - it was one of the fastest R1 robots globally with no major errors or retries during competition.
- Area 1: Completion time dropped from 29.05 s → 26.06 s → 23.05 s in one night of solo tuning. However, acceleration was set too high (32 m/s²), causing tire slippage and rapid wear.
- Area 2: The track following system worked but was slower than expected. Arcs introduced errors requiring stops for pre-steering, making WD R1 slower than FD R1 in Area 2.
- Shooter: An unexpected yaw offset caused inaccuracy and asymmetry between red/blue fields.
- Laser positioning: Code was too complex, making debugging difficult. The math's correctness remains uncertain.
Awards & Recognition
- 🏆 ABU Robocon Hong Kong 2024 - 2nd Runner-Up (War Dragon)
- 🏅 ABU Robocon Hong Kong 2024 - Best Team Spirit Award