Crane anti-swing control method and device based on LQR algorithm

Through the anti-swing control method of cranes based on LQR algorithm, the problems of slightly sluggish, overshoot and debugging in the existing technology are solved, and the fast and stable anti-swinging and anti-swinging of the crane system are achieved.

CN119551558APending Publication Date: 2025-03-04ZHEJIANG JIAOGONG EQUIP ENG CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411731411.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The existing crane anti-swing technology has slightly lagging PID control, overshoot and debugging, while the solution based on fuzzy control and neural network algorithms is cumbersome to calculate, costly and difficult to implement the program.

Method used

The anti-swing control method of crane based on the LQR algorithm is adopted. By obtaining the state space equation of the crane system, the LQR controller is designed, the feedback matrix K is calculated, and the optimal control variable u is obtained to realize anti-swing control of the crane system.

Benefits of technology

It realizes the rapid anti-swing and deswing of the crane system, optimizes the state vector and control variables, improves the performance indicators of the system, and maintains the stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119551558A_ABST
    Figure CN119551558A_ABST
Patent Text Reader

Abstract

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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crane control, and in particular to a crane anti-sway control method and device based on an LQR algorithm. Background Art

[0002] There are many kinds of anti-sway technologies for cranes. The anti-sway equipment of well-known foreign brands such as ABB, Yaskawa, Siemens and other professional manufacturers is not only expensive, but also not universal and difficult to popularize. Therefore, it is necessary to find a new anti-sway device for use in the production and handling of materials. Research on the anti-sway of cranes, currently the electronic anti-sway and anti-sway control is widely used, mainly in the following two situations: the first is to use the classical control method, that is, based on the classical PID control theory, the controller is designed using this method to achieve the purpose of anti-sway and positioning, and the other is based on the modern control method. Based on the intelligent control theory, that is, the fuzzy control strategy of two-dimensional input and the neural network algorithm, and the fuzzy controller is established according to the above theory and gradually applied to the field of anti-sway. The feasibility of fuzzy control has been proved through simulation and good control effects have been achieved.

[0003] However, all of the above methods have disadvantages to varying degrees: 1. The characteristic of PID control is that the output of the system controlled object (controlled quantity) is fed back to affect the output of the controller, forming one or more closed loops. The PID system generally adopts negative feedback control, that is, the feedback signal is opposite to the system given value signal. When the structure and parameters of the controlled object cannot be fully mastered, or an accurate mathematical model cannot be obtained, the structure and parameters of the system controller must be determined based on experience and on-site debugging. Therefore, when PID control theory is used for anti-sway of cranes, there are problems such as slight lag in the anti-sway effect, overshoot of the swing angle, and greater difficulty in debugging.

[0004] 2. The anti-sway algorithm based on fuzzy control strategy and neural network algorithm realizes position and speed control on the basis of anti-sway. It is necessary to establish a 2 or 4-dimensional fuzzy anti-sway controller, but the fuzzy control strategy has great shortcomings. Generally speaking, the number of fuzzy rules will increase significantly with the increase of the dimension of the fuzzy controller input. A complete 4-dimensional fuzzy control may require five or six hundred or even thousands of fuzzy rules to support it, which brings trouble to the formulation of fuzzy rules. Although this scheme is better than PID control in anti-sway, when the intelligent control theory of modern control methods is used for anti-sway of cranes, there are still unfavorable factors such as the formula is too cumbersome, the calculation workload is large, the program implementation is difficult, and large industrial electrical control devices such as industrial computers are required to increase costs. Summary of the invention

[0005] In order to solve the above problems, an embodiment of the present application provides a crane anti-sway control method and device based on the LQR algorithm.

[0006] In a first aspect, the present application provides a crane anti-sway control method based on the LQR algorithm, comprising the following steps:

[0007] S1: Obtaining the state space equations of the crane system Where u is the control variable, A, B, C, and D are all state matrices;

[0008] S2: Design an LQR controller based on the LQR algorithm based on the state space equation u=-Kx, where K is the feedback matrix, u is the control variable in the state space equation, and x is the state vector X in the state space equation. The K value of the optimal solution is calculated based on the Riccati equation and the cost function, and the K value is substituted into the LQR controller to calculate the optimal control variable u;

[0009] S3: Substitute the optimal control variable u into the state space equation to perform anti-sway control on the crane system.

[0010] Preferably, step S1 specifically includes:

