Homemade table tennis robot for ~$230 by tbkdan
Featured
Overview
After looking around at a bunch of table tennis robots out there to help me practice, I decided to make it a fun project with my wife to build one of our own with a feature-set that was similar to or better than what was already out there. It's been a long on-and-off development cycle, but it's finally to the point of being usable. It utilizes a dual-wheel ball thrower with vertical, horizontal, and rotational servos. It is currently controlled by an Arduino Mega 2560 microcontroller, but I have plans to change that to a Teensy 2.0. Drills are created on a PC using a simple Java application and then saved to an SD card. The Arduino displays available drills on an LCD interface and a standard TV remote is used to select the drill and start/stop it. Power is provided by a standard ATX computer power supply (both 5V and 12V).

I had originally started this project with the intention of making everything hand-made using off-the-shelf parts from the local Home Depot/Lowes, but it quickly became apparent that anything made would not be easy to reproduce so that was idea was scrapped. We then went the route of home fabrication with a 3D printer and purchased a Reprap Prusa Mendel from Makergear to help make any parts that we modeled on the computer. This has been absolutely essential to making this design work :-) So, there will be some parts obtained at a local Home Depot/Lowes and some purchased online. All-in-all, the total Bill of Materials comes to about $230 without shipping. BoM is attached below (as both a PDF and XLSX).

Summary of construction
I will break this out into three main components: frame/ball path (including PVC and custom parts), electronics, and software. To complete this project you will require basic hand tools, a wood saw, a drill, measuring tape, stapler and staple gun, a 3D printer (or printing service), soldering iron, multimeter, and a PC with a USB port (and an SD card reader/writer if you want to use customized drills). While not necessary, I found it much easier to utilize a custom PCB to mount all the electronic components (LCD/SD/resistors/servo leads/etc) - to do so, you'll either need a laser printer and chemicals to do etching, a CNC mill for PCB milling, or utilize a PCB creation service.

Some notes
1) The larger the throwing wheel, the slower it needs to spin since as the wheel gets larger, the linear speed at the outside diameter will increase while the angular speed remains the same. This being said, a larger wheel allows for better granularity of speed as well as quieter operation (lower motor RPM). The downside is that the throwing head needs to be a bit larger.
2) If you throw a ball with absolutely no spin (in table tennis this is a dead ball, in other sports it may be known as a knuckle ball) it will fly very erratically and be incredibly inconsistent. Rather than throw deadspin balls, I found it was better to throw a _very_ light backspin ball so it would fly consistently and be almost dead once it hit the table.
3) With the speed controllers I have selected, if the motor is spinning and is stopped for any reason (too much load, reversed without stopping first, someone held the motor, etc) they will not spin the motor again until they are brought back to neutral (0) throttle. I think this is a safety feature to prevent overloading of the speed controller if the motor is stuck or dead.
4) Due to the nature of FDM (fused deposition modeling - a method of 3D printing), the parts can sometimes be weak along the printed axis. As an example, let's say you printed a cup as if it were placed vertically on a table. If you were to pull the top and bottom in opposite directions, they would come apart quite easily along a layer seam. With this in mind, it can be beneficial to lightly coat certain stress points with plastic cement (hobby glue) to help increase strength. Such places to coat would be hinge tabs, screw holes, etc.

Video overview

Topspin test


Backspin test


Step 1: Robot construction

The main frame assembly is simply some 2x4, 1x2, plywood, and brackets/screws, so it's pretty simple to put together. Here are some generic notes about the assembly:
1) The pieces of 1x2 that the ball trays attach to are slanted downwards at about a 2-3 degree angle to help the balls roll towards the opening.
2) The pieces of 1x2 that mount the agitator servo only have a single screw per piece so that they can pivot upwards in case of some stubborn balls. There is a screw going into the main frame piece just beneath the 1x2 to prevent the 1x2 from drooping too far down.
 
I have attached the stl files (and reference images) for the printed parts as a zip to this step. Other than that, please follow the detailed images for assembling the robot! Feel free to ask any questions if you need clarification.

