Distributed unmanned aerial vehicle universal controller and self-learning control method

By designing a general controller for distributed unmanned aerial vehicles and a self-learning control method based on Transformer neural network, the difficulty of parameter setting in the existing technology and the problem of adapting to multiple aircraft models and complex environments is solved, and high-precision and stable flight are achieved control.

CN119439732APending Publication Date: 2025-02-14NANJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411565641.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The parameters of existing aircraft control algorithms are difficult to adjust, and they cannot adapt to multiple aircraft models and complex environments, making it difficult to achieve high-precision control.

Method used

Design a general-purpose controller for distributed unmanned aerial vehicles, adopting a distributed deployment scheme, including sub-computer, median and cloud service platforms, combining the self-learning control method of Transformer neural network to control the drone's flight attitude in real time, and according to Closed-loop feedback reasoning for internal and external disturbances, and real-time compensation is provided.

Benefits of technology

It improves the stability and robustness of the flight control system, simplifies the debugging process of the controller, realizes adaptation to a variety of aircraft models and complex environments, and improves control accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119439732A_ABST
    Figure CN119439732A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed unmanned aerial vehicle universal controller and a self-learning control method. The universal controller adopts a distributed deployment scheme, has good universality, and supports various carriers such as unmanned aerial vehicles, unmanned vehicles, unmanned ships and the like. According to the self-learning control method, the real-time control requirements of various carriers can be met, the self-learning ability is achieved, the method is based on a Transform neural network, an end-to-end deep learning controller architecture is built, the tedious parameter setting step of a traditional PID control algorithm and an ADRC control algorithm is omitted, the autonomous iteration ability is achieved, and the debugging process of the controller is simplified. The flight attitude of the unmanned aerial vehicle is controlled in real time, internal and external disturbance in the flight process of the unmanned aerial vehicle is inferred according to closed-loop feedback, and real-time compensation is performed, so that the stability and robustness of a flight control system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of autonomous unmanned aerial vehicle control technology, and specifically to a distributed unmanned aerial vehicle universal controller and self-learning control method. The present invention aims to design a universal controller with autonomous iterative learning capability, supporting multiple vehicles such as unmanned aerial vehicles, unmanned vehicles, and unmanned ships, as well as a controller method that meets the real-time control requirements of the vehicle and has self-learning capability. The self-learning controller method is based on a Transformer neural network, which controls the flight attitude of the unmanned aerial vehicle in real time, and performs real-time compensation for internal and external disturbances during the flight of the unmanned aerial vehicle based on closed-loop feedback reasoning, thereby improving the stability and robustness of the flight control system. Background Art

[0002] In recent years, with the rapid development of flight control technology, communication technology and electronic information technology, the types of unmanned aerial vehicles have continued to increase, and their performance has continued to improve. Their advantages such as small size, low cost and wide application range have gradually become prominent, and the demand for their application in military and civilian fields has continued to increase. Among various types of unmanned aerial vehicles, the flight control system is its core component. The existing aircraft on the market are different in terms of volume, weight, frame structure, power configuration, etc. Most of the existing flight control systems can only control a single type of vehicle, are not universal for different types of aircraft, and are difficult to adapt to the complex interference of the external environment. Reliability and stability need to be further improved.

[0003] In terms of aircraft control algorithms, the classic PID control algorithm is still in a dominant position among the existing flight control methods. This method is also one of the most widely used control methods in industrial automation control, with the advantages of simple structure and easy implementation. In addition, the active disturbance rejection controller ADRC introduces the extended state observer (ESO), tracking differentiator (TD) and nonlinear feedback control law (NLSEF) on the basis of the PID control algorithm, and attributes the unmodeled dynamics and unknown external disturbances of the system to the "total disturbance" of the system for estimation and compensation, smoothing the control process and accelerating the convergence of the system. Compared with the PID controller, it has better anti-disturbance ability and faster convergence speed. However, both PID control and ADRC control have the problem of high dependence on parameters. The controller parameters depend on the characteristics of the drone itself, such as volume and weight, frame structure, power configuration, etc., and are also affected by the external environment. In addition, PID control and ADRC control themselves have many parameters, which makes it difficult to set parameters. One set of parameters cannot be adapted to multiple models, and it is difficult to adapt to complex environments and achieve high-precision control.

[0004] The above-mentioned unmanned aerial vehicle controller has the following disadvantages:

[0005] 1. Existing flight control systems have poor versatility, most of which can only control a single type of vehicle and are difficult to adapt to complex interference from the external environment.

[0006] 2. The existing controller algorithm has unstable control effects on different aircraft models and different flight environments, and requires frequent parameter tuning.

[0007] 3. The existing controller algorithm itself has many parameters, which makes it difficult to adjust the parameters and achieve high-precision control.

[0008] Transformer is a deep learning model architecture for natural language processing (NLP) and other sequence-to-sequence tasks. The Transformer architecture introduces self-attention mechanism and position encoding, which enables the model to consider all positions in the input sequence at the same time and assign different weights according to different positions in the sequence to better capture the positional relationship between sequences. The self-attention mechanism supports parallel computing, and compared with sequence models such as RNN, it can be more easily trained and inferred efficiently on hardware such as GPU and TPU. The Transformer architecture consists of encoders and decoders such as position encoding, multi-head self-attention modules, and stacked layers, and uses residual connections and layer normalization techniques to solve the problems of gradient disappearance and gradient explosion, thereby improving the training efficiency of the model. Summary of the invention

[0009] The technical problem solved by this application is that the existing aircraft control algorithm parameters are difficult to adjust, cannot adapt to a variety of aircraft models and complex environments, and is difficult to achieve high-precision control. To solve the above problems, this application provides a distributed unmanned aerial vehicle universal controller and a self-learning control method.

