Mechanical Checkers Peter Frandina Raymond Poudrier Christopher Rouland.
-
date post
15-Jan-2016 -
Category
Documents
-
view
221 -
download
0
Transcript of Mechanical Checkers Peter Frandina Raymond Poudrier Christopher Rouland.
Mechanical Checkers
Peter FrandinaRaymond PoudrierChristopher 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 Board24”x24”x10”
Squares2” green/white in color24 black squares along perimeter for captured pieces
PiecesRed/white in color
Error
IllegalMove
Performed
WhiteTurn
Move inProgress
RedTurn
Takeback Reset Start/Resume
Draw
Difficulty
HardEasy Med
Draw
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
Error
IllegalMove
Performed
WhiteTurn
Move inProgress
RedTurn
Takeback Reset Draw
Difficulty
HardEasy Med
Draw
Start/Resume
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 I2C 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
Electromagnet
motor_x
motor_y
Y-axis Track
pulley_ypulley_x
Positional Motors
Motor Stepping Pattern +5 V
Darlington Arrays
(ULN2064b)
8-Wire Stepper Motor
+5 V
Coil 1 Coil 2 Coil 3 Coil 4
Step 1 0 1 1 1
Step 2 1 0 1 1
Step 3 1 1 0 1
Step 4 1 1 1 0
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 square3. 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 = 0.03665 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?
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?