Introduction: Pool Playing Robot

Picture of Pool Playing Robot

I hope for the opportunity to do this kind of work with Instructables during this upcoming Artist in Residency session.

If you like my project, please vote!! If you like the idea of me being considered for an artist in residence position, please vote!!! Thank you!

Now, here is the story of the pool playing robot code named Judith.

Step 1: Where to Start?

Picture of Where to Start?

I'm playing pool and think "Robots are doing brain surgery, how is one not yet playing pool?"

"If one were to be made, what would it look like?"

I start sketching. It doesn't take long to realize the first challenge is to navigate the table legs. Pool tables are super heavy. If a robot is going to come from underneath the table, it will need to go around some strong table legs.

Robot designs get very complicated when they have to bob in and out of table legs. I struggle with this challenge for a long time. Then, I see someone holding a bouquet of flowers and think, "Support the table from one pedestal in the center and you can eliminate the table legs altogether." I draw it up.

Step 2: Getting Rid of the Table Legs

Picture of Getting Rid of the Table Legs

I see an artist laser cutting and then stacking layers of cardboard to make flowing and unique shapes. Later, I see a construction site with a perfect rectangular stack of plywood. I think, "If I can laser cut plywood, I could stack the pieces into a pedestal big enough to support a pool table."

I find a laser cutter that can cut wood one sixth that of construction site plywood. Thus begins the one-sixth scale mini-Judith project.

Step 3: Getting the Robot Around the Table

Picture of Getting the Robot Around the Table

I realize I traded one challenge for another with the pedestal decision. Sure there are no table legs, but where am I going to find a three foot inner-diameter bearing?

Discouraged, I tell a student the challenge and he suggests making a bearing. Pool balls are there and the idea develops to use pool balls as ball-bearings. Slingshot ammo is one sixth the size of a pool ball.

Step 4: Prototyping

The motion platform feels like a blank canvas for design ideas to access and shoot the balls. I do a lot more sketching and then it pours rain outside for a few days straight. Work gets canceled. I stay home and build a prototype.

Step 5: Test the Geometry

I talk with a science teacher using stop motion video to have students learn about proteins. I am inspired to test the geometry of the Judith prototype using stop motion. The geometry seems to work for straight forward shots.

It feels like time to start adding programmable motion control to the system.

Step 6: Controlling Motion Around the Table

Picture of Controlling Motion Around the Table

I'm doing a 3D-printer repair and it hits me that 3D-printer belts are really good, really cheap and readily available. One of those, a little razzle-dazzle gear designing and wallah, servo/belt control of the platform motion.

Step 7: Adding Motion Control to the Arms

I redesign the prototype with servos, belts and gears at the points of rotation to add programmable motion.

While doing so, I stumble across an easy win. It turns out that the "parked under the table" orientations, and the "perpendicular to the table" orientations are regular stops for pool playing robots. Adding two tabs to a layer of the table pedestal and placing two switches on the motion platform is a simple way to reliably detect those positions.

Step 8: How Do We See the Table?

Picture of How Do We See the Table?

We certainly need a camera looking down on the table to see what is going on in the game. The trouble is with the cables connected to the camera. Aren't they going to tangle as the platform spins around the table?

That question is yet to be answered. I decided to suspend a mirror above the table and to put a camera on the platform at an angle. The PixyCam is a great tool to test the idea on a 1/6th scale and 3D printing an angled Pixy mount is easy enough.

Step 9: Getting Data From the Table

Picture of Getting Data From the Table

The Pixy sees and recognizes pool balls by color and provides identity and location data. Here, I'm showing pool ball identity and location data being received through the Arduino serial terminal.

As a bonus, the Pixy gives angle data if two color swatches are placed next to one another. One way to use this feature is to put dials with paired color swatches in view of the Pixy. If we then link position commands to the angle data of the color swatches, we can give Judith "remote" commands simply by turning the dials.

Step 10: Circuit and Code

This scale model consists of two independent Arduino based motion systems. The first controls the coarse motions of the machine and the second is responsible for the finer motions of aligning the shooting mechanism with the cue ball.

The coarse motion system controls the platform and the two linked "bicep" servos that lift the rest of the machine. As the lifting motion must be slow, I used VarSpeedServo libraries to control the servo speed.

