Тёмный

PID Controlled Ping Pong Ball Juggling Robot With 90FPS Realtime Image Processing 

Electron Dust
Подписаться 42 тыс.
Просмотров 31 тыс.
50% 1

This is a Raspberry Pi Ping Pong Juggling Robot. This time it doesn't use a plate but a real ping pong racket. I use Nema17 stepper motors for the movements. I bought some belt drive components and ball bearings. I used those to convert the axial motion of the steppers into linear motion. It's the same setup as in an inkjet printer.
The main controller of this project is a Raspberry Pi 2. It has a Raspberry Pi camera module NoIR connected to it. Because it is NoIR, there's no IR filter on the thing. I originally planned to use infrared light to brighten up the ball in front of the camera. But it didn't work well. The IR elements I used were way to weak. The infrared noise in the background (sunlight etc.) would overweight the infrared light getting reflected from the ball. Another problem was, that the IR signal gets picked up on the red-channel of the camera. This means that even if there is no infrared noise from sunlight, the infrared light's intensity still has to surpass the normal red light's intensity to be recognizable. So that idea got dropped. I ended up using the green-channel on the camera with green light from a RGB Power LED pointed at the ping pong ball. Sure enough, normal white light would've done the job as well, but I just happened to have a RGB LED laying around so I ended up with green.
Another important thing is this: You might be asking yourself "Why did you use a light source anyway? Couldn't you just use OpenCV and get the thing to recognize the white ball with normal lightning conditions?". The answer to this is: Probably not. At least not with a Raspberry Pi 2. The reason being that we need 90 fps real-time image processing to track that ball. The image processing has to be done fast. I didn't really use OpenCV for anything at this Point in time but my guess is, that it wouldn't work well, because I don't think I could get the processing rate up to 90 fps with OpenCV. Maybe I am wrong about this, but it was my gut feeling, so I went on to program a really simple algorithm that could take care of the image data really fast. The algorithm looks directly at the data stream, so no conversion to a different datatype (e.g. NumPy) is needed. This is one reason this algorithm is quite fast. The other reason is, of course, that it is a dumb algorithm. All it does is look for a clump of bright green pixels on a fairly black background and then compute the center of it.
After the algorithm extracted 3D coordinates out of the images it examines that data and, in the case the ball is going downwards and gets quite near to the racket, it uses that specific data set in a PID controller to get some useful correction values on the racket as the ball is moving towards it (the machine tries to get the ball into the center of the racket). The movement values are then sent to the Arduino Uno over the serial port. The Arduino Uno runs grbl (a program for running stepper motors very efficiently) and all it does most of the time is waiting for some new instructions from it's master; The Raspberry Pi.
Some lines about the tilting mechanism: The tilt in the racket is produced by different heights of the 3 belts on which the racket is mounted. The joint "belt to racket" is a rather elastic one. This is why a tilted racket can be accomplished without ruining the joints or other parts of the machine.
It's worth mentioning that the thing isn't working perfectly at all. A 2 hour juggling session is definitely not one of the things this machine is capable of doing. It is able to juggle the ball for about 2 mins. Then it makes some misjudgment and the ball drops. So it isn't great. But then again: It only uses one single camera to compute 3D coordinates of a flying object. using 2 cameras would improve the performance. But it would also make the thing more complicated.
The Stepper motors are Nema17 Steppers! It Also uses an Arduino Uno with Arduino CNC-Shield.
The Arduino Stepper Motor Controller uses the great grbl software! here a link:
github.com/grb...
And here's the complete Raspberry Pi source code (Python3):
github.com/T-K...
And here's a blog post about the thing:
electrondust.c...
Music:
"Covered In Oil" by Broke For Free
www.brokeforfre...

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@pinolux21
@pinolux21 3 года назад
You are an excellent electronic, mathematician and programmer. Congratulations incredible what you achieved !!
@thezone363
@thezone363 7 лет назад
this is sick I might want to try this for a group project with some friends
@MrKnutriis
@MrKnutriis 4 года назад
thezone363 how did it go?
@KulbirAhluwalia
@KulbirAhluwalia 6 лет назад
Holy Table Tennis! Damn!
@Peter-sj6yn
@Peter-sj6yn 7 лет назад
Nice Video! I like the way the bounce height varies.
@ElectronDust
@ElectronDust 7 лет назад
Thanks Peter!
@demej00
@demej00 5 лет назад
Great project. Would be interesting to use a machine learning algorithm and see if it can break that 2 min barrier.
@ElectronDust
@ElectronDust 5 лет назад
There sure is room for improvement. Although I am a bit worried about the data. I've got a feeling that the problem isn't so much the controlling algorithm (in this case it is a PID controller), but rather the data being too rough.
@revimfadli4666
@revimfadli4666 4 года назад
@@ElectronDust what about machine learning to un-rough the data?
@OussamaOusmoi
@OussamaOusmoi 7 лет назад
Awesome !
@helxsz
@helxsz 7 лет назад
wonderful work !!!
@ElectronDust
@ElectronDust 7 лет назад
Thank you!
@3bschool995
@3bschool995 4 года назад
Nice bro keep going.
@pedrorafaelvidalarias6517
@pedrorafaelvidalarias6517 7 лет назад
Great video! I would like to see this on your robotic arm.
@ElectronDust
@ElectronDust 7 лет назад
Hey Pedro! The robot arm is way to weak to hold that racket. ^^
@pedrorafaelvidalarias6517
@pedrorafaelvidalarias6517 7 лет назад
Yes but if a larger robotic arm is used so that it could manipulate the racket. Would it be possible?
@ElectronDust
@ElectronDust 7 лет назад
Yes. I think there are some people doing that here on RU-vid. If you use an industrial robot arm it shouldn't be a problem at all. ^^
@pedrorafaelvidalarias6517
@pedrorafaelvidalarias6517 7 лет назад
I see. I hope you upload more videos about this. Excellent work. Thank you!
@ElectronDust
@ElectronDust 7 лет назад
Oh. Thank you! Glad you like it.
@HarshJaiswal-v2f
@HarshJaiswal-v2f 10 месяцев назад
In your Arduino code there are so many code we can't understand how you juggling the platform . in your readme file, it is also not mention that how to approch your code, can you please send me code of arduino because we are building same thing for our courser project
@ipadize
@ipadize 5 лет назад
1900: We will have flying Cars in the future! now:...
@Chris-bg8mk
@Chris-bg8mk 4 года назад
What language did you code it in? C? Assembly?
@user255
@user255 4 года назад
Python.
@indiarobotschool9680
@indiarobotschool9680 4 года назад
Bro where u study help
Далее
The coolest robot I've ever built!
19:40
Просмотров 4,7 млн
High precision speed reducer using rope
20:19
Просмотров 1,8 млн
PID Balance+Ball | full explanation & tuning
13:13
Просмотров 747 тыс.
The Octo-Bouncer: Advanced Bouncing Patterns
4:59
Просмотров 352 тыс.
DIY Laser Image Projector (100ft+ Range!)
20:08
Просмотров 332 тыс.
I took Taser Chess to Open Sauce
12:40
Просмотров 397 тыс.
50,000,000x Magnification
23:40
Просмотров 6 млн
Ball Balancing PID System
2:07
Просмотров 126 тыс.
The Octo-Bouncer
4:26
Просмотров 4,8 млн
Making Professional PCB at Home - cnc WEGSTR
16:35
Просмотров 54 тыс.