Project Group 48: Chess Robot

This is an archive site. Current senoir design projects are at https://projects.eng.uci.edu.

Topic:

Team Name: J.A.M. and Jelly

Team Members:

  • James Ortiz-Luis (CpE)
  • Allan Rodriguez (CpE)
  • Mario Ruiz (CpE)

Mentor: Professor Rainer Dömer

Goal Statement:
Our goal is combine the application of computer vision and robotics to build a user-friendly chess-playing robot to provide a challenging opponent to chess players. 

Approach:
The main controller of our project is the Raspberry Pi, which will be running our chess software. To determine the orientation of pieces on the chessboard, we will use a camera connected to the Pi and image processing. To physically move the chess pieces, we will use a programmable robot arm connected to an Arduino, which will receive direction from the Raspberry Pi.

Responsibilities:

  • James - Computer Vision
  • Allan   - Chess software and A.I. 
  • Mario  - Piece manipulation using robotic arm

Computer Vision

The steps taken to see the pieces on the board are as follows:

  1. Take top-down image of chessboard

  2. Segment the image into the 64 squares of the chessboard

  3. Count the number of white pixels on a square after running edge detection to find a piece.

  4. Use the average grayscale pixel intensity of each occupied square to determine the color of the piece.

After these steps, we obtain an 8 by 8 matrix which describes the state of the chessboard. 0 indicates an empty square, 1 indicates a white piece, and 2 indicates a black piece. By subtracting the matrices from two consecutive images, the movement of a piece can be determined.
 

Ches Engine and A.I.
We built our own chess engine to power Jelly’s decision-making by defining chess rules, then using existing chess knowledge to assign point values to potential moves. Our engine then builds a tree of moves and prunes it as it goes, so as to minimize computation and deliver the optimum move for Jelly.

Robotics
Jelly is equipped with an arduino controlled robotic arm which we programmed to establish a serial connection to our main controller. This way the main controller can send the A.I.’s move to the robotic arm through the serial port, and the arm can precisely move the chess piece to the designated position on the board.