Data processing system, method, device and storage medium for unmanned aerial vehicle
Through the model predictive control system based on neural network optimization, the problem of difficult trajectory tracking control of quad-rotor UAVs in complex environments is solved, achieving higher control accuracy and safety, and reducing computational complexity.
Patent Information
- Application Number
- CN202410949099.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-16
AI Technical Summary
It is difficult to track and control the trajectory of existing quad-rotor UAVs during flight. Traditional control algorithms such as PID, LQR, SMC, etc. perform poorly in complex environments and cannot effectively handle constraint issues, resulting in insufficient safety during flight.
A model predictive control system based on neural network optimization is used to obtain the reference pose and actual pose data of the UAV through the data acquisition module, construct a model predictive control cost function with state quantity and control quantity constraints, and use the original dual neural The network solves the quadratic programming problem and outputs the optimal control quantity data to achieve trajectory tracking control.
It significantly improves the accuracy and stability of quad-rotor UAV trajectory tracking control, can handle multi-constraint problems, enhances safety during flight, greatly reduces computational complexity, and improves computational efficiency.
Smart Images

Figure CN118502250B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data processing system, method, device and storage medium for unmanned aerial vehicles. Background Art
[0002] In recent years, with the continuous innovation and development of technologies such as artificial intelligence, sensors, and control algorithms, quad-rotor drones have gradually become a hot topic in the 21st century's intelligent technology. Quad-rotor drones are widely used in military reconnaissance, agricultural irrigation, search and rescue, etc. due to their simple structure, strong maneuverability, vertical take-off and landing, autonomous hovering, and easy operation.
[0003] For quad-rotor drones, a good flight motion control algorithm is the key to completing flight missions. At present, whether in agricultural irrigation or search and rescue, quad-rotor drones often need to accurately track pre-planned path points or trajectories when performing flight missions. However, it is still difficult to achieve flight motion control of quad-rotor drones and track established trajectories. First, the quad-rotor drone is a typical multi-input and multi-output under-actuated nonlinear system, and there is a strong coupling relationship between each input and output; secondly, the quad-rotor drone is easily disturbed by the external environment and it is impossible to establish an accurate dynamic model. A good control algorithm directly determines the performance of the quad-rotor drone in tracking the trajectory during flight, so the control algorithm design of the quad-rotor drone has important research significance.
[0004] At present, PID is still the most widely used control algorithm for quadcopters in practical applications. Although its design does not rely on the kinematic and dynamic models of quadcopters, it can reduce a certain amount of workload in model building. However, PID controllers are usually only applicable to single input-output linear systems. For a multi-input, multi-output, strongly coupled nonlinear complex system such as a quadcopter, when performing trajectory tracking tasks in a complex environment, the tracking performance of PID is also unsatisfactory. As for the popular linear quadratic regulator (LQR), sliding model control (SMC), and active disturbance rejection control (ADRC), compared with traditional PID, they have improved in stability and accuracy, but they are insufficient in predicting the future behavior of the quadcopter system, and cannot take measures in advance to avoid potential problems in the flight process. In addition, these controllers cannot handle constraint problems, and cannot effectively constrain the state and control quantities of the quadcopter, thus failing to avoid the problem of the drone crashing due to excessive speed or angle during flight. To this end, some researchers have proposed applying model predictive control algorithms to quadrotor drones. However, most of the research focuses on how to improve the robustness of the controller and the accuracy of trajectory tracking, while ignoring the huge amount of computation in the optimization process. The existing model predictive control methods use traditional quadratic programming sequence solution methods in the process of real-time optimal solution to quadratic programming problems. Such methods require complex matrix inversion operations, partial derivatives, etc., which require a lot of computation and are not suitable for real-time optimal control input of quadrotor drones at each sampling moment of trajectory tracking.
[0005] Based on this, a UAV data processing system that greatly reduces computational complexity and improves computational efficiency needs to be developed urgently. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present application proposes a data processing system, method and device for an unmanned aerial vehicle based on a combination of neural network optimization and model predictive control.
[0007] The technical solution adopted by this application to solve the above technical problems is:
[0008] A data processing system for unmanned aerial vehicles, comprising:
[0009] Data acquisition module, used to collect reference posture and actual posture data of the UAV;
[0010] A storage module, used to store the dynamics model and kinematics model of the UAV;
[0011] The dynamics module is used to calculate the actual posture data of the UAV, transmit the data to the data acquisition module, and track and control the reference trajectory of the UAV according to the optimal control quantity data;
[0012] The control module is arranged between the data acquisition module and the dynamics module, and simultaneously exchanges data with the data acquisition module and the dynamics module, and is used to construct a cost function of model predictive control with state quantity and control quantity constraints according to the kinematic model and the dynamics model of the UAV, and convert the cost function into a constrained quadratic programming problem, and then solve the constrained quadratic programming problem through the original dual neural network to output the optimal control quantity data.
[0013] The control module comprises:
[0014] A position controller, connected to the acquisition module, for outputting lift data in the optimal control amount data according to the actual posture and reference posture data;
[0015] A posture controller, connected to the data acquisition module, is used to output the three-axis torque data in the optimal control amount data according to the actual posture and reference posture data;
[0016] The dynamics module comprises:
[0017] A dynamics model unit, connected to the position controller and the attitude controller, and configured to output actual linear velocity data and actual angular velocity data using a dynamics model according to the optimal control amount data;
[0018] A kinematic model unit is connected to the output end of the dynamic model unit and is used to obtain the actual position information and actual attitude angle data of the UAV using the kinematic model according to the actual linear velocity data and the actual angular velocity data;
[0019] The position controller is connected to the output end of the kinematic model unit and is used to obtain the actual position information of the UAV;
[0020] The attitude controller is connected to the output end of the kinematic model unit and is used to obtain the actual attitude angle data.
[0021] The cost function of the model predictive control with state quantity and control quantity constraints is constructed according to the kinematic model and the dynamic model of the UAV, including:
[0022] The UAV model is discretized to obtain the discretized state space equation without performing decoupling operations;
[0023] The prediction time domain in the discretized state space equation is made equal to the control time domain, and a cost function with state constraints and control constraints and a prediction model state equation are constructed.
[0024] The model of the drone is discretized to obtain a discretized state space equation without performing a decoupling operation, including:
[0025] The dynamic and kinematic models of the UAV are discretized to obtain the state space equation under discrete time:
[0026] In the formula Represents the actual state input, where x, y, and z represent the coordinate positions in three directions respectively. Represent the speeds in three directions respectively, φ, θ, ψ represent the roll angle, pitch angle, and yaw angle respectively, Respectively represent the angular velocity of the roll angle, pitch angle, and yaw angle; u = [U1, U2, U3, U4] T Represents the control input, where U1 = mg-F cosφcosθ, U2 = τ x , U3=τ y , U4=τ z , F is the total lift, τ x ,τ y ,τ z Represents the torque in the x, y, and z directions respectively; y = [x, y, z, ψ] T represents the state output; k represents discrete time; represents the state input coefficient matrix, represents the control input coefficient matrix, c = I 12×12 represents the state output coefficient matrix;
[0027] Among them, I represents the unit matrix, 0 3×3 represents a 3×3 zero matrix, dt represents the sampling time, I xx ,I yy ,I zz They represent the moment of inertia in the x, y, and z directions respectively.
[0028] The discretized state space equation is processed to construct a cost function and a prediction model state equation with state constraints and control constraints.
[0029] The processing of the discretized state space equation to construct a cost function and a prediction model state equation with state constraints and control constraints includes:
[0030] The prediction time domain in the discretized state space equation is equal to the control time domain, and the step length is N, then the cost function with state constraints and control constraints is:
[0031]
[0032] Stu min ≤u(k+i)≤u max
[0033]
[0034] Wherein, i=0, 1, 2, ... N-1;
[0035] in, Represents the actual state input quantity; represents the reference state input, u represents the control amount; Q represents the state weight matrix, R represents the control weight matrix; k represents the discrete time; Indicates the minimum value of the state quantity; Indicates the maximum value of the state quantity; u max Indicates the maximum value of the control amount; u min Indicates the minimum value of the control amount.
[0036] According to the ability of model predictive control to predict future behavior, the system's predictive model state equation and the corresponding state constraints and control constraints can be obtained as follows:
[0037] in, Among them, a represents the state input coefficient matrix, b represents the control input coefficient matrix, and N represents the control time domain, which is equal to the time step of the prediction time domain;
[0038] It is a 4N×4N unit matrix.
[0039] The cost function is converted into a constrained quadratic programming problem, and then the constrained quadratic programming problem is solved by a primal-dual neural network, including:
[0040] The cost function is:
[0041]
[0042] s.tu min ≤u(k+i)≤u max
[0043]
[0044] Wherein, i=0, 1, 2, ... N-1;
[0045] The cost function is transformed into a quadratic programming problem with state constraints and control constraints:
[0046] in,
[0047] c represents the state output coefficient matrix; Q represents the state weight matrix, R represents the control weight matrix; N represents the time step of the control time domain or the prediction time domain;
[0048] The primal-dual neural network is used to solve the quadratic programming problem with state constraints and control constraints:
[0049] The original dual decision vector and the upper and lower bound vectors are defined as follows: Where ξ represents the primal-dual decision vector, ξ + represents the upper bound vector, ξ - represents the lower bound vector, δ represents the associated dual decision vector; δ + is the upper bound vector of the dual decision vector; δ - is the lower bound vector of the dual decision vector; z represents the prediction control vector in the state equation of the prediction model; z min represents the minimum value of the predictive control vector; z max Represents the maximum value of the predictive control vector.
[0050] According to the H, L, M, h matrices in the quadratic programming problem, the dynamic differential equation of the original dual neural network is established, and the following is obtained: in, I represents the unit matrix, h represents the convergence rate of the original dual neural network; is the clipping function of the primal-dual decision vector ξ;
[0051] The Runge-Kutta method is used to solve the original dual neural network dynamic differential equation and construct the following fourth-order Runge-Kutta equation:
[0052]
[0053] Where h represents the time step, m irepresents the i-th order Taylor expansion (i=1,2,3,4), ξ represents the optimal solution of the dynamic differential equation of the original dual neural network; by solving the above fourth-order Runge-Kutta equation, the optimal solution ξ of the dynamic differential equation of the original dual neural network can be obtained, and the first N elements in ξ are the optimal control quantities of the designed controller at each sampling moment.
[0054] A drone control method for a drone data processing system as described above comprises:
[0055] Collect the actual posture data and reference posture data of the UAV;
[0056] Construct the kinematic and dynamic models of the UAV;
[0057] According to the kinematic model and the dynamic model of the UAV, a cost function of model predictive control with state quantity and control quantity constraints is constructed;
[0058] Converting the cost function into a constrained quadratic programming problem;
[0059] The constrained quadratic programming problem is solved by the original dual neural network to output the optimal control quantity data.
[0060] An electronic device for data processing, comprising:
[0061] Storage medium for storing computer programs;
[0062] The processing unit exchanges data with the storage medium, and is used to execute the computer program through the processing unit to perform the steps of the method as described above when processing data for the drone.
[0063] A computer-readable storage medium, characterized in that:
[0064] The computer readable storage medium stores a computer program;
[0065] When the computer program is run, the steps of the method described above are executed.
[0066] The beneficial effects brought by this application are:
[0067] The system described in the present application utilizes a data acquisition module to collect reference posture data of the UAV, obtains actual posture data of the UAV, and tracks and controls the trajectory of the UAV according to the optimal control quantity data; through the control module, a cost function of model predictive control with state quantity and control quantity constraints is constructed according to the kinematic model and the dynamic model of the UAV, and the cost function is converted into a constrained quadratic programming problem, and then the constrained quadratic programming problem is solved through the original dual neural network to output the optimal control quantity data.
[0068] Compared with traditional PID control, the system described in the present application is fully suitable for multi-input, multi-output, strongly coupled nonlinear complex systems such as quadrotor drones, and can effectively improve the accuracy and stability of quadrotor drone trajectory tracking control; compared with LQR, SMC, ARDC and other types of controllers, the system described in the present application has a stronger ability to predict the future of quadrotor drone systems, and can also handle multi-constraint problems, thereby improving the safety of quadrotor drones during flight; compared with existing model predictive control, the system described in the present application proposes to use the original dual neural network to solve the quadratic programming problem constituted by model predictive control in real time, which greatly reduces the complexity of calculation and improves the calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A block diagram of the system described in this application;
[0070] Figure 2 A control block diagram of the system described in this application;
[0071] Figure 3 The earth coordinate system and body coordinate system of the quadrotor drone;
[0072] Figure 4 This is the three-dimensional trajectory tracking effect diagram of the quad-rotor drone;
[0073] Figure 5 This is the position tracking effect diagram in the x, y, and z directions;
[0074] Figure 6 This is the speed tracking effect diagram in the x, y and z directions;
[0075] Figure 7 This is the effect diagram of φ, θ, ψ attitude angle tracking;
[0076] Figure 8 This is the tracking effect diagram of φ, θ, ψ attitude angular velocity;
[0077] Fig. 9 This is a flow chart of the drone control method described in this application. DETAILED DESCRIPTION
[0078] The present application is further described below in conjunction with the accompanying drawings. Specific embodiment 1:
[0080] This application provides an embodiment:
[0081] like Figure 1 and Figure 2 A data processing system for a drone comprises: a data acquisition module 100, a dynamics module 200, a control module 300 and a storage module 400; wherein the data acquisition module 100 is used to acquire actual posture data and reference posture data of the drone; the storage module 400 is used to store the dynamics model and kinematic model of the drone; the dynamics module 200 is used to obtain the actual posture data of the drone and track and control the trajectory of the drone according to the optimal control quantity data; the control module 300 is arranged between the data acquisition module 100 and the dynamics module 200, and simultaneously exchanges data with the data acquisition module 100 and the dynamics module 200, and is used to construct a cost function of model predictive control with state quantity and control quantity constraints according to the kinematic model and the dynamics model of the drone, and convert the cost function into a constrained quadratic programming problem, and then solve the constrained quadratic programming problem through a primitive dual neural network to output the optimal control quantity data.
[0082] Specifically, the control module 300 includes: a position controller 301 and a posture controller 302; the position controller 301 is connected to the data acquisition module 100, and is used to output lift data in the optimal control quantity data according to the reference posture data; the posture controller 302 is connected to the data acquisition module 100, and is used to output three-axis torque data in the optimal control quantity data according to the reference posture data;
[0083] The dynamics module 200 includes: a dynamics model unit 201 and a kinematics model unit 202; wherein the dynamics model unit 201 is connected to the position controller 301 and the attitude controller 302, and is used to output actual linear velocity data and actual angular velocity data using a dynamics model according to the optimal control quantity data; the kinematics model unit 202 is connected to the output end of the dynamics model unit 201, and is used to obtain the actual position information and actual attitude angle data of the UAV using a kinematic model according to the actual linear velocity data and the actual angular velocity data; the position controller 301 is connected to the output end of the kinematics model unit 202, and is used to obtain the actual position information of the UAV; the attitude controller 302 is connected to the output end of the kinematics model unit 202, and is used to obtain the actual attitude angle data.
[0084] Specifically, in the data processing system for the drone described in this embodiment, the optimal control quantity data is output by running the following steps in the control module 300; the drone in this embodiment is a quad-rotor drone.
[0085] The main steps are as follows:
[0086] S1: According to the earth coordinate system and the body coordinate system, such as Figure 3 , the nonlinear model of the dynamics and kinematics of the quadrotor drone is established as:
[0087]
[0088] Among them, x, y, z represent the coordinate positions in three directions respectively, v x ,v y ,v z Represents the speed in the three directions of X, Y, and Z respectively. They represent the acceleration in three directions, φ, θ, ψ represent the roll angle, pitch angle, and yaw angle, respectively; p, q, r represent the angular velocity of the roll angle, the angular velocity of the pitch angle, and the angular velocity of the yaw angle, respectively. They represent the angular acceleration of the roll angle, the angular acceleration of the pitch angle, and the angular acceleration of the yaw angle, respectively. m represents the mass of the drone. I xx ,I yy ,I zz Respectively represent the moment of inertia in the x, y, and z directions, τ x ,τ y ,τ z They represent the moments in the x, y, and z directions respectively, F represents the resultant lift, and g represents the acceleration due to gravity.
[0089] In order to facilitate the design of the subsequent model predictive controller and reduce the complexity of the calculation, the model of the quadcopter is simply linearized according to the principle of small angle assumption to obtain:
[0090]
[0091] Among them, U1, U2, U3, U4 represent four control quantities, U1 = mg-Fcosφcosθ, U2 = τ x , U2=τ x , U3=τ y , U4=τ z In order to facilitate calculation, the resultant lift is not directly used as the control quantity. Instead, the control quantity U1 is cleverly transformed to reduce the amount of calculation.
[0092] S2: Based on the established kinematic and dynamic model of the quadrotor UAV, a cost function of model predictive control with state and control quantity constraints is constructed.
[0093] S2.1: From Figure 1 As can be seen from the control block diagram, the controller of the quadcopter includes a position controller and an attitude controller. Most studies decouple the position controller and the attitude controller and design them separately. However, due to the strong coupling relationship between the two controllers, this application does not perform decoupling operations to facilitate the design of the controller. Model predictive control is performed in discrete time, and the model of the quadcopter needs to be discretized and written as a matrix representation of the state space equation as follows:
[0094]
[0095] In the formula u=[U1,U2,U3,U4] T , y=
[0096] [x,y,z,ψ] T
[0097] represents the state coefficient matrix, represents the control input coefficient matrix, c = I 12×12 , represents the state output coefficient matrix.
[0098] Among them, I represents the unit matrix, 0 3×3 represents a 3×3 zero matrix, dt represents the sampling time,
[0099] g represents the acceleration due to gravity.
[0100] S2.2: Based on the discretized state space equation obtained in S2.1, let the prediction time domain of the system be equal to the control time domain, with a step size of N, and then we can construct a cost function with state constraints and control constraints:
[0101]
[0102] In the formula, Indicates the actual position and posture state input; represents the state input such as reference position and posture, where
[0103] Among them, u represents the control amount, Q represents the state weight matrix, R represents the control weight matrix, and k represents the discrete time; Indicates the minimum value of the state quantity; Indicates the maximum value of the state quantity; u max Indicates the maximum value of the control amount; umin Indicates the minimum value of the control amount;
[0104] S2.3: In S2.2, it is defined that the prediction time domain of the system is equal to the control time domain, both of which are N. According to the ability of model predictive control to predict future behavior, the prediction model state equation of the system and the corresponding state constraints and control constraints can be obtained as follows:
[0105]
[0106] in, Among them, a represents the state input coefficient matrix, b represents the control input coefficient matrix, and N represents the control time domain, which is also equal to the time step of the prediction time domain.
[0107]
[0108] It is a 4N×4N unit matrix.
[0109] S3: The constrained cost function constructed by model prediction is transformed into a quadratic programming problem, and the primal-dual neural network is used to solve the optimal solution of the control quantity in real time.
[0110] S3.1: In order to further solve the optimal solution of the cost function established by the model predictive control, the equation (4) obtained in S2.1 is transformed into a quadratic programming problem with state constraints and control constraints to obtain:
[0111] stMz≤h (7)
[0112] in,
[0113] c represents the state output coefficient matrix, Q represents the state weight matrix, R represents the control weight matrix, and N represents the time step of the control domain or the prediction domain.
[0114] S3.2: In the traditional method of solving quadratic programming problems, it is often necessary to solve a complex Hessian matrix, which requires not only solving partial derivatives but also solving complex matrix inverse operations. In order to reduce the computational cost, this application uses the original dual neural network method to solve the quadratic programming problem constructed by equation (7).
[0115] According to the predicted vector z of the control quantity obtained in S2.2, and its constraint z min and z max To define the primal-dual decision vector and the upper and lower bound vectors as follows:
[0116]
[0117] Where ξ represents the primal-dual decision vector, ξ + represents the upper bound vector, ξ - represents the lower bound vector, δ represents the related dual decision vector, and z represents the predictive control vector in the state equation of the predictive model; min represents the minimum value of the predictive control vector; z max Represents the maximum value of the predictive control vector.
[0118] S3.3: Use the matrices H, L, M, and h in the quadratic programming problem constructed in step 3.1 to establish the dynamic differential equations of the original dual neural network and obtain:
[0119]
[0120] in, I represents the unit matrix, η represents the convergence rate of the primal-dual neural network, which is proportional to the convergence speed of the dynamic neural network. is the clipping function of the primal-dual decision vector ξ.
[0121] S3.4: Use the Runge-Kutta method to solve the original dual neural network dynamics differential equation and construct the following fourth-order Runge-Kutta equation:
[0122]
[0123] Where h represents the time step, m i Represents the i-th order Taylor expansion (i=1,2,3,4), ξ represents the original dual decision vector and is also the optimal solution of the original dual neural network's dynamic differential equation. By solving the above fourth-order Runge-Kutta equation, the optimal solution ξ of the differential equation can be obtained. The first N elements in ξ are the optimal control quantities of the designed model predictive controller at each sampling moment. The optimal control quantity is brought into the model of the quadcopter UAV, thereby realizing the trajectory tracking control of the quadcopter UAV. In the entire process of calculating the optimal solution of the original dual neural network's dynamic equation, only simple matrix multiplication, addition, and subtraction operations are required, which greatly reduces the complexity of the calculation and improves the efficiency of the calculation.
[0124] Simulation experiment:
[0125] In order to verify the feasibility and effectiveness of the solution of this application, a model predictive controller based on neural network optimization proposed in this application was designed, and a trajectory tracking simulation experiment was carried out. The experimental goal is to use the proposed method to control the quadrotor drone to track the position and posture of the upper reference when both the state quantity and the control quantity are constrained.
[0126] The relevant parameters are: the mass of the drone m = 0.9 kg, the moment of inertia of the three axes I xx =I yy =8.276×10 -3 , I zz =1.612×10 -2 , sampling time dt = 0.05, the convergence rate of the original dual neural network η = 0.032, the prediction time domain and the control time domain N = 6, the state weight matrix Q = diag [7.56, 7.56, 1600, 0, 0, 0, 0, 1, 0, 0, 0], the control weight matrix R = diag [0.01, 0.01, 0.01, 25], the position x, y, z constraints of the UAV are [-10 3 ,10 3 ](m), speed v x ,v y ,v z The constraint is [-3,3] (m / s), the attitude angles φ, θ, ψ are [-0.5, 0.5], [-0.5, 0.5], [-2π, 2π] (rad) respectively, and the reference position and attitude are: Get as Figure 4-8 The result diagram of the simulation experiment; among them, Figure 4 A diagram showing the three-dimensional trajectory tracking effect of a quad-rotor drone; Figure 5 The position tracking effect diagram in x, y, and z directions is shown. Figure 6 It shows the speed tracking effect diagram in x, y and z directions; Figure 7 Angle tracking effect diagram showing the three attitude angles φ, θ, and ψ; Figure 8 It represents the tracking effect of φ, θ, ψ attitude angular velocity.
[0127] from Figure 4-8 It can be clearly seen from the result diagram of the simulation experiment that the system proposed in this embodiment can accurately track the reference trajectory and reference posture, and can handle the constraints of various state quantities and control quantities of the drone, effectively improving the accuracy, stability and safety of the drone when completing the tracking task. At the same time, it also proves the feasibility and effectiveness of the application solution. Specific embodiment 2:
[0129] This application provides an embodiment:
[0130] like Fig. 9, a data processing method for a data processing system for an unmanned aerial vehicle based on the specific embodiment 1, comprising: collecting actual posture data and reference posture data of the unmanned aerial vehicle; constructing a kinematic model and a dynamic model of the unmanned aerial vehicle; constructing a cost function of model predictive control with state quantity and control quantity constraints based on the kinematic model and the dynamic model of the unmanned aerial vehicle; converting the cost function into a constrained quadratic programming problem; solving the constrained quadratic programming problem through a primitive dual neural network to output the optimal control quantity data.
[0131] The UAV control method described in this embodiment is based on the model predictive control of the quadrotor UAV optimized by neural network, and combines the model predictive control with the primal-dual neural network optimization method. Compared with the existing technology, the method described in this embodiment is fully applicable to the multi-input and multi-output, strongly coupled nonlinear complex system of the quadrotor UAV, and can effectively improve the accuracy and stability of the trajectory tracking control of the quadrotor UAV; at the same time, it has a stronger ability to predict the future behavior of the quadrotor UAV system, and can also handle multi-constraint problems, so as to improve the safety of the quadrotor UAV during flight; and the method described in this embodiment proposes to use the primal-dual neural network to solve the quadratic programming problem constituted by the model predictive control in real time, which can greatly reduce the complexity of the calculation and improve the calculation efficiency.
[0132] This application also provides an embodiment:
[0133] An electronic device for data processing, comprising: a storage medium and a processing unit; wherein the storage medium is used to store a computer program; the processing unit exchanges data with the storage medium, and is used to execute the computer program through the processing unit when processing data of a drone, and perform the steps of the method described in specific embodiment 2.
[0134] In the above-mentioned electronic device, the storage medium is preferably a storage device such as a mobile hard disk, a solid-state hard disk, or a USB flash drive; the processing unit is preferably a CPU. The above-mentioned CPU can perform various appropriate actions and processes according to the program stored in the storage medium. The electronic device also includes the following peripherals, including input parts such as a keyboard and a mouse, and may also include output parts such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; in particular, according to the embodiments disclosed in the present application, Fig. 9 The described processes can all be implemented as computer software programs.
[0135] This application also provides an embodiment:
[0136] A computer-readable storage medium: the computer-readable storage medium stores a computer program; when the computer program is running, the steps of the method described in specific embodiment 2 are executed.
[0137] In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0138] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily change or replace within the technical scope disclosed in the present application, which belongs to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A data processing system for unmanned aerial vehicles, characterized in that: include: Data acquisition module, used to collect actual posture data and reference posture data of the UAV; A storage module, used to store the dynamics model and kinematics model of the UAV; The dynamics module is used to calculate the actual posture data of the UAV and track and control the trajectory of the UAV according to the optimal control data; A control module is arranged between the data acquisition module and the dynamics module, and simultaneously exchanges data with the data acquisition module and the dynamics module, and is used to construct a cost function of model predictive control with state quantity and control quantity constraints according to the kinematic model and the dynamics model of the UAV, and convert the cost function into a constrained quadratic programming problem, and then solve the constrained quadratic programming problem through a primitive dual neural network to output the optimal control quantity data; The step of converting the cost function into a constrained quadratic programming problem comprises: The cost function is: s.t.u min ≤u(k+i)≤u max Wherein, i=0, 1, 2, ... N-1; The cost function is transformed into a quadratic programming problem with state constraints and control constraints: stMz≤h; in, c represents the state output coefficient matrix; Q represents the state weight matrix, R represents the control weight matrix; a represents the state input coefficient matrix, b represents the control input coefficient matrix; N represents the time step of the control time domain or the prediction time domain; k represents the discrete time; represents the actual state quantity at time k, represents the reference state quantity at time k; is a 4N×4N unit matrix; u represents the control quantity; u max Indicates the maximum value of the control amount; u min Indicates the minimum value of the control amount; Indicates the minimum value of the state quantity; represents the maximum value of the state quantity; z represents the prediction control vector in the state equation of the prediction model; Solving the constrained quadratic programming problem by using a primal-dual neural network; The method of solving the constrained quadratic programming problem by using the primal-dual neural network includes: The primal-dual neural network is used to solve the quadratic programming problem with state constraints and control constraints: The original dual decision vector and the upper and lower bound vectors are defined as follows: Where ξ represents the primal-dual decision vector, ξ + represents the upper bound vector, ξ - represents the lower bound vector, δ represents the associated dual decision vector; δ + is the upper bound vector of the dual decision vector; δ - is the lower bound vector of the dual decision vector; z min represents the minimum value of the predictive control vector; z max represents the maximum value of the predictive control vector; The dynamic differential equation of the original dual neural network is established, and we get: in, I represents the unit matrix, η represents the convergence rate of the original dual neural network; is the clipping function of the primal-dual decision vector ξ; The Runge-Kutta method is used to solve the original dual neural network dynamic differential equation and construct the following fourth-order Runge-Kutta equation: Where h represents the time step, m i represents the i-th order Taylor expansion, i = 1, 2, 3, 4; ξ represents the primal-dual decision vector, which is also the optimal solution of the dynamic differential equation of the primal-dual neural network; The optimal solution ξ of the differential equation is obtained by solving the fourth-order Runge-Kutta equation. The first N elements in ξ are the optimal control quantities at each sampling moment.
2. The data processing system for drones according to claim 1, characterized in that: The control module comprises: A position controller, connected to the data acquisition module, configured to output lift data in the optimal control amount data according to the reference posture data; A posture controller, connected to the data acquisition module, for outputting three-axis torque data in the optimal control quantity data according to the reference posture data; The dynamics module comprises: A dynamic model unit, connected to the position controller and the attitude controller, and configured to output actual linear velocity data and actual angular velocity data using a dynamic model according to the optimal control amount data; A kinematic model unit is connected to the output end of the dynamic model unit and is used to obtain the actual position information and actual attitude angle data of the UAV using a kinematic model according to the actual linear velocity data and the actual angular velocity data; The position controller is connected to the output end of the kinematic model unit and is used to obtain the actual position information of the UAV; The attitude controller is connected to the output end of the kinematic model unit and is used to obtain the actual attitude angle data.
3. The data processing system for drones according to claim 1, characterized in that: The cost function of the model predictive control with state quantity and control quantity constraints is constructed according to the kinematic model and the dynamic model of the UAV, including: The UAV model is discretized to obtain the discretized state space equation without performing decoupling operations; The prediction time domain in the discretized state space equation is made equal to the control time domain, and a cost function with state constraints and control constraints and a prediction model state equation are constructed.
4. The data processing system for drones according to claim 3, characterized in that: The model of the drone is discretized to obtain a discretized state space equation without performing a decoupling operation, including: The kinematic and dynamic models of the UAV are discretized to obtain the discretized state space equation: In the formula Represents the actual state input, where x, y, and z represent the coordinate positions in three directions respectively. Represent the speeds in three directions respectively, φ, θ, ψ represent the roll angle, pitch angle, and yaw angle respectively, Respectively represent the angular velocity of the roll angle, pitch angle, and yaw angle; a represents the state input coefficient matrix, b represents the control input coefficient matrix; u=[U1,U2,U3,U4]T represents the control input, where U1=mg-Fcosφcosθ, U2=τ x , U3=τ y , U4=τ z , m represents the mass of the drone, g represents the acceleration of gravity, F represents the total lift, τ x ,τ y ,τ z Respectively represent the torque in the three directions of x, y, and z; y = [x, y, z, ψ] T represents the state output; c represents the state output coefficient matrix; k represents discrete time; The discretized state space equation is processed to construct a cost function and a prediction model state equation with state constraints and control constraints.
5. The data processing system for unmanned aerial vehicles according to claim 4, characterized in that: The processing of the discretized state space equation to construct a cost function and a prediction model state equation with state constraints and control constraints includes: The prediction time domain in the discretized state space equation is equal to the control time domain, and the step length is N, then the cost function with state constraints and control constraints is: s.t.u min ≤u(k+i)≤u max Wherein, i=0, 1, 2, ... N-1; Represents the actual state input quantity; represents the reference state input quantity, where u represents the control quantity; Q represents the state weight matrix, R represents the control weight matrix; k represents the discrete time; Indicates the minimum value of the state quantity; Indicates the maximum value of the state quantity; u max Indicates the maximum value of the control amount; u min Indicates the minimum value of the control amount; According to the ability of model predictive control to predict future behavior, the prediction model state equation and the corresponding state constraints and control constraints are: in, represents the actual state quantity at time k; a represents the state input coefficient matrix, b represents the control input coefficient matrix, N represents the time step of the control time domain or the prediction time domain; z represents the prediction control vector in the prediction model state equation; It is a 4N×4N unit matrix.
6. A data processing method for a data processing system for an unmanned aerial vehicle based on any one of claims 1 to 5, characterized in that: include: Collect the actual posture data and reference posture data of the UAV; Construct the kinematic and dynamic models of the UAV; According to the kinematic model and the dynamic model of the UAV, a cost function of model predictive control with state quantity and control quantity constraints is constructed; Converting the cost function into a constrained quadratic programming problem; The constrained quadratic programming problem is solved by the original dual neural network to output the optimal control quantity data.
7. An electronic device for data processing, characterized in that: include: Storage medium for storing computer programs; A processing unit exchanges data with the storage medium, and is used to execute the computer program through the processing unit when processing data for the drone to perform the steps of the method as claimed in claim 6.
8. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program; When the computer program is run, the steps of the method according to claim 6 are performed.
