Swing-up and stabilizing control of an inverted pendulum is one of the most common experiments used for illustrating nonlinear control techniques. Since an actual inverted pendulum has a limited pivotal travel, its controller has to be designed to satisfy this constraint. However, it is difficult to design controllers for underactuated systems with state constraints, like inverted pendulums. In this paper we propose a robust control law which can swing up a translational inverted pendulum using a limited pivot travel effectively. Bearing in mind that the energy of the pendulum can be controlled according to the sign condition of pivot acceleration, we develop a control law for swinging up the pendulum which performs controlling acceleration of the pivot as well as limiting its travel. The swing-up controller consists of a lower-level controller that increases or decreases the energy of the pendulum and an upper-level controller that controls the pendulum energy to a given value by adjusting the lower-level controller using PID control techniques. The results of our simulations and experiments demonstrate the effectiveness of the proposed control law.