[0010] According to the first aspect, the present application provides a distributed unmanned aerial vehicle universal controller, which adopts a distributed deployment solution and has good versatility, including: a lower computer, a middle computer, and a cloud service platform. The lower computer is equipped with a posture sensing unit, a position sensing unit, a power unit, a remote control receiving unit, and a core processing unit. The attitude sensing unit is used to sense the attitude information of the aircraft, including the angles, angular velocities and angular accelerations of the three axes of roll, pitch and yaw, and obtain attitude data; the position sensing unit is used to sense the position information of the aircraft and obtain position data; the power unit is connected to the core processing unit, used to power the aircraft, receive the flight control PWM signal and act on the power unit of the aircraft to provide lift, and finally adjust the flight attitude and position of the aircraft; the remote control receiving unit is used to receive remote control control information and obtain the expected attitude data and expected position data of the aircraft; the core processing unit is connected to the attitude sensing unit, the position sensing unit, the power unit, the remote control receiving unit and the intermediate computer through the SPI / IIC / USART interface respectively, used to solve the attitude data, the position data, the expected attitude data and the expected position data and transmit them to the intermediate computer, and receive the control data generated by the intermediate computer and solve them into the flight control PWM signal. The central computer is equipped with a high-performance processing unit, connected to the core processing unit and the cloud service platform, and is used to generate control data according to the various data transmitted by the core processing unit and transmit the various data to the cloud service platform. The cloud service platform is deployed on a cloud server and is connected to the central computer through a wireless module to provide computing power and generate aircraft characteristic parameters according to the aircraft posture data, the aircraft expected posture data and the control data.

[0011] The attitude sensing unit includes an accelerometer module, a gyroscope module, and an electronic compass module. The accelerometer module is used to generate three-axis acceleration data of the aircraft; the gyroscope module is used to generate three-axis angular velocity data of the aircraft; and the electronic compass module is used to generate magnetic compass azimuth data.

[0012] The position sensing unit includes one or more of a GPS module, a laser radar module, a barometer module, and a visual navigation module. The GPS module is used to generate aircraft position data, the laser radar module and the barometer module are used to generate aircraft altitude data; and the visual navigation module is used to generate aircraft data and navigation position attitude data.

[0013] The power unit includes a battery module, an ammeter module, an electric adjustment module and a motor module. The battery module is connected to the ammeter module to provide electric energy for the aircraft to fly; the ammeter module is connected to the battery module and the electric adjustment module to monitor the working voltage and working current of the battery module; the electric adjustment module is connected to the ammeter module and the motor module to control the start and stop and speed of the motor module according to the flight control PWM signal; the motor module is connected to the electric adjustment module to convert electric energy into power under the control of the electric adjustment module, provide flight power for the aircraft and finally adjust the flight attitude and position of the aircraft.

[0014] The remote control receiving unit includes a remote control receiver module and a PPM encoding module and is connected via a PWM signal. The remote control receiver module is used to receive the remote control signal and generate a PWM signal; the PPM encoding module is used to encode the PWM signal and transmit the converted PPM signal to the core processing unit.

[0015] The core processing unit includes an SPI communication module, an IIC communication module, a USART communication module, a Mavlink communication module, a USB interface module, a data storage module, a posture calculation module, a PWM output module, an LED module and a buzzer module. The SPI communication module is connected to the attitude sensing unit and the position sensing unit, and is used to receive the aircraft attitude data and position data; the IIC communication module is connected to the peripherals using the IIC communication protocol; the USART communication module is connected to the high-performance processing unit of the intermediate computer, and is used to transmit the aircraft attitude data, the expected attitude data and the control data; the Mavlink communication module and the USB interface module are used to connect to the external ground station, and are used for the ground station to perform wired / wireless communication and debugging, and the USB interface module can also provide a stable working voltage for the core processing unit and the high-performance processing unit; the data storage module is used to store the aircraft flight log and the firmware on which the core processing unit depends on the operation, and the flight log includes various data generated during the operation of the aircraft, such as the attitude data, the position data and the control data; the attitude solution module is used to receive the attitude data and the position data and solve the aircraft attitude information and the position information; the PWM output module is used to solve the control data to generate the corresponding PWM control signal and transmit it to the power unit; the LED module and the buzzer module are used to generate sound and light information to indicate the working status of the lower computer.

[0016] The high-performance processing unit includes a real-time reasoning module, a wireless communication module, and a USART communication module. The real-time reasoning module is used to receive the aircraft attitude information and position information, and generate the control data in combination with the aircraft expected attitude data and expected position data; the wireless communication module is used to transmit the attitude data and the expected attitude data to the cloud service platform; the USART communication module is connected to the core processing unit and is used to transmit the aircraft attitude information and the expected attitude data.

[0017] The cloud service platform is deployed on a cloud server and includes a feature extraction module and a wireless communication module.

[0018] The feature extraction module is used to generate aircraft characteristic parameters based on aircraft posture data and control data; the wireless communication module is connected to the high-performance processing unit of the intermediate computer and is used to transmit the characteristic parameters to the real-time reasoning module.

[0019] According to the second aspect, the present application provides a self-learning control method, which is based on Transformer and can be deployed on an independent computing power platform, including: a real-time reasoning module and a feature extraction module. The real-time reasoning module is used to receive the desired attitude angle of the aircraft and the real-time angle, real-time angular velocity, and real-time angular acceleration of the aircraft, and output the desired angular acceleration of the aircraft. The aircraft attitude information is provided by the AHRS and IMU modules carried by the flight control system of the aircraft. The real-time reasoning module pushes the aircraft attitude information and control quantity to the feature extraction module at the same time; the feature extraction module is used to receive the real-time control quantity of the aircraft and the aircraft attitude information obtained by feedback, and infer and calculate the characteristic parameters of the drone for output compensation of the real-time reasoning module. The real-time reasoning module and the feature extraction module are both built based on the Transformer architecture, including position encoding, multi-head self-attention module, residual connection, layer normalization, encoding layer and decoding layer, and generator. The specific implementation steps are as follows:

