The invention provides a crane anti-swing control method and device based on an LQR
algorithm, and belongs to the technical field of crane control. The crane anti-swing control method based on the LQR
algorithm comprises the following steps: S1, obtaining a state-space equation of a crane
system; s2, an LQR controller u =-Kx based on the LQR
algorithm is designed based on the state-space equation, K is a feedback matrix, a K value of an optimal solution is obtained through calculation based on the
Riccati equation and a cost function, and the K value is substituted into the LQR controller to obtain an
optimal control variable u through calculation; and S3, substituting the
optimal control variable u into the state-space equation so as to carry out anti-swing control on the crane
system. According to the method, a state-space equation of a crane
system is established, an LQR controller based on an LQR algorithm is applied to calculate and obtain a K value of an optimal solution, an
optimal control variable u is calculated and obtained according to the K value of the optimal solution, the optimal
control variable u is substituted into the state-space equation, output of the crane system is influenced, and rapid anti-swing and anti-swing are achieved.