Simulation and debugging of LQR control for two-wheeled self-balanced robot

In this paper, the Newton-Euler method is used to model the two-wheeled self-balancing robot, then the model is linearized and decoupled. The LQR optimal quadratic model is used to simulate the model, and the influence of Q and R on the system state is analyzed. Combined with the simulation, the algorithm is written to the controller for the actual control of the robot, and the debugging method is given.