[0020] (1) Input sequence position encoding

[0021] The Transformer architecture introduces a position encoding mechanism, which adds position encoding vectors to input signals at different positions to better express the position relationship between sequence signals. The position encoding vector follows a specific pattern. The absolute position matrix pos can be expressed as:

[0022] pos=[0,1,2,…,l-1] (1)

[0023] The shape change matrix div_term can be expressed as:

[0024]

[0025] (1) where l represents the maximum sequence length that supports position coding, (2) where d model Represents the word embedding dimension for position encoding. The multiplication of the two matrices can obtain the position encoding matrix pe

[0026]

[0027] (3)(4) where i∈[0,l],j∈[0,d model ],i,j∈R

[0028] For the real-time inference module, the input sequence matrix can be expressed as:

[0029]

[0030] (5) where tar, represents the desired attitude angle and desired attitude angular velocity of the aircraft, θ, They represent the real-time attitude angle and real-time attitude angular velocity of the aircraft respectively, and dt represents the sampling period of the real-time attitude of the aircraft.

[0031] For the feature inference module, the input sequence matrix can be expressed as:

[0032]

[0033] (6) where u represents the control quantity sequence of length l output by the real-time reasoning module at the previous moment. The word embedding matrix is ​​emb, and the word embedding matrix of the input sequence is obtained and added to the position encoding matrix to obtain the position encoding output, which is recorded as x

[0034]

[0035] (2) Multi-head self-attention module

[0036] The multi-head self-attention is used to extract input sequence features, which can consider the positional relationship between sequence signals in a global scope and assign different weights according to different positions in the sequence to better capture the positional relationship between sequences. The weight matrix W is q ,W k ,W v There are query vector q, key vector k, and value vector v which can be expressed as:

[0037] q=x×W q (8)

[0038] k=x×W k (9)

[0039] v=x×W v (10)

[0040] (8)(9)(10) In formulas qkv, the matrix can be transformed into a matrix of n×l×dk, where n is the number of attention heads. The self-attention score of the sequence can be obtained:

[0041]

[0042] The self-attention score is obtained from formula (11), which is nonlinearized by the softmax function, and a mask is designed to cover the self-attention score at future moments to ensure that the controller is suitable for causal systems:

[0043]

[0044] Normalize the self-attention score and multiply it by the weight matrix:

[0045]

[0046] The matrix y can be transformed back into l×d model The matrix is ​​used as input to the next stacked layer.

[0047] (3) Layer Normalization

[0048] Layer normalization is used to map the input data to a relatively stable interval, making the distribution of input data in each layer relatively stable and accelerating the learning speed of the model. The layer normalization operation can be performed as shown in formula (13):

[0049]

[0050] Where a and b are parameters to be determined.

[0051] (4) Residual Connection

[0052] The residual connection is used to linearly add the original input to the output calculated by the network, retaining the details and semantic information in the original input data, alleviating the gradient vanishing and gradient exploding problems, and reducing the information loss of the model to the input data. The operation of the multi-head self-attention module is denoted by the function multi_atten(), and the layer normalization is denoted by the function ln(). From equations (8)(9)(10)(11)(12)(13), the residual connection function resnet() is shown in equation (14):

[0053]

[0054] Where relu is the activation function, expressed as:

[0055] relu(x)=max(0,x) (15)

[0056] (5) Coding layer and decoding layer

[0057] The encoding layer and the decoding layer are composed of the aforementioned steps. The encoding layer is used to compress the input sequence into a vector of a specified length; the decoding layer is used to decode the output semantic vector of the encoding layer. Multiple encoding and decoding layers are stacked in series to process the position-encoded aircraft attitude signal, expected angle, and sampling period, extract sequence features in the word embedding dimension, and output a control vector. The first encoding layer takes the position-encoded signal as input, extracts sequence features as input to the next-level encoding layer and the same-level decoding layer. The control sequence output by the real-time inference module is additionally used as the input to the first decoding layer, extracts sequence features as input to the next-level decoding layer, and the final decoding layer outputs a control vector. It can be specifically expressed as follows:

[0058]

[0059] Where out is the control quantity sequence with a length of l output by the real-time control module as of the previous moment.

[0060] (6) Generator

[0061] The generator is used to generate the control quantity of the unmanned aerial vehicle according to the semantic vector output by the codec layer. The codec layer finally outputs l×d model dimensional matrix. For the aircraft control system, the desired control quantity is angular acceleration. The generator takes the output of the encoding and decoding layer, the output of the real-time inference module and the aircraft characteristic parameters as input. Among them, the aircraft characteristic parameters are calculated by the feature extraction module, which can be specifically expressed as follows:

[0062]

[0063] Among them, α and kp are unknown coefficients, w1, w2, and w3 are weight matrices of the neural network, and output is the output of the final decoding layer. For the real-time control module, eigen is the characteristic parameter of the drone, and out is the output control amount at the next moment; for the feature extraction module, eigen = 0, and out is the output drone characteristic parameter. The hyperbolic tangent function tanh() is expressed as:

[0064]

[0065] (7) Back propagation process

[0066] Steps (1) to (6) are the forward propagation process of the general self-learning control algorithm, and the model is trained through the back propagation process.

[0067] The loss function of the system is defined as formula (20):

[0068]

[0069] (20) where out0(k) is the ideal control quantity of the controller, and out(k) is the actual output control quantity of the self-learning controller. The weight matrix and the unknown parameters of the network are modified iteratively according to the gradient descent method, that is, the negative gradient direction of the weight matrix is ​​searched and adjusted according to Loss(k), and the gradient is calculated as formula (21):

[0070]

[0071] where g ij (k) is the negative gradient direction of the ijth element of the weight matrix of this layer. In the back-propagation process, the AdamW optimizer is used for weight decay, and the weight matrix update formula is (22):