There are two switches positioned to identify both parked and perpendicular platform orientations. The code moves the platform between the perpendicular and parallel positions while slowly raising and lowering the biceps. Ball location data is collected through the PixyCam when the platform is perpendicular to the table.

The second system connects to the first system with an "extender" arm that is fitted with a Flora LSM9DS0 sensor. (Special thanks to the Adafruit support forum for help with the LSM9DSO sensor.) The extender servo tracks the Flora sensors angle data to maintain target angle positions. The shooting mechanism is represented here by a tilt/pan system driven by a PixyCamera trained on the cue ball color. The code posted drives the extender arm to target angles while the tilt/pan system tracks the cue ball.

Step 11: The Shooting Mechanism

Picture of The Shooting Mechanism

I like the idea of creating a rail-gun/solenoid style electromagnet shooting mechanism.

In an effort to avoid having giant, high-powered magnets involved in the machine, I figured I'd try to make it using two electromagnets, one a coil around the cue stick, the other around a tube. Go ahead and chuckle if you know this doesn't work... I didn't until the testing. Somehow the opposite magnetic fields just "cancel" rather than repel. What? What happens to all that work from the battery? Heat? C'mon! No way. I have a lot of questions. Regardless, it doesn't work. I had to resort to using high powered magnets. What about all the magnetically sensitive sensors used on other parts of the machine? Another day's challenge... here we go.

In true "Ready, Fire, Aim!" style, I disregarded the questionable test results and went ahead and purchased the strongest magnets I could find, an 8 Farrad car audio capacitor, five pounds of magnet wire and a metal pipe. These components should enable me to make the full scale shooting system. The black thing I'm holding is all five pounds of magnet wire wrapped around the metal pipe. The white ends are 3D printed caps to guide the stick through the tube.

I'll update when the carbon tube where I'll embed the magnets and to which I'll attach the cue shaft arrives.

Step 12: What Is Left to Do?

I have yet to write a strategic shooting algorithm.

I proposed the challenge of making shot commands based on ball data to a computer science student and he came up with a fascinating bit of code that first finds all possible shots and then selects the shot to take based on which has the largest margin of error. I have a lot to learn in the computer science department and am excited to do so.

The actual shooting device, the part that controls the cue stick motion, has yet to be created. You'll notice on this one-sixth scale model that I'm using a laser cut, wooden placeholder. Making an artistic, full size shooting mechanism is one of the ideas I would like to propose to the decision makers of "Who gets accepted into the artist in residency program?"

Thank you for looking at my project. Please vote!!


albenbrewder (author)2017-09-14

Very entertaining...Good work.

Re: driving the pool Que... Check out this Video

Also see where it was used.. here

Al Brendel

BVarv (author)albenbrewder2017-10-15

Hi Al!

Thanks! I needed inspiration to pick this back up.

I too like the solenoid idea. I went ahead and put some energy into making one and I've updated the progress as step 11. What do you think?

Thanks again!


laith mohamed (author)2017-06-24

Wowww that is unbelievable

BVarv (author)laith mohamed2017-06-25


Jonathanrjpereira (author)2017-05-13

Circuit Diagram & Code?

BVarv (author)Jonathanrjpereira2017-05-27

Hey Jonathanrjpereira, I've added a step at the beginning with circuit diagrams and Code. Thanks again for asking and for being interested!

BVarv (author)Jonathanrjpereira2017-05-13

Thanks Jonathan, you're the first to ask. I'm hosting out of town guests for a few days, but will put together what I have and post after that. Stay tuned!

Widgetwizard (author)2017-05-13

Awesome build!! I thought I was a good pool player until I saw this. It is clear you have spent a lot of time on this project. Great job! I look forward to seeing what you come up with next.

BVarv (author)Widgetwizard2017-05-13

Thank you! I'll reach out when I post something new.

Mr innovative (author)2017-05-12

Mindboggling !!!!

BVarv (author)Mr innovative2017-05-12

"Mindboggling!!!" from Mr. Innovative is a great way to start the weekend. Thank you!

raddevus (author)2017-05-12

Fantastic. So many innovative ideas. Absolutely great. Thanks for sharing.

BVarv (author)raddevus2017-05-12

