Introduction
First of all, this is a work in progress. This blog will be updated regularly. I did not post any of this yet since development is going slow. Partly due to the beginning of July being very hectic work-wise...
Anyhow, I would like to thank the sponsors of these PYNQ webinars, it has been very interesting, I learnt a lot. Please continue supporting these kind of webinars!
Current pandemic is not making it easy for any of us, near lockdown situations keep us at home. People seek things to do. I don't know if it is the same in your country, but here in Belgium it is becoming very hard to find ping pong tables, table tennis is a nice sport to practice at home, it keeps you fit which is important nowadays.
My kids love to play ping pong, but sometimes they get frustrated due to the difference in level between them.
It would be best to train them individually to crank up their levels.
This is why I got the idea of developing an advanced DIY ping pong trainer. You can buy these robots for around 1000 EUR. I think it should be possible to create one with high end features with stuff I have laying around here at home...
3D modeling
Basically what you need is a bucket with a tube on which you mount three BLDC motors that have wheels on them which will spin the ball and shoot it away.
In this project I am going to get my kids involved, the model you see above here has been designed by my oldest son. I have been organizing summer camps for children the last four years and I see this as a kind of extension to that... ;-)
Once he has his model finished we are going to 3D print it and connect the BLDC motors to it.
Since my kids already have some experience with python the PYNQ-Z2 is an ideal platform for this joint effort. At this point you might wonder why we need an fpga for this. But of course we are going to use image recognition to see where the ball ends up on the table and if the user is able to hit it. This way we try to estimate the level of the current player.
Some extra features we are thinking to integrate:
- a mobile application to control the training session
- topspin/backspin/...
- swivelling the output so the ball can change direction
- keeping track of the user's progress (if he/she properly returns the ball)
- adaptive training (user has a low level, easy exercises, user has a high level, more difficult exercises)
We are using ESCs to control the BLDC. The motors and controllers are sourced from a drone. Using an ESC controlling the BLDC is as easy like controlling a servo motor.
A camera is mounted on the trainer for object recognition. This is the part where I am going to use all of the things we learnt during the sessions by adamtaylorcengfiet, recogizing the ping pong ball and the user with his bat. Wavedrom will used to output some data of our controller.
Controlling using an Android application is something we still need to figure out, but we'll manage to find some way to do this.
The PYNQ platform will allow me to get the kids involved in this project, I wonder how they will pick up the process of learning... They're getting a deep dive into engineering ;-)
I you're triggered by this project, like and follow, we will be posting the proceedings in August.
[Update 29/07/2020]
We are going to use a BLDC from Avizar, the MC2834:
The first model is finished:
And already printing:
We are printing with ASA filament which is engineering grade and should be quite strong...
The ESC we are going to use appear to be no brand... That is, I don't want to cut open the package just yet... We'll try to get them working like this first.
Next thing:
The wheels that will be connected to the motors and should barely touch the ping pong balls to make them spin.
One option is to also print them, another option I was thinking of is to create a wooden disk and glue some ping pong rubber to them so we get a nice grip on the ball...
Printing has finished:
Motors assembled:
Experimenting with wheels...
After having a few days off, to go mountain climbing with the kids, I started enhancing the ping pong shooter.
Added a front cover to prevent being hurt if an o-ring (which will be mounted on the wheels, thanks for the tip dougw) slips off.
Also added a ball coupling, this allows the shooter to move by about 36 degrees left/right/up/down...
After 3 days, the print is ready, next step will be creating a box with a ping pong ball feeder.
After updating the discs, serious improvements where achieved for the speed of the ball... At low speed it even shoots away fast!
High speed made me worry of hurting someone...
Next to the feeder system, this will be a wooden box in which a servo with circular to linear motion pushes the balls in.
On top of this box one or two cameras will be mounted for the image processing. We will need a high framerate to deal with motion blur... I wonder how many frames per second would be needed to eliminate motion blur... Otherwise we will see trails instead of a single ball.
I'll be starting with the first experiments on image processing soon. Wondering if using two camera's would be useful, if anyone has any experience with stereo image processing, feel free to give me some advice...
So, what are we going to do with the PYNQ platform?
We have to recognize the ping pong ball and check if it has bounced on the table.
Doing some filtering we should be able to get the ball position and the table since the ball is plain white and the table has a white rectangular strip.
(some people have done research about this subject already, we might be able to adapt this to the PYNQ platform, still need to read up more on this...)
This rectangular strip might give us some clues on perspective and three dimensional positioning...
Using Python on the PYNQ platform should make the development a bit easier.
So, from the PYNQ Workshop we will be using the knowledge about the camera input and image processing.
[Updates will be posted regularly]
Top Comments