[0072]

[0073] Where β1, β2 are the exponential decay rates of the first-order moment and the second-order moment of the gradient, λ is the regularization coefficient, γ is the learning rate, and w i ′ j is the updated weight matrix.

[0074] The real-time reasoning module and the feature extraction module are respectively composed of two independent Transformer deep learning architectures. In the unmanned aerial vehicle controller structure combined with the real-time reasoning module and the feature extraction module, the unmanned aerial vehicle expected attitude angle, expected attitude angular velocity, real-time attitude information, sampling period and feature parameters are As the input of the real-time reasoning module, the real-time reasoning module outputs the desired angular acceleration out of the unmanned aerial vehicle as the control quantity. The feature extraction module uses the desired attitude angle, expected angular acceleration and attitude information of the unmanned aerial vehicle As input, the feature extraction module outputs the UAV feature parameter eigen according to the attitude information fed back by the UAV under the expected angular acceleration, and continuously adjusts and compensates the output of the real-time reasoning module so that the network output corresponds to the parameters such as the UAV frame characteristics, so as to achieve the desired control accuracy and stability.

[0075] The beneficial effects of this application are:

[0076] 1. According to the first aspect above, the present invention discloses a distributed unmanned aerial vehicle universal controller, and the flight control system processing unit can be deployed separately, so that the entire flight control system has good versatility and scalability.

[0077] 2. Based on the first aspect mentioned above, the present invention discloses a distributed unmanned aerial vehicle universal controller, and the flight control system can establish a connection with a cloud server, so that the flight control system can call on more computing resources, and the entire flight control system is more accurate and stable.

[0078] 3. According to the second aspect above, the present invention discloses a self-learning control method. The algorithm builds an end-to-end deep learning controller architecture, eliminating the cumbersome parameter setting steps of the traditional PID control algorithm and ADRC control algorithm, and simplifies the debugging process of the controller.

[0079] 4. According to the above second aspect, the present invention discloses a self-learning control method, which specifically includes two parts: a real-time reasoning module and a feature extraction module. The algorithm allows the two modules to be independently deployed on different computing platforms, which solves the contradiction between the deep learning controller model's demand for a high computing platform and the unmanned aerial vehicle's demand for a streamlined and cost-effective flight control system, improves the feasibility of algorithm deployment, and has good scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 This is a schematic diagram of the structure of a distributed unmanned aerial vehicle universal controller in one embodiment of the present application;

[0081] Figure 2 This is a schematic diagram of the structure of a core processing unit in an embodiment of the present application;

[0082] Figure 3 This is a schematic diagram of the structure of a high-performance processing unit and a cloud service platform in an embodiment of the present application;

[0083] Figure 4 This is a control flow chart of a distributed unmanned aerial vehicle universal controller in one embodiment of the present application;

[0084] Figure 5 This is a structural diagram of a self-learning control method in an embodiment of the present application;

[0085] Figure 6 This is a schematic diagram of the structure of the Transformer encoding and decoding layer in an embodiment of the present application. DETAILED DESCRIPTION

[0086] In the description of the present invention, it should be understood that the described embodiments are only part of the embodiments of the present invention, not all the embodiments.

[0087] In a specific embodiment, see Figure 1This embodiment discloses a distributed unmanned aerial vehicle universal controller, which mainly includes a power unit 11, a remote control receiving unit 12, a position sensing unit 13, a posture sensing unit 14, a core processing unit 15, a central computer 16, and a cloud service platform 17. The power unit 11 and the remote control receiving unit 12 can be adjusted according to different vehicles and different mission requirements, and the position sensing unit 13 and the posture sensing unit can also adjust the modules carried according to different vehicles and different mission requirements. They are described separately below.

[0088] The power unit 11 is connected to the core processing unit 15, and is used to provide a stable operating voltage for the core processing unit, monitor voltage and current data, and receive a control PWM signal from the core processing unit 15, and then adjust the flight attitude and position of the aircraft.

[0089] The remote control receiving unit 12 is connected to the core processing unit 15 , and is used for receiving the remote control signal and generating a PWM signal, performing encoding conversion on the PWM signal, and transmitting the converted PWM signal to the core processing unit 15 .

[0090] The position sensing unit 13 is connected to the core processing unit 15 and is used to sense the position information of the aircraft, obtain the position data, and transmit the position data to the core processing unit.

[0091] The attitude sensing unit 14 is connected to the core processing unit 15 and is used to sense the attitude information of the aircraft and obtain attitude data, including the angles, angular velocities and angular accelerations of the three axes of roll, pitch and yaw of the aircraft, and transmit the attitude data to the core processing unit 15 .

[0092] The core processing unit 15 is connected to the intermediate computer 16 for receiving the aircraft position control data, attitude control data and PPM remote control signals, and transmitting the calculated position / attitude control data to the intermediate computer 16 via the USART communication module.

[0093] The central computer 16 is connected to the cloud service platform 17 and is used to receive the position / attitude control data and the characteristic parameters calculated by the cloud service platform 17 , calculate the aircraft control quantity and transmit it to the core processing unit 15 .

[0094] The cloud service platform 17 is connected to the intermediate computer 16 via a wireless communication module, and is used to receive position / posture control data and control quantity, calculate characteristic parameters, and transmit them to the intermediate computer 16 .

[0095] In a specific embodiment, see Figure 1 The power unit 11 includes a battery module 111 , an ammeter module 112 , an electric control module 113 , and a motor module 114 .

[0096] The battery module 111 is used to provide the total current to the ammeter module 112 .

[0097] The ammeter module 112 is connected to the core processing unit 15 to supply power to it and monitor the current flowing through the electric adjustment module 113 to achieve the purpose of current monitoring and continuous estimation.

[0098] The electric adjustment module 113 is connected to the core processing unit 15 , receives the PWM signal transmitted by the core processing unit 15 , and converts the signal into a driving current of the motor module 114 .

