6
CHESSBOT – A chess playing robot ArunKumar N Sandeep Kumar KG Dept. of Electrical and Electronics Engineering, Pondicherry Engineering College, Pondicherry – 605 014. India. Email: [email protected], [email protected] Abstract- This project is an attempt to design and build a Chess playing Robot. The specially designed sensor based chessboard detects your moves automatically and thereafter a PC controlled robot will play against you. It gives you a feeling that a real opponent is playing against you and this has several advantages. ChessBot is very much simpler; it is not athletic but has lots of brain to make you sweat. ChessBot can play special moves like Castling, En passant etc. and can detect wrong moves. Keyword- Chess, Robots, DOF, Magnetic Sensors, Stepper Motor I. INTRODUCTION Chess is debatably the greatest board game ever. It originated in India in the early seventh century and has grown into a worldwide popular pastime. The rules of modern chess have changed a little, since the fifteenth century. However, the way chess is played has undergone a major revolution since the invention of the computer. Most of the people would prefer to play against a real person sitting in front of them, on a large well-made chessboard. However, sometimes a computer is the only player to satisfy your chess appetite. But, this has its own set of problems. Continuous exposure to computer may cause sore eyes. Surely there must be a way to avoid sore eyes from staring at the chess game on the monitor for too long and clicking pieces around with a mouse. A chess kit which can eliminate this issue has a good scope and will be more helpful. The market recognizes this and as a result there are many electronic solutions available, where a player can play on an actual chess board. Electronic chess boards with real pieces and computerized opponents come a long way in bridging the gap between traditional game play and modern technology. Excalibur and Novag [1] chess boards are examples. But again the problem here is that the player has to make the move on the board for the PCs move also. In recent years robots have captured the interest of more and more people. Robots [2] have changed the way, industries are evolving. They have increased the quantity and quality of production in all kinds of industries by their speed and accuracy. The world of gaming has seen a great nuance since the advent of computers. It was computers that embarked humans into the era of cyber games. Addiction to cyber games causes excessive physical and mental trauma. This demanded an interactive way of playing games in real- time. This veered robots into the gaming arena. Thereafter it has been making its advancements by leaps and bounds. We today play the Robo-soccer [3], Robo-volleyball [4] etc. The idea of confluencing the robot with the game of chess has been tried in several research institutes [5-8]. The attempts were not very successful because of their usage of industrial robots with specially crafted coins and board. All these have paved way for the intelligent robo-gaming and this area does have a great scope in the years to come. The main objective of the project is to make the game of chess more realistic and to add a new game to the already growing robo-gaming. Section II outlines the design choices made throughout the implementation of ChessBot. The decisions for or against particular implementations are discussed as the final design is uncovered. Features and specifications of chessbot are given in section III and IV respectively. II. DESIGN The ChessBot is a simple and user friendly system to play chess with. It comprises of the robotic arm, the sensor based chessboard, the interface circuitry and of course the personal computer. Fig 1. General Block Diagram of ChessBot Chessbot design has three major domains namely mechanical design, electrical design and software development. The electrical part focuses on the design and fabrication of the driving circuit and the sensory chessboard. The software has to be designed in such a way that extra hardware could be easily added perhaps in the form of add- on modules. A. Mechanical Design The project proposes to use the Cartesian coordinate system for the design of the robotic arms. This is due to the following reasons: The simplicity of design in the Cartesian coordinates is not achieved in any other coordinate. The chessboard being a 2-D matrix (8 X 8), the coins can be best accessed using a rectangular working space. The algorithm for the movement and control of the Degrees of Freedom (DOF) becomes very complicated in other coordinates. It asks for continuous tracking of the motors. The whole stability and body balance of the robot is high in Cartesian robots.

Chessbot - Final Paper

Embed Size (px)

Citation preview

Page 1: Chessbot - Final Paper

CHESSBOT – A chess playing robot

ArunKumar N Sandeep Kumar KG Dept. of Electrical and Electronics Engineering, Pondicherry Engineering College, Pondicherry – 605 014. India.

Email: [email protected], [email protected] Abstract- This project is an attempt to design and build a