Thank you!

pj200 (author)2017-05-11

Is this your work which is featured on the official Arduino website?

BVarv (author)pj2002017-05-11

GET. OUT. WHOAAAAA. It sure is. Thanks for the heads up!!
I am so honored. I don't even know what to say. I hope those views translate to something positive for this contest...

pj200 (author)BVarv2017-05-12

Those views will definitely translate into a victory!
Well done and you should proud of yourself.
Congrats again.

BVarv (author)pj2002017-05-12

Thank you. Fingers crossed!

pj200 (author)pj2002017-05-12


pj200 (author)pj2002017-05-11

and congrats if so.

DIY Hacks and How Tos (author)2017-05-05

I love this! Soon there will be robot pool hustlers.


JeffB293 (author)BVarv2017-05-10

Great stuff, Ben. There are a ton of skills embedded in this creation.

BVarv (author)JeffB2932017-05-11

Thanks Jeff, I've learned a lot creating it.

tcheupluk (author)2017-05-10

Beau et intelligent.

BVarv (author)tcheupluk2017-05-11

Je vous remercie

barancanaydin (author)2017-05-10

Wow Cool project!

BVarv (author)barancanaydin2017-05-10

Thank you!

EltonO (author)2017-05-10

Thats so so so so awesome man!

What about using something like a slingshot (e.g. angry birds haha) for the cue system? Its gonna looks like 8 ball pool (android game) where you pull the cue and release it at the desired power.

BVarv (author)EltonO2017-05-10

Elton! Thank you!
I love the slingshot idea. It seems like that style would be easy to control how much energy each shot gets, which is a big focus of my efforts. A slingshot would also be very compact, unlike using a falling mass to power the shot. Love it. I hope to make a few designs and to post results for you to see. Thanks again for the comment!

EltonO (author)BVarv2017-05-10

Ill be happy to see it working :D

LorrieM6 (author)2017-05-09

Wow! So impressed!

BVarv (author)LorrieM62017-05-10

Thanks Lorrie!!

Timothee Gillier (author)2017-05-09

Cool project!

jailie (author)2017-05-09

we have a winner

BVarv (author)jailie2017-05-09

Well. This makes my day.
Thank you.

AlecM39 (author)2017-05-08

Wow that's really cool!

BVarv (author)AlecM392017-05-08

Thanks Alec!

Mdiaz415 (author)2017-05-06

This is very impressive, Ben. I look forward to seeing this project grow.

BVarv (author)Mdiaz4152017-05-08

Thanks Mikey!

pjerz (author)2017-05-06

Great idea! Hope you will build also a full sized one!

BVarv (author)pjerz2017-05-08

Thanks! Meeeeee toooooo. I'm hopeful about gaining access to tools large enough to do so.

jrbums (author)2017-05-05

This is an impressive project, especially the table design and how you are acquiring ball position with a camera. Do you have a favorite reference for using the PixyCam with an Arduino?

BVarv (author)jrbums2017-05-06

Wow, thank you. Looking at your projects, I'm humbled and flattered that you are impressed with mine.
The Pixy forum and their wiki page are really all I used as reference. Both are fantastic.

jrbums (author)BVarv2017-05-07

Cool, I will explore there. Best of luck with collaborating on the shooting algorithm!

BVarv (author)jrbums2017-05-08

Thanks! I'll post new project steps as it develops

HendoJ (author)2017-05-06


BVarv (author)HendoJ2017-05-08

HA! "Perfect" may be a bit of an overstatement, but I'll take it! Thanks. Your bionic hand project is inspiring for some ideas I have about the shooting mechanism. Thanks for the comment and for posting your project.

juanm115 (author)2017-05-06

Fantastic!! A lot of effort!

BVarv (author)juanm1152017-05-08

Yes, a LOT of effort, but this stuff is fun for me so it doesn't feel like work...
Thanks for the comment!

Timothee Gillier (author)2017-05-07

This is cool!

About This Instructable




Bio: Purdue University Mechanical Engineer. CAD designing, 3-D printing, CNC Plasma cutting, Laser cutting, welding, woodworking, Arduino enthusiast and instructor.
More by BVarv:Pool Playing RobotSkittle Sorter
Add instructable to: