This paper takes a self-erecting inverted pendulum system made by Quanser Inc.as the research object.Firstly,the dynamic model is derived based on the Lagrange's Equation.Then,the LQR control and PID control are used to control this system and a switch control is used to realize the switch of the first two controllers.At last,all the three controllers are used together to realize the self-erecting inverted pendulum system's self-swinging up and stable control.