[0011] S11: Establish a three-dimensional dynamic model of the crane system in generalized coordinates based on the Lagrange equation;

[0012] S12: Linearly simplify the three-dimensional dynamic model to obtain the two-dimensional dynamic model of the crane system Where M represents the mass of the trolley, m represents the mass of the hanging weight, μ represents the friction coefficient between the trolley and the guide rail, and x represents the horizontal displacement of the trolley. represents the horizontal speed of the car, represents the horizontal acceleration of the trolley, θ represents the swing angle of the hanging weight, is the angular velocity of the hanging weight, represents the angular acceleration of the hanging weight, I represents the length of the wire rope, F represents the horizontal driving force of the trolley, and g represents the acceleration due to gravity;

[0013] S13: Two-dimensional kinetic model Simplify to get the first simplified equation For the first simplified equation Transform to obtain the state space expression

[0014]

[0015] S14: According to the state space expression The state space equation of the crane system is obtained in u is the control variable, u=F, Y=[x,θ],

[0016] Preferably, in step S3, obtaining the K value in the LQR controller based on the Riccati equation and the cost function calculation specifically includes:

[0017] S31: Get cost function

[0018] S32: Get Riccati equation A T P+PA-PBR -1 B T P+Q=0, where A and B are state matrices, parameter matrices Q and R are set, and the Riccati equation is solved to obtain the constant matrix P;

[0019] S33: Take K = R -1 B T P, substitute the constant matrix P into the formula K = R -1 B T The optimal solution K value is calculated in P.

[0020] Preferably, step S13 specifically includes:

[0021] S131: Set cosθ=1, sinθ=θ, according to the formula Two-dimensional dynamic model Simplified to the first simplified equation

[0022] S132: For the first simplified equation Transform and sort to get the first transformation equation The second transformation equation and the transfer function equation

[0023] S133: Let the formula x1=x, x3=θ, The first transformation equation, the second transformation equation and the transfer function equation are transformed to obtain the state space expression

[0024]

[0025] Preferably, MTALAB software is developed based on the single-chip microcomputer 32, step S2 is executed through the LQR calculation module in the MTALAB software to obtain the K value, and step S2 is executed based on the K value to obtain the optimal control variable u.

[0026] In a second aspect, an embodiment of the present application provides a crane anti-sway control device based on an LQR algorithm, comprising:

[0027] Model acquisition module to obtain the state space equations of the crane system Where u is the control variable, A, B, C, and D are all state matrices;

[0028] An LQR calculation module is used to design an LQR controller u=-Kx based on the LQR algorithm based on the state space equation, where K is a feedback matrix, u is a control variable in the state space equation, and x is a state vector in the state space equation. The K value of the optimal solution is calculated based on the Riccati equation and the cost function, and the K value is substituted into the LQR controller to calculate and obtain the optimal control variable u;

[0029] The control module is used to substitute the optimal control variable u into the state space equation to perform anti-sway control on the crane system.

[0030] Preferably, the model acquisition module includes

[0031] A three-dimensional model unit is used to establish a three-dimensional dynamic model of the crane system in generalized coordinates based on the Lagrange equation;

[0032] The two-dimensional model unit is used to linearly simplify the three-dimensional dynamic model to obtain the two-dimensional dynamic model of the crane system. Where M represents the mass of the trolley, m represents the mass of the hanging weight, μ represents the friction coefficient between the trolley and the guide rail, and x represents the horizontal displacement of the trolley. represents the horizontal speed of the car, represents the horizontal acceleration of the trolley, θ represents the swing angle of the hanging weight, is the angular velocity of the hanging weight, represents the angular acceleration of the hanging weight, l represents the length of the wire rope, F represents the horizontal driving force of the trolley, and g represents the acceleration due to gravity;

[0033] Expression unit for two-dimensional dynamic models Simplify to get the first simplified equation For the first simplified equation Transform to obtain the state space expression

[0034] State space unit, used to express the state space The state space equation of the crane system is obtained in u is the control variable, u=F, Y=[x,θ],

[0035] Preferably, the LQR calculation module includes

[0036] Function acquisition unit, used to obtain the cost function

[0037] Matrix acquisition unit, used to obtain the Riccati equation A T P+PA-PBR -1 B T P+Q=0, where A and B are state matrices, parameter matrices Q and R are set, and the Riccati equation is solved to obtain the matrix P;

