Swinging up of a cart-pendulum system via a homoclinic orbit