Dynamics and control of a spacecraft with a moving, pulsating ball in a spherical cavity