Mechatronics maze-solving robot with ultrasonic sensor array and gripper arm
04 // Robotics — Capstone

Mechatronics Maze‑Solving Robot

University of Toronto  ·  2023

Arduino C++ Python PID Control Ultrasonic Sensors Bluetooth Sensor Fusion Gripper Design 3D Printing SAE Level 2 Automation
⏱ Completed in 4 min 18 sec — within the 5-minute limit
Overview

Navigate, Locate, Pick Up & Deliver

A compact rover designed for a capstone challenge requiring it to navigate a predefined maze while meeting strict constraints on size, weight, cost, and functionality. The robot had to avoid obstacles, localize itself anywhere in the maze, pick up a block from a loading zone, and deliver it to a drop-off point — operating at SAE Level 2 driving automation.

Challenges Faced

  • Unreliable ultrasonic readings at angled walls
  • Motor bias causing drift in straight-line motion
  • Power limitations across combined subsystems
  • Stable, user-friendly control interface requirement

Solutions Implemented

  • Automated obstacle-avoidance via ultrasonic sensors
  • Manual override via Bluetooth with compass orientation
  • Dual Bluetooth modules — motors and sensors separated
  • PID controller to correct motor bias drift

Key Contributions & Outcomes

Technical Approach

PID Correction & Hybrid Control

The drivetrain used a differential-drive configuration with a PID controller to counteract motor bias — a common issue in dual-motor systems where slight torque asymmetry causes the robot to drift off course. The controller read encoder feedback and applied differential corrections at each control loop tick.

Two Bluetooth modules were used to separate motor command traffic from sensor telemetry — preventing packet collisions that would corrupt time-sensitive obstacle readings. A custom Python GUI on the operator's laptop visualized live sensor data, giving the operator situational awareness for manual override decisions.

The "X"-shaped gripper used a single servo to open and close four arms simultaneously — a mechanically elegant solution that minimized weight, wiring complexity, and potential failure points compared to a multi-servo design.

// PID motor bias correction float error = targetHeading - compassReading; float correction = Kp * error + Kd * (error - prevError); setMotors(BASE_SPEED + correction, BASE_SPEED - correction); prevError = error;
Mechatronics maze-solving robot — 3D-printed chassis with gripper arm