JD
John Doe/Project
Built with folio
TubeSort — Autonomous Puzzle-Solving Robot
Profile

On this page

ProblemSolutionImplementationSystem ArchitectureVision PipelineSolverActuation

TubeSort — Autonomous Puzzle-Solving Robot

Engineered a CNC gantry robot that photographs a puzzle game via Pi Camera, extracts game state through an OpenCV pipeline (perspective warp, contour detection, K-Means color segmentation), solves it with a DFS backtracking algorithm, and physically executes moves by driving stepper motors and a servo gripper through GPIO

Python · OpenCV · Raspberry Pi · Stepper/Servo

Problem

Sliding-tile puzzles require iterative manual moves to reach a solved state. Solving them robotically demands three things working in concert:

  1. Real-time vision to detect puzzle state from arbitrary camera angles
  2. Optimal path-finding to compute the minimal move sequence
  3. Precise actuation to execute moves autonomously

Solution

TubeSort integrates computer vision, algorithmic search, and precision robotics into a single autonomous system. A Raspberry Pi-driven CNC gantry photographs the puzzle, analyzes it via OpenCV, solves it with a DFS backtracking algorithm, and executes moves through stepper motors and a servo gripper.

Implementation

System Architecture

Vision Pipeline

Key Steps:

  • Capture: Raspberry Pi Camera mounted above puzzle board
  • Perspective Correction: Normalize board geometry from arbitrary angles
  • Tile Detection: Contour analysis isolates individual pieces
  • Color Classification: K-Means clustering identifies tile colors robustly

Solver

Algorithm:

  • Convert detected tiles into searchable puzzle representation
  • Explore move trees via depth-first backtracking
  • Output ordered list of tile swaps for execution

Actuation

Components:

  • Stepper Motors: Drive XY gantry to position gripper over target tile
  • Servo Gripper: Z-axis lift, move, and place operations
  • GPIO Control: Real-time command execution from Raspberry Pi
Profile