Chess playing Robot. The specially designed sensor based chessboard detects your moves automatically and thereafter a PC controlled robot will play against you. It gives you a feeling that a real opponent is playing against you and this has several advantages. ChessBot is very much simpler; it is not athletic but has lots of brain to make you sweat. ChessBot can play special moves like Castling, En passant etc. and can detect wrong moves.

Keyword- Chess, Robots, DOF, Magnetic Sensors, Stepper Motor

I. INTRODUCTION Chess is debatably the greatest board game ever. It

originated in India in the early seventh century and has grown into a worldwide popular pastime. The rules of modern chess have changed a little, since the fifteenth century. However, the way chess is played has undergone a major revolution since the invention of the computer. Most of the people would prefer to play against a real person sitting in front of them, on a large well-made chessboard. However, sometimes a computer is the only player to satisfy your chess appetite. But, this has its own set of problems. Continuous exposure to computer may cause sore eyes. Surely there must be a way to avoid sore eyes from staring at the chess game on the monitor for too long and clicking pieces around with a mouse. A chess kit which can eliminate this issue has a good scope and will be more helpful.

The market recognizes this and as a result there are many electronic solutions available, where a player can play on an actual chess board. Electronic chess boards with real pieces and computerized opponents come a long way in bridging the gap between traditional game play and modern technology. Excalibur and Novag [1] chess boards are examples. But again the problem here is that the player has to make the move on the board for the PCs move also.

In recent years robots have captured the interest of more and more people. Robots [2] have changed the way, industries are evolving. They have increased the quantity and quality of production in all kinds of industries by their speed and accuracy. The world of gaming has seen a great nuance since the advent of computers. It was computers that embarked humans into the era of cyber games. Addiction to cyber games causes excessive physical and mental trauma. This demanded an interactive way of playing games in real-time. This veered robots into the gaming arena. Thereafter it has been making its advancements by leaps and bounds. We today play the Robo-soccer [3], Robo-volleyball [4] etc. The idea of confluencing the robot with the game of chess has been tried in several research institutes [5-8]. The

attempts were not very successful because of their usage of industrial robots with specially crafted coins and board. All these have paved way for the intelligent robo-gaming and this area does have a great scope in the years to come.

The main objective of the project is to make the game of chess more realistic and to add a new game to the already growing robo-gaming. Section II outlines the design choices made throughout the implementation of ChessBot. The decisions for or against particular implementations are discussed as the final design is uncovered. Features and specifications of chessbot are given in section III and IV respectively.

II. DESIGN

The ChessBot is a simple and user friendly system to play chess with. It comprises of the robotic arm, the sensor based chessboard, the interface circuitry and of course the personal computer.

Fig 1. General Block Diagram of ChessBot Chessbot design has three major domains namely

mechanical design, electrical design and software development. The electrical part focuses on the design and fabrication of the driving circuit and the sensory chessboard. The software has to be designed in such a way that extra hardware could be easily added perhaps in the form of add-on modules.

A. Mechanical Design

The project proposes to use the Cartesian coordinate system for the design of the robotic arms. This is due to the following reasons:

• The simplicity of design in the Cartesian coordinates is not achieved in any other coordinate.

• The chessboard being a 2-D matrix (8 X 8), the coins can be best accessed using a rectangular working space.

• The algorithm for the movement and control of the Degrees of Freedom (DOF) becomes very complicated in other coordinates. It asks for continuous tracking of the motors.

• The whole stability and body balance of the robot is high in Cartesian robots.

Page 2: Chessbot - Final Paper

The Degree of Freedom (DOF) of a robot is a very cautiously chosen aspect. It can be called as the “necessary evil”, because higher the DOF more will be the flexibility of the robot but with it increases the number and complexity in the design of actuators and manipulators. Generally, pick & place robots for simple use have 3-5 DOF. We decided to have 4 DOF for the following purposes:

• 1st DOF – X axis – To reach the required File • 2nd DOF – Y axis – To reach the required Rank • 3rd DOF – Z axis – To reach the Coin • 4th DOF – Gripper – To hold or release a coin The Chessbot employs the basic screw drive mechanism

