This paper proposes the performance comparison of a linear quadratic regulator (LQR) controller for the ball and beam system (BBS). The BBS is a standard benchmark control system, which has two degree-of-freedom (2 DOF). It is an open loop and a highly nonlinear unstable system. This makes its parameter difficult to be estimated accurately, hence designing a controller for it is a challenging task. MatheThe BBS was modelled using Euler–Lagrange modeling technique, while the LQR controller was used for the stabilization of the ball on the beam. Simulation was done in MATLAB/Simulink 2022b environment, and the results simulated showed that for the two weighting matrices (Q and R), the state weighting matrix had a higher penalty on the ball displacement, ball velocity, beam angle, and beam angular velocity at lower values of Q. For the state weighting matrix had a better effect of penalty performance on the BBS with lower values. Also, as the diagonal element of the state weighting matrix Q increases from 0.1 to 20, the values of the optimal controller K increase, the reduced Ricatti matrix P increases, and the estimated eigenvalues E reduce. This implies that the ball displacement, ball velocity, beam angle, and beam angular velocity are better at lower values of Q.