This paper presents the design of balance control for an inverted pendulum system. The system consists of a cart, linear motor and a pole. The pole is pivoted on the cart where the cart is actuated by a linear motor. The control objective is to stabilize the pole at its upright position. The second-order sliding mode control is used to design the stabilizing control law for the system. For comparison, we consider LQR (Linear Quadratic Regulator) control and first-order sliding mode control to stabilize the system. The dynamic model of the system is given. The linearized model of the system is used to design the LQR control law, while the nonlinear dynamic model is used to design first-order and second-order sliding mode control. The MATLAB/Simulink is used to conduct the simulation studies and the designed control laws are implemented on a digital signal processor. The effectiveness of the designed control laws is demonstrated in the simulations and experiments.