as shown in fig. 2 for its X and Z axis movement. This is in view of the stability and simple design. The screw mechanism of the X axis is driven by a motor which rests at one end of the base. Unlike in other mechanism where the motor sits on the body. Similarly the stability is improved as the base box, which encases the Z axis motor, can sit on the smooth base and move with more stability.

Fig 2. Leadscrew drives: As the leadscrew rotates, the load is translated in

the axial direction The Z axis movement is also done by screw drive

mechanism. But, here in addition to the main screw there are two other guiding bars which provide balance and stability to the plate moving in the Z direction.

The Y axis movement is carried out by the Rack and Pinion method. This option was chosen because it suits the need of this arm. This arm has to reach the opposite end of the chessboard. Moreover the dovetail wedge gives a higher stability to the manipulator.

The Gripper is the end –effector of the arm. Chessbot has a gripper designed using very thin steel bars with a semicircular plate at the end. This design has been adopted because the coins have a circular base and hence catching this part is very important for proper grip. The thin rods go easily within the gaps even if all the adjacent squares are occupied.

Fig 3. Gripper

The plier mechanism is preferred because of its easy design and construction. It is driven by a small stepper

motor whose shaft is directly attached to the coupling of the two projections. It has been designed to have only two states, open and close. The close state has been designed for a base diameter equal to that of a pawn, which is the smallest.

The speed and flexibility obtained in the control and activation of electric actuators are not found in the hydraulic actuators. We decided to choose the stepper motor as our prime actuator because of the following reasons:

• The stepper motor needs only excitation pulses and a constant DC source unlike the servos which require special continuous DC supply.

• The stepper can be used for both open loop and closed loop control.

• The stepper motor can be directly controlled using the pulses coming from the computer.

• Stepper motor systems are cheaper when compared to the servo motor drives.

B. Electrical Design

The chess board should be able to talk with a processor. The communication protocol should use a variant of the standard Portable Game Notation (PGN) [9], which is used for recording chess games. This will allow the software to be easily written to interface with the board. 25 pin Parallel ports [10] are used for interfacing the processor and the board. Signal at the output of the parallel port can not run the stepper motors directly. Therefore, driving circuit is necessary to drive the motors.

1) Driving circuit

The drive circuitry consists of power transistors TIP42C [11] to drive the stepper motor. The output of the control logic from the PC is fed to the base of the power transistor through a resistor. The excitation voltage for the stepper motor is applied to the motor. And the stepper motor coil is connected to the collector. The signals from the PC are sent through a Darlington pair to increase the current and then fed to the buffers. The buffers 74LS125 [12] are used to enable or disable a stepper motor. 74LS125 has an active-LOW enable which selects a particular motor if the enable input of the buffer corresponding to that motor is LOW.

2) Sensor board

The Robot will work on the signals being fed to the processor and its resulted action as taken by the software. Hence the movement of the pieces on the board is a very necessary requirement. This asks for a special board which will be able to exactly tell the processor where the human has played and also keep track of the position of the pieces. This special board is a sensory board with sensors that can detect moves. The feasibility of using a certain sensor scheme over another for the project required some research. The different options available were optical, inductive, capacitive, force, resistive and magnetic sensors. The main problem of optical sensors is the multiplexing issue. In the case of resistive sensors, chess pieces make electrical

Page 3: Chessbot - Final Paper

contact with the board, changing the resistance between contacts on a square. If the contacts were not perfect this could present problems. Inductive and capacitive sensors require special resonance circuits to detect moves and were found to be expensive. So, the project plans to utilize magnetic reed switches to detect the movement of pieces. Preliminary investigation also suggests that reed switches are cheaper than other magnetic sensors like Hall Effect sensors etc.

Having selected reed switches as the sensor to implement here, chess pieces with magnetic bases are required. To use the switch as a position sensor, it was first thought that the switch could rest horizontally below each square Fig 4.

Fig 4. Original reed switch arrangement