[0099] The motor module 114 is used to provide power for the aircraft to fly.

[0100] In a specific embodiment, see Figure 1 , the remote control receiving unit 12 includes a remote control receiving module 121, a PPM encoding module 122.

[0101] The remote control receiving module 121 is used to receive a remote control signal and generate a PWM signal.

[0102] The PPM encoding module 122 is connected to the core processing unit 15 and is used for receiving the PWM signal and encoding and converting it into a PPM signal and transmitting it to the core processing unit 15 .

[0103] In a specific embodiment, see Figure 1 The position sensing unit 13 contains at least one position sensing module, including a GPS module 131 , a laser radar module 132 , a barometer module 133 , and a visual navigation module 134 .

[0104] The GPS module 131 is used to generate aircraft position data.

[0105] The laser radar module 132 is used to generate aircraft altitude data.

[0106] The barometer module 133 is used to generate aircraft altitude data.

[0107] The visual navigation module 134 is used to generate aircraft navigation position and attitude data.

[0108] In a specific embodiment, see Figure 1 The attitude sensing unit 14 includes at least one attitude sensing module, including a gyroscope module 141 , an accelerometer module 142 , and an electronic compass module 143 .

[0109] The gyroscope module 141 is used to generate three-axis angle and angular velocity data of the aircraft.

[0110] The accelerometer module 142 is used to generate three-axis angular acceleration data of the aircraft.

[0111] The electronic compass module 44 is used to generate magnetic compass azimuth data.

[0112] In a specific embodiment, see Figure 2 The core processing unit 21 includes a data storage module 211, an SPI communication module 212, an IIC communication module 213, a Mavlink communication module 214, an attitude calculation module 215, a USB interface module 216, an LED module 217, a buzzer module 218, a USART communication module 219, and a PWM output module 220.

[0113] The data storage module 211 is connected to the attitude solution module and is used to store the aircraft flight log and the firmware on which the core processing unit 21 depends for operation. The aircraft flight log includes various data generated during the operation of the aircraft, including but not limited to attitude data, position data, control quantity, etc.

[0114] The SPI communication module 212 is connected to the position sensing unit 22 , the attitude sensing unit 23 , and the attitude solving module 215 , and is used to receive the aircraft attitude data and position data and transmit them to the attitude solving module.

[0115] The IIC communication module 213 is connected to a peripheral device using the IIC communication protocol and is used to receive data generated by the peripheral device.

[0116] The Mavlink communication module 214 is connected to an external ground station and is used for wired / wireless communication and debugging with the ground station.

[0117] The attitude calculation module 215 is connected to the USART communication module 219 and the PWM output module 220 , and transmits the aircraft attitude / position control data to the high-performance processing unit 25 through the USART communication module 219 , and outputs the PWM control signal to the power unit 26 through the PWM output module 220 .

[0118] The USB interface module 216 is connected to an external ground station and is used for wired / wireless communication debugging and firmware burning with the ground station, and is used to power the core processing unit when the battery module is offline.

[0119] The LED module 217 and the buzzer module 218 are used to generate sound and light information to indicate the working status.

[0120] In a specific embodiment, see Figure 3 The high-performance processing unit 32 includes a USART communication module 321 , a real-time reasoning module 322 , and a wireless communication module 323 .

[0121] The USART communication module 321 is connected to the core processing unit 31 and the real-time reasoning module 322 , and is used to transmit the aircraft attitude control data and position control data to the real-time reasoning module 322 .

[0122] The real-time reasoning module 322 is connected to the wireless communication module 323, and is used to generate aircraft control quantities, transmit the control quantities to the core processing unit 31 through the USART communication module 321, and transmit the aircraft attitude control data, position control data, and control quantities to the cloud service platform 33 through the wireless communication module 323.

[0123] The wireless communication module 323 is connected to the cloud service platform 33 and is used for wireless communication with the cloud service platform 33 .

[0124] In a specific embodiment, see Figure 3 The cloud service platform 33 includes a wireless communication module 331 and a feature extraction module 332 .

[0125] The wireless communication module 331 is connected to the high-performance processing unit 32 and is used for wireless communication with the intermediate computer.

[0126] The feature extraction module 332 is used to receive aircraft attitude control data, position control data, and control quantity, calculate the aircraft characteristic parameters, and transmit them to the high-performance processing unit 32 through the wireless communication module 331.

[0127] In a specific embodiment, the overall operation process of the distributed unmanned aerial vehicle universal controller is as follows: Figure 4 As shown, it includes the following steps.

[0128] Step 41 is a power-on self-test. After the universal controller is powered on and receives a remote unlock signal, it enters a self-test program to check whether the battery voltage is normal, whether each sensor is calibrated, whether the safety switch is unlocked, and whether the GPS signal and the electric adjustment module are calibrated. If the self-test program fails, step 42 is implemented to sound and light alarm.

[0129] Step 43 is mode selection. The universal controller supports several flight modes. Two of the modes are listed for illustration in this embodiment, but it does not mean that the specific implementation is limited to these descriptions.

[0130] If the mode is switched to the self-stabilizing mode, the process proceeds to step 44 , in which the remote control signal is the desired attitude angle of the aircraft.

[0131] Step 46 reads the remote control signal. The core processing unit reads the remote control signal through the remote control receiving unit.

[0132] Step 47 reads the posture information, and the core processing unit reads the posture data through the posture sensing unit.

[0133] If the mode is switched to the hovering mode, the process proceeds to step 45 . In the hovering mode, the remote control signal is the expected displacement of the aircraft in the world coordinate system.

[0134] Step 48 reads the remote control signal. The core processing unit reads the remote control signal through the remote control receiving unit.

[0135] Step 49 reads the position information, and the core processing unit reads the position data through the position sensing unit.

