abbeyjean’s

Lego Mindstorms NXT

Projects

CheckersBot

Mark II

This is my second attempt at a robot that can play checkers. My earlier effort (CPR) was slow and unreliable at identifying the pieces.

This one is pretty fast to both scan and play taking approximately 30 seconds to scan and 10-15 seconds to make a move. It is totally autonomous and generally plays a reasonably good game. Occasionally it will fail to pick up a piece and also occasionally misread a piece when scanning, particularly in bright light conditions but generally it is not too bad.

Checkersbot consists of a board made of three basboards. The actual playing surface consists of tiles.  Along one side is a conveyor belt that carries a carriage with an arm that can move left to right across the board. Mounted on the end of the arm are two HiTechnic EOPD sensors which make really good light/colour sensors.

At the rear is a robotic arm that can rotate and move forward and back and up and down. At the end of the arm is a pneumatic 'Hand'. The air for the hand is supplied by a compressor situated at the rear of the board behind the arm. Beside the arm is a table containing four black kings and next to that is a discard bin for any taken pieces to be dropped into. 

Initialization.Before a game can begin the system must initialize itself. This consists of the hand opening, the scanner beam retracting and the carriage moving to its 'home' position. Both the scanner beam home position and the carriage home position are determined by touch sensors.

The arm then rotates to find its horizontal position (determined by a touch sensor) and lifts up to find its vertical position, determined by a tilt sensor and by checking when the NXT motor stalls.

Finally the player can make fine adjustments to check that the arm will pick up and replace a piece.

The game can now begin. The player moves and then presses the 'Turn over' button (another touch sensor) to tell the NXT that it can make its move. The NXT scans the board to determine where the pieces are, decides on its move and then picks up the piece it wants to move. It then moves it to the square where it finishes up and places it there. If any pieces were jumped these are them removed and dropped into the discard bin at the rear of the board. If the piece that the NXT moves is to be made a king, it is also dropped in the discard bin and replaced by one of the four kings on the table next to the bin. It is then the players turn again. And so on.

Scanning the board: The carriage moves towards the player until it is in line with the first row. This is determined by the encoder in the motor. The arm then travels out across the board and detects what pieces are in the first two rows. A HiTechnic angle sensor is used to determine when the scanner beam is in the right position to read a piece. To speed things up two EOPD sensors are used so two rows can be scanned at a time. The carriage then moves forward two more rows and the arm retracts reading rows three and four. This is repeated for rows five and six and seven and eight. The carriage then moves back to its 'home' position.

Moving a piece: Once the NXT has decided on its move the robotic arm must move to that square and pick up the piece. The position the arm must move to is determined by three encoder values, one for the rotation motor, one for the 'upper arm' motor and one for the 'forearm' motor. These values are held in an array'. Once the arm is in position the hand closes to grasp the piece. The arm now moves to the square where the piece is moving to. The hand opens and the piece is dropped there. The same procedure is used to remove jumped pieces from the board and drop them into the discard bin, or to replace the piece with a king if necessary. Then it is the players turn. The whole process is repeated until the game is over.  

Front Side

 

 
Scanner Beam Pneumatic Hand   Discard box & King table
Air Compressor Scanner Carriage

The Robot uses quite a lot of motors and sensors:

 

One NXT motor was used to rotate the arm, another to move the 'shoulder' joint, a third to move the ''elbow' joint and a fourth to drive the scan carriage.

The Mindsensor Motor MUX is needed to drive the additional NXT motor.

 

A small power functions motor was used to move the scanner beam in and out and another was used to operate a pneumatic switch to open and close the hand. A large power functions motor drives the compressor.

These are all controlled using the HiTechnic IR Link sensor.

 

A Touch sensor is used for an input button to let the NXT know when the player has moved..

Another Touch sensor is used to determine when the scan carriage is 'home'.

A third Touch sensor is used to determine when the arm had rotated to the 'home' position.

This meant I also needed the HiTechnic Touch Multiplexer.

 

The HiTechnic Tilt sensor is used to detect the vertical 'home' position of the 'upperarm'.

 

A HiTechnic Angle sensor is used to determine where the beam is so each square can be read by the two HiTechnic EOPD sensors which detect whether a square contains a white man, a black man, a white king, a black king or nothing.

A Touch sensor is used to determine when the scanner beam had retracted to its 'home' position.

These were all connected to a HiTechnic Sensor multiplexer. I modified this to run off a Power Functions battery as the battery box that comes with the multiplexer is annoyingly difficult to mount.

 

Thanks to Xander Soldaat (mightor_at_gmail.com) for his RobotC driver suite which I used or modified as needed. Also to Robotarm v3.0 which inspired my robotic arm design.

 

'Turn over' button Arm rotation setup  

    Home    The NXT Step    Nxtasy    RobotC    Bricklink    HiTechnic    Mindstorms Home    Contact Me

LEGO, MINDSTORMS and NXT are registered trademarks of The LEGO Group.