The Dynamics of Ball Flight and Design of a Robotic Ball Shooter

Part 1 of 3: Criteria, Shooter Dynamics and Kinematics, and the Simulation Algorithm

Sajiv Shah
Towards Data Science

--

Team 649’s 2021 Robot, “Guppy”. Image by Author

The FIRST Robotics Challenge is an international robotics competition that over 500,000 high school students compete in yearly. Each year, a challenge is released and teams create robots to compete in randomly matched 3 v 3 games. Because of the COVID-19 pandemic, the 2021 season has no in-person gameplay but rather has a set of at-home challenges, two of which are centered around launching 7-inch foam balls into an 8 foot-tall target from different distances, and in a given time frame.

While many teams design and create mechanisms through iterative prototyping, what often sets high-performing teams apart is their application of science and math in their design process to ensure their mechanisms consistently work. Our team took our limitation to in-person meetings as an opportunity to do some theoretical analysis of the ball shooter, and use that to make a prototype that would require little adjusting to perform to our expectations.

Trajectory Estimation

The majority of design requirements for the shooter comes from the trajectory analysis, which will tell us the velocity range the ball must achieve, as well as the angles it must be able to shoot at. To begin, we first need to determine how far we need to shoot from, and how high the ball must reach.

A. Locations

The Interstellar Accuracy Challenge requires teams to shoot into the power port from different zones, shooting three balls from each zone then three balls from a zone of choice for a total of fifteen balls. The robot is allowed to hold a maximum of three balls. Shown below is the map of the zones, including the re-introduction zone where teams may feed balls into the robot.

Interstella accuracy challenge map, with markings. From FIRST Infinite Recharge @ Home game manual[1]

To minimize the variability required by the shooter, we strategized and decided that shooting from the border of each zone would require less tuning from the software team, as the change in the x-distance (~30in) may not require a large change in the shooter angle or ball velocity.

POWER PORT challenge map, with markings. From FIRST Infinite Recharge @ Home game manual[1]

For the POWER PORT Challenge ( image above), teams must score as many balls into the target in a given amount of time, meaning that teams can choose to shoot from anywhere in the green area. Teams must get balls back into their robot from the re-introduction zone which is located just a few feet from the shooting area, meaning a direct back and forth movement from an optimized shooting location will likely garner the most points.

B. Constraining Our Trajectory

We aimed to score balls at the peak of their trajectory as slight perturbations would have smaller impacts when the trajectory is flattened, and because the ball has the least kinetic energy at the peak of its trajectory, meaning it is less likely to bounce off the back wall and out of the shooting target hole.

When GPE is maximized, KE is at its lowest, meaning the ball will have a low momentum and will bounce off the rear wall at a lower velocity, reducing the chance of it bouncing out instead of falling into the scoring gates.

C. Dynamics and Kinematics

The major force of any object in 2d projectile motion is gravity. Gravity will accelerate the ball downward in any environment and has a constant acceleration when close to the surface of the earth. Introducing air as a fluid into the trajectory produces two new forces that must be considered for an accurate estimation. The first is drag, which is the resistance created by the air hitting the ball, tangent to the path of the ball. The second is the lift force, which is a result of the Magnus Effect[2], in which a spinning ball creates a low-pressure area above the ball, creating a vacuum and therefore a lift force perpendicular to the ball’s path.

From NASA[3] and other online physics resources, we derived the equations for the three forces on the ball. Because F=ma, we divided each force by the mass of the ball to get the acceleration created on the ball by that force.

These accelerations are all acting on different velocity components of the ball, except for gravity, which is always vertically down. Breaking the tangential velocity of the ball into its x and y components, and then factoring in the acceleration due to each force acting on that component gives us the net accelerations in each direction as shown below:

The angle is dependent on the velocities being changed, and the velocities are dependent on the angle, meaning an iterative method such as Euler's would be required to plot the parametric function of the position of the ball.

D. Calculating Velocity and Spin

The angle is independent of the velocity and spin and is easily changeable for each trajectory, based on the setup of the two wheels relative to the ground. The spin and velocity, however, change together. An increase in the top or bottom wheel speed would increase the spin and the translational velocity of the ball, and also impact the inertia or power into the ball. The equations and diagram below represent these relationships.

Each wheel has a maximum angular velocity, which is simply a function of the max speed of the motor. The motors we chose for this application have a theoretical free speed of 6380 rpm, which we can convert to radians/second. Using that value, we can multiply by the gearing ratio between the wheel and the motor to determine the maximum angular speed of each wheel.

