Football Spin - Data Analysis

The Neblina™ motion tracking module can be used in a variety of applications related to health or sports. In this post, we showcase one of the applications of our technology, by presenting an experiment on a football to analyze its spin.

The setup for our experiment is shown in the figure below:

A ProMotion board has been placed inside the football. The ball spin might involve rotations in yaw, pitch, and roll as shown in the figure. A good football throw will generate minimum spinning in yaw, and pitch, but might involve several rotations in roll, while the ball is in the air. The direction of the throw is also very important as shown in the above figure. We would definitely like to throw the ball alongside its longest semi-axis.

Recording Ball Spin Data using Neblina

After setting up the board, we have made use of our open-source Neblina Control Panel iOS application (available here) to do the following steps:

1) Connect to the ProMotion board using Bluetooth Low Energy (BLE) interface. You can see a list of available devices on the left panel when you run the iOS application. Next, enable all the motion streaming features by setting the "Motion Data Stream" button to ON. This will enable the streaming of both raw sensor data, and fused basic motion features. The streaming data includes raw accelerometer, gyroscope and magnetometer readings, as well as orientation quaternion found by our proprietary orientation filter, external force vector, rotation and pedometer information.

2) Start the recording on Board#1, by setting the "Flash Record" button to ON. Notice that one of the LEDs on the corresponding board will start blinking indicating that a recording session is in progress.

3) Perform the experiment with the ball, e.g., do a number of throws...

4) Connect to the ProMotion board again and set the "Motion Data Stream" button to OFF.

5) Stop the recording for the board by setting the "Flash Record" button to OFF. Notice that the blinking LED will go OFF to indicate that the recording session is stopped.

6) Connect the board to PC using the micro USB cable. Make sure that you power the board down by holding the reset button for ~20 seconds before connecting it to PC.

7) Run our open-source "" Python application (available here):

8) Dump the recorded data to CSV files on your PC using the "sessionPlayback" command in the interactive shell:

sessionPlayback <session ID> <dump to file option> //<dump to file option> should be set to 1  

Note that you can also check the total number of recorded sessions present in the on-chip recorder, as well as the length of each session using the following commands:

getSessionCount //gives the total number of sessions present in the recorder  
getSessionInfo <session ID> //gives the length of <session ID>  

The dump CSV files will be available in the "record" folder:

9) Exit the interactive shell using the "exit" command, unplug the ProMotion board, and turn it off by holding the reset button for ~20 seconds.


Offline Data Analysis

After all the raw and fused motion data from the ProMotion board were mapped to CSV files, we performed some offline analysis over the collected data to showcase the capabilities of Neblina using the Scilab tool. The Neblina module is shown to be capable of delivering the following information regarding a football throw:

1) Delivering the start and stop timestamps of a throw. This can be done by detecting semi-uniform high-spin patterns from gyro readings, while the ball is in the air:

2) Overall spin in yaw, pitch and roll in terms of the total number of full 360 degree rotations. This is found through continuous integration of the angular velocities, while the ball is in the air. For instance, we have:

Yaw Spin: \( \int_{T}^{} \omega_z dt \)

where \(T\) is the period of time, where the ball is in the air. Note that the gyro readings (angular velocities) should initially pass the necessary calibration procedure to remove the gyroscopes' zero-bias drift effect before being used in the above equation. For more information regarding the tracking of gyros' zero-bias drift, you can refer to this blog. The following figure shows the spin results of a sample ball throw:

3) The percentage of how good the initial direction of the throw has been. This can be found based on the direction of the force vector at the initial timestamp (start of the throw):

Efficiency of the initial throw direction = \( (\dfrac{a_x}{\sqrt[]{a_x^2+a_y^2+a_z^2}}) *100 \),

where x is the longest semi-axis of the ball. Using the above equation, one can verify that by applying a higher force (acceleration) alongside the longest semi-axis x, the direction of the initial throw will be more accurate.

4) The maximum acceleration at the start of a throw.

Here is a video of a few crude football throws back and forth with visualization of some spin data produced in Scilab using offline analysis.

If you require further information or assistance on how to perform the aforementioned offline data processing and visualization in Scilab, please do not hesitate to send us an email at (mailto:// or drop us a line at +1-888 -849-6956.

Additional Improvements

This has been just a simple experiment to showcase the capabilities of our Neblina™ module. One might use additional sensors to provide more useful information regarding a football spin. For instance, using a barometer helps to get the altitude of the ball. Furthermore, by attaching more boards to the arm joints of the players, one can evaluate the hand trajectory for each ball throw to gather more useful information.

Motsai designs and builds innovative embedded systems, and is the leading Canadian developer of miniature low-power, wireless devices used in wearables and human motion analysis. Please feel free to send us an email at or drop us a line at +1-888 -849-6956. Don't forget to signup for blog updates below.

Omid Sarbishei, Ph.D.

Omid is the R&D lead at Motsai. He has published over 20 peer-reviewed IEEE journal and conference articles and a book chapter on sensor technologies.


Subscribe to Motsai Musings

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!
Motsai Inc
1395 rue Marie-Victorin
Saint Bruno-de-Montaville, Quebec J3V 6B7
Toll free: 1.888.849.6956