[0038] Calculation acquisition unit, used to obtain K = R -1 B T P, substitute the constant matrix P into the formula K = R -1 B T The optimal solution K value is calculated in P.

[0039] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method provided in the first aspect or any possible implementation of the first aspect are implemented.

[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect or any possible implementation of the first aspect.

[0041] The beneficial effects of the present invention are as follows: a state space equation of a crane system is established, an LQR controller based on an LQR algorithm is used to calculate the K value of the optimal solution, an optimal control variable u is obtained according to the K value of the optimal solution, and the optimal control variable u is substituted into the state space equation, so that the crane system constitutes a closed-loop optimal control, and by optimizing the state vector and the control variables, the crane system achieves better performance indicators, so that the crane system can remain stable, and finally achieves rapid anti-sway and sway elimination. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 A schematic flow chart of a crane anti-sway control method based on an LQR algorithm provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of the structure of a crane anti-sway control device based on the LQR algorithm provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0046] Figure 4 A simplified force model diagram of a crane control system for a crane anti-sway control method based on an LQR algorithm provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0048] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, although the embodiment may not be clearly recorded in the following text.

[0049] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.

[0050] See also Figure 1 , 4 . Figure 1 A schematic diagram of a flow chart of a crane anti-sway control method based on an LQR algorithm provided in an embodiment of the present application, Figure 4 A simplified force model diagram of a crane control system of a crane anti-sway control method based on an LQR algorithm provided in an embodiment of the present application. In an embodiment of the present application, the method comprises the following steps:

[0051] S1: Obtaining the state space equations of the crane system Where u is the control variable, A, B, C, and D are all state matrices;

[0052] S2: Design an LQR controller based on the LQR algorithm based on the state space equation u=-Kx, where K is the feedback matrix, u is the control variable in the state space equation, and x is the state vector X in the state space equation. The K value of the optimal solution is calculated based on the Riccati equation and the cost function, and the K value is substituted into the LQR controller to calculate the optimal control variable u;

[0053] S3: Substitute the optimal control variable u into the state space equation to perform anti-sway control on the crane system.

[0054] In the embodiment of the present application, the control quantity u is calculated, which is a control quantity (changing in real time) given after real-time calculation based on physical quantities such as wire rope height, trolley running speed, and lifting weight. The control quantity is added to the given quantity to form a total control quantity, which is given to the frequency converter for corresponding speed changes. For example: the trolley speed is given at 20HZ + anti-sway control quantity (+5HZ) = the total control quantity is 25HZ, and the trolley speed is given at 20HZ + anti-sway control quantity (-5HZ) = the total control quantity is 15HZ.

[0055] In the embodiment of the present application, the optimal control variable u is calculated in the LQR controller based on the K value of the optimal solution and the state vector x.

[0056] In the embodiment of the present application, the trolley and the hook of the bridge crane are connected by a non-rigid soft steel rope. When the trolley or the trolley of the crane starts to move, that is, when the trolley or the trolley starts to start or stop, and temporarily without considering various external disturbance factors, we decompose the swing of the hanging weight into the following two motion states: Case 1, when the trolley or the trolley works independently, the swing of the hanging weight in the entire plane of the trolley or the trolley is similar to the simple harmonic motion mode of the pendulum; Case 2, when the trolley and the trolley work together, the hanging weight will be centered on the vertical point of the static state and the length of the steel rope connecting the hanging weight as the radius, and perform an attenuated oscillation motion similar to a curved surface. Since the dynamic process of the crane system is a relatively complex nonlinear system when it is working, if a very accurate corresponding nonlinear mathematical model is to be established, it is necessary to comprehensively consider the joint influence of the environment on the system and various interference factors. In order to establish a suitable model, it is necessary to add some assumptions to the system to simplify the construction of the crane dynamics model. The assumptions are as follows: (1) When the crane is moving materials, the trolley usually does not do anything, that is, it remains stationary. Therefore, when building a swing model for the trolley load, the influence of the trolley is ignored; (2) The rigidity of the load swing arm is very strong, and its length change should be ignored when building the model; (3) The friction between the trolley and the guide rail is related to the speed of the trolley, usually set as a linear relationship, and the friction factor is μ; (4) It is assumed that the load only moves in a plane perpendicular to the horizontal plane and always remains horizontal when working. Therefore, when building a simplified model, it is regarded as a point mass without volume; (5) The influence of air damping and wind force is ignored; (6) It is assumed that the driving force F of the given trolley is a controllable variable. Excluding a series of nonlinear interferences caused by the transmission mechanism such as the motor and reducer, the drive control of the trolley can be achieved by adjusting the output of the inverter. Controlling the position and anti-sway of the crane is actually a study of the position and swing of the trolley and the cart on the plane. This application is limited to studying the anti-sway and positioning of the crane on the plane formed by the trolley and the movement of the trolley.