A small 3X3 board was constructed to test the suitability of this configuration. On testing however it was discovered that positioning the magnet above the center was not suitable to actuate the switch. This is because of the fact that when a magnet is placed at the center, the flux produced will deflect both the plates of the reed switch in the same direction and there will be no contact (fig. 5). The same magnet when placed slightly off center actuates the switch (fig 6). Thus, either the reed switch or the chess piece has to be placed slightly off center. We can not impose a constraint on the player to place the chess piece off center. Therefore, we placed the reed switches on the board slightly off center.

Fig 5. Magnetic field perpendicular to reed switch

Fig 6. Magnetic field parallel to reed switch

A schematic of the sensory board is shown in fig.5.

Detection of moves can be done in a number of ways to varying degrees of success. This project utilizes the simplest method of move detection using Demux and 8 bit buffer 74LS244 [12].

The outputs of the Demux are used to address the Ranks. The processor will send control signals to the Demux and switch ON the outputs one by one sequentially. These outputs are given to the enables of the 8 bit buffer 74LS244. All the eight reed switches in a Rank will be given to the eight inputs of the buffer. The outputs of the buffer are given to the Processor. Thus the board will be scanned one Rank after the other.

Present state of the reed switches will be scanned and stored in the processor memory. When the user makes a move, one has to press the user button. The Processor will be put in polling mode of operation. It will scan the user button and send control signals to scan the board again. The new states will be compared with the previous states and the moves will be detected. C. Software

The software for Chessbot is developed using C language [13]. There are two different programs used by the Chessbot. One is the chess engine [14] that can be modified to communicate with the hardware interface program (HIP). This program receives its inputs from HIP and then calculates the opposing moves. The other software is the hardware interface software. This has been done in C. This software receives the signals from the sensor board and then calculates the move and gives it as the input to the main chess program. Similarly while the control of actuators, the signals generated by the chess algorithm has to be converted into a sequence of bits which then control the stepper motors.

Page 4: Chessbot - Final Paper

III. FEATURES

• We can play the game of chess anywhere, anytime. • The game will be more realistic. • ChessBot avoid sore eyes. • ChessBot is more interactive. • ChessBot has the ability to detect wrong moves and can

play special moves like castling etc. • As ChessBot is PC based it can be programmed to play

the game online. • An LCD Chess clock could be implemented as an add-

on module for playing timed games. • A Speech module could be implemented that speaks

aloud the opponent’s move. • ChessBot could be interfaced to a Personal Digital

Assistant (PDA) or a mobile phone. The PDA’s processor could run a chess engine. The mobile phone could provide a connection to a special Internet chess Server. The options are endless.

• ChessBot has the ability to embed other game engines on the processor, providing the ability to play games other than chess and to do some other useful work.

III. SPECIFICATION Configuration Manipulator Type Point – Point Capability Intelligent Robot Coordinate system Cartesian Work envelope Rectangular Prism DOF 4 Mobility Fixed Internal Sensors No External Sensors Non Contact Type (Magnetic Reed

Switches) Control Open Loop Software C Language Length 50 cm Breadth 40 cm Height 25 cm Chess Square Size 2.5 cm Chess Coins Standard GNU chess pieces with

magnetic base Chess Rules FIDE Power Supply Direct – 230 V,50Hz Interfacing 16 bit Parallel Port

V. CONCLUSION

Design of chessbot is completed and simulated using simulation software like Circuitmaker. Driving circuit is fabricated and tested using random test signals. Sensor board fabrication is yet to be done. The testing phase showed that chessbot is a great success and we have found it to be better than the previous attempts made to create such robots.

VI. REFERENCES [1] Chess boards , http://www.bcmchess.co.uk/bcmcomp.html [2] P A Janakiraman (1995), “Robotics and Image Processing”, Tata

Mcgraw Hill, India [3] Robo-soccer, http://www.cs.utexas.edu/~pstone/robosoccer.html [4] Robo-volleyball,

http://www.biped.ri.cmu.edu/jim2/www/volley/index.html [5] Jos´e Gon¸calves, Jos´e Lima, Paulo Leit˜ao , “Chess Robot System:

A multi-disciplinary experience in automation”, Thesis, Instituto Polit´ecnico de Bragan¸ca,, Bragan¸ca, Portugal

[6] David Urting and Yolande Berbers, “MarineBlue: A Low-Cost Chess Robot”, Thesis, Department of Computer Science, Leuven, Belgium

