• 1
    Introduction

    Most sports projects and commercial products utilize a vision system when they want to track the position of a ball, for example in this project by Youtuber Stuff Made Here, where he created a moving basketball hoop that doesn't let you miss a shot.

    Such systems are inspiring and impressive, but most require a vision system to track the ball's flight path. If the camera lens gets wet, dirty, or obstructed, or if the lighting is insufficient, this can affect the tracking results. I wanted to build a sports training tool that (1) doesn't require a vision system, (2) can be used at night, and (3) can be implemented with a low-cost microcontroller. Sports rebounders are perfect candidates for such a tool, because the meaningful training data has to do with the impact of the ball, not its flight through the air.

    Rebounders are simple and self-explanatory - you throw or kick a ball at a springy backboard, and the ball is rebounded back to the player. The vast majority of rebounders on the market today don't provide measurements or feedback to the player. The closest thing I've found to a non-vision based bounce tracking system is this commercial trampoline system, which uses a proprietary algorithm/calculation to identify bounces.

    The idea I wanted to try for myself is to mount 4 x accelerometers on a rebounder net. These types of sensors output the acceleration along 3 x axes, as well as the rate of rotation about those 3 x axes. I could have tried collecting the acceleration data and then teasing the ball landing position out from it using a closed-form equation or algorithm, but given their rise in accessibility in the last few years, I realized that machine learning would be perfect for this application.

    Neural networks are one such type of machine learning - they are based our understanding of how neurons in the human brain are believed to operate, and they excel at modeling relationships between input (the accelerometer data) and output (any information we want to learn about the ball impact.) In the end, this machine learning structure was able to infer the soccer ball landing position with surprising accuracy!

  • 2
    Mechanical Hardware

    I created the rebounder frame out of cheap and readily-available metal tubing called EMT (electrical metallic tubing) conduit, which is typically used by electricians for construction wiring, but has grown increasingly popular in recent years for home projects. I cut the tubes to length and removed their sharp edge (deburred them) using a rotary deburring tool for the inner diameter (ID) and a hand file on the outer diameter (OD.) I used a conduit hand bender tool to make the corners. These 3/4" conduit pieces were connected end-to-end using metal set screw couplings.

    On the rear of the frame, I used 4 x U-shaped metal hinges plus shoulder bolts to allow the frame tilt angle to be set. A center pole made from 1/2" conduit and 3/4" conduit utilizes an EMT conduit telescoping coupling to lock the tilt angle. This coupling is available in my online store, with free shipping available for all orders in the USA. Shipping to Canada is also available. To ensure all pieces would fit together, I modeled the PCB, enclosure, and EMT conduit telescoping pole using Autodesk Fusion 360. The CAD model render is below, along with the actual assembly.

    I drilled holes in the sides of the front frame using a cheap drill press, installed rivet nuts (rivnuts) using this tool, and then threaded metal #8-32 thread, 1-7/8" J-bolt into them, locking the position with an extra nut. These hooks are used to hold the elastic shock cord (bungee cord) which loops through the outer edge of the net.

    The #18 black Nylon net was a custom order, and the frame size was designed to both accommodate the net and also easily fit in my car. I used continuous bungee cord to allow the net to spring back, but individual bungee cords or metal springs would have sufficed as well. I initially planned to take advantage of the mechanical response of bungee cord in order to provide an optimal ball bounce - that's a topic I may cover in a future article. I tested the mechanical response of shock cord samples for different diameters from different vendors, and I ultimately decided on this 1/4" diameter shock cord.

    I made a cover for the rebounder made from 210 Denier black coated Oxford nylon fabric with 1/8" small-diameter bungee cord around its outer edge. I marked and cut the fabric with scissors, laid the bungee cord around its outer edge, folded and then sewed the fabric edge using a Brother SE600 sewing machine - I bought this machine because it also does multi-colored embroidary, which I utilized for another project. Along the top edge of the fabric cover, I used a hammer + hole punch with a metal grommet to mount the front-facing RGB LED using this plastic retainer. The inner edge of the fabric cover is reinforced using 4 x strips of 1-inch wide Nylon webbing, which I sewed in place. The center of the net features a target ribbon held end to end with adhesive hook and loop.

    For extra cushioning, I cut 1-1/2" lengths of Buna-N foam tubing and added it onto the corners of the frame. For indoor testing, I designed and 3D-printed these anti-slip clips with double-sided tape on the underside. For outdoor testing, I created these 3D-printed stakes that are pressed into the ground. Because the rebounder uses accelerometers to take measurements regarding the ball impact, it's important that the frame remains stationary during use, and that it doesn't tip or slide.

    All 3D-printed files are available on my Thingiverse page!

  • 3
    Electrical Hardware

    The 4 x MPU6050 accelerometers are mounted equidistant from the center of the rebounder net, each using a 3D-printed mount with zip ties. Each accelerometer is attached to its mount using 2 x M2.5 screws that self-tap into the 3D-printed plastic. Although the MPU6050 is admittedly antiquated, they turned out to be sufficient for the machine learning aspect of this project. Each accelerometer is connected to the control PCB via its own cable consisting of 4 conductors for power (3V3), ground, SDA and SCL for I2C communication protocol.

    I soldered the cable wires directly to the accelerometer breakout board's header pins, and reinforced the connection with black hot glue. For the next version of this project, I would replace the 3D printed mount and the breakout board with a dedicated PCB of the same shape and zip tie it directly to the net. I would additionally a dedicated cable connector directly to that PCB to minimize the risk of wire and solder joint damage.

    First, I verified the circuit using a solderless breadboard with an ESP32 dev board and a TCA9548 breakout board. After verification, I selected an appropriate enclosure, and designed a dedicated PCB to fit inside it:

    The custom PCB consists of the following:

    1. ESP32 microcontroller
      1. I selected this microcontroller because it provides for a future opportunity to use Wifi or Bluetooth wireless communication.
    2. TCA9548 I2C multiplexer.
      1. The MPU6050 communicates over I2C protocol, and each MPU6050 can only be set to one of 2 x distinct I2C addresses. Since I need to take readings from all accelerometers one-by-one, I decided to use a dedicated I2C chip.
      2. In previous testing, I tried selectively turning the accelerometers on and off using their EN pins and read one unit at a time, but I was concerned that that switching might limit my rate of data collection or adversely affect the readings if the accelerometers didn't adequately equilibrate after startup.
    3. USB-C connector with FT231 USB-to-UART converter.
      1. I initially tried using the CP2012 chip as on the Adafruit HUZZAH32 board, but its QFN package was a pain to solder, so I opted to use the slightly more expensive FT231 chip.
    4. Buzzer for user feedback.
    5. Cable connectors for the 4 x accelerometers, the front-facing RGB LED, and the RGB LED mounted on the rear of the PCB enclosure.

    The PCB is a simple 2-layer board. Several LEDs indicate whether or not the unit is powered, and if serial communication is taking place. A future design may also include indicator LEDs for each of the accelerometers to show that they are receiving power and communicating with the board. The cables leading out to the accelerometers and their solder joints are at risk of damage from soccer ball impacts, which would make such indicator LEDs useful for debugging in case a connection got damaged.

    The PCB is powered via its USB-C connector. A USB cable connects to a PC which runs the machine learning script and logs the ball impact data. The next version of this project may utilize the wireless capabilities of the ESP32 and include a battery so that the USB cable is no longer necessary.

    The bill of materials (BOM) for the PCB components from the vendor Digikey can can be found at this link if you'd like to order all the components. Convenient, eh? I included a few extras of the more sensitive components (e.g. FT231XS) in that list, in case you need a spare.

    The schematic for the PCB is below. I use KiCAD for my PCB design work - it's open source and I highly encourage anyone interested in learning to check it out! Digikey has an excellent introductory video series here for those interested learning this software and creating their own PCBs. I highly recommend it.

    Below is the layout for the PCB. I designed it to fit inside the Hammond 1593 black ABS enclosure. I chose this enclosure due to its size, and because it has two removable panels which can be modified to pass cables through. I 3D-printed replacement panels with cutouts for the rear RGB LED, USB-C cable connector, and the cables leading out to the accelerometers on the net. I modeled the panels in Fusion 360 and printed them on my Voxelab Aires 3D printer, which I've found to be a solid entry-level FDM printer.

    The enclosure panels can alternatively be machined on a CNC or manual mill, or laser-cut if a suitable alternative material is used (ABS emits cyanide gas and tends to melt if laser cutting is attemped - acrylic or polypropylene would be suitable alternatives.)