Autonomous Foosball Table

Summary of Autonomous Foosball Table


This senior design project built an autonomous foosball table that uses a webcam and Java software to visually track colored ball and opponent players, predict trajectories, and control rows of players via servos (including AX-12s) to play without human input. Budget was about $500 and software used Java Media Framework; vision-based tracking simplifies object identification and is inexpensive versus specialized sensors.

Parts used in the Autonomous Foosball Table:

  • Webcam (USB)
  • Computer/PC
  • Java runtime and Java Media Framework (JMF)
  • AX-12 servos (4 units)
  • Additional servos (4 units of a different type)
  • External gears (for speed conversion)
  • Foosball table and player rods/rows
  • Wiring and serial link for servo communication
  • Power supply for servos and electronics

I was contacted by somebody who suggested I should enter our senior design project here. Seeing as how we found and used the AX-12s from Trossen Robotics, I figured this would be a great place to post.

This project was our senior design, a semester long course that requires a team of electrical and computer engineering undergraduates to design, order parts for, build, and program a piece of their choosing. We figured that, since we knew we’d be locked up in the senior design lab anyway, we should at least do something at least mildly entertaining. We were given about a $500 budget from the school.

Autonomous Foosball TableThe ball and all opponent players are tracked visually with a webcam hooked up to the computer. Both are unique colors, so tracking becomes a trivial task. In order to increase the processing speed, trajectory prediction is used. This allows the ball to be localized to a “most likely” position, around which, individual pixels may be searched. The advantage to using a visual system is that it’s more true to the way humans play. We wanted to create a robot that played the game as much like humans do as possible. An alternative method would be to either implant a locator in the ball or furnish the table with an array of sensors. One additional advantage is that webcams are CHEAP compared to any other system. Finally, by using a visual system, we can track any number of objects, none of which need to be “specially outfitted.” We can track each trajectory and there is little to no ambiguity of what those objects are. In a time-crunch situation, it’s also nice to know that it’s very easy to interface a webcam to a PC (simple USB connection). The software on the PC was all written in Java, utilizing the Java Media Framework (JMF). Contrary to popular opinion, the lag from the webcam and the processing time on the PC are so minimal they can easily be adjusted for in software.
Since this is a robotics website, I will get down to the guts and glory of what most of you are probably intested in: the servo motors. We used 2 different types of servos for this project, though in retrospect, I would probably go about the project quite differently in some aspects (I’ll revel in that a little later in this post). As I already mentoned, we did use th AX-12s for 4 of the 8 motrs (1 for each row). These provided the lateral motion. The beauty behind them is how eeeaaasssyyyyy they are to program! They provide great torque, are individually addressable on a single serial link, have tons of built-in features (torque overload detection, heat overloads, etc), and they’re relatively inexpensive. By using a larger external gear, we were able to convert that high torque into a higher lateral speed.

Quick Solutions to Questions related to Autonomous Foosball Table:

  • How is the ball and opponent tracked?
    They are tracked visually with a webcam using color-based identification and trajectory prediction.
  • What software was used for processing the webcam input?
    The software was written in Java and utilized the Java Media Framework (JMF).
  • Why use a visual tracking system instead of embedded sensors?
    Visual tracking is cheaper, can track many objects without special outfitting, and closely resembles human perception.
  • How many AX-12 servos were used and what was their role?
    Four AX-12 servos were used to provide lateral motion, one for each row.
  • Are the AX-12 servos easy to program?
    Yes, the AX-12 servos are described as very easy to program and are individually addressable on a single serial link.
  • What advantages do AX-12 servos offer?
    They offer great torque, built-in features like torque and heat overload detection, and cost-effectiveness.
  • How was lateral speed increased from the high-torque servos?
    By using a larger external gear to convert the servos high torque into higher lateral speed.
  • Was webcam and processing lag a problem?
    No, lag from the webcam and PC processing were minimal and could be adjusted for in software.
  • What was the project budget?
    The team was given about a $500 budget from the school.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter