Friday, March 28, 2014

ARM T3 - Tic Tac Toe Playing Robot Arm


ARM T3 - Tic Tac Toe Playing Robotic Arm

I am going to tell you the story of our robot ARM T3, a robot capable of playing tic tac toe with a human. Here is the video of ARM T3 in action.


This robot has two main parts, vision system to detect board and mechanical arm to draw crosses on board. 

Mechanical Components


For implement robot arm we use low cost hobby servos and servo brackets. We bought servos from pololu.And servo brackets from ebay. Then we assembled brackets and servos and build 3 link arm and used a one servo for control of pen. It was not a hard task to this part.

And then we did some modeling of robot arm in Matlab so that we can do calculations easily. Here is a image of planning robot in Matlab.This image shows all accessible points to robot arm when it is placed at origin.

Eye of the Robot

 

And most important part of this robot is its vision system, we used a Logitech C270 webcam  to grab images of the tic tac toe board. Images grabbing and processing algorithm is implemented in a java program which runs on a laptop computer. This program uses javacv(openCV wrappers for java) for doing these image processing works. 
Before starting a game we calibrate the robot, in this stage our algorithm detects lines in the board and it identify positions of 9 squares. And it also programmed to identify circles drawn by human opponent on the game board.

How Robot thinks 


Also thinking where to play is also an important task. After identifying game status via image processing algorithm robot has to play on a suitable position. We use min-max algorithm for this tic tac toe robot to calculate best option to play. This min-max algorithm is also programmed in the previously mentioned java program. 

Interconnecting All things


Now I am going to tell you how these things are interconnected. 
As already mentioned robot continuously looks at game board to detect circles drawn by human.
As soon as it detects humans play, it updates the game status and calculate best option to play by using the min-max algorithm.
And then laptop computer which runs those algorithm sends necessary motor rotating angles to arduino board which then controls the servo positions.

This is how we came across with this little tic tac toe playing robot and we are going to develop it by using dynamixel servos so that maximizing its drawing capabilities.

Your suggestions are warmly welcome !