[0057] In the embodiment of the present application, the simplified force model of the crane system is as follows: Figure 4 In the figure, the mass of the trolley is M, the mass of the load is m, and the coordinates of the trolley and the load are set to (x M ,y M ), (x m ,y m), the system is subject to the following external forces: the trolley driving force F, the wire rope lifting force F1, and the friction force f between the trolley and the guide rail. The direction of the trolley driving force F is taken as the positive direction of the x-axis, and the direction perpendicular to the ground is taken as the positive direction of the y-axis, thereby establishing a rectangular coordinate system. When the crane lifts the goods, the physical quantities such as the lifting mass m, the running speed, the consumed time, and the acceleration setting are regarded as known quantities, so the wire rope lifting force F1 on the system is a constant value. The process of crane carrying heavy objects is decomposed into two steps: it can be regarded as a combination of the crane system moving in the horizontal plane and the vertical plane respectively. When the crane is in the process of moving in the vertical plane, the heavy object is pulled by the motor through the wire rope to the specified position; when the crane is in the process of moving in the horizontal plane, the traction motor drives the weight to follow the movement, and at the same time, it is also necessary to ensure that the swing angle of the weight is as small as possible or kept within the allowable range.

[0058] In one possible implementation, step S1 specifically includes:

[0059] S11: Establish a three-dimensional dynamic model of the crane system in generalized coordinates based on the Lagrange equation;

[0060] S12: Linearly simplify the three-dimensional dynamic model to obtain the two-dimensional dynamic model of the crane system Where M represents the mass of the trolley, m represents the mass of the hanging weight, μ represents the friction coefficient between the trolley and the guide rail, and x represents the horizontal displacement of the trolley. represents the horizontal speed of the car, represents the horizontal acceleration of the trolley, θ represents the swing angle of the hanging weight, is the angular velocity of the hanging weight, represents the angular acceleration of the hanging weight, I represents the length of the wire rope, F represents the horizontal driving force of the trolley, g represents the acceleration of gravity, H represents the maximum lifting length of the wire rope, Indicates the wire rope lifting speed, represents the acceleration of the wire rope lifting, f represents the friction between the trolley and the guide rail, F I Indicates the lifting force of the wire rope;

[0061] S13: Two-dimensional kinetic model Simplify to get the first simplified equation For the first simplified equation Transform to obtain the state space expression

[0062] S14: According to the state space expression The state space equation of the crane system is obtained in u is the control variable, u=F, Y=[x,θ],

[0063] In one possible implementation, the step S3 of calculating and obtaining the K value in the LQR controller based on the Riccati equation and the cost function specifically includes:

[0064] S31: Get cost function

[0065] S32: Get Riccati equation A T P+PA-PBR -1 B T P+Q=0, where A and B are state matrices, parameter matrices Q and R are set, and the Riccati equation is solved to obtain the constant matrix P;

[0066] S33: Take K = R -1 B T P, substitute the constant matrix P into the formula K = R -1 B T The optimal solution K value is calculated in P.

