Abstract:Aiming at the defects that the weight coefficients of linear quadratic regulator (LQR) of two-wheeled balance robot needs to be manually selected, an improved carnivorous plant algorithm (ICPA) is used to optimize the LQR weight coefficients, which realizes the self-stability and high-precision trajectory tracking of two-wheeled balance robot. Firstly, the dynamic equations of the balance robot system is constructed by Lagrange equation method, and the LQR optimization PID control strategy is used to ensure the optimal control force. Secondly, an adaptive capture coefficient is proposed in the growth process of carnivorous plant algorithm, which balances the growth of carnivorous plants and preys, and improves the ability of global exploration in the early stage and local optimization in the later stage. Then, the interference factor is designed in the reproduction process of carnivorous plant algorithm to expand the search space and further improve the global optimization ability. Finally, based on EA cost function, the weight coefficients of LQR controller is optimized by ICPA, and the control strategy model of two-wheeled balanced robot is established in MATLAB/Simulink environment. The experimental results show that the PID controller optimized by the proposed ICPA-LQR optimized PID controller has faster dynamic response speed, stronger anti-interference ability and better overall performance than the control effect optimized by the carnivorous plant algorithm, sparrow search algorithm, moth fire extinguishing algorithm and improved particle swarm optimization algorithm. Under disturbance, the dynamic deviation of the control two-wheeled balance robot tracking complex trajectory dip angle is less than 0.05 rad, the deviations of the horizontal and vertical coordinates is less than 0.2 m, the deviation of the steering angle is less than 0.2 rad, and the deviation of the wheel position angle is less than 3 rad, which can accurately track the given reference trajectory under the premise of maintaining dynamic balance, behaving strong generalization ability.