The ballbeam control system is one of the most perfect and classic experimental equipment for the research and analysis of automatic control theory. Other nonlinear and unstable systems have important dynamic performance, but because the ball bar system is nonlinear and unstable, it is necessary to design a controller to correct it. In this paper, the root locus and the state space theory are used for correction. In the root locus correction, the curve of the root locus is changed by adding open-loop zeros and poles to make the system stable; in the state space, a state feedback observer is designed by using the principle of pole assignment, and the state feedback matrix
K
is obtained to make the system stable. Using the visual tool Simulink in MATLAB to simulate, we can see the specific control effect of the controller intuitively. The real-time control was carried out on gbb2004, and the results were observed.