[0067] In the embodiment of the present application, LQR (Linear Quadratic Regulator), i.e., linear quadratic regulator, can obtain the optimal control law of state linear feedback, and is easy to form closed-loop optimal control. LQR optimal control is cheap but can make the original system achieve better performance indicators and is easy to implement. It is a relatively mature part of modern control theory. Substituting u(t)=-Kx(t) into the state space equation, we get The state matrix A becomes (A-BK). Therefore, by configuring the feedback matrix K, the closed-loop system can be made The extreme point reaches the preset state. First, design the cost function. The optimal control trajectory should be to minimize the cost function. Select the cost function Where Q and R are parameter matrices set by the user. A and B are known conditions for the state matrix, Q and R are symmetric semi-positive definite and positive definite matrices respectively, both are weight matrices, which are relative concepts. For example, when the weight of Q is relatively large, the state variable x will converge faster, that is, the system will reach the steady-state value faster. K=R -1 B T P, then the closed-loop system The matrix is ​​A-BK=A-BR -1 B T P, select the parameter matrices Q and R, solve the Riccati equation to obtain the matrix P, and calculate the optimal solution K. Substitute u = -Kx into get For the state space equation The open-loop system, according to modern control theory, knows that the poles of the open-loop transfer function are the eigenvalues ​​of the system matrix A, which now becomes The closed-loop form of the state transformation matrix A becomes (A-BK), so by configuring the feedback matrix K, the poles of the closed-loop system can reach the desired state. Select the cost function Where Q is a set of semi-positive definite matrices, and R is a positive definite matrix. First, assume that the state vector x(t) is 1-dimensional, then x T Qx is a square term Qx^2>=0, u T Ru is the same. If the cost function J is to be minimized, then the state vectors x(t) and u(t) must be small. If J is minimized, it is a bounded function. It is inferred that when t tends to infinity, the state vector x(t) will tend to 0, which also ensures the stability of the closed-loop system. The input u(t) should be small, which means that the optimal control is obtained with the minimum control cost. For example, when controlling a motor, a small input PWM will save energy. Generally speaking, a large Q value means that to make J small, x(t) needs to be smaller, which means that the eigenvalue of the closed-loop system matrix (A-BK) is farther to the left of the S plane, so that the state x(t) decays to 0 at a faster rate. On the other hand, a large R means that more attention is paid to the input variable u(t). The decrease of u(t) means that the state decay will slow down. At the same time, Q is a semi-positive definite matrix, which means that its eigenvalue is non-negative, and R is a positive definite matrix, which means that its eigenvalue is positive. If Q and R are both diagonal matrices, then the diagonal elements of Q are positive numbers, and several 0s are allowed, and the diagonal elements of R can only be positive numbers.

[0068] In the embodiment of the present application, u=-Kx is substituted into the cost function Get To find K, assume there exists a constant matrix P such that The formula Substitution Get Assume that the closed-loop system is stable, that is, when t tends to infinity, x(t) tends to 0. Expand the differential on the left and use the differential of the state variable x Substitute x T A c T Px+x T PA c x+x t Qx+x T K T RKx=0,x T (A c T P+PAc +Q+K T RK)x=0, formula x T (A c TP+PA c +Q+K T RK)x=0 is always true, the term in the brackets must always be equal to 0, (A-BK) T P+P(A-BK)+Q+K T RK=0,A T P+PA+O+K T RK-K T B T P-PBK=0, this is a quadratic equation about K. Choosing an appropriate K makes the two quadratic terms cancel out, which not only meets the requirements but also simplifies the calculation. Take K=R -1 B T P, substitute into the formula (A-BK) T P+P(A-BL)+QK T RK=0、A T P+PA+Q+K T RK-K T B T When P-PBK=0, we get A T P+PA+Q+(R -1 B T P) T R(R -1 B T P)-(R -1 B T P) T B T P-PB(R -1 B T P)=0、A T P+PA+Q-PBR -1 B T P = 0, so there is no quadratic term of K, but the value of K is related to P, and P is a constant assumed. By solving the Riccati equation A T P+PA-PBR -1 B T P+Q=0 can get the constant matrix P, and then the optimal solution K value can be obtained.

[0069] In one possible implementation, step S13 specifically includes:

[0070] S131: Set cosθ=1, sinθ=θ, according to the formula Two-dimensional dynamic model Simplified to the first simplified equation

[0071] S132: For the first simplified equation Transform and sort to get the first transformation equation The second transformation equation and the transfer function equation

[0072] S133: Let the formula x1=x, x3=θ, The first transformation equation, the second transformation equation and the transfer function equation are transformed to obtain the state space expression

