Software Description:
- Python Idle : This is the coding platform used in this project. Whole Robot is coded in Python language on Python Idle.
- Open CV : This is an Image processing Library used for giving Robot the vision of the chessboard.
- Pyfirmata: This is used to code Arduino in Python Language. Basically this connects Arduino to Python Idle instead of Arduino IDE.
Concepts to learn for making Autonomous Chess playing Robotic Arm: Working of robotic Arm involves series of concepts and mechanisms.
1. Forward Kinematics : Given the angles of servo motor Forward kinematics deals with finding Desired Position of End Effector. (i.e given the servo angles such as theta_1, theta_2 and theta_3 Forward kinematics helps to find X, Y and Z coordinates or position of the end-effector). This is also used to check whether angles obtained by inverse kinematics are correct or not. The video is provided in this zip file’s “Videos” folder.
2. Inverse Kinematics : Given the X, Y AND Z coordinates of end effector the inverse kinematics deals with finding the desired angles of the Servos to reach the desired location. (for example : For picking an object which is placed at position (X, Y, Z) Inverse kinematics can be used to reach that particular object and grab it. The video is provided in this zip file’s “Videos” folder.
3. Kinematic Diagrams : These are the diagrams used to derive and solve the equations of forward and inverse kinematics. I solved kinematic diagram for an 3DOF articulated Manipulator.
4. Denavit–Hartenberg parameters : This is a method to solve Forward kinematics easily by making a Parameter table.
5. Rotational Matrices and Displacement Vectors : These are used in finding homogeneous Transformation Matrix and also for converting camera coordinates into Robots base frame coordinates.
6. Image Processing : This is used to give Robot vision of what’s happening on chess board like if move is played or not or if move is played by white or black.
DH Convention Rules
- Rule 1: The Z-axis must be the axis of rotation for a revolute joint or direction of motion for prismatic joint.
- Rule 2:
- Rule 3:
- Rule 4:
DH Parameters
- theta
- alpha
- r
- d
Step by step working of Robotic Arm:
Step 1: First input from the player is given whether he wants black or white. If the player chooses white then Robotic arm takes black color and black color is given as input and vice versa if players chooses black suppose player chooses white here
Step2: Game starts. As soon as the game begins, image processing starts to check if white played the move. The detection of movement is detected by simple subtraction of two images first one is original image and second is the new image formed to changes of position of pieces on board. If subtraction results in nothing that means no move is played. If subtraction results in a non zero matrix then move is played by white. This lets Robot understand if move is played or not.
Step 3: Suppose white plays move E4 here. Move is detected by image processing. Then robot fetches the move from its chess opening dictionary I created and then plays the move accordingly. The dictionary is like { “e5”:coordinates }. From this the Robot gets the desired coordinates and then by Inverse Kinematics picks up the pawn from e7 square and places it at e5 square. This is how picking and placing of piece works.
Step 4: This whole process keeps on repeating itself unless game comes to conclusion. The whole Robot is controlled by Arduino pro mini which controls and provides necessary PWM to Motors.
Conclusion: The robot successfully detects the moves played and also successfully picks up and place the chess pieces accurately and precisely on the chessboard using Image processing.
Working Video :Feel free to check the working video of this project below :)
Comments