[0136] Step 410 reads the posture information, and the core processing unit reads the posture data through the posture sensing unit.

[0137] Step 411 calculates the expected attitude. The core processing unit combines the expected displacement of the aircraft, the real-time position data and the real-time attitude data to calculate the expected attitude of the aircraft.

[0138] Step 412 is transmitted to the central computer, and the core processing unit transmits the desired attitude of the aircraft, the real-time attitude data, and the real-time position data to the high-performance processing unit of the central computer.

[0139] Step 413 calculates the control amount. The real-time reasoning module of the high-performance processing unit calculates the aircraft control amount based on the aircraft's desired attitude, real-time attitude data, real-time position data, and aircraft characteristic parameters.

[0140] Step 414 is transmitted to the cloud service platform. The high-performance processing unit transmits the real-time attitude data, real-time position data, and control quantity of the aircraft to the feature reasoning module of the cloud service platform through the wireless communication module.

[0141] Step 416 calculates characteristic parameters, and the characteristic reasoning module calculates the aircraft characteristic parameters based on the received data.

[0142] Step 417 is transmitted to the central computer, and the cloud service platform transmits the calculated new round of aircraft characteristic parameters to the central computer for the next control quantity calculation.

[0143] Step 415 is transmitted to the lower computer, and the high-performance processing unit transmits the aircraft control quantity to the core processing unit through the USART communication module.

[0144] Step 417 outputs the desired PWM, and the core processing unit outputs a PWM control signal to the electrical adjustment module according to the control amount.

[0145] Step 419: The ESC outputs current. The ESC module converts the received PWM control signal into a control current.

[0146] Step 420 drives the motor module, outputs a control current to drive the motor module to generate power to change the attitude and position of the aircraft.

[0147] In a specific embodiment, see Figure 5 , the self-learning control method includes a real-time reasoning module 51 and a feature extraction module 52. The real-time reasoning module 51 is connected to the feature extraction module 52 through a generator 519, and is used to receive the desired attitude angle 53, the desired attitude acceleration 54, the real-time attitude angle 55, the real-time attitude angular velocity 56, and the real-time sampling period 57 of the aircraft, calculate the aircraft control quantity, and output the desired angular acceleration of the aircraft as the aircraft control quantity through the generator 519. The feature extraction module 52 is connected to the implementation reasoning module through a generator 529, and is used to receive the desired attitude angle 53, the desired attitude acceleration 54, the real-time attitude angle 55, the real-time attitude angular velocity 56, the real-time sampling period 57, and the aircraft control quantity of the aircraft, calculate the aircraft characteristic parameters, and output them through the generator 529. In addition, the generator 519 also outputs the aircraft control quantity to the lower computer. The overall steps of the control method are described below in conjunction with specific formulas:

[0148] (1) Input sequence position encoding

[0149] In a specific embodiment, see Figure 5 , the Transformer architecture introduces a position encoding mechanism, adding position encoding vectors to input signals at different positions to better express the position relationship between sequence signals. The position encoding vector follows a specific pattern. The absolute position matrix pos can be expressed as:

[0150] pos=[0,1,2,…,l-1] (1)

[0151] The shape change matrix div_term can be expressed as:

[0152]

[0153] (1) where l represents the maximum sequence length that supports position coding, (2) where d model Represents the word embedding dimension for position encoding. Multiplying the two matrices can obtain the position encoding matrix pe:

[0154]

[0155] (3)(4) where i∈[0,l],j∈[0,d model ],i,j∈R.

[0156] For the real-time inference module, the input sequence matrix can be expressed as:

[0157]

[0158] (5) where tar, represents the desired attitude angle 53 and the desired attitude angular velocity 54 of the aircraft, θ, They represent the real-time attitude angle 55 and the real-time attitude angular velocity 56 of the aircraft respectively, and dt represents the sampling period 57 of the real-time attitude of the aircraft.

[0159] For the feature inference module 52, the input sequence matrix can be expressed as:

[0160]

[0161] (6) where u represents the control quantity sequence of length l output by the real-time reasoning module 51 at the last moment. Let the word embedding matrix be emb, and the word embedding matrix of the input sequence can be obtained, and added to the position encoding matrix to obtain the position encoding output, which is recorded as x:

[0162]

[0163] The word embedding matrix emb is stored in word embedding dimension 511 and word embedding dimension 521. The position encoding matrix is ​​stored in position encoder 512 and position encoder 522.

[0164] (2) Multi-head self-attention module

[0165] In a specific embodiment, see Figure 6 , let the query parameter matrix 621, key value parameter matrix 622, and weight parameter matrix 623 be W q ,W k ,W v , these three matrices are multiplied with the input matrix 61 to obtain the query vector q, key vector k, and value vector v, which can be expressed as (8)(9)(10):

[0166] q=x×W q (8)

[0167] k=x×W k (9)

[0168] v=x×W v (10)

[0169] (8)(9)(10) In the formula, the qkv matrix can be transformed into an n×l×dk matrix after passing through the multi-head self-attention module 624, where n is the number of attention heads, The calculation rule in the multi-head self-attention module 624 is as shown in formula (11), and the self-attention score of the sequence can be obtained:

[0170]

[0171] Designing a mask to cover up the self-attention scores at future times ensures that the controller is suitable for causal systems:

[0172]

[0173] The normalized self-attention score is passed through a softmax activation function 625 and then score-weighted 626, as shown in formula (12):

[0174]

[0175] The matrix y can be transformed back into l×d model Matrix for the next step of operation.

[0176] (3) Layer Normalization

[0177] In a specific embodiment, see Figure 6 , there is layer normalization 627 as shown in formula (13):

[0178] For the input matrix Layer normalization can be performed:

[0179]

[0180] Where a and b are parameters to be determined.

[0181] (4) Residual Connection