The velocity of the ball is equivalent to the average velocity on each edge of the ball. This is similar to a situation where the ball is rolling without slipping, where the ball has a translational velocity of (v), an edge velocity of 0 at the bottom, and an edge velocity of 2v at the top.

image from alanpedia.com[4]

A velocity is applied to the ball at the two contact points of the flywheels, and at each of those points, the edge flywheel speed is equivalent to the angular speed of the flywheel multiplied by its radius. Taking the average of those values gives us the translational velocity of the ball. Subtracting those values and dividing by the radius of the ball gives us the spin of the ball in radians/second, which can be easily converted to rotations per second.

With the given variables and equations we have, we need to define one more quantity to be able to create an algorithm to output the required motor speed to score the ball from a given distance. That would be the ratio of the top wheel speed to the bottom wheel speed. Through analysis of past designs and from basic prototyping, we discovered that the top and bottom roller must be mechanically linked. If they are not, during the contact time with the ball, the two rollers will not keep a consistent speed ratio, which will cause the spin of the ball and the velocity of the ball to be inaccurate in comparison to the set value. The speeds of the flywheels change because they must transfer energy to the ball, given by the equations below:

To transfer energy to the ball, each flywheel must lose some speed, because the motor cannot solely transfer energy to the ball in the small contact time the flywheels have with the ball.

After some testing, we established that the top wheel should run at 9/16 of the speed of the bottom wheel. This was a rough estimation and chosen fairly based on shooting the ball at the target at a fixed angle and observing how flat or spiked the ball path was based on the top wheel to bottom wheel ratio.

Simulation Algorithm

Working with Ayaan Haque, we designed a python simulator to take an input of distance, in meters, of the shooter from the target (horizontal distance), and output a plot of the path of the ball and the motor rpm, as well as the angle of the shooter.

To do this, we run a function called trajectory() which runs ~40,000 times per path, testing each possible motor rpm and angle of the shooter and running the path.

The controllable motor rpm in radians/sec ranges from 30 to 600 in our case, where we can change it in increments of one. The angle of the shooter can be in a range from 15 to 75 degrees and can be changed in increments of about one. The trajectory function then converts the motor angular speed to a ball velocity and spin, which it inputs into the runPath() function.

The runPath() function is the main function that calculates the path of the ball. It uses an iteration variable, which is 0.001 seconds. At each iteration, it recalculates the angle of the ball’s path and then applies the acceleration of the ball from the three different forces on the ball, dependent on the angle. It continues to do this until one of three things happen:

  1. The y-distance falls below 0. If the y-value falls below 0 after the path has begun running, then the path has essentially ended as the ball has hit the ground. Continuing to iterate past this point would not be valuable.
  2. An optimized parameter or function triggers: For example, for a trajectory optimizing for the peak of the ball to be the point at which the ball hits the target, then if the y-velocity is negative, the runPath() function would end that specific path.
  3. The path is successful. If the ball covers an x-distance of +/- 0.01 meters of the inputted distance, and if the y-distance at that point in time is +/- 0.01 meters of the height of the target, then the ball has roughly passed through the scoring target, counting as a successful score.

The program then outputs a plot of the path of the ball and the motor rpm and angle the trajectory is based on.

In Part 2 of the series, we will analyze the different parameters we optimized the simulation for, how the simulator data compared to the results from the actual shooter, and assumptions in our calculation that likely led to the error in our estimation.

References

[1] “INFINITE RECHARGE — Season Materials.” FIRST, 2 Mar. 2021, www.firstinspires.org/resource-library/frc/competition-manual-qa-system.

[2] “What Is The Magnus Effect”. Ffden-2.Phys.Uaf.Edu, 2021, http://ffden-2.phys.uaf.edu/211_fall2010.web.dir/Patrick_Brandon/what_is_the_magnus_effect.html. Accessed 5 Mar 2021.

[3] “Lift Of A Baseball”. Grc.Nasa.Gov, 2021, https://www.grc.nasa.gov/www/k-12/airplane/balllift.html. Accessed 5 Mar 2021.

[4]studio, saxtech. “Rotational Kinematics”. Alanpedia.Com, 2021, https://www.alanpedia.com/physics_kinematics/rotational_kinematics.html. Accessed 5 Mar 2021.

Acknowledgment

The students of MSET 649 would like to thank all our donors, adult mentors, student mentors, parent volunteers, and especially our sponsors for allowing us students to explore the STEM field and create meaningful projects.

--

--