[0073] In the embodiment of the present application, the present application is controlled according to the specific situation when the crane is working. Usually, after the heavy object is lifted to a predetermined position, the trolley is driven to move to the designated position, and then the heavy object is put down. Therefore, there is no need to consider the length change of the wire rope in the vertical direction. Then the rope length is set unchanged. Get the two-dimensional dynamic model of the crane system Where M represents the mass of the trolley, m represents the mass of the hanging weight, μ represents the friction coefficient between the trolley and the guide rail, and x represents the horizontal displacement of the trolley. represents the horizontal speed of the car, represents the horizontal acceleration of the trolley, θ represents the swing angle of the hanging weight, is the angular velocity of the hanging weight, represents the angular acceleration of the hanging weight, I represents the length of the wire rope, F represents the horizontal driving force of the trolley, and g represents the acceleration of gravity. Usually, under the standard use criteria, the swing angle θ of the crane fluctuates very little within the range of the equilibrium position θ=0, and there will be no large swing. Then, cosθ=1, sinθ=θ are set. According to the formula Two-dimensional dynamic model Simplified to the first simplified equation For the first simplified equation Transform and sort to get the first transformation equation The second transformation equation and the transfer function equation According to the formula x1=x, x3=θ, The first transformation equation, the second transformation equation and the transfer function equation are transformed to obtain the state space expression The state equation of the crane system is: The output equation of the crane system is: In the above formula:

[0074] In one possible implementation, MTALAB software is developed based on the single-chip microcomputer 32, step S2 is executed through the LQR calculation module in the MTALAB software to obtain the K value, and step S2 is executed based on the K value to obtain the optimal control variable u.

[0075] In the embodiment of the present application, based on the single-chip microcomputer STM32F103C8T6 basic development board, the K value is calculated by the LQR calculation module in the MTALAB software, and the anti-sway control of the crane is realized by programming in the C language of the KEIL MDK software. The state feedback matrix is ​​calculated by borrowing the relevant functions of MATLAB. The hardware of the anti-sway control in the prior art basically adopts: the structural mode of industrial computer + programmable controller (PLC) + servo driver, and the existing hardware structure is specifically complicated in that a large number of calculation processes are completed by the industrial computer, and the swing angle detection, running speed detection, and positioning distance detection are completed by the PLC, so it is required that the PLC and the industrial computer must maintain real-time communication, thereby reducing the time delay of the sensor transmission signal and the time delay of the anti-sway calculation to generate the control signal. Now choose to use the form of a single-chip microcomputer to integrate the swing angle detection and running speed detection into one chip to greatly avoid the above-mentioned disadvantages of generating delay and improve the response speed.

[0076] In the embodiment of the present application, through the analysis of the LQR algorithm, the crane anti-sway device based on the LQR algorithm needs to apply the Lagrange equation to the three-dimensional system of the crane load and the cable to establish a three-dimensional dynamic model under generalized coordinates; then, the system is linearly simplified at the stable point in combination with the actual operation scenario, and a two-dimensional dynamic model of the system is established on this basis; the LQR algorithm can be applied to obtain the optimal solution K value, thereby obtaining the optimal control variable u, which is fed back to affect the output of the controller to ultimately achieve rapid anti-sway and sway elimination. This control system is a full-state feedback control system.

[0077] In the embodiments of the present application, 1. According to the known conditions of the crane: load weight, running speed, wire rope length, trolley weight and other conditions, the system motion structure is analyzed to obtain the physical model of the crane, and then the system is modeled using the Lagrange equation to obtain the dynamic model of the crane system, thereby analyzing the state matrices A and B of the system, and calculating the K value through the MTALAB software or compiling the K value calculation program using the KEIL MDK software C language; 2. Based on the K value and the feedback value of the crane wire rope swing angle, the KEIL MDK software C language is used to compile the trolley output speed program u=-(k1*(x+x_target)+k2*x_dot+k3*theta+k4*theta_dot), thereby performing anti-sway control on the crane.

[0078] The following will be combined with the attached Figure 2, a crane anti-sway control device based on the LQR algorithm provided in the embodiment of the present application is introduced in detail. It should be noted that the attached Figure 2 The crane anti-sway control device based on the LQR algorithm is used to implement the present application Figure 1 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 The embodiment shown.

[0079] See also Figure 2 , Figure 2 Schematic diagram of the structure of a crane anti-sway control device based on the LQR algorithm provided in the embodiment of the present application. Figure 2 As shown, the device comprises

[0080] Model acquisition module 201, used to obtain the state space equation of the crane system Where u is the control variable, A, B, C, and D are all state matrices;

[0081] LQR calculation module 202, used to design an LQR controller u=-Kx based on a state space equation, where K is a feedback matrix, u is a control variable in the state space equation, and x is a state vector in the state space equation, and to calculate and obtain the optimal solution K value based on the Riccati equation and the cost function, and to substitute the K value into the LQR controller to calculate and obtain the optimal control variable u;