[0182] In a specific embodiment, see Figure 6 , for the input matrix The operation of the multi-head self-attention module is denoted by the function multi_atten(), and the layer normalization is denoted by the function ln(). From equations (8)(9)(10)(11)(12)(13), the residual connection function resnet() is expressed as:

[0183]

[0184] Where relu(x) is the activation function, expressed as:

[0185] relu(x)=max(0,x) (15)

[0186] The weight parameters w1, w2 are the weights of the feedforward network 628, relu(x) is the activation function of the feedforward network 628, and after the residual connection of formula (14), the output matrix 63 is y.

[0187] (5) Coding layer and decoding layer

[0188] In a specific embodiment, see Figure 6The encoding / decoding layer 62 is composed of the above steps stacked several times, and multiple encoding and decoding layers are stacked in series to process the position-encoded aircraft attitude signal, the desired angle and the sampling period, extract the sequence features in the word embedding dimension and output the control vector. Figure 5 For the real-time reasoning module, the first-level encoding layer 512 takes the position-encoded signal as input, extracts the sequence features as the input of the second-level encoding layer 516 and the first-level decoding layer 513, and so on, and connects them layer by layer in series. The aircraft control quantity output by the generator 519 is additionally used as the input of the first-level decoding layer 513, extracts the sequence features as the input of the next-level decoding layer, and the N-level decoding layer 518 outputs the control vector. For the feature extraction module 52, except for the different output vector of the receiving position encoder 522, the remaining calculation links are similar to the real-time reasoning module 51, which can be specifically expressed as follows:

[0189]

[0190] Where out is a control quantity sequence with a length of l output by the real-time control module 51 at the last moment.

[0191] (6) Generator

[0192] In a specific embodiment, see Figure 6 The encoding and decoding layer finally outputs l×d model dimensional matrix, for the aircraft control system, the desired control quantity is angular acceleration. For the real-time reasoning module 51, the generator 519 takes the output of the codec layer, the aircraft control quantity output by itself, and the aircraft characteristic parameters output by the generator 529 as input. Among them, the aircraft characteristic parameters are calculated by the feature extraction module, which can be specifically expressed as follows:

[0193]

[0194] Among them, α and kp are unknown coefficients, w1, w2, and w3 are weight matrices of the neural network, and output is the output of the N-level decoding layer. For the real-time control module, eigen is the characteristic parameter of the drone, and out is the output control amount at the next moment; for the feature extraction module, eigen = 0, and out is the output drone characteristic parameter. The hyperbolic tangent function tanh() is expressed as:

[0195]

[0196] (7) Back propagation process

[0197] Steps (1) to (6) are the forward propagation process of the self-learning method, and the model is trained through the back propagation process.

[0198] The loss function of the system is defined as formula (18):

[0199]

[0200] (19) where out0(k) is the ideal control quantity of the controller, and out(k) is the actual output control quantity of the self-learning controller. The weight matrix and the unknown parameters of the network are modified iteratively according to the gradient descent method, that is, the negative gradient direction of the weight matrix is ​​searched and adjusted according to Loss(k), and the gradient is calculated as formula (20):

[0201]

[0202] where g ij (k) is the negative gradient direction of the ijth element of the weight matrix of this layer. In the back propagation process, the AdamW optimizer is used for weight decay, and the weight matrix update formula is (21):

[0203]

[0204] Where β1, β2 are the exponential decay rates of the first-order moment and the second-order moment of the gradient, λ is the regularization coefficient, γ is the learning rate, and w i ′ j is the updated weight matrix.

[0205] In the unmanned aerial vehicle controller structure combining the real-time reasoning module and the feature extraction module, the unmanned aerial vehicle expected attitude angle, expected attitude angular velocity, real-time attitude information, sampling period and feature parameters As the input of the real-time reasoning module, the real-time reasoning module outputs the desired angular acceleration out of the unmanned aerial vehicle as the control quantity. The feature extraction module uses the desired attitude angle, attitude information and expected angular acceleration of the unmanned aerial vehicle as the control quantity. As input, the feature extraction module outputs the UAV feature parameter eigen according to the attitude information fed back by the UAV under the expected angular acceleration, and continuously adjusts and compensates the output of the real-time reasoning module so that the network output corresponds to the parameters such as the UAV frame characteristics, so as to achieve the desired control accuracy and stability.

[0206] The above contents are further detailed descriptions of the present application in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present application is limited to these descriptions. For ordinary technicians in the technical field to which the present application belongs, several simple deductions or substitutions can be made without departing from the inventive concept of the present application.

Claims

1. A distributed unmanned aerial vehicle universal controller, characterized in that: include: The lower computer is equipped with an attitude sensing unit, a position sensing unit, a power unit, a remote control receiving unit, and a core processing unit, and is used to sense the attitude and position information of the UAV, receive remote control signals, and control the power unit to change the attitude and position of the UAV; The middle computer is equipped with a high-performance processing unit, connected to the core processing unit and the cloud service platform, and is used to generate control data according to various data transmitted by the lower computer and transmit various data to the cloud service platform; The cloud service platform is deployed on the cloud server and connected to the central computer through a wireless module to provide computing power and generate aircraft characteristic parameters according to the aircraft posture data, the aircraft expected posture data and the control data.

2. The distributed unmanned aerial vehicle universal controller according to claim 1, characterized in that: The lower computer includes a posture sensing unit, a position sensing unit, a power unit, a remote control receiving unit, and a core processing unit. The attitude sensing unit includes one or more of an accelerometer module, a gyroscope module, and an electronic compass module, and is used to sense attitude information of the aircraft, including angles, angular velocities, and angular accelerations of the three axes of roll, pitch, and yaw, and obtain attitude data; The position sensing unit includes one or more of a GPS module, a laser radar module, a barometer module, and a visual navigation module, and is used to sense the position information of the aircraft and obtain position data; The power unit includes a battery module, an ammeter module, an electric control module and a motor module. The power unit is connected to the core processing unit and is used to power the aircraft and receive flight control PWM signals. Under the control of the core processing unit, the power unit provides lift for the aircraft and ultimately adjusts the flight attitude and position of the aircraft; The remote control receiving unit includes a remote control receiver module and a PPM encoding module, which are used to receive remote control control information and obtain the desired attitude data and desired position data of the aircraft.

