UAV Flight Control Method Based on Physical Neural Network Prediction Model
By introducing physical constraints into the loss function of the multi-layer perceptron neural network prediction model and training with the dynamic equations of the drone, the problem of lack of physical interpretability in the flight control method of neural network drone in the prior art is solved, and more efficient drone trajectory tracking control and physical interpretability are achieved.
Patent Information
- Application Number
- CN202510227963.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-28
AI Technical Summary
The prior art drone flight control method based on neural networks lacks physical interpretability, resulting in model parameters that do not directly correspond to the physical parameters of the system and lack physical significance.
Physical constraints are introduced into the loss function of the prediction model of multi-layer perceptron neural network, and trained in combination with the dynamic equations of the drone to improve the physical interpretability and prediction accuracy of the model.
By introducing physical constraints, the computational efficiency of neural network prediction model for system behavior state prediction and online optimization is improved, more efficient drone trajectory tracking control is achieved, and the physical interpretability of the model is enhanced.
Smart Images

Figure CN119739043B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle control, and particularly to a method for controlling the flight of an unmanned aerial vehicle based on a physical neural network prediction model. Background Art
[0002] In the field of unmanned aerial vehicle flight control, model-based control technologies rely highly on the accuracy of the unmanned aerial vehicle dynamics model. Among them, in model predictive control (MPC), the state prediction and online optimization of the system behavior will also bring the problem of "complexity explosion". In addition to numerical solution methods, more accurate dynamics modeling methods need to be explored. In recent years, data-driven modeling methods based on neural networks (NN) have been widely used, such as using rectified linear units, convolutional neural networks, recurrent neural networks, etc., which rely on input-output observations to describe the dynamic characteristics of the system. At the same time, neural networks are applied to MPC. This method can predict the future behavior of the dynamic model for the system and incorporate it into the optimization process to determine the optimal trajectory of the operating variables. The neural network model predictive control trajectory tracking control method has been applied in the fields of electrical engineering technology, wind power technology, robot control, etc.
[0003] Chinese patent application with publication number CN117555270A discloses a control method based on a neural network prediction aircraft model, clarifies the uncertain terms in the aircraft model, takes the uncertain terms in the aircraft model as the output of a BP neural network, and determines the aircraft state information as the input of the BP neural network according to the correlation between the uncertain terms and the aircraft state information; obtains sample data through mechanism modeling; preprocesses the sample data; establishes a BP neural network model; performs offline training on the BP neural network to obtain the mapping relationship between the input and the output; and predicts the aircraft model in real time through the trained neural network module, so as to adjust the control parameters. However, the interpretability of this BP neural network model is poor because the model parameters do not directly correspond to the physical parameters of the system and lack physical meaning. Therefore, how to provide a neural network prediction model with physical interpretability and apply it to the flight control of unmanned aerial vehicles is an urgent technical problem to be solved in this field. Summary of the Invention
[0004] In view of the deficiencies in the prior art, the present invention proposes a method for controlling the flight of an unmanned aerial vehicle (UAV) based on a physical neural network prediction model. Aiming at the problem of poor physical interpretability of the neural network prediction model, physical constraints are introduced into the loss function of the multi-layer perceptron model, aiming to introduce the dynamic equation of the UAV into the training of the neural network prediction model, thereby improving the computational efficiency of the neural network prediction model for state prediction and online optimization of system behavior, and realizing more efficient trajectory tracking control of the UAV.
[0005] The technical solution of the present invention is as follows:
[0006] A method for controlling the flight of an unmanned aerial vehicle based on a physical neural network prediction model, comprising the following steps:
[0007] Step S1: Establish a multi-layer perceptron neural network prediction model;
[0008] Step S2: Design a loss function for the multi-layer perceptron neural network prediction model, and the loss function consists of data loss and physical loss;
[0009] Step S3: Use the training data set to train the multi-layer perceptron neural network prediction model and verify the training effect;
[0010] Step S4: Initialize the model predictive controller, set the constraint conditions, reference values, and time step, and establish a multi-objective optimization function;
[0011] Step S5: Run the model predictive controller, and within each moment of the prediction time step , predict the sequence of predicted state values of the UAV within the control time step through the multi-layer perceptron neural network prediction model, and then solve the multi-objective optimization function using the constraint conditions to obtain the optimal control input;
[0012] Step S6: Based on the optimal control input, control the UAV to fly along the reference trajectory.
[0013] Preferably, the input of the multi-layer perceptron neural network prediction model in step S1 is the state value of the UAV at the current moment and the control input value , and the output is the predicted state value of the UAV at the next moment .
[0014] Preferably, the state value at the current moment , the control input value , the predicted state value at the next moment , is the pitch angle of the UAV, is the forward speed of the UAV in the ground coordinate system, is the normal velocity of the UAV in the ground coordinate system, is the pitch angular velocity of the UAV, is the deflection angle of the UAV rotor servo, is the rotational angular velocity of the UAV rotor motor, is the predicted pitch angle of the UAV, is the predicted forward velocity of the UAV in the ground coordinate system, is the predicted normal velocity of the UAV in the ground coordinate system, is the predicted pitch angular velocity of the UAV.
[0015] Preferably, the multi-layer perceptron neural network prediction model consists of an input layer, a first fully connected layer, a first activation function layer, a second fully connected layer, a second activation function layer, and an output layer.
[0016] Preferably, in step S2, the loss function consists of a data loss and a physical loss summation;
[0017]
[0018] The expression of the data loss is:
[0019]
[0020] where represents the number of samples, represents the data loss weight of the th sample, represents the current moment state value of the th sample, represents the predicted state value of the next moment of the th sample;
[0021] The expression of the physical loss is:
[0022]
[0023] where is the physical loss weight of the th sample, is the current moment state acceleration of the th sample, is the predicted state acceleration of the next moment of the th sample.
[0024] Preferably, in step S4, the constraint conditions include state constraints and control constraints, and the reference values include reference state values and the reference control value , the time step includes a prediction time step and a control time step .
[0025] Preferably, in the step S4, the multi-objective optimization function has the following expression:
[0026]
[0027] wherein, represents the -th step prediction state value at the i -th moment, represents the -th step control input value at the i -th moment, represents the state value at the -th moment, represents the first-step prediction state value at the -th moment, represents the -th step prediction state value at the -th moment, represents the control input value at the -th moment, represents the first-step control input value at the -th moment, represents the -th step control input value at the -th moment, is the weight matrix of the state error, is the weight matrix of the control error, is the future -step prediction state value sequence predicted by the multi-layer perceptron neural network prediction model at the -th moment, is the control input value sequence obtained at the -th moment through , represents the lower bound of the state constraint, represents the upper bound of the state constraint, represents the lower bound of the control constraint, represents the upper bound of the control constraint.
[0028] Preferably, the expression of the multi-layer perceptron neural network prediction model is:
[0029]
[0030] wherein, represents the -th moment of the The predicted state acceleration obtained by differentiating the predicted state value of the step denotes the NN model.
[0031] Preferably, in the step S6, controlling the drone to fly along the reference trajectory includes:
[0032] Based on the optimal control input at the moment , , update the state of the drone:
[0033]
[0034] wherein, denotes the state acceleration at the moment, is the system model of the drone.
[0035] Preferably, the Euler method is used for numerical integration of the state of the drone:
[0036]
[0037] wherein, denotes the state value at the moment, denotes the time step.
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] 1. Compared with the existing data-driven black box model, the multi-layer perceptron neural network prediction model of the present invention has physical interpretability because the dynamic principle is introduced into the loss function of the multi-layer perceptron neural network prediction model.
[0040] 2. The multi-layer perceptron neural network prediction model of the present invention has high prediction accuracy and good stability.
[0041] 3. Since the model predictive controller (MPC) in the present invention uses the multi-layer perceptron neural network prediction model to update the state within the control time domain, it can achieve complex real-time calculations and is easy to implement in engineering.
[0042] 4. The drone flight control method based on the physical neural network prediction model proposed by the present invention can achieve stable flight control for a given reference trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention can be more clearly understood. The drawings are schematic and should not be construed as imposing any limitations on the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0044] Figure 1 It is a flowchart of the UAV flight control method based on the physical neural network prediction model of the present invention.
[0045] Figure 2 It is a schematic structural diagram of the multi-layer perceptron neural network prediction model.
[0046] Figure 3 It is the overall technical concept of the UAV flight control method based on the physical neural network prediction model of the present invention.
[0047] Figure 4 It is the simulation result of the training of the multi-layer perceptron neural network prediction model.
[0048] Figure 5 It is the simulation result of the trajectory tracking of the model predictive controller. Specific Embodiments
[0049] In order to be able to more clearly understand the above-mentioned objects, features and advantages of the present invention, the following will further describe the present invention in detail in conjunction with the drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.
[0050] Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.
[0051] The overall technical concept of the UAV flight control method based on the physical neural network prediction model proposed by the present invention is as Figure 3 shown, mainly including three parts: a modeling layer, a planning layer, and a control layer. The modeling layer includes a multi-layer perceptron neural network prediction model, the planning layer includes a reference trajectory and a reference control input, and the control layer includes the rolling solution of a multi-objective optimization function and an optimal control input sequence.
[0052] Embodiment 1
[0053] A UAV flight control method based on a physical neural network prediction model, as Figure 1 shown, includes the following steps:
[0054] Step S1: Establish a multi-layer perceptron neural network prediction model, which is used to predict the next moment prediction state of the UAV according to the current moment state of the UAV and control input . ;
[0055] The multi-layer perceptron neural network prediction model only considers the longitudinal dynamics model of the tail-sitter UAV, and selects as the current moment state value of the UAV, as the control input value, and the two are used as the input of the multi-layer perceptron neural network prediction model together; the next moment prediction state value of the UAV is used as the output of the multi-layer perceptron neural network prediction model. Among them, is the pitch angle of the UAV, is the speed of the UAV in the ground coordinate system (the axis of the ground coordinate system points to the forward direction of the UAV in the ground plane, axis is vertically downward, axis is perpendicular to the plane, and is determined by the right-hand rule), is the forward speed of the UAV in the ground coordinate system, is the normal speed of the UAV in the ground coordinate system, is the pitch angular velocity of the UAV, is the deflection angle of the UAV rotor servo, is the rotational angular velocity of the UAV rotor motor, is the predicted pitch angle of the UAV, is the predicted speed of the UAV in the ground coordinate system , is the predicted forward speed of the UAV in the ground coordinate system, is the predicted normal speed of the UAV in the ground coordinate system, is the predicted pitch angular velocity of the UAV.
[0056] The multi-layer perceptron neural network prediction model consists of an input layer, a first fully connected layer, a first activation function layer, a second fully connected layer, a second activation function layer, and an output layer.
[0057] Among them, the first fully connected layer contains 10 hidden nodes, the second fully connected layer contains 8 hidden nodes, and both the first activation function layer and the second activation function layer are tanh layer, and the hyperbolic tangent function tanh is used as the activation function, as Figure 2 shown.
[0058] The input layer is a feature input layer. The input sequence has a total of 6 features, corresponding respectively to four state variables in and two control variables in . The output layer is used to convert the network parameters of the multi-layer perceptron neural network prediction model into the predicted state value at the next moment .
[0059] Step S2: Design the loss function of the multi-layer perceptron neural network prediction model. The loss function is composed of the sum of the data loss and the physical loss . The data loss is used to ensure that the predicted value and the true value of the multi-layer perceptron neural network prediction model are consistent. The physical loss introduces the dynamic principle to ensure that the predicted value conforms to the dynamic law.
[0060] Among them, ;
[0061] The data loss is used to measure the error between the predicted value and the true value, and is measured by the weighted mean absolute error:
[0062]
[0063] Among them, represents the number of samples, is the data loss weight of the th sample, used to represent the importance of the state value at the current moment of the th sample, represents the predicted state value at the next moment of the th sample.
[0064] The purpose of the physical loss is to ensure that the predicted value conforms to the dynamic law, that is, the predicted value needs to satisfy the UAV dynamic equation:
[0065]
[0066] Among them is the physical loss weight of the th sample, is the current moment state acceleration of the th sample, is the predicted state acceleration at the next moment of the th sample.
[0067] Step S3: Train the multi-layer perceptron neural network prediction model using the training dataset obtained from the six-degree-of-freedom dynamics simulation of the drone and verify the training effect;
[0068] Step S4: Initialize the model predictive controller (MPC), set the constraint conditions, reference values, time step, and establish a multi-objective optimization function.
[0069] The constraint conditions include state constraints and control constraints, and the reference values include reference state values and reference control values , and the time step includes the prediction time step (how many steps of control the MPC performs) and the control time step (how many steps of future state prediction the MPC performs in each step of control); the multi-objective optimization function is used to obtain the optimal control input based on the reference values in each step of control.
[0070] In some embodiments, the prediction time step (the MPC performs 10 steps of control), and the control time step (the MPC performs future 3-step state prediction in each step of control); set the state constraints and control constraints as the constraint conditions, and construct the multi-objective optimization function at the th moment :
[0071]
[0072] Wherein, represents the th step prediction state value at the th moment, represents the th step control input value at the th moment, represents the state value at the th moment, represents the first step prediction state value at the th moment, represents the th step prediction state value at the th moment, represents the th step control input value at the th moment, represents the first step control input value at the th moment, represents the th step control input value at the is the weight matrix of the state error, is the weight matrix of the control error, is the The predicted future sequence of predicted state values for the next steps at time obtained through the multi-layer perceptron neural network prediction model, represents the lower bound of the state constraint, represents the upper bound of the state constraint, represents the lower bound of the control constraint, represents the upper bound of the control constraint.
[0073] Step S5: Run the model predictive controller. At each moment within the prediction time step , use the multi-layer perceptron neural network prediction model to predict the sequence of predicted state values of the UAV within the control time step . Then, use the constraint conditions to solve the multi-objective optimization function to obtain the optimal control input and perform flight control on the UAV. The model predictive controller obtains the optimal control input through real-time rolling optimization, that is, the deflection angle of the UAV rotor servo and the rotational angular velocity of the UAV rotor motor.
[0074] Among them, the expression of the model predictive controller is:
[0075]
[0076] Among them, represents the predicted state acceleration obtained by differentiating the predicted state value at the -th step at time , represents the NN model.
[0077] The core of MPC is to find an optimal control input sequence. By minimizing the multi-objective optimization function, it enables the UAV to fly along the reference trajectory. For example, at the -th moment, MPC will find the current optimal control input , that is, the first item of the control input sequence obtained through at the -th moment, which includes the deflection angle of the UAV rotor servo and the rotational angular velocity of the rotor motor, and applies it to the system model of the UAV to update the state of the UAV:
[0078]
[0079] Among them, represents the state acceleration at time . is the system model of the UAV.
[0080] In the actual update, due to and both calculate the first derivative of the UAV's state, the Euler method is used to numerically integrate the UAV's state:
[0081]
[0082] where represents the state value at the th moment, and represents the time step.
[0083] Finally, in order to verify the effectiveness of the UAV flight control method based on the physical neural network prediction model proposed in the present invention, a MATLAB simulation system for tail-sitter UAV-NN-MPC trajectory tracking control is built.
[0084] In the training of the multi-layer perceptron neural network prediction model, 80% of the training data set is used for training, 19% for verification, and 1% for testing. The number of samples in the training set is 2124, the number of samples in the verification set is 89, the number of samples in the test set is 23, and the total number of network parameters is 194. The error probability density of the four state variables output by the multi-layer perceptron neural network prediction model on the verification set is as Figure 4 shown, and respectively represent the mean and standard deviation of the normal distribution. The prediction results are all close to the true values, with a small variance and stable prediction.
[0085] In the model predictive controller trajectory tracking simulation, the prediction time step is set, and the control time step . The simulation results of tracking the reference trajectory are as Figure 5 shown. The result curve is smooth and can stably track, verifying that the UAV flight control method based on the physical neural network prediction model proposed in the present invention has good modeling accuracy and trajectory tracking effect.
[0086] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A UAV flight control method based on a physical neural network prediction model, characterized in that: The following steps are involved: Step S1: Establish a multi-layer perceptron neural network prediction model; Step S2: designing a loss function of a multi-layer perceptron neural network prediction model, wherein the loss function is composed of data loss and physical loss; Step S3: Use the training data set to train the multi-layer perceptron neural network prediction model and verify the training effect; Step S4: Initialize the model predictive controller, set constraints, reference values and time steps, and establish a multi-objective optimization function; Step S5: Run the model predictive controller at the prediction time step At each moment, the multi-layer perceptron neural network prediction model predicts the control time step The predicted state value sequence of the UAV is obtained, and then the constraints are used to solve the multi-objective optimization function to obtain the optimal control input; Step S6: Based on the optimal control input, control the UAV to fly according to the reference trajectory; The input of the multi-layer perceptron neural network prediction model in step S1 is the current state value of the drone. and control input value , the output is the predicted state value of the drone at the next moment ; In step S2, the loss function Due to data loss and physical losses Sum composition; Data loss The expression is: in, represents the number of samples, Indicates The data loss weight of each sample is Indicates The current state value of samples, Indicates The predicted state value of samples at the next moment; Physical damage The expression is: in For the The physical loss weight of samples, For the The current state acceleration of samples, For the The predicted state acceleration of the next moment of samples.
2. The UAV flight control method according to claim 1, characterized in that: Current state value , control input value , the predicted state value at the next moment , is the pitch angle of the drone, is the forward speed of the UAV in the ground coordinate system, is the normal velocity of the UAV in the ground coordinate system, is the pitch angular velocity of the UAV, is the deflection angle of the UAV rotor servo, is the rotational angular velocity of the UAV rotor motor, is the predicted pitch angle of the UAV, is the predicted forward speed of the UAV in the ground coordinate system, is the predicted normal velocity of the UAV in the ground coordinate system, is the predicted pitch angular velocity of the UAV.
3. The UAV flight control method according to claim 2, characterized in that: The multi-layer perceptron neural network prediction model consists of an input layer, a first fully connected layer, a first activation function layer, a second fully connected layer, a second activation function layer, and an output layer.
4. The UAV flight control method according to claim 3, characterized in that: In step S4, the constraint conditions include state constraints and control constraints, and the reference value includes a reference state value. and reference control value , the time step includes the prediction time step and control time step .
5. The UAV flight control method according to claim 4, characterized in that: In step S4, the multi-objective optimization function The expression is: in, Indicates The moment Step prediction state value, Indicates The moment Step control input value, Indicates The state value at the moment, Indicates The first step predicted state value at time , Indicates The moment Step prediction state value, Indicates The control input value at time Indicates The first step at time controls the input value, Indicates The moment Step control input value, is the weight matrix of the state error, is the weight matrix of the control error, For the The future predicted by the multi-layer perceptron neural network prediction model at all times The predicted state value sequence of the step, For the Moment by The obtained control input value sequence, represents the lower bound of the state constraint, represents the upper bound of the state constraint, represents the lower bound of the control constraint, Represents the upper bound of the control constraint.
6. The UAV flight control method according to claim 5, characterized in that: The expression of the multi-layer perceptron neural network prediction model is: in, Indicates The moment The predicted state acceleration obtained by differentiating the predicted state value of the step, Represents the NN model.
7. The UAV flight control method according to claim 6, characterized in that: In step S6, controlling the drone to fly according to the reference trajectory includes: Based on The optimal control input at time , , update the status of the drone: in, Indicates The state acceleration at the moment, It is the system model of the UAV.
8. The UAV flight control method according to claim 7, characterized in that: Use Euler's method to numerically integrate the drone's state: in, Indicates The state value at the moment, Represents the time step.
Citation Information
Patent Citations
Control method and controller for predicting aircraft model based on neural network
CN117555270A
Unmanned aerial vehicle flight method and device based on neural network
CN113467512A