Mechanical Checkers Peter Frandina Raymond Poudrier Christopher Rouland
Agenda Project objective Interface design and layout Initialization and startup Hardware components Software components Testing / Integration Remaining Issues Questions
Project Objective -To Achieve a Physical Checkers Game Experience Against a Computer Opponent Physical game board with tangible pieces Enjoyable for players of variable skill Computer plays using a microcontroller and magnets hidden below the playing surface Piece placement detected by embedded photocells
Game-play Follows Traditional English Draughts If one or more jumps exist, one must be taken User is responsible for ‘kinging’ pieces at appropriate times The user is responsible for removing all pieces jumped during his or her turn Computer is responsible for removing all pieces jumped during its turn
Exterior Physical Layout Game Board 24” x 24” x 10” Squares 2” green/white in color 24 black squares along perimeter for captured pieces Pieces Red/white in color
User Interface 5 Push-Button Switches Reset, Start/Resume, Take Back, Draw, Difficulty 9 LEDs 2 Turn Indicators, Move in Progress, Illegal Move Performed, Error, Draw, 3 for difficulty level
Initialization Initially, the user is required to set up the checker board by placing all checkers in their appropriate starting locations User selects difficulty setting User presses the “Start / Resume” button All checker locations are verified by checking photocell values. If board is setup correctly, motors will move to starting locations, and game will begin Otherwise, error light will be illuminated
Error Recovery Errors Illegal jump/move Checkers are placed in improper locations during the user’s turn Recovery The error light is illuminated, at which point all checkers have to be replaced to last known valid location The user then presses the “Start / Resume” button, and all checker locations are verified via the photocell values If board is in last valid state, the game will resume
Photocell Board Placement 56 Photocells Used 32 Playing surface 24 Removed checker locations 5mm wide x 4mm high x 2mm thick Light Resistance = 5k Dark Resistance = 500k Mounted flush with the board surface Centered in each square
Microcontroller Module CSM12D module Uses Freescale MC9S12DT256 5V power requirement 16bit processor 256K byte Flash EEPROM 4K byte EEPROM 12.0K byte RAM
Microcontroller I/O Scheme 61 Inputs (Photocells, switches) 19 Outputs (LEDs, motors) Not enough on breakout header of CSM12D I/O expander via I 2 C bus (Inter-Integrated Circuit) 4x 16 bit I/O Expanders Each individually addressable Only 2 pins on microcontroller needed (SCL, SDA) Expanders will handle photocells and switches MCP23017 by Microchip
Positional Motors 2 Stepper Motors 5 V, 7.5° step angle 2 Aluminum Timing Belt Pulleys 2 Urethane Timing Belts 40” length, ¼” wide 2 tracks perpendicular to platform for alignment
Positional Motors Motor Stepping Pattern +5 V Darlington Arrays (ULN2064b) 8-Wire Stepper Motor +5 V Coil 1Coil 2Coil 3Coil 4 Step Step Step Step 41110
Capturing a Piece If a piece to be removed is horizontally blocked from the removal squares, 1. Blocking pieces are each moved down one square 2. The captured piece is moved to its appropriate removal square 3. Blocking pieces that had to be moved are returned to their starting positions. 4. The actual “jumping” movement take place. → 1. Remove Captured Red Piece, 2. Move the Jumping White Piece
Software Algorithm Minimax Algorithm Recursive algorithm which calculates best possible score of future moves Difficulty setting determines number of moves to calculate (Easy = 2, Medium = 3, Hard = 4) Scoring events Capturing pieces (higher score for capturing ‘kinged’ pieces than normal checkers) Attaining key positions on the board (positions along left/right edges of board for normal checkers, any edge position for ‘kinged’ piece)
Anticipated Problem Areas Experimenting with electromagnet Wiring Placing photocells in board and wiring so that magnet can pass as close to the surface as possible Keeping wiring out of the way of the moving electromagnet Power source must be investigated
Testing Strategies Motor Testing Verify that it takes 54.5 steps to move 1 square 7.5 degrees / step = 48 steps / 360 degrees Circumference of pulley = 1.76 inches 1 step = inches Photocell Testing Operation of game will be done in various lighting environments to verify photocell functionality Software Algorithm will be verified on personal computer so that adjustments to scoring methods may be easily altered and re-simulated
System Integration Software algorithm completed and verified Software driver functions for I/O Photocells LED’s Reset Switches Motor verification Board creation Wiring to various I/O devices
Questions? ???? ???? ???? ???? ???? ????