Controlling the kinematics of a spring-pendulum system using an energy harvesting device