[0082] The control module 203 is used to substitute the optimal control variable u into the state space equation to perform anti-sway control on the crane system.

[0083] In one possible implementation, the model acquisition module 201 includes

[0084] A three-dimensional model unit is used to establish a three-dimensional dynamic model of the crane system in generalized coordinates based on the Lagrange equation;

[0085] The two-dimensional model unit is used to linearly simplify the three-dimensional dynamic model to obtain the two-dimensional dynamic model of the crane system. Where M represents the mass of the trolley, m represents the mass of the hanging weight, μ represents the friction coefficient between the trolley and the guide rail, and x represents the horizontal displacement of the trolley. represents the horizontal speed of the car, represents the horizontal acceleration of the trolley, θ represents the swing angle of the hanging weight, is the angular velocity of the hanging weight, represents the angular acceleration of the hanging weight, l represents the length of the wire rope, F represents the horizontal driving force of the trolley, and g represents the acceleration due to gravity;

[0086] Expression unit for two-dimensional dynamic models Simplify to get the first simplified equation For the first simplified equation Transform to obtain the state space expression

[0087] State space unit, used to express the state space The state space equation of the crane system is obtained in u is the control variable, u=F, Y=[x,θ],

[0088] In one possible implementation, the LQR calculation module 202 includes

[0089] Function acquisition unit, used to obtain the cost function

[0090] Matrix acquisition unit, used to obtain the Riccati equation A T P+PA-PBR -1 B T P+Q=0, where A and B are state matrices, parameter matrices Q and R are set, and the Riccati equation is solved to obtain the constant matrix P;

[0091] Calculation acquisition unit, used to obtain K = R -1 B T P, substitute the constant matrix P into the formula K = R -1 B T The optimal solution K value is calculated in P.

[0092] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit", "module" and "part" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (Field-Programmable Gate Array, FPGA), an integrated circuit (Integrated Circuit, IC), etc.

[0093] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.

[0094] See also Figure 3 , which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement Figure 1 The method in the embodiment shown. Figure 3As shown, the electronic device 300 may include: at least one central processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .

[0095] The communication bus 302 is used to realize the connection and communication between these components.

[0096] The user interface 303 may include a display screen (Display) and a camera (Camera). The optional user interface 303 may also include a standard wired interface and a wireless interface.

[0097] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0098] Among them, the central processing unit 301 may include one or more processing cores. The central processing unit 301 uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the terminal 300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the central processing unit 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The central processing unit 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics central processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the central processing unit 301, and it can be implemented separately through a chip.

[0099] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 305 may optionally be at least one storage device located away from the aforementioned central processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.

[0100] exist Figure 3 In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the central processor 301 can be used to call an application program for crane anti-sway control based on the LQR algorithm stored in the memory 305, and specifically perform the following operations:

[0101] S1: Obtaining the state space equations of the crane system Where u is the control variable, A, B, C, and D are all state matrices;

[0102] S2: Design an LQR controller u(t)=-Kx(t) based on the state space equation, where K is the feedback matrix. Obtain the K value in the LQR controller based on the Riccati equation and the cost function. Substitute the K value into the LQR controller to calculate and obtain the optimal control variable u.

[0103] S3: Substitute the optimal control variable u into the state space equation to perform anti-sway control on the crane system.

[0104] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0105] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0107] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program code.

[0111] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct the relevant hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0112] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A crane anti-sway control method based on LQR algorithm, characterized in that: The steps include: S1: Obtaining the state space equations of the crane system Where u is the control variable, A, B, C, and D are all state matrices; S2: Design an LQR controller based on the LQR algorithm based on the state space equation u=-Kx, where K is the feedback matrix, u is the control variable in the state space equation, and x is the state vector X in the state space equation. The K value of the optimal solution is calculated based on the Riccati equation and the cost function, and the K value is substituted into the LQR controller to calculate the optimal control variable u; S3: Substitute the optimal control variable u into the state space equation to perform anti-sway control on the crane system.

