Flight controller fusing PID control and neural network, method and storage medium
By integrating PID control and neural network, using wind field-independent aerodynamic neural network and real-time online adaptive adjustment linear coefficients, the problem of the existing technology being difficult to effectively control the aircraft in complex environments is solved, and a higher level is achieved robustness and fault tolerance.
Patent Information
- Application Number
- CN202310975616.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-04
- Publication Date
- 2025-02-18
AI Technical Summary
Existing flight control algorithms are difficult to effectively control aircraft in complex environments, especially under the influence of strong external winds and chaotic airflow.
Using a flight control method that combines PID control and neural network, by obtaining real-time flight status data, inputting pre-trained wind field-independent aerodynamic neural network, obtaining wind field-independent base function data, and adjusting it in real-time online adaptively The linear coefficients related to the wind field are obtained, and finally the residual force is converted into the power of the aircraft and fed back to the PID controller.
Effectively realize the control of a variety of uncertain nonlinear complex processes, improve the robustness and fault tolerance of flight control systems, and improve the flight performance of aircraft in complex environments.
Smart Images

Figure CN119472235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of aircraft, and in particular to a flight controller, method and storage medium integrating PID control and neural network. Background Art
[0002] The flight control algorithm of the aircraft has an important impact on the stability of the aircraft, the efficiency, accuracy, and jitter of trajectory planning and tracking, and the reliability, accuracy, and real-time performance of data link transmission, and plays a decisive role in the flight performance of the aircraft. However, the aircraft will be subject to various interferences during the flight, such as sensor noise and drift, dynamic interference of the interaction between the rotor propulsion airflow and its own aerodynamic structure, load changes and model changes caused by excessive inclination, etc., which will affect the flight performance of the aircraft. In particular, strong winds and turbulent airflows outside are more unpredictable and will seriously affect the flight performance of the aircraft. These interferences put forward higher requirements for the flight control algorithm of the aircraft. PID control is currently the most widely used flight control method and a classic linear control method. It has a simple structure, is easy to use, and is easy to implement. However, we found that when the control object is in a complex environment (such as variable wind force and complex flight trajectory planning), PID control is often difficult to achieve satisfactory control effects. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a flight controller, method and storage medium that integrate PID control and neural network in view of the above-mentioned defects of the prior art.
[0004] The technical solution adopted by the present invention to solve its technical problem is:
[0005] On the one hand, a method for aircraft flight control integrating PID control and neural network is constructed, the method comprising:
[0006] Acquire the real-time online flight status data of the aircraft, and input the data into a basis function to obtain wind field-independent basis function data, wherein the basis function is a pre-trained wind field-independent aerodynamic neural network;
[0007] The linear coefficients related to the wind field are obtained through real-time online adaptive adjustment;
[0008] The residual force is obtained by multiplying the wind field-independent basis function data obtained in real time online with the linear coefficient related to the wind field.
[0009] The residual force is converted into the power of the aircraft and fed back to the PID controller to realize the control of the aircraft.
[0010] Furthermore, in the aircraft flight control method integrating PID control and neural network described in the present invention, the method further includes:
[0011] Complete the experiment in different wind field environments and obtain a set of flight status data and motor control force data with time stamps;
[0012] According to the flight state data and the motor control force data, a set of data of unmodeled residual force of the reaction aircraft is calculated based on the dynamic model;
[0013] Using flight status data and residual force data, offline pre-training is performed to obtain a set of wind field-independent aerodynamic neural networks and discriminant networks. The discriminant network is used as a regularizer to eliminate wind-related information in the neural network.
[0014] Further, in the aircraft flight control method integrating PID control and neural network described in the present invention, the flight status data includes the position and speed of the aircraft;
[0015] The aforementioned calculation of a set of data of the unmodeled residual force of the reaction aircraft based on the dynamic model is specifically to calculate the data of the unmodeled residual force according to the following calculation formula:
[0016] y=M(p)v'+C(p,v)v+g(p)-u;
[0017] Where: p is the position, v is the velocity, v' is the acceleration of the aircraft, v' is obtained by differentiating the velocity, u is the motor control force, M(p) is the positive definite inertia matrix, C(p,v) is the Coriolis matrix, g(p) is the gravity, and y represents the unmodeled residual force.
[0018] Furthermore, in the aircraft flight control method integrating PID control and neural network described in the present invention, the flight state data and residual force data are used to obtain a set of wind field-independent aerodynamic neural networks and discriminant networks through offline pre-training, which specifically includes:
[0019] Step 1: Create a dataset Each specific element in the data set Indicates the wind environment w w The data pair consists of the flight status data and the residual force data. x represents the flight status data, y represents the residual force data, and ε represents the noise interference term unrelated to the aircraft wind field. represents the neural network;
[0020] Step 2: Initialize the neural network and discriminant network;
[0021] Step 3: Randomly select a data from dataset D and will Randomly divide into two disjoint data subsets Ba and B;
[0022] Step 4: In the data subset Ba, find a set of linear coefficients by the least squares method
[0023] Step 5: Train the neural network using stochastic gradient descent on the data subset B:
[0024]
[0025] If the random probability is less than the parameter η, the discriminant network is trained using stochastic gradient descent in the data subset B:
[0026]
[0027] Among them, h represents the discriminant network;
[0028] Step 6: If convergence is achieved, the output neural network is completed. If not, return to step 3 and retrain.
[0029] Furthermore, in the aircraft flight control method integrating PID control and neural network described in the present invention, η is a number greater than zero and less than or equal to 1, and the value of η needs to ensure that the neural network and the discriminant network can be trained alternately during the entire training process, and the training frequency of the discriminant network is less than the training frequency of the neural network.
[0030] Furthermore, in the aircraft flight control method integrating PID control and neural network described in the present invention, the linear coefficients related to the wind field are obtained through real-time online adaptive adjustment, which specifically includes: real-time collection of current wind condition data, based on position tracking error terms and power prediction error terms, through a Kalman filter, to obtain a set of linear coefficients related to the wind field.
[0031] Furthermore, in the aircraft flight control method integrating PID control and neural network described in the present invention, the converting of the residual force into the power of the aircraft and feeding it back to the PID controller to realize the control of the aircraft specifically includes: according to the correspondence between the thrust of the aircraft and the PWM output, substituting the residual force as the thrust into the correspondence to obtain the corresponding PWM output, and feeding back the PWM instruction corresponding to the PWM output to the PID controller.
[0032] Furthermore, in the aircraft flight control method integrating PID control and neural network described in the present invention, the method also includes: pre-establishing a corresponding curve between the throttle and thrust of the aircraft; recording the PWM output and the aircraft state, and converting the aircraft state into thrust by calculating the dynamic formula; and performing curve fitting based on the data set of the recorded PWM output and thrust F to obtain the corresponding relationship between the thrust and PWM output of the aircraft.
[0033] On the second aspect, an aircraft integrating PID control and neural network is constructed, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the method described above are implemented.
[0034] In a third aspect, a computer-readable storage medium is constructed, which stores a computer program, and when the computer program is executed by a processor, the steps of the method described above are implemented.
[0035] The flight controller, method and storage medium integrating PID control and neural network of the present invention have the following beneficial effects: the present invention decouples various interference factors into two types of factors, namely, non-real-time and real-time factors, and obtains a set of basis functions with strong representation ability through learning ability before flight to determine flight control parameters. The basis function is specifically an aerodynamic neural network independent of the wind field. In this way, the present invention can effectively realize the control of various uncertain nonlinear complex processes and improve the robustness and fault tolerance of the flight control system. At the same time, during the flight, the system can collect the current wind conditions in real time and obtain the linear coefficients related to the wind field corresponding to the basis function at a high speed, so as to cooperate with the previously obtained basis function to obtain better control performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative work:
[0037] Figure 1 It is a flow chart of the flight control method integrating PID control and neural network;
[0038] Figure 2 It is a flowchart of neural network training. DETAILED DESCRIPTION
[0039] In order to improve the adaptability of the aircraft's flight control to strong winds and turbulent airflows, the present invention proposes a flight control scheme based on a neural network that automatically learns various interferences, especially wind field characteristics. The implementation of this scheme is mainly based on two original observations from experiments: First, under different wind field conditions, the aerodynamic performance of the aircraft can find a set of representations that are independent of the wind field; second, the influence of the wind field-related part on the aircraft is located in a low-dimensional space. To this end, the present invention decouples various interference factors into two types of factors: non-real-time and real-time. The principle of decoupling is:
[0040] The flight dynamics model of an aircraft in a wind field is:
[0041] M(p)v'+C(p,v)v+g(p)=u+f(p,v,w);
[0042] Where: p is the position, v is the velocity, v' is the acceleration of the aircraft, v' is obtained by differentiating the velocity v, u is the motor control force, M(p) is the positive definite inertia matrix, C(p,v) is the Coriolis matrix, g(p) is the gravity. f(p,v,w) is the unmodeled residual force due to effects such as wind and noise.
[0043] We transform the complete dynamic model into a residual aerodynamic model by removing relatively simple rigid body dynamics and converting all wind-related factors into a residual aerodynamic model. By building the model, we decouple the unmodeled residual forces into basis functions that are independent of the wind field. Linear coefficient a(w) related to the wind field:
[0044]
[0045] Therefore, the overall idea of the implementation scheme of the present invention is to first obtain an aerodynamic neural network (also called basis function) that is independent of the wind field through offline pre-training characterization; then, during the real-time flight of the aircraft, on the one hand, input the real-time online flight status data into the pre-trained aerodynamic neural network that is independent of the wind field to obtain basis function data that is independent of the wind field, and on the other hand, obtain the linear coefficient related to the wind field through real-time online adaptive adjustment, and then multiply the wind field-independent basis function data obtained in real-time online by the linear coefficient related to the wind field to obtain the residual force; finally, the residual force is converted into the power of the aircraft and fed back to the flight control system of the aircraft, and the aircraft is controlled by PID.
[0046] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Typical embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solutions of the present application, rather than limitations on the technical solutions of the present application. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0047] refer to Figure 1 The present invention is an aircraft flight control method that integrates PID control and neural network. The original flight control system of the aircraft is implemented based on the PID model. It is based on the real-time sensor input, PWM output, etc., and the PWM output is adjusted by feedback from various sensors to the flight control system. On this basis, the present invention proposes to consider the unmodeled residual force and convert it into PWM output to achieve supplementary control of the aircraft. Therefore, the flight control method of this embodiment introduces the supplementary control process of the residual force. Specifically, the method of this embodiment includes:
[0048] S1: Obtain the real-time online flight status data of the aircraft, and input it into the basis function to obtain the basis function data that is independent of the wind field;
[0049] The basis function is a pre-trained wind field-independent aerodynamic neural network. Therefore, this embodiment also requires pre-training of the neural network.
[0050] refer to Figure 2 , the training process of the neural network is:
[0051] S101) completing experiments in different wind field environments to obtain a set of flight status data and motor control force data with time stamps. Specifically, the flight status data includes a 3-tuple of the aircraft's position p, velocity v, and attitude q, and the motor control force is represented by u.
[0052] S102) calculating a set of data of unmodeled residual force of the reaction aircraft based on the dynamics model according to the flight state data and the motor control force data;
[0053] Specifically, the unmodeled residual force data is calculated according to the following formula:
[0054] y=M(p)v'+C(p,v)v+g(p)-u;
[0055] Where: p, v, u are all obtained in step 1), v' is obtained by differentiating the velocity v, and y represents the unmodeled residual force.
[0056] After S101) and S102), the flight status data and residual force data are obtained. Then, S103) to S108) use the flight status data and residual force data to perform offline pre-training to obtain a set of wind field-independent aerodynamic neural networks. And the discriminant network h, neural network That is, the wind field-independent aerodynamic basis function mentioned in this paper. Different wind field conditions form different domains. There should be a common invariant aerodynamic basis function in these domains. A discriminant network h is introduced to judge whether the wind field conditions have changed. h is used as a regularizer to eliminate The wind-related information in the final optimization goal is:
[0057]
[0058] Among them, the output of h is a K-dimensional vector of classification probability under K conditions, using the cross entropy loss function, that is:
[0059]
[0060] Among them, only when k = j, δ kj =1, other δ kj =0,e j are standard basis functions.
[0061] The following specifically introduces S103)-S108):
[0062] S103): Establishing a data set in Indicates the wind environment w k The data pair consists of the flight status data and the residual force data. x represents the flight status data, y represents the residual force data, ε represents the noise interference term unrelated to the aircraft wind field, N k Indicates that in S101, in the wind field environment w k The number of experimental data obtained in
[0063] S104): Set two hyperparameters α≥0, 0<η≤1 to ensure the robustness and convergence of the algorithm, where α is a hyperparameter used to control the degree of regularization; and initialize the DNN neural network and discriminant network h;
[0064] S105): Randomly select a data from the data set D and will Randomly divide into two disjoint data subsets Ba and B;
[0065] S106): In the data subset Ba, find a set of linear coefficients by the least squares method
[0066] S107): In the data subset B, the neural network is trained using the stochastic gradient descent method
[0067]
[0068] If the random probability is less than the parameter η, the discriminant network h is trained using stochastic gradient descent in the data subset B:
[0069]
[0070] S108): If converged, the output neural network is completed; if not, it returns to S105) for retraining.
[0071] The convergence condition is Of course, you can also use the post-verification method, for example, first train 500 times, then check the verification curve of the convergence condition, select a relatively appropriate training round, and derive the corresponding
[0072] By setting the hyperparameter η, we can ensure that during the entire training process, and h can be trained alternately, and the training frequency of h is less than
[0073] S2: The linear coefficients related to the wind field are obtained through real-time online adaptive adjustment;
[0074] Specifically, the current wind condition data is collected in real time, and based on the position tracking error term and the power prediction error term, a set of wind field-related linear coefficients are obtained through the Kalman filter, for example:
[0075] Through k-1 moment Update the coefficients of the unsuperimposed dynamic prediction error term and position tracking error term λ is a hyperparameter that can be optimized through learning;
[0076] Prediction by power and location tracking k The error term is used to update the k-time where F k and T k are the prediction error and tracking error coefficients at time k.
[0077] S3: multiplying the wind field-independent basis function data obtained in real time online by the linear coefficient related to the wind field to obtain the residual force;
[0078] S4: converting the residual force into power of the aircraft and feeding it back to the PID controller to realize control of the aircraft.
[0079] Specifically, according to the correspondence between the thrust and the PWM output of the aircraft, the residual force is substituted as the thrust into the correspondence to obtain the corresponding PWM output, and the PWM instruction corresponding to the PWM output is fed back to the PID controller.
[0080] Among them, the corresponding relationship between thrust and PWM output is obtained by pre-fitting. The specific process is:
[0081] 1) Establish the corresponding curve between the throttle and thrust F of the aircraft in advance;
[0082] 2) PWM output OUT pwm It is proportional to the throttle, so the PWM output OUTpwm and the aircraft status, including speed, acceleration, etc., are recorded, and the aircraft status is converted into thrust F through the calculation of the dynamic formula;
[0083] 3) Based on the recorded PWM output and thrust F data set {OUT pwm , F}, curve fitting is performed to obtain the corresponding relationship between the thrust of the aircraft and the PWM output.
[0084] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0085] In summary, the embodiment of the method has the following beneficial effects: the present invention decouples various interference factors into two types of factors, non-real-time and real-time, and obtains a set of basis functions with strong representation ability through learning ability before the flight to determine the flight control parameters. The base function is specifically an aerodynamic neural network that is independent of the wind field. In this way, the present invention can effectively realize the control of various uncertain nonlinear complex processes and improve the robustness and fault tolerance of the flight control system. At the same time, during the flight, the system can collect the current wind conditions in real time and obtain the linear coefficients related to the wind field corresponding to the basis function at a high speed, thereby combining with the basis function obtained before to obtain better control performance.
[0086] Based on the same inventive concept, the present invention also discloses an aircraft integrating PID control and neural network, including a processor and a memory, wherein the memory stores a computer program, and is characterized in that when the computer program is executed by the processor, the steps of the method described above are implemented, and the specific implementation process refers to the method embodiment part.
[0087] Based on the same inventive concept, the present invention also discloses a computer-readable storage medium storing a computer program, which implements the steps of the above-mentioned method when executed by a processor. For the specific implementation process, refer to the method embodiment part.
[0088] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. An aircraft flight control method integrating PID control and neural network, characterized in that: The method comprises: Acquire the real-time online flight status data of the aircraft, and input the data into a basis function to obtain wind field-independent basis function data, wherein the basis function is a pre-trained wind field-independent aerodynamic neural network; The linear coefficients related to the wind field are obtained through real-time online adaptive adjustment; The residual force is obtained by multiplying the wind field-independent basis function data obtained in real time online with the linear coefficient related to the wind field. The residual force is converted into the power of the aircraft and fed back to the PID controller to realize the control of the aircraft.
2. The aircraft flight control method integrating PID control and neural network according to claim 1, characterized in that: The method further comprises: Complete the experiment in different wind field environments and obtain a set of flight status data and motor control force data with time stamps; According to the flight state data and the motor control force data, a set of data of unmodeled residual force of the reaction aircraft is calculated based on the dynamic model; Using flight status data and residual force data, offline pre-training is performed to obtain a set of wind field-independent aerodynamic neural networks and discriminant networks. The discriminant network is used as a regularizer to eliminate wind-related information in the neural network.
3. The aircraft flight control method integrating PID control and neural network according to claim 2, characterized in that: The flight status data includes the position and speed of the aircraft; The aforementioned calculation of a set of data of the unmodeled residual force of the reaction aircraft based on the dynamic model is specifically to calculate the data of the unmodeled residual force according to the following calculation formula: y=M(p)v'+C(p,v)v+g(p)-u; Where: p is the position, v is the velocity, v' is the acceleration of the aircraft, v' is obtained by differentiating the velocity, u is the motor control force, M(p) is the positive definite inertia matrix, C(p,v) is the Coriolis matrix, g(p) is the gravity, and y represents the unmodeled residual force.
4. The aircraft flight control method integrating PID control and neural network according to claim 2, characterized in that: The flight state data and residual force data are used to pre-train offline a set of wind field-independent aerodynamic neural networks and discriminant networks, specifically including: Step 1: Create a dataset Each specific element in the data set Indicates the wind environment w k The data pair consists of the flight status data and the residual force data. x represents the flight status data, y represents the residual force data, and ε represents the noise interference term unrelated to the aircraft wind field. represents the neural network; Step 2: Initialize the neural network and discriminant network; Step 3: Randomly select a data from data set D and will Randomly divide into two disjoint data subsets Ba and B; Step 4: In the data subset Ba, find a set of linear coefficients by the least squares method Step 5: Train the neural network using stochastic gradient descent on the data subset B: If the random probability is less than the parameter η, the discriminant network is trained using stochastic gradient descent in the data subset B: Among them, h represents the discriminant network; Step 6: If convergence is achieved, the output neural network is completed. If not, return to step 3 and retrain.
5. The aircraft flight control method integrating PID control and neural network according to claim 4, characterized in that: η is a number greater than zero and less than or equal to 1. The value of η needs to ensure that the neural network and the discriminant network can be trained alternately during the entire training process, and the training frequency of the discriminant network is less than the training frequency of the neural network.
6. The aircraft flight control method integrating PID control and neural network according to claim 1, characterized in that: The linear coefficients related to the wind field are obtained by real-time online adaptive adjustment, which specifically includes: real-time collection of current wind condition data, based on position tracking error terms and power prediction error terms, and obtaining a set of linear coefficients related to the wind field through a Kalman filter.
7. The aircraft flight control method integrating PID control and neural network according to claim 1, characterized in that: The converting of the residual force into the power of the aircraft and feeding it back to the PID controller to realize the control of the aircraft specifically includes: according to the correspondence between the thrust of the aircraft and the PWM output, substituting the residual force as the thrust into the correspondence to obtain the corresponding PWM output, and feeding back the PWM instruction corresponding to the PWM output to the PID controller.
8. The aircraft flight control method integrating PID control and neural network according to claim 7, characterized in that: The method also includes: pre-establishing a corresponding curve between the throttle and thrust of the aircraft; recording the PWM output and the aircraft state, and converting the aircraft state into thrust by calculating a dynamic formula; and performing curve fitting based on the recorded PWM output and thrust F data set to obtain a corresponding relationship between the thrust and PWM output of the aircraft.
9. An aircraft integrating PID control and neural network, comprising a processor and a memory, wherein the memory stores a computer program, 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 8 are implemented.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Aircraft aerodynamic parameter identification method based on recurrent neural network
CN114004023A
Rotor craft trajectory tracking adaptive control method fused with AI deep learning
CN115793453A
Cited By
Unmanned aerial vehicle residual force prediction network training and control method based on deep learning
CN121302546A
Unmanned aerial vehicle residual force prediction network training and control method based on deep learning
CN121302546B