Quadcopter Ball-in-a-Cup

As part of my Master’s degree coursework, I studied advanced control systems design. For my final project, I developed a control algorithm that enabled a small quadcopter to play the children’s game ball-in-a-cup. A cup was mounted on top of the quadcopter, while a small ball was suspended below it on a fine string.

The control strategy was divided into two phases: a swing-up phase to inject energy into the ball and a catch phase to capture it in the cup. I designed the switching manifold by converting the ball’s instantaneous kinetic energy into an estimated maximum height. Once a predefined relative height threshold was reached, the controller transitioned from swing-up to catch mode.

During the catch phase, the system tracked the ball, estimated its ballistic trajectory, and commanded the quadcopter along an interception path to align the cup with the predicted catch location.

Below is a replay of live experimental data showing the quadcopter, the ball, and, highlighted in magenta, the ball’s estimated position. During the swing-up phase, the magenta marker indicates the predicted peak height derived from the ball’s kinetic energy; during the catch phase, it represents the target point along the estimated ballistic trajectory.

The entire demonstration took place in a motion-capture arena. Both the quadcopter and the suspended ball were tracked by the motion-capture system; the ball itself consisted of a single reflective motion-capture marker. Position and orientation data for both objects were streamed to a ground-based computer running the high-level motion planning and control algorithms.

This computer generated real-time position and attitude setpoints, which were transmitted to the quadcopter. The onboard flight controller then regulated the quadcopter’s orientation using PID-based control laws.