Step 2: Assembly diagrams

On this step I have all of the assembly images. I also attached a zip of the PDF files which can be zoomed in a bit more if needed. Please let me know if you need clarification anywhere!

Step 3: Electronics

Power
At the heart of the electronics is ATX power supply. We will be using two voltages from this power supply: 5V and 12V. A standard ATX has several molex connectors (usually the whitish 4-pin connectors) that have both the 12V (yellow) and 5V (red) feeds. The 12V feed is used to power the Arduino and the main ball throwing motors, and the 5V feed is used to power the servos. A note on getting an ATX power supply to actually power on: computers tell the power supply to operate by connecting the green wire in the large 20(or 24)-pin connector to ground - you can do the same with a paperclip by bridging the green wire to a black wire.

Microcontroller
At the moment I am using an Arduino Mega 2560 to control the robot, but I have plans to port that over to a Teensy 2.0 since it is considerably cheaper, has a smaller footprint, and I can still use the Arduino IDE.

Servos
There are five servos used in this robot. Two high-torque servos are used for the ball feed/vertical positioning, and three moderately torqued servos are used for rotation/horizontal positioning/ball agitation. The servo for ball agitation needs to be modified to be a continuous rotation servo: http://www.acroname.com/robotics/info/ideas/continuous/continuous.html  Alternatively, you can just purchase a servo that is already continuous rotation (such as a Parallax 900-00008), but they cost a bit more.

Motors
The motors that I chose are hexTronik DT700 brushless outrunner motors. I went with brushless motors because of longevity requirements, and as a bonus these are quieter and more efficient than most brushed motors. The speed controllers are HobbyKing SS Series 25-30A brushless ESC and are controllable via the standard Arduino servo library. Finally, since these speed controllers are not reversible, I have two DPDT relays (TE Connectivity RTE24005F) to reverse the motors for excellent spin :-)

Miscellaneous
These items are nice to have, but not strictly necessary to get a ball-flingin' robot :-) The LCD is a standard 16x2 character that is well used in the Arduino community. The SD card is pretty well standardized, and I chose a pre-assembled module so I didn't need to purchase any additional resistors/mounts/etc. The IR sensor is great to control the robot remotely with a standard TV remote - you don't need to program it, just press any three buttons when the robot is powering up to let it know what you want to use for up/down/enter! Finally, the custom PCB is not really necessary, but it sure makes assembly easier!


Construction!
Most of the effort here is in connecting the devices to the Arduino for operation, so it's easier to show you the layout that I generated in CADSoft Eagle. I have also attached the Eagle project file if you wish to make the board yourself and/or get more clarification on where things are connected. The large areas of blue are ground planes. Again, I'd like to note that this is for the Arduino Mega 2560 and I will eventually modify this for the Teensy 2.0. As for other connections that need to be made that are not displayed here:

1) 12V output from power supply goes to Arduino power input (I used a power plug from Radio Shack) and to the speed controllers.
2) 5V output from power supply goes to 5V input on board (for servo use). It is important that you do not try to use the Arduino 5V output to power the servos as it cannot handle the load the servos will require.
3) Brushless motors and speed controllers have three leads. One lead from the speed controller goes directly to the motor. The other two go to the input for the relay - we do this so we can reverse the direction of the motor. See image below for more information. We control the relay with the circuit shown on the board (see here) - the 5V along the top side of the board near the 1N4004 goes to the relay input and the two empty holes just below the 1N4004 go to the relay ground. There are two motors, so we need two relays and two control circuits (note the two transistors/resistors/diodes on the board). For more info on DPDT relays, please read the Wikipedia article for lots of info :-)
4) The LCD that I used was the same one used by Adafruit. A potentiometer is required to adjust contrast on this particular model, but I placed that close to the LCD so I only needed 8 wires (CAT5 ethernet cabling) to connect the Arduino to the LCD.
5) The SD card module that I used already had resistors in place, and you can even use a MicroSD module if you wish. However, if you have a plain old SD slot that you want to use, please be sure to use the proper wiring/circuitry to prevent damage to the SD card!

