The PoolShark project was completed by Team 16 of ECE 4950 (Integrated Design I) in Fall 2025 at Clemson University. I worked on this team alongside John Walker Bolding, David Bootle, William McGlone, and Blake Morgan. Our team was tasked with designing an automated mini–billiards system capable of detecting ball positions and striking a ball from one end of the table into a selected pocket on the opposite side.
The final design integrates key engineering fields including Linear Control Systems, Computer Vision, and Mechanical Design to achieve a fully automated aiming and firing sequence.
This project utilized Linear Control Systems to safely operate and execute the motor movements involved with the system. The main utilization of this was in the DC Motor Model. The DC Motor Model was controlled with a closed-feedback loop that used a PID tuning and a sum block to subtract the expected motor position from the detected motor position. The DC Motor had a hall sensor built into it, this was responsible for returning the detected position to the Simulink for further feedback loop continuation until the motor approximated to final position.
This project also utlized Simulink for the digital writes to the servo motor and solenoid. The servo motor was pushed a PWM signals to rotate the pointer to the desired aim angle. The solenoid control block issued a simple digital high/low command to trigger the shot mechanism.
The combination of these two control elements formed the full Simulink pipeline for the PoolShark project. The DC motor positioned the cue along the gantry X-axis, then the servo adjusted to its commanded position, and after a brief delay the solenoid fired. This sequencing ensured a predictable, repeatable, and safe motion, allowing the system to translate X position in millimeters and desired angle into physical actions
Primary Contributers: Camren Khoury, John Walker Bolding
DC Motor Control Block
DC Motor, Servo, and Solenoid Subsystems
The circuit diagram to the left shows how the DC motor, solenoid, and servo interface with the Arduino Mega 2560 microcontroller provided with the lab through dedicated power and switching components. Each subsystem uses different hardware requirements, and the circuit is broken into three functional blocks similar to the associated Simulink model blocks above.
The DC motor subsystem uses a motor driver to safely interface the motor with the Arduino, due to differences in voltage and current requirements between the two. The DC motor is connected to a 12V DC Power supply since the microcontroller can not supply a voltage over 5V safely. The arduino provides PWM and directional signals to the motor driver, allowing control of both motor speed and rotational direction. The servo subsystem uses a standard PWM control signal from the Arduino digital write to set its rotational angle. It receives its own 5V and ground lines and the interal electronics will interpret the PWM commands and self-adjust the position until the servo essentially fights to the desired position. The solenoid subsystem requiers a N-channel MOSFET which acts as a high-current switch to power the solenoid on command. The Arduino is responsible for driving the MOSFET gate through the 47 ohm resistor, which slightly removes overcurrent and reduces noise. The 10k ohm resistor is placed on the MOSFET gate to ensured the solenoid remains off during start up or if the control pin is undecided and currently neither driving 1 or 0.
Primary Contributer: Blake Morgan
Pool Shark Circuit Diagram
The vision system relies on a multiple coordinated computer-vision elements including homography correction, HSV color masking, and object morphology and reconstruction. The combination of these elements takes a raw out-of-position webcam frame and converts it into a top-down birds-eye repreentation of the table with specific billiard balls and their locations located.
The homography transformation converts the angled webcam image into a proportionate bird's-eye view, top-down representation of the pool table The camera is mounted off to the side in the initial gantry design, which became a limitation when it came to computer vision, thus homography was implemented to give a better view of the table and to account for perspective distortion. From the initial perspective objects that are located further from the camera, appear smaller and have less pixels associated per mm in real life, and the table edges are skewed. The homography correct this by mapping the four corners of the real table to a rectangular coordinate system during an early calibration step.
The software defines a target rectangle whose dimensions match the actual table size and resolution desired for processing. The MATLAB code computes a projective transform matrix with fitgeotrans, which mathematically describes how every point in the original image maps to the now uniform top-down view.
Once the frame is calculated, the frame is remapped using the MATLAB iwarp function. This step reconstructs a new image where straight lines remain straight and distances are consistent across the table. The resulting image becomes the new frame for calculations for color detection, morphology, and centroid placement allowing for accurate angle calculations and distance placement.
Primary Contributers: William McGlone, Camren Khoury
Pre Homography Example
Post Homography Example
Eight Ball Color Detection (Blue Disabled)
Morphology Example (Green)
Work in Progress!
Primary Contributer: Camren Khoury
Pool Shark Entrance Page
Pool Shark Control Page
Work in Progress!
Primary Contributers: David Bootle, William McGlone, John Walker Bolding
Gantry CAD
Belt and with Solenoid Attached
Work in Progress!
Primary Contributer: John Walker Bolding
Shot Geometry Sketch
Insert Photo With Full Pipeline From User input -> Solenoid Firing -> Returning