The toy ball cannon consists of a stationary base, featuring a stepper-driven mechanism consisting of an internal ring gear to optimize mechanical advantage and a lazy Susan bearing to facilitate smooth, high-precision yaw rotation. This system allowed for smooth incremental accuracy: the stepper motor has a step of 1.8 degrees, which, when rotated, transmits to the outside gear. This rotation translates to 0.42 degrees for the actual cannon per step of the stepper motor, resulting in highly smooth, precise tracking. 3D-printed stands support a geared stepper motor to provide the necessary holding torque for securing the cannon's vertical orientation as well as the output torque for precise pitch adjustment.
The cannon assembly draws inspiration from the Nerf Nemesis blaster, incorporating high-RPM DC motors into a dual flywheel launching system. The assembly also incorporates a conveyor belt system that feeds the projectiles through the cannon chamber into the flywheels. Furthermore, the ball funneling system utilizes a servo-powered agitator that rotates to prevent projectile jamming and facilitate consistent feeding into the cannon chamber.
All the actuators are autonomously commanded by an onboard microcomputer, which uses an RGB pi camera for color-based target identification and tracking. At the core of the sentry’s autonomous engagement system is a standard RGB picam module, acting as the only sensor for target identification and tracking; this system utilizes highly optimized, color-based tracking via OpenCV to actively seek out and lock onto a specific deep-red visual signature. The vision pipeline begins as the camera captures high-resolution frames, around 30 fps, and immediately converts the raw RGB video feed into the Hue, Saturation, Value (HSV) color space. This is far more resilient to changes in lighting conditions and shadows. The software then applies a strict mathematical formula to allow the system to calculate its exact center of mass. By measuring the pixel distance between this centroid and the system's crosshairs, the Raspberry Pi generates the X and Y error values required to drive the stepper motors. We ultimately selected this HSV color-based tracking over more complex machine learning models like YOLO for three distinct engineering advantages. First, it provides ultra-low latency for more real-time responsiveness without the computational overhead that causes lag. Secondly, it preserves crucial CPU cycles for resource allocation, allowing the hardware to run an autonomous, multi-faceted firing state in the program for all the DC motors and the servo simultaneously. Lastly, it offers higher reliability within the project scope, as the stark contrast of deep red against standard backgrounds ensures a reliable lock, given clear and bright lighting, with virtually low chances of false positives. All of this eliminates the need for a bloated, data-heavy training model.