In this paper, a simulated study of three different control strategies; Linear Quadratic Regulator (LQR), Integer order PID and Fractional order PID (FOPID), is performed in order to stabilize an inverted pendulum on a cart. First, a nonlinear model of the cart-pendulum system is presented which is used later in the simulations. The tuning parameters of all three controllers are obtained using the Particle Swarm Optimization (PSO) technique, with the Integral of the Squared Error (ISE) index as fitting function and employing a unit step as reference. The simulation results, when applying a unit step reference (same as in the PSO tuning process), show a better performance for the FOPID when using the cost function of the LQR as performance index. However, in a more general case of a sequence of step references, the LQR exhibits a better behavior.