Internal (faculty, staff, TA)
MAE
2025-2026
Fall
Winter

The BOOM Squad - Toy Ball Cannon

BOOM Squad Logo

Summary

The Toy Ball Cannon Project is a mechatronics-focused design that redefines recreational fun. The system launches lightweight projectiles using flywheel technology while coupling RGB-oriented object detection and navigation to track fast-moving targets. This project heavily involves collaborative design, research, prototyping, performance optimization, safety considerations, and extensive testing, allowing us to apply critical engineering principles in a dynamic way to meet our stakeholder needs and expectations.

Inspired by the Nerf Rival Nemesis blaster, our team aimed to create an autonomous turret that sprays a volley of balls to hit a moving target a minimum of one time per firing cycle.

Technical Approach/Methodology

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.

Outcomes

An Autonomous Color-Guided Sentry System

The project culminated successfully in the design, programming, assembly, and integration of a fully autonomous cannon with a dual-axis targeting system capable of real-time color tracking and synchronized projectile firing. With integrated computer vision, proportional kinematics, and an automatic feed mechanism under a unified control script, the cannon runs seamlessly to track and engage its target.

This toy ball cannon offers a wide operational range, allowing for complete manual control where the user determines the position and simultaneous actuation of all individual systems - including yaw, pitch, firing rate, etc. - either independently or in tandem as necessary. The system can perform these same complex functions autonomously with the touch of a button, utilizing its pitch and yaw capabilities to track the color red and initiate firing sequences once the target is confirmed.

The entirety of this system represents a large amount of integration in using raw hardware components together with robust techniques and clear logic. 

Listed below are the specific accomplishments our team achieved by the end of the project:

1. Real-Time Computer Vision & Targeting

  • Color-Based Acquisition: Implemented a highly optimized, low-latency OpenCV pipeline using HSV color space thresholding to isolate and track deep-red visuals without the bottleneck of heavy machine learning models.
  • Parallax Compensation: Engineered dynamic crosshair offsetting to mathematically correct for the physical distance between the camera lens and the mechanical barrel.
  • Engagement Dead-zone: Established a pixel central boundary that acts as a binary trigger, shifting the system instantly from a "tracking" state to a "firing" state when crosshair and the target pixels align.

2. Kinematics & Gimbal Control

  • Proportional Tracking: Developed a closed-loop control algorithm for the Yaw and Pitch stepper motors to actuate upon communication from the camera. The system dynamically scales motor speed based on the target's distance from the center frame and current speed, resulting in more precise tracking that prevents overshooting.
  • Dead Reckoning Safety Limits: Programmed software-defined boundaries using step-counting logic to prevent the 27:1 planetary pitch gearbox from rotating beyond its safe mechanical limits of +45° to -20° from the horizontal, eliminating the risk of self-destructive hardware collisions.

3. Asynchronous Firing & Feed State Machine

  • Non-Blocking Architecture: Replaced standard synchronous delays with a time-delta state machine. This software allows the processor to simultaneously manage motor control, video processing, and weapon actuation without dropping frames or lagging.
  • Tri-Stage Weapon Synchronization:
    • Propulsion: An Electronic Speed Controller (ESC) was chosen over MOSFET due to its ability to control dc motor speeds, rather than simple on or off. The ESC actuates the flywheels, brushless DC motors, spinning up to an optimal 5000+ RPM the moment a target lock is achieved.
    • Delivery: A secondary ESC drives a conveyor belt in precise pulses to feed ammunition into the speeding flywheels.
    • Agitation: An SG90 micro-servo runs a rapid sweep cycle alongside the conveyor to upend any affixed projectiles in the hopper, ensuring zero mechanical ball jams during the feed cycle.

4. Power Architecture & Manual Fail-safes

  • Isolated Power Rails: Successfully segregated the delicate 3.3V logic signals from the high-current 11.1V motor demands and the other 5V demands of other components. The system utilizes an ESC's integrated Battery Eliminator Circuit (BEC) for the servo, a buck converter for the Pi, and direct connections to the 3s battery preventing processor brownouts during voltage spikes.
  • Vibration-Resistant Logic Interface: A screw-terminal breakout HAT was integrated with the Raspberry Pi 5, eliminating the reliance on standard friction-fit jumper wires that are prone to disconnecting. Every logic signal is securely clamped down, ensuring zero signal degradation or mechanical disconnects during operation.
  • Modular High-Current Distribution: The primary 11.1V power bus utilized secure lever-nut connectors rather than permanent soldered splices or weak breadboard rails. This approach eased the connection modifications made in the project and easily handled the high amperage draw of the brushless ESCs and stepper drivers.
  • Hardware & Software Fail-Safes: Inline Circuit Breaker: A physical circuit breaker wired directly into the main 11.1V LiPo battery line stops power from spiking back into the battery. If a motor jams or the system experiences a dead short, the breaker trips instantly, preventing catastrophic damage to key components.

All of these functionalities were successfully tested and subsequently demonstrated for audiences at the Annual Design Review (ADR). 

Project Media

Project Poster