Step 4: Software

DrillDesigner.PNG
ArduinoSerial.jpg
The software section will be split into two parts: the Arduino/Teensy software and the Java application to design the drills to be stored on the SD card. I still have a bit of work to do for the all-in-one control software (conversion to Teensy), so for the time being I will post the Arduino code that I have for testing the robot. It's pretty simplistic, but it works! :-)

Arduino
Full program coming soon. Attached below is a testing application.

Drill Designer
Coming soon!
hubert1946bloom says: Apr 4, 2013. 2:34 PM
Hi tbkdan

This looks like a great project. I think I will try to make one. Can you tell me how close the rollers are to each other, presumable they have to pinch the ball a little so the centres of the rollers must be slightly closer than the combined diameters of the roller plus ball?
You also mention the need to have the rollers going in opposite directions for extra spin! Is this really necessary?

Many thanks for your answers.

Hubert
shail363 says: Apr 18, 2013. 3:59 AM
It slightly depends on your wheels.I have rubber wheels and have kept gap of 38mm.It works great.Secondly design in such a way that you can alter this gap my moving motos as required.hence make a slot so that you can move your motors up and down and try which one is best for you.

Cheers
shail363 says: Apr 18, 2013. 3:55 AM
Hello TDKDAN
Hope you are doing fine.I have completed about 75% of this robot and need your advice/help in software code,I can operate individual components successfully but face very wierd problems when i combine everything. whether it is possible for you to share your operating code having remote interface for my reference ? My email Id is shail363@yahoo.com

Thank you very much in advance and have nice day.

Thank you very much
fr33mumia says: Mar 3, 2013. 5:25 PM
hi tbkdan, can u upload the smaller mount tab for motor? tqvm
shail363 says: Feb 5, 2013. 3:18 AM
(removed by author or community request)
tbkdan (author) says: Feb 9, 2013. 2:28 PM
On step 3 you can see the PCB (Arduino shield) that I designed for this. That's where I place the single and double pin headers. Some of the headers are used to connect the servos. You'll see a section of single row three pin headers for the different servos and large tracks for the servo power on that PCB picture. You could go without a PCB and just solder everything directly if you wish.
shail363 says: Nov 21, 2012. 6:40 AM
Hello TDKdan
Hope you are doing fine.Apologies if i am bothering you. I would really apprecite your help for connecting Arduino and Sevor motor with ATX power supply.

1) How to power arduino with ATX power supply securely ?
   Which wires from ATX should be connected?
(You have used power plug.Whether it is possible for you to provide link for the image of Power plug so that exactly I can understand)