2. A crane anti-sway control method based on LQR algorithm as claimed in claim 1, characterized in that: Step S1 specifically includes: S11: Establish a three-dimensional dynamic model of the crane system in generalized coordinates based on the Lagrange equation; S12: Linearly simplify the three-dimensional dynamic model to obtain the two-dimensional dynamic model of the crane system Where M represents the mass of the trolley, m represents the mass of the hanging weight, μ represents the friction coefficient between the trolley and the guide rail, and x represents the horizontal displacement of the trolley. represents the horizontal speed of the car, represents the horizontal acceleration of the trolley, θ represents the swing angle of the hanging weight, is the angular velocity of the hanging weight, represents the angular acceleration of the hanging weight, l represents the length of the wire rope, F represents the horizontal driving force of the trolley, and g represents the acceleration due to gravity; S13: Two-dimensional kinetic model Simplify to get the first simplified equation For the first simplified equation Transform to obtain the state space expression S14: According to the state space expression The state space equation of the crane system is obtained in u is the control variable, u=F, Y=[x,θ], 3. A crane anti-sway control method based on LQR algorithm as claimed in claim 1 or 2, characterized in that: In step S3, the K value in the LQR controller is obtained based on the Riccati equation and the cost function calculation, which specifically includes: S31: Get cost function S32: Get Riccati equation A T P+PA-PBR -1 B T P+Q=0, where A and B are state matrices, parameter matrices Q and R are set, and the Riccati equation is solved to obtain the constant matrix P; S33: Take K = R -1 B T P, substitute the constant matrix P into the formula K = R -1 B T The K value in the LQR controller is calculated in P.

4. The crane anti-sway control method based on the LQR algorithm according to claim 2, characterized in that: Step S13 specifically includes: S131: Set cosθ=1, sinθ=θ, according to the formula Two-dimensional dynamic model Simplified to the first simplified equation S132: For the first simplified equation Transform and sort to get the first transformation equation The second transformation equation and the transfer function equation S133: Let the formula x1=x, x3=θ, The first transformation equation, the second transformation equation and the transfer function equation are transformed to obtain the state space expression 5. The crane anti-sway control method based on the LQR algorithm according to claim 1 or 2, characterized in that: Based on the MCU 32, MTALAB software is developed, and step S2 is executed through the LQR calculation module in the MTALAB software to obtain the K value, and step S2 is executed based on the K value to obtain the optimal control variable u.

6. A crane anti-sway control device based on LQR algorithm, characterized in that: include Model acquisition module to obtain the state space equations of the crane system Where u is the control variable, A, B, C, and D are all state matrices; An LQR calculation module is used to design an LQR controller u=-Kx based on the LQR algorithm based on the state space equation, where K is a feedback matrix, u is a control variable in the state space equation, and x is a state vector in the state space equation. The K value of the optimal solution is calculated based on the Riccati equation and the cost function, and the K value is substituted into the LQR controller to calculate and obtain the optimal control variable u; The control module is used to substitute the optimal control variable u into the state space equation to perform anti-sway control on the crane system.

7. The crane anti-sway control device based on the LQR algorithm as claimed in claim 6, characterized in that: The model acquisition module includes A three-dimensional model unit is used to establish a three-dimensional dynamic model of the crane system in generalized coordinates based on the Lagrange equation; The two-dimensional model unit is used to linearly simplify the three-dimensional dynamic model to obtain the two-dimensional dynamic model of the crane system. Where M represents the mass of the trolley, m represents the mass of the hanging weight, μ represents the friction coefficient between the trolley and the guide rail, and x represents the horizontal displacement of the trolley. represents the horizontal speed of the car, represents the horizontal acceleration of the trolley, θ represents the swing angle of the hanging weight, is the angular velocity of the hanging weight, represents the angular acceleration of the hanging weight, l represents the length of the wire rope, F represents the horizontal driving force of the trolley, and g represents the acceleration due to gravity; Expression unit for two-dimensional dynamic models Simplify to get the first simplified equation For the first simplified equation Transform to obtain the state space expression State space unit, used to express the state space The state space equation of the crane system is obtained in u is the control variable, u=F, Y=[x,θ], 8. A crane anti-sway control device based on LQR algorithm as claimed in claim 6 or 7, characterized in that: The LQR calculation module includes Function acquisition unit, used to obtain the cost function Matrix acquisition unit, used to obtain the Riccati equation A T P+PA-PBR -1 B T P+Q=0, where A and B are state matrices, parameter matrices Q and R are set, and the Riccati equation is solved to obtain the constant matrix P; Calculation acquisition unit, used to obtain K = R -1 B T P, substitute the constant matrix P into the formula K = R -1 B T The optimal solution K value is calculated in P.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Cited By

  • Intelligent control method and system for tower crane

    CN120622319A