Single Player Foosball Table with an Autonomous Opponent
ECE 4007 Senior DesignTeam FIFADr. James Hamblen
Michael AeberhardShane Connelly
Evan TarrNardis Walker
Preliminary Design ReviewOctober 16th, 2007
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
Project Overview
Develop an automated human vs. machine foosball table Low-cost Competitive play
Prototype is a modificationof a normal foosball table
Player assumes one side, a computer controls the other side
Source: Gauselmann
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
System Overview
Servo ControlBoard
ImageProcessing
PC
Webcam
Foosball Table
Servos
USB 2.0
RS-232 Physical
Bi-directionalUART and PWM
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
Image Processing
Use webcam for image input SPC-900NC chosen for 90FPS USB 2.0 allows 480Mbit/s
Use PC for image processing Java Media Framework used for
software processing Allows easy acquisition using a single command As fast as C for media processing: up to 250FPS
Localization and prediction performed in real time
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
Image ProcessingAcquire new frame from webcam
Scan all pixels for yellow ball
Ball found?
Kalman Filter
Acquire new frame from webcam
Search localized area for yellow ball
Store current position
Predict position at next frame
Yes
No
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
Servo Controller
A controller board is used to control the servo motors Servo motors interact mechanically with the
handles of the foosball table Microchip PIC18F4520 microcontroller
Software for microcontroller written in C AX-12 servos used for the lateral motion of
handles PWM servos used for the rotational kicking
motion
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
AX-12 servos controlled by a bi-directional UART data bus Each servo identified by a unique ID AX-12 communications protocol Read, write, write all, status
instructions used to control and obtain information from the servos
AX-12 powered by a separate 9.6V source Typical servo current draw: 1A each Prevents power overload from microcontroller
Each PWM servo controlled by a pulse-width-modulated signal from the microcontroller
Servo Communication
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
AX-12 Servo Communication
Source: Robotis AX-12 User Manual
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
SPIModule 115.2 kBit/s
RS-232UART
115.2 kBit/s
Servo Control Block Diagram
PIC18F4520
Microcontroller
MAX3100UART
MAX232Transceiver
SPI
10 MBit/sPC
EPWMModule
EUSARTModule
AX-12Servo
AX-12Servo
AX-12Servo
AX-12Servo
UART
1 MBit/s
PWMServo
PWMServo
PWMServo
PWMServo
Lateral Motion
Kicking Motion
PWM Signals
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
PC-Controller Communication
RS-232 physical interface from PC to microcontroller
UART data communication between PC and microcontroller at 115.2 kBit/s
Custom communication protocol
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Data bits for communication message
0-1: Always [ 1, 0 ] 2: Control Bit (1 = special command, 0 = servo control) 3: Servo Type Select (0 = AX-12, 1 = PWM) 4-5: Servo Addressing (00 = 1, 01 = 2, 10 = 3, 11 = 4)6-15: Positional Value
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
Mechanical Assembly
Top-Down View
PWM Servo(Rotational)
AX-12 Servo(Lateral)
Nylon TrackNylon Gear(Attached to Servo)
Nylon Gear
Nylon Track
Foosball Table
Side View
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
Current Status
Mechanical assembly Goalie handle assembly complete Currently testing the design
Servo control board Successful AX-12 communication/control Successful PC communication
Image processing Preliminary tracking software completed Processing successfully at over 200FPS
ECE 4007 Team FIFASchool of Electrical and Computer Engineering
Goals and Issues
Need to successfully test mechanical operation Once completed, duplication of design is easy Critical item – needs to be completed to
continue development Implement and test PC-microcontroller
communication Webcam acquisition rate is low
Currently at 10 FPS Goal: at least 60 FPS
Begin developing gameplay AI