2) How to connect 5 Servos with ATX power supply/Arduino ?
(what I understand is that Atx will supply power through power jack and can be accessed throught 5vin ? but not clear how to wire it

Whether it is possible for you to put simple hand made diagram showing wiring across Atx power ,Arduino and Servo motor ?

Once again Thank you in Advance

Cheers

shail363
tbkdan (author) says: Jan 28, 2013. 4:04 AM
If you look at a standard Molex 4-pin plug on an ATX power supply, you'll see yellow/black/black/red. Yellow is +12V and red is +5V. I used +5V to power the Arduino and the servos. The servos have three leads: positive and negative power, and signal. The signal lead goes to the Arduino pin that is used to control that servo, and the positive and negative go directly to the ATX power supply pins. http://www.mp3car.com/attachments/power-supplies/42969d1182548152-m2-atx-5v-and-3-3v-dead-atx-psu-pinouts.gif
shail363 says: Jan 28, 2013. 6:42 AM
Oooo Dan..how r u doing? After long time.Hope you are doing fine.I am still making this robot.As I dont have 3rd printer I am manufacturing manually.Well I am struggling with electronics but picking up slowly.
As u said, molex connector has 2 inputs for 5 v(+tive and -tive)
So my real question is how do Iconnect 5 +tive lead from ser
vo and 1 + tive from arduino into 1 +tive molex hole.(same goes for brushed motorsh
tbkdan (author) says: Jan 28, 2013. 2:39 PM
I just got standard connectors and soldered the appropriate leads to the appropriate pins on the connector.

https://www.sparkfun.com/products/11300
robertosmyth says: Dec 14, 2012. 3:26 PM
Awsome! I do not have access to a 3D printer. I'd be happy to pay for the printing if you could somehow swing that for me?!
alvinchua says: Jul 2, 2012. 7:40 AM
Nice project!

How do you control the spin (top/back/side) of the ball ?

tbkdan (author) says: Jul 2, 2012. 8:08 AM
The two motors spin independently of each other (and in both directions) so I control the motor speed and direction to obtain the spin that I want. The entire motor assembly rotates to provide side-spin.
shail363 says: Oct 4, 2012. 3:48 AM
Dear tdkdan

Hope you are doing fine

First of all this is great Great Project done......

I came across your project when i was searching home made TT project .I am also TT player :)

I would really appreciate if you help me to understand Arduino alittle bit.I am newbie for Arduino.(I was inspired by your project though)

I was very simple question.I understand that you have created Sketch for Arduino and uploaded in it.Test it ,Works fine.....Proto type done.

How do you implement in practical life ? Suppose if you need to take this robot to club, whether this Robot will still work with Arduino board with same setup or you have to create your own Circuit Board ,mount all components and use it

Thank you in Advance

Regards
Shail363


tbkdan (author) says: Oct 4, 2012. 4:22 AM
In practical use, I have a different sketch that takes drill files from an SD card that state where the ball needs to be with what spin and spins the motors/moves the servos appropriately to get the ball where it needs to be - just like a 2040. It's not ready for prime time and I haven't had much time to work on it over the summer, but hopefully with Fall/Winter coming up I'll be able to invest more time in polishing it off. :-)
shail363 says: Oct 4, 2012. 5:34 AM
Dear TDKDAN

Thank you very much for prompt reply.

My question is slightly different and is verrrry basic.It is related to ARDUINO BOARD itself.Apologies if that was not clear to you.I will try to make very clear.

Consider that your final sketch is ready and uploaded in ARDUINO BOARD and you take drills from SD Card.

Q1) Whether ACTUAL ARDUINO BOARD is installed in the robot that is shown in the video ? (i was thinking ARDUINO BOARD is only used for prototype and cannot be used independent of Computer.Corrrct me if I am wrong)

Q2) Whether ARDUINO BOARD will react to program stored in it wihout DEPENDING on COMPUTER ?

Q3) When progam is uploaded in Arduino and Power is Switchd off then whether same program is accesable when it is switched on ?


Regards

shail363
tbkdan (author) says: Oct 4, 2012. 6:10 AM
The Arduino is installed and running in that video. In the pictures above, you can see it attached to the board just in front of the power supply (with a custom shield on top of it). In the sketch that I have (the unfinished one) the Arduino is completely independent of any computer and draws the power from the ATX power supply. Once you turn on the power supply, the Arduino powers up and starts the sketch, showing the IR remote initialization on the LCD. Please let me know if you need any clarification :-)
shail363 says: Oct 4, 2012. 7:41 AM
Dear TDKDAN

Wow... That great...

Controlling 4 Servos, 2 Brushless motors ,SD card, IR and LCD on just one Arduino Mega.After hooking up all these components,whether Arduino Board is capable of taking the load for continous usage without over heating?

For SD card and LCD have you used any shield ?

For how many hours continuoulsy you have operated it?

Whether Arduino board can handle daily practise of 2-3 hours?

