Air Hockey Robot

Inspired by the great Jose Julio with his amazing work Air Hockey Robot
https://www.jjrobots.com/air-hockey-robot-a-3d-printer-hack
I decided to make one as well about 1.5 years ago.
In order to create the needed parts, I needed to make a 3D printer first
https://alexchenwoodworks.blogspot.com/2018/10/3d-printer-enclosure.html
which took me about half year. But the process was very rewarding. I learned a lot about Arduino, Ramps 1.4 and stepper motors.

The build of the table was from scratch, by cutting the ply wood, drilling the holes, building the table, installing the fans, and the power supply.

Once the table is done, the next step is to install the Arduino Mega board + Ramps1.4, parts for the robot ( I used the parts Jose created ) and the motors. This step of installing the mechanical parts is crucial in that I had to make sure the path the robot goes through be smooth, straight, and square. There are a lot of factors that can limit the robot's final speed, ex: unevenness of the table surface, too wide of the table (causing the robot to stuck on the 2 rails when going fast), un-parallellness of the 2 rails ... etc. Unfortunately due to the design of my table and the imperfection of my building it, my robot's final speed is not as fast as the original one.

The next key step is the software. After studying Jose's code, I decided to revamp it by re-writing the whole thing myself.

I changed the architecture of the software. The original software has most of the code resided on Arduino, but I've changed it in a server-client fashion, with the separation of Arduino (client) side and PC (server) side. The eye and brain of the robot are the code on the server side, and it gives order to the robot as for where to move, on the client side. But, the basic algorithms, like puck, robot detection, robot strategies, are still similar to Jose's.

The new software is written in C++ in Object Oriented fashion, and Arduino. I've also made quite some improvements, performance wise and logic wise, as well as some bug fixes.
You can find the source code here.

Below I list the improvements compared to the original air hockey robot:
  • the robot eye needs not specifically be a PS3 camera, but any web cam
  • the code is easier to read, with the new concepts of client-server, and improved performance and logic.
  • bug fixes
  • new and added logic for the robot strategy and missing step correction

[What can be done better?]
Due to the design and the imperfection of my DIY table, the mechanical of the robot limits its speed, so I was not able to get as fast speed as Jose's. If I can make it again, I'd just purchase a commercial table and go from there.

Enjoy!












Comments

Popular Posts