[7] Robotchess, http://staff.science.uva.nl/~toto/Work/RobotChess/ [8] Autonomous chess playing robot ,

http://www.harding.edu/engineering/pages/projects/chess.html [9] PGN Notation, http://www.very-best.de/pgn-spec.htm [10] Parallel Port specification,

http://www.epanorama.net/circuits/parallel_output.html [11] R.L. Boylestad, L.Nashelsky, “Electronic Devices and Circuit

Theory”, 8th Ed., Prentice Hall India

[12] Thomas L. Floyd, “Digital Fundamentals”, 8th Ed., Pearson Education Inc

[13] Kernighan and Dennis Ritchie, ”The C programming Language”, 2nd Ed.’ Prentice Hall India

[14] Faile chess engine, http://sourceforge.net/projects/faile/ [15] Fairchild Semiconductor Corporation, www.fairchildsemi.com

Page 5: Chessbot - Final Paper

VII. A

PPEN

DIX

Manufacturer

Model

Sensor Method

Feedback Ivan II

Magnetic auto-sense

LCD

K

ing Arthur

Manual

LCD

E

xcalibur

Karpov G

randmaster

Pressure Auto-sensory

LED

& L

CD

M

ephisto Exclusive V

I A

utosensing LC

D &

LED

M

ephisto Chess

Acadam

y Feather touch

LED

& L

CD

Saitek

(Kasparov)

Mephisto C

ouger Feather T

ouch LE

D on boarder, LC

D

Star Diam

ond A

uto-sense LE

D &

LC

D

Novag

Obsidian

Auto-sense

LED

& L

CD

D

GT

Projects D

GT

Electronic

chessboard Inductive auto-sense

None

Appendix 1. A

vailable chess boards

EnablePP

Enable Z

Enable X

X Motor

Y Motor

Z Motor

PP Motor

5A

Enable Y

CheckMate

User

Wrong Move

Open Ckt

To 8 8bit buffers...(16- 4 bit buffers)

0123

Bits from 4 bit buffer

5VS1

74LS154

19 E118 E0

20 A321 A222 A123 A0

1715 1614 1513 1412 1311 1110 109 98 87 76 65 54 43 32 21 10

U7+V

V25V

74LS1617 CEP10 CET2 CP

6 D35 D24 D13 D0

9PE 1MR

15TC 11Q3 12Q2 13Q1 14Q0

U4

Q4PNP

Q3PNP

Q2PNP

Q1PNP

Q8PNP

Q7PNP

Q6PNP

Q5PNP

Q9PNP

Q10PNP

Q14PNP

Q13PNP

Q12PNP

Q11PNP

Q15PNP

Q17PNP

10V

1A

2

3B

4

M1

1A

2

3B

4

M2

1A

2

3B

4

M3

1A

2

3B

4

M4

74LS1254C4A3C3A2C2A1C1A

4Y

3Y

2Y

1Y

U6

74LS1254C4A3C3A2C2A1C1A

4Y

3Y

2Y

1Y

U5

74LS1254C4A3C3A2C2A1C1A

4Y

3Y

2Y

1Y

U1

74LS12513 4C12 4A10 3C9 3A4 2C5 2A1 1C2 1A

114Y

83Y

62Y

31Y

U2

74LS139

3 A1a2 A0a1 Ea

13 A1b14 A0b15 Eb

7Q3a 6Q2a 5Q1a 4Q0a 9Q3b 10Q2b 11Q1b 12Q0b

U8

74LS1393 A1a2 A0a1 Ea

13 A1b14 A0b15 Eb

7Q3a 6Q2a 5Q1a 4Q0a 9Q3b 10Q2b 11Q1b 12Q0b

U3

123456789

10111213

141516171819202122232425

J1

1k

1k

1k

1k

1k

1k

1k

1k

1k

1k

1k

1k

1k

1k

1k

1k

A

ppendix 2. Driving C

ircuit

Page 6: Chessbot - Final Paper

A1 B1 C1 D1 E1 F1 G1 H1

A2 B2 C2 D2 E2 F2 G2 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