Thanks in advance
tbkdan (author) says: Oct 4, 2012. 2:50 PM
I don't think I'm taxing the Arduino very much - servos and motors are all PWM controlled via the PWM library, IR is just receiving data every so often, LCD is just sending data every so often.. not a whole lot to it. I actually have plans to change it over to a Teensy 2.0 for cost and size issues, but again... time :-) I've used it continuously for 40 minutes straight without issue, and combined probably about 10 hours of actual (non-testing) usage. The SD card and LCD are wired directly into my custom shield that I posted on this project.
shail363 says: Oct 5, 2012. 2:37 AM
Dear TDKDAN
Thats great.
If 4-5 Servos are operated togther.,whether they are not noisy ?
If yes then what alternative you will suggest for this ?

Cheers
tbkdan (author) says: Oct 7, 2012. 2:45 PM
I guess it depends on your definition of noisy :-) I definitely hear them, but it doesn't bother me in my basement. There are probably quieter servos out there, but I was more concerned about keeping price down than noise. Perhaps the servos could be wrapped in some noise-deadening foam?
shail363 says: Oct 10, 2012. 9:11 AM
Dear TDKDAN
Thank you very much for your reply.Hope you are doing fine.

I have decided to make this robot and would really appreciate your expert guidance in electronics part.
I was searching to buy Arduino mega 2560 .So i found Arduino mega 2560 R3 Whether I should go for r3? whether being R3 will create any issues ?
I am also planning to consider this robot to operate on Battery which will be chargebale and run for 2-4 hrs .Can u please suggest me which battery is suitable for this purpose ? (Effective in term s of cost and performace)

have nice day

Cheers
tbkdan (author) says: Oct 12, 2012. 3:35 AM
I don't see anything that would be an issue with the 2560 R3. You could also get away with the 1280 to save some money, but they're harder to find.
I'm not sure how you could pull it off with a battery since, as configured, this robot uses both the +5V and +12V rails of the ATX power supply (for the servos and the motors). Maybe you could find some high voltage servos that could handle 12V...
shail363 says: Oct 21, 2012. 4:30 PM
Dear TDKDAN

How r u doing ? Hope you had nice weekend.I need little help of yours and hope you don't mind bothering you .I have bought almost all of the items except 3.I searched alot for exact configuration for following 3 items but was not able to find.( especially Transistor and DPDT relay.)
1)Power supply Unit
2) Transistor
3) DPDT relay

I was just able to find closest match for Transistor .Can you please let me know whether this item is fit for purpose as there is slight difference in configuration.and whether these difference effect any performance or change in circuit?
My Transistor link : http://www.ebay.co.uk/itm/2N2222A-TRANSISTOR-NPN-TO-18-Pack-of-1-FREE-UK-POSTAGE-/221034462712?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item3376ae3df8
Your Transistor link for comparison: http://gb.mouser.com/Search/ProductDetail.aspx?R=2N2222virtualkey61000000virtualkey610-2N2222


If they are not fit for purpose , then Can you please help me in identifying these 3 items from "ebay.co.uk" as i Stay in Uk. I am using same motors as yours (http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=6246)

And for power supply unit you selected,there is just one output of 12 v @ 18 Amp.How 2 Brushless motors are controlled ? As Brushless motor will take max current of 13 amp and there are 2 motors?

What important I should look while selecting PSU ?

Thank you in Advance
Cheers
tbkdan (author) says: Oct 22, 2012. 3:47 AM
I believe that transistor should work. As for the DPDT relay, the key aspect is that it needs to have a coil voltage of 5V. It was easier for me to find it at an electronics seller like Mouser that could filter on those features than it was to search through pages and pages of eBay listings hoping to find it.

The brushless motors are nowhere near their max load, and the only time they are under any load at all is the brief period when the balls are in contact with the wheels for launching. I believe most computer power supplies over 300W should be ok with the load.
shail363 says: Nov 5, 2012. 3:36 AM
Hello TDKdan

Hope you are doing fine and had very nice week end.
I am manufacturing parts for robot and its been a month now.I am lacking much behind.
I want your help in deciding battery pack as I am not going with ATX Power supply as my club may not allow me plug as it requiers test certificate.
Can you please advice which rechargeable battery pack will be good to run this robot for 3-4 hours.
Whether NIMH,LIpo or any other best one.My budget will be up to 50- 60 pounds

