UBC Engineering Physics · Summer 2026
ENPH 253 Autonomous Robot
We built an autonomous robot for UBC's 16-team Mars habitat competition, finished early enough to tune it, and won.
C++ · ESP32 · FreeRTOS · Motion control
The competition
ENPH 253, more commonly known as robot summer, is a unique course at UBC Engineering Physics taken in your second summer. Sixteen teams of four second-year students spend about six weeks building a fully autonomous robot, then compete head-to-head at the end to find a winner.
What’s so special about this course is that teams have to make their robot entirely from scratch. That means designing parts for fabrication, including laser cutting, 3D printing, and waterjetting. We also designed and assembled custom PCBs and wiring, and wrote the software that controls the robot from scratch. The course sets a new challenge every year, so there’s no one to copy from.
The 2026 theme was building a Mars habitat. In two-minute, head-to-head heats, each robot had to navigate the field and complete as many tasks as it could. The competition overview here describes the event in a bit more detail.
This year, the competition was designed to have several different ways to score. Robots could stack radio-tower pieces, assemble a habitat dome, remove covers from solar panels, find the rock containing hidden aluminum, or spot concealed teletubies and flash a light at them. The aluminum rock looked like the others, so it had to be detected rather than recognized by appearance. The solar-panel location was signaled by an infrared beacon. These tasks called for navigation, sensing, and manipulation to work together, all entirely autonomously.

Our approach
Our philosophy from the start was to build the simplest robot we could get working as quickly as possible. We deliberately chose not to pursue the radio tower points, as supporting that task would have added significant mechanical complexity. Instead, we focused on getting the rest of the robot working as reliably as possible. Because of our approach and the team’s collective effort, our robot was running nearly two weeks before any of the other 15 teams had a working robot. We used that time to tune it on the field extensively and make it as consistent as possible.
I developed the embedded software and controls for the drivetrain, two-DOF arm, camera, tape detectors, and metal detectors. My teammates and I built and tested the complete robot together.

Driving a repeatable route
The mecanum drivetrain let our robot translate sideways as well as drive forward and backward. I programmed holonomic motion using combined angular and linear PID controllers to move it toward target positions. For pose estimation, we used OTOS (Optical Tracking Odometry Sensor), an optical localization sensor I had developed for TNTN Robotics. This enabled high-speed and precise movement through complex maneuvers without taking up much space or additional design effort.
Having a working robot early gave us time to test complete routes on the real field and adjust the routing when a run did not match the plan, ensuring that our robot could perform consistently under real-world conditions.

A mecanum wheel and drive hardware inside the chassis.
Making the arm predictable
I used inverse kinematics to turn a target claw position into targets for our robot’s two-link arm. We used magnetic encoders on each joint with nested position and velocity PID loops controlling their movement. We also added battery-voltage compensation so the arm’s behaviour was consistent across different battery states.

One of the arm joints, with its belt drive and encoder.
Electronics
Each subsystem had its own dedicated custom PCB that we designed and assembled ourselves. Our main board used an ESP32 with PWM and I2C multiplexers to control the rest of the robot. The other boards included a tape-sensor array, a metal detector circuit, power distribution, and custom H-bridge circuits. The boards were designed to be robust and easy to assemble, with connectors for each subsystem and clear labeling.
Sensing and coordination
We used a combination of sensors to help our robot navigate and interact with its environment. Computer vision on a second processor was used for teletubby detection, a tape sensor array was used for position recalibration, and two metal detectors enabled our robot to detect the metallic rock. I wrote the ESP32 firmware in C++, using FreeRTOS tasks and queues to coordinate driving, sensing, and manipulation.
Result
In the end, after a lengthy overnight stay in Hebb Theater and a long day of competition, our team won the finals. Our team was also interviewed by CityNews Vancouver after the event, and finally, we got some rest.
Overall, the course was a great experience. It was a lot of work, but we learned a lot about designing and building something almost entirely from scratch, and we had a lot of fun doing it.