Dynamics and control of an active pendulum system