I am just considering following components for robot:
Infra red receiver: 1No
Brushless motors :2 nos 11.1v 13amp max
servo motor : 4.8 - 6v 4 nos


how much operating current will following component require :
Brushless motor =??? Amp
servo motor =??? Amp
How to decide how much current has to be supplied to Servo motor as specification does not mention any Amperes.
I have Arduino mega which supplies 40mamp current and Servo operates with load of 500 grams.
But i am not sure how much current should be passed to servo

If I am deciding to buy 12 v battery pack , whether I can use voltage regulator to reduce voltgae from 12v to 5v for servo motor.
But here should I be concerned about current that will be passed to servo oR sERVO itself has capability to take care of that

cheers

Shail363
dugregn says: Oct 21, 2012. 3:32 PM
Wow, I think this is the best instructable I've ever seen! And just what I was looking for.

One question: Can it mix top and underspin from ball to ball? So every other shot is an underspin ball for instance. I have a RoboPong 2050 and it is very good but I really miss being able to train changing spin.

By the way, how did you get these mad engineering skills...?

Regards
tbkdan (author) says: Oct 22, 2012. 3:32 AM
Thanks! :-) Yes, I can change every component of spin from ball to ball. I have a pre-programmed drill that does right side top, left side top, right side bottom, left side bottom.

I've always been a tinkerer and enjoyed building stuff, and my wife is a mechanical engineer so she taught me how to use the 3D modeling app.
dugregn says: Oct 22, 2012. 4:12 AM
Great, I think your robot is then more flexible than most if not all of the comercial alternatives :-) !

Which 3D app are you using?
tbkdan (author) says: Oct 23, 2012. 3:44 AM
Thanks :-) I'm using Autodesk Inventor.
LuisG10 says: Sep 28, 2012. 4:18 PM
When the full program for arduino will be complete?
tbkdan (author) says: Sep 29, 2012. 5:01 AM
I don't have any ETA at the moment. Other projects have taken priority and at the moment, it "works" for me so I haven't been as motivated to polish it off. Perhaps now that the weather is turning cold I'll have more time for it.
alvinchua says: Jul 10, 2012. 12:23 AM
Hi,

Can you explain/clarify how you connect the controlling wire of ESC to the arduino ?

TIA.
alvinchua says: Jul 4, 2012. 9:06 AM
Thanks. Hope you won't get tire of my questions. The reason why i'm asking many question is that I don't have the sources for some of the parts in your project, therefore i must modified or improvised it.
Here are my questions:
1. Why you need to put a upper ball detent ring ? What will be result if you omit it?
2. In your design, you use piston to feed the ball, what is fastest rate of feed?
3. from my understanding, your ball feed servo determine the rate of how often the ball is throw, right ?
tbkdan (author) says: Jul 5, 2012. 5:17 AM
No problem :-)

1) The upper ball detent ring is used to prevent the balls from falling forward when aiming the ball launch downwards (I find having the ball bounce on the far side of the table first works better for topspin balls).
2) Right now I have it set to a max of 1 ball every .6 seconds. I might be able to speed that up, but I didn't find it necessary. You can probably get a faster servo to speed that up as well.
3) Correct.
alvinchua says: Jul 3, 2012. 6:20 PM
Hi,
Thanks for quick response. I planning to build this robot. I still have questions,
How do you compare your robot with other Robo Pong in the market that uses single motor to launch the ball ?
tbkdan (author) says: Jul 4, 2012. 7:44 AM
I only briefly used a 2040 a while ago so I can't give an in-depth analysis, but the dual-motor design allows for dead spin balls and extremely heavy spin balls (backspin that I just *cannot* loop, so I turned it down a bit :-) ). One of the complaints that I've heard with single-motor design is that they cannot do dead spin balls. Also, since we control the code and hardware, we can make this do whatever we want! Once I bring it into a higher ceiling environment (I have it in my basement right now) I may try programming it for lob balls :-)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!