3. The distributed unmanned aerial vehicle universal controller according to claim 1, characterized in that: The core processing unit includes an SPI communication module, an IIC communication module, a USART communication module, a Mavlink communication module, a USB interface module, a data storage module, a posture calculation module, a PWM output module, an LED module and a buzzer module. The SPI communication module is connected to the attitude sensing unit and the position sensing unit, and is used to receive the aircraft attitude data and position data; The IIC communication module is connected to the peripherals using the IIC communication protocol; the USART communication module is connected to the high-performance processing unit of the intermediate computer for transmitting aircraft posture data, desired posture data and control data; The Mavlink communication module and the USB interface module are used to connect to an external ground station for wired / wireless communication and debugging at the ground station. The USB interface module can also provide a stable operating voltage for the core processing unit and the high-performance processing unit. The data storage module is used to store the flight log of the aircraft and the firmware on which the core processing unit depends. The flight log includes various data generated during the operation of the aircraft, such as the attitude data, the position data, and the control data; The attitude calculation module is used to receive the attitude data and position data and calculate the aircraft attitude information and position information; The PWM output module is used to calculate the control data to generate a corresponding PWM control signal and transmit it to the power unit; The LED module and buzzer module are used to generate sound and light information to indicate the working status of the lower computer.

4. The distributed unmanned aerial vehicle universal controller according to claim 1, characterized in that: The intermediate computer is equipped with a high-performance processing unit, including a real-time reasoning module, a wireless communication module, and a USART communication module. The real-time reasoning module is used to receive the attitude information and position information of the aircraft, and generate the control data in combination with the expected attitude data and expected position data of the aircraft; The wireless communication module is used to transmit the posture data and the expected posture data to the cloud service platform; The USART communication module is connected to the core processing unit and is used to transmit aircraft posture information and expected posture data.

5. The distributed unmanned aerial vehicle universal controller according to claim 1, characterized in that: The cloud service platform is equipped with a feature extraction module and a wireless communication module. The feature extraction module is used to generate aircraft feature parameters according to aircraft posture data and control data; The wireless communication module is connected to the high-performance processing unit of the intermediate computer and is used to transmit the characteristic parameters to the real-time reasoning module.

6. A self-learning control method, characterized in that Based on the Transformer deep learning architecture, including: An input sequence position encoder is used to add position encoding vectors to input signals at different positions to better express the position relationship between sequence signals. A multi-head self-attention module, which is used to extract input sequence features, can consider the positional relationship between sequence signals in a global scope, and assign different weights according to different positions in the sequence to better capture the positional relationship between sequences; Layer normalization and residual connection, the layer normalization is used to map the input data to a relatively stable interval, so that the distribution of input data in each layer is relatively stable, and the model learning speed is accelerated; the residual connection is used to linearly add the original input and the output calculated by the network, retaining the details and semantic information in the original input data, alleviating the gradient disappearance and gradient explosion problems, and reducing the model's information loss to the input data. The encoding and decoding layer is used to compress the input sequence into a vector of a specified length; the decoding layer is used to decode the output semantic vector of the encoding layer. A generator is used to generate unmanned aerial vehicle control quantity according to the semantic vector output by the encoding and decoding layer.

7. The self-learning control method according to claim 6, characterized in that: The input sequence position encoder includes an absolute position matrix, a shape transformation matrix and a word embedding matrix. The absolute position matrix and the shape transformation matrix are multiplied to obtain a position coding matrix; The word embedding matrix is ​​used to multiply the input sequence and add it to the position encoding matrix to obtain an input vector that has been positionally encoded and embedded in the word dimension.

8. The self-learning control method according to claim 6, characterized in that: The multi-head self-attention module multiplies the input vector by the weight matrix W q ,W k ,W v To obtain the query vector q, key vector k, and value vector v. The query vector and the key vector are multiplied to obtain a self-attention score score, and the self-attention score is used to obtain an output vector after passing through an activation function softmax and a sequence mask and then multiplied by the value vector.

9. The self-learning control method according to claim 6, characterized in that: The encoding and decoding layer includes the multi-head self-attention module, the layer normalization, the residual connection and the feedforward network. Each layer of the feedforward network grasps the global input, processes it and passes it to the next layer, which is used to improve the recognition complexity of the self-learning control method and make the calculation more efficient; The encoding and decoding layer is composed of a multi-head self-attention module, layer normalization, a feedforward network, layer normalization, and original input addition, which are sequentially connected in series.

10. The self-learning control method according to claim 6, characterized in that The control amount and characteristic parameters of the unmanned aerial vehicle are calculated by the Transformer deep learning architecture. The specific implementation process is as follows: The real-time reasoning module and the feature extraction module are respectively composed of two independent Transformer deep learning architectures. In the unmanned aerial vehicle controller structure combined with the real-time reasoning module and the feature extraction module, the unmanned aerial vehicle expected attitude angle, expected attitude angular velocity, real-time attitude information, sampling period and feature parameters are As the input of the real-time reasoning module, the real-time reasoning module outputs the desired angular acceleration out of the unmanned aerial vehicle as the control quantity. The feature extraction module uses the desired attitude angle, expected angular acceleration and attitude information of the unmanned aerial vehicle As input, the feature extraction module outputs the UAV feature parameter eigen according to the attitude information fed back by the UAV under the expected angular acceleration, and continuously adjusts and compensates the output of the real-time reasoning module so that the network output corresponds to the parameters such as the UAV frame characteristics, so as to achieve the desired control accuracy and stability.