information would not be enough to
reliably predict where the ball would
land. They argued that the differences in
the y coordinate would also have to be
examined in order to determine if the
ball was currently rising or falling. It was
also debated that more than two sets of
coordinates would have to be analyzed
as a unit in order to extract acceleration
data (implying that velocity data alone
would not be enough).

In general, we certainly agree with this
assessment, if the robot were to make only one
prediction. For our algorithm, though, the robot will
constantly update its prediction of where the ball will
land. Early predictions do not have to be precise
because their major purpose is to start the robot
moving toward the expected destination. This early
movement ensures that the robot will be close
enough to the ball's impact position that only small
movements will be needed (late in the ball's flight) to
fine-tune the interception of the ball. If you watch
baseball outfielders (especially those that are young
or inexperienced), you will see this is exactly what
they do. When the ball is first hit, they make a quick
assessment as to whether the ball will be short or long,
and start moving in an appropriate direction. As the ball
approaches them, they constantly adjust their movement to
ensure they are properly positioned to make the catch.

Our simulation will allow the user to employ a slingshot to initially launch the ball at various angles and speeds.
The mouse is used to pull the ball back as shown in
Figure 1. The distance pulled back controls the speed, and
the pull-back angle controls the trajectory much like the
program, Angry Birds. The robot (shown on the right side
of the figure) will move left and right trying to make the
ball bounce off the platform mounted above it.

After the ball bounces off the robot (or the ground if
the robot did not make its way to the ball in time), the
robot will again try to move to the new impact position.
This action is very similar to a child trying to keep a balloon
afloat by constantly moving to the balloon's new position
and batting it back into the air.

The Algorithm

As promised earlier, the robot will use minimal
mathematics to predict where the ball will land. Instead of
trying to predict the actual flight of the ball, our robot will
simply assume that the distance the ball will travel will be
proportional to the ball's current horizontal velocity and its
altitude as depicted by the expression:
Distance = k HorzVelocity Height
The constant k in the expression is a fudge-factor that
tries to correlate the relationship between the distance
traveled and other two variables. There are many factors
that influence the value of k — some of which are the units
of time and distance, as well as the force of gravity being
used in the simulation. Keep in mind, though, that this
simple expression provides only a very rough guess of the
value of how far the ball will travel — especially early in the
ball's flight path — because it does not consider factors such
as the ball's current acceleration or even if the ball is rising
or falling.

As the ball approaches impact, the predictions made
with this expression are much more accurate. This led us to
believe there could be some value for k that would let the
robot perform much like a baseball outfielder. Furthermore,
we felt it made sense to let the robot learn to catch the ball
on its own by letting it self-modify the value of k based on
the accuracy of its predictions.

If the value of k is too large, the predicted distance will
be too long. This will cause the robot to move past the
actual impact point as shown in Figure 2. This figure was
created by modifying the simulation program so that it does
not erase the old positions of the ball and robot during the
animation process. In this case, the ball has just been
batted into the air and the robot is moving to the right to
intercept it. Since the prediction is too large, the robot
moves well past where the ball will actually land (as
depicted by the green line).

Notice also in this example, that the robot has already
realized its error and has started moving back to the left.
When the predicted distance-to-impact is too long — as it