Open AndreaFavero71 opened 5 months ago
Silent stepper motors and drivers, i really like the "sound" of that ! I hope you'll succeed make it bounce a ball !! I will definitely follow up on your progress !!!
Very interested to follow. You might also consider the openMV module. Runs python too. has the high refresh rate circle transform built in. very impressive frame rates. (Uses Hough transform)
Adding the docs for find_circle (and everything else) here:
You might need the global shutter camera option to get frame rates up to 400fps.
According to @KoshiroRobot (YT video), the 60 fps of the camera seems to be the limiting factor for a ball bouncing controller.
I like this project and I'm thinking to make something similar, very likely with stepper motors and silent stepper drivers (to avoid getting kicked out of the family while working on this). Before buying the material I looked into the code, to answer the question "is it preferable a Raspberry Pi 5 + V1 camera or a Raspberry Pi 4b is enough ... perhaps in combination with a more recent camera version?" I made some tests with components borrowed from other projects: Raspberry Pi 4b 2Gb with different PiCamera versions, namely V3 wide, V2 and a V1 clone. While trying to increase the camera fps, I monitored the FOV (horizontal and especially vertical) to be as per this project setup.
Result with the original code: Rpi4 + V1 --> _imgfps 62 (camera fps as per original project)
With some little code's changes: Rpi4 + V1 --> _imgfps 62 (I could not speed up the camera) Rpi4 + V2 --> _imgfps 83 (30% faster camera) Rpi4 + V3 wide --> _imgfps 120 (90% faster camera)
Conclusion: For this project, I'm going to buy a Raspberry Pi 4b 2Gb and a V3 wide camera. The total cost will be rougly the same :-( . Below some notes: 1) V3 wide camera at 120fps has quite some crop, yet the reduced FOV overlaps the one of V1 camera at 62fps. 2) By increasing the camera fps the robot controller increases the load to the cpu, yet the Rpi 4b keeps up with the camera's fps. I believes it's beneficial a synchronization between the threads, but this is a fully different topic. 3) I have no clues whether the higher fps will be sufficient to be able to bounce the ball, perhpas I'll know it soon...
If anyone is interested in these changes to the code, please let me know by adding a comment to this post and I will summarize them here; Otherwise I will proceed with the project and see how far I get.
EDIT 23/06/2024: Changes at the camera_Class file (new, changed or integrated parts have '#AF#' comment)
And those at main.py (again, changes have the '#AF#' comments):