240 FPS Trajectory Prediction: Real-Time Computer Vision for Robotic Air Hockey

During my time commissioning exhibits for India's first public Robotics Gallery at Gujarat Science City, one of the most demanding real-time platforms was the 4-DOF SCARA Air Hockey Robot. Unlike industrial robots picking stationary parts, an air hockey puck travels at speeds up to $8\text{ m/s}$ ($28.8\text{ km/h}$) with unpredictable acoustic rebounds off aluminum side rails.

To consistently block human shots and return aggressive bank shots, the vision-to-motion control loop had to operate under an ultra-strict deadline: less than 10 milliseconds from camera photon to motor torque.


1. High-Speed Optical Pipeline at 240 FPS

A standard 30 FPS camera captures a frame every $33.3\text{ ms}$. At $8\text{ m/s}$, a puck moves over $26\text{ cm}$ between consecutive frames—rendering trajectory estimation completely useless due to severe motion blur.

We deployed a high-speed global-shutter CMOS camera configured at 240 FPS ($4.16\text{ ms}$ inter-frame interval) with a localized Region of Interest (ROI):

  • Color Thresholding & HSV Segmentation: HSV color thresholding was accelerated using lookup tables (LUTs) in memory.
  • Contour Filtering & Centroid Extraction: Evaluated puck circularity and area to filter out reflections from fluorescent gallery ceiling lights.

  • 2. Rebound Physics & Intercept Calculation

       Puck Vector [X, Y, Vx, Vy] 
                ↓ 
       Wall Collision Detector (Boundary Checks)
                ↓
       Specular Reflection Model (Coefficient of Restitution e = 0.92)
                ↓
       Striker Intercept Kinematics (7ms deadline)

    When a shot is fired towards the robot goal:

  • 1.We fit a linear least-squares regression line through the last 4 centroid positions to calculate instantaneous velocity components $(V_x, V_y)$.
  • 2.If the vector intersects the side rails, we calculate specular rebound angles modified by an empirical coefficient of restitution ($e = 0.92$).
  • 3.The intercept solver computes where the puck will cross the defensive striking arc, maps Cartesian coordinates to SCARA joint angles $(\theta_1, \theta_2)$ via inverse kinematics, and streams velocity commands to the servo drives via ROS.

  • 3. Production Lessons

    Operating this system 8 hours a day with hundreds of museum visitors revealed key lessons:

  • Lighting Stability: Variations in ambient museum lighting disrupted HSV color masks. We enclosed the table with synchronized high-CRI LED strips and calibrated ambient light offsets daily.
  • Mechanical Settling: High-speed SCARA arm reversals produced table resonance. Adding S-curve jerk-limiting filters stopped striker ringing and kept defensive block accuracy above $92\%$.