By far my hardest engineering project at the time (17yo), requiring two devices to communicate at high speed and a PID for controlling with accuracy stepper motors and dealing with bad tolerances on plastic parts
Look at the demo here: https://youtube.com/shorts/tS_cE6SSZQE
The general layout is the following:
- A webcam on top that records the black plane
- A python function that identifies the brightest pixel, then anchors to the ball with sub pixel precision and calculates the trajectory
- A python function that sends the data to arduino (every 30ms)
- Arduino code that recieves the data (every 8ms) and updates the behaviour
- Arduino code that moves the motors by sending current through different wires (every 2ms)