Four-rotor unmanned aerial vehicle attitude control method and device based on improved model predictive controller

By improving the model predictive controller and the adaptive quantum niche genetic algorithm, and designing the optimal weight factor, the dynamic performance and robustness problems of attitude control of quadrotor UAVs were solved, and high-precision attitude control was achieved.

CN121635449APending Publication Date: 2026-03-10SOUTH CHINA AGRICULTURAL UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Attitude control of quadcopter drones is difficult to achieve with good dynamic performance, strong robustness, and strong anti-disturbance capability. Traditional control schemes have many parameters and are difficult to debug.

Method used

An improved model predictive controller is adopted, combined with an adaptive quantum niche genetic algorithm, to design the optimal weight factor. The optimal control input is then optimized and solved through the model predictive controller to control the attitude of the quadcopter UAV.

Benefits of technology

It improves the control performance of quadcopter UAVs in complex disturbance environments, with good dynamic performance, strong robustness, strong anti-disturbance ability, and low debugging difficulty, making it suitable for intelligent aquaculture operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635449A_ABST
    Figure CN121635449A_ABST
Patent Text Reader

Abstract

The invention discloses a quadrotor unmanned aerial vehicle attitude control method and device based on an improved model predictive controller. The method comprises the following steps: establishing a quadrotor unmanned aerial vehicle mathematical model; designing a model prediction controller according to the four-rotor unmanned aerial vehicle mathematical model; designing an adaptive quantum niche genetic algorithm, and searching an optimal weight factor of a model prediction controller; and the optimal weight factor is substituted into a model prediction controller for optimization solution to obtain optimal control input, and the optimal control input is executed through a four-rotor unmanned aerial vehicle power system to control the attitude of the four-rotor unmanned aerial vehicle. The feeding type four-rotor unmanned aerial vehicle has the advantages of being good in dynamic performance, high in robustness, high in anti-interference capacity and low in debugging difficulty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and apparatus for attitude control of a quadcopter unmanned aerial vehicle (UAV) based on an improved model predictive controller, belonging to the field of UAV attitude control technology. Background Technology

[0002] In recent years, unmanned aerial vehicle (UAV) technology has seen significant development. Quadrotor UAVs are increasingly widely used. A quadcopter UAV is a multi-rotor helicopter capable of vertical takeoff and landing and free hovering. It boasts advantages such as small size, simple structure, ease of maintenance, and good maneuverability, making it promising for applications in military, agriculture, and scientific research. However, the dynamic models of quadcopter UAVs are highly complex. The model parameters are influenced by uncertainties such as motor selection, rotor size, overall weight, and mass distribution, resulting in significant model uncertainty and making modeling and control of quadcopters difficult. This is especially true for delivery-type quadcopter UAVs, which are high-powered. The special nature of their operations increases the difficulty of control. Attitude control is fundamental for quadcopter UAVs to perform various tasks, and the quality of attitude control directly determines the quality of position control and higher-level control.

[0003] Attitude control schemes for quadrotor UAVs in related technologies mainly include cascade PID control or active disturbance rejection (ADR) control. While PID control is model-independent, simple in structure, and widely used, it suffers from poor dynamic performance, difficulty in parameter tuning, susceptibility to overshoot, and limited ability to resist large disturbances. Traditional ADR control involves numerous parameters, making tuning challenging. Furthermore, ADR control schemes in related technologies have numerous parameters, making positive definiteness difficult. Traditional model predictive control heavily relies on weight matrices Q and R. Although heuristic calibration of these weight factors is technically feasible, the lack of standardized tuning methods inherently limits the performance of manual optimization. Summary of the Invention

[0004] In view of this, the present invention provides a method, device, computer equipment and storage medium for attitude control of a quadrotor UAV based on an improved model predictive controller, which enables the quadrotor UAV to have the advantages of good dynamic performance, strong robustness, strong anti-disturbance ability and low debugging difficulty.

[0005] The first objective of this invention is to provide a method for attitude control of a quadcopter unmanned aerial vehicle based on an improved model predictive controller.

[0006] The second objective of this invention is to provide an attitude control device for a quadcopter unmanned aerial vehicle based on an improved model predictive controller.

[0007] A third objective of this invention is to provide a computer device.

[0008] A fourth objective of this invention is to provide a storage medium.

[0009] The first objective of this invention can be achieved by adopting the following technical solution:

[0010] A method for attitude control of a quadrotor unmanned aerial vehicle based on an improved model predictive controller, the method comprising:

[0011] Establish a mathematical model for a quadcopter unmanned aerial vehicle (UAV);

[0012] Based on the mathematical model of a quadcopter UAV, design a model predictive controller;

[0013] Design an adaptive quantum niche genetic algorithm to find the optimal weight factor for the model predictive controller;

[0014] The optimal control input is obtained by substituting the optimal weight factor into the model predictive controller and then executing the optimal control input through the quadcopter UAV power system to control the attitude of the quadcopter UAV.

[0015] Furthermore, the establishment of the mathematical model for the quadcopter UAV specifically includes:

[0016] Establish the Newton-Euler equations for the quadrotor UAV, and treat the motion of the quadrotor UAV as rigid body motion, decomposing it into translational motion of the center of mass and rotational motion around the center of mass.

[0017] A state-space equation is established for the power system of a quadcopter UAV, and a zero-order hold is used to discretize the state-space equation.

[0018] Furthermore, the Newton-Euler equations for the quadcopter UAV are as follows:

[0019] ;

[0020] in, The velocity components are in the geodetic coordinate system. Its acceleration component; This is the overall lift coefficient; = This is the drag coefficient; air density; This refers to the drag coefficient; This refers to the effective area of ​​the rotor. For the first The rotational speed of each rotor, This is the total lift of the rotor; , and pitch angle Roll angle and yaw angle The angular velocity, through the Euler angular components , and Calculated; , The weight of the quadcopter drone itself, The weight of the feeding box; ; ; ; , and These are the moments of inertia of the quadcopter drone about the X, Y, and Z axes, respectively. , and The moment of inertia that varies with time; This is the acceleration due to gravity.

[0021] Furthermore, the state-space equation is expanded using a first-order Taylor series, as follows:

[0022] ;

[0023] in, , for status and control inputs; It is the state Jacobian matrix; It controls the Jacobian matrix;

[0024] The state-space equations are discretized as follows:

[0025] ;

[0026] in, , It is a discretized matrix; It is a discrete input matrix.

[0027] Furthermore, the model predictive controller establishes a predictive model by predicting the system state within an n-step range, and uses a discrete-time model to derive the state sequence within the prediction range;

[0028] The recursive application of the discrete-time model makes the state propagation within the prediction range represent a matrix function of the control input, as follows:

[0029] ;

[0030] in, This is the state propagation matrix; To affect the input matrix; Input control needs to be optimized;

[0031] The cost function of the model prediction controller is as follows:

[0032] ;

[0033] in, The target matrix;

[0034] Transform the cost function 𝐽 into a quadratic form, representing it as a quadratic function of the control input 𝑈:

[0035] ;

[0036] in, and The weight matrix is ​​used; solving the quadratic function generates the optimal input sequence. .

[0037] Furthermore, the design of the adaptive quantum niche genetic algorithm specifically includes:

[0038] A genetic algorithm framework is designed, and the fitness evaluation function of the genetic algorithm lays the foundation for subsequent quantum catastrophe. The fitness evaluation function is defined as follows:

[0039] ;

[0040] in, ; ;

[0041] The chromosomes generated by the genetic algorithm are encoded as quantum superposition states. After determining whether a quantum catastrophe has occurred, the quantum chromosomes are decoded into binary-coded chromosomes. The quantum chromosome encoding is defined as follows:

[0042] ;

[0043] The chromosomes are forcibly divided into several independent niches, where the division of independent niches is defined as:

[0044] ;

[0045] in, Indicates population size, This represents the niche population size in each cluster, and the updated population center is defined as:

[0046] ;

[0047] in, express A single set within a niche, defined as the adaptive niche radius:

[0048] ;

[0049] in, The initial niche radius, ;

[0050] The adaptive crossover rate and mutation rate are designed as follows:

[0051] ;

[0052] ;

[0053] in, Expressed as crossover rate; This is expressed as the rate of variation.

[0054] Furthermore, the conditions for triggering the disaster are defined as follows:

[0055] ;

[0056] in, Indicates the size of the detection window. For the minimum allowable fitness improvement rate, The average fitness of the population. Indicates the fitness variance. This is the convergence threshold;

[0057] The process of decoding the quantum chromosome into a binary-encoded chromosome is as follows:

[0058] ;

[0059] in, and express The feasible range of parameters, Indicates the number of qubits.

[0060] A quadcopter UAV attitude control device based on an improved model predictive controller, the device comprising:

[0061] Establish a module for building mathematical models of quadcopter drones;

[0062] The first design module is used to design a model predictive controller based on the mathematical model of the quadcopter UAV.

[0063] The second design module is used to design an adaptive quantum niche genetic algorithm to find the optimal weight factor for the model prediction controller.

[0064] The control module is used to substitute the optimal weight factors into the model predictive controller for optimization to obtain the optimal control input. The optimal control input is then executed through the quadcopter UAV's power system to control the attitude of the quadcopter UAV.

[0065] The third objective of this invention can be achieved by adopting the following technical solution:

[0066] A computer device includes a processor and a memory for storing processor-executable programs, wherein when the processor executes the programs stored in the memory, it implements the above-described attitude control method for a quadcopter unmanned aerial vehicle.

[0067] The fourth objective of this invention can be achieved by adopting the following technical solution:

[0068] A storage medium storing a program, which, when executed by a processor, implements the aforementioned attitude control method for a quadcopter unmanned aerial vehicle.

[0069] The present invention has the following advantages over the prior art:

[0070] This invention overcomes the shortcomings of traditional model predictive control, such as its sensitivity to parameters leading to poor control performance and the difficulty in parameter tuning. It enables the feeding quadcopter UAV to have advantages such as good dynamic performance, strong robustness, strong anti-disturbance ability, and low tuning difficulty. The proposed method can effectively enhance the control performance of UAV in complex disturbance environments, and provides a feasible high-precision control strategy for intelligent aquaculture operations. Attached Figure Description

[0071] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0072] Figure 1 This is a flowchart of the attitude control method for a quadcopter UAV based on an improved model predictive controller according to Embodiment 1 of the present invention.

[0073] Figure 2 This is a schematic diagram of the model prediction controller in Embodiment 1 of the present invention.

[0074] Figure 3 This is a flowchart illustrating the adaptive quantum niche genetic algorithm in Embodiment 1 of the present invention.

[0075] Figure 4 This is a structural block diagram of the attitude control simulation model of a quadcopter UAV according to Embodiment 1 of the present invention.

[0076] Figure 5 This is a structural block diagram of the attitude control device for a quadcopter UAV based on an improved model predictive controller according to Embodiment 2 of the present invention.

[0077] Figure 6 This is a structural block diagram of the computer device according to Embodiment 3 of the present invention. Detailed Implementation

[0078] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0079] Example 1:

[0080] like Figure 1 As shown, this embodiment provides an attitude control method for a quadcopter UAV based on an improved model predictive controller. This method is applied to a delivery-type quadcopter UAV, which includes an attitude controller for implementing the method. The method includes the following steps:

[0081] S101. Establish a mathematical model of the attitude of a quadcopter UAV.

[0082] Furthermore, step S101 specifically includes:

[0083] S1011. Establish the Newton-Euler equations for the quadcopter UAV, and treat the motion of the quadcopter UAV as rigid body motion, decomposing it into translational motion of the center of mass and rotational motion around the center of mass. The interference of the mass decay of the feeding box on the moment of inertia and the overall mass needs to be taken into account.

[0084] In this embodiment, the Newton-Euler equations for the quadcopter UAV are as follows:

[0085] ;

[0086] in, The velocity components are in the geodetic coordinate system. Its acceleration component; This is the overall lift coefficient; = This is the drag coefficient; air density; This refers to the drag coefficient; Let be the effective area of ​​the rotor; for the The lift generated by each rotor is denoted as . , No. The rotational speed of each rotor is denoted as The total lift of the rotor is denoted as: For an "X" configuration quadcopter, rotors 1 and 3 rotate clockwise (assuming angular momentum is downward); rotors 2 and 4 rotate counterclockwise (angular momentum is upward), thus... The pitch angle, roll angle, and yaw angle are defined as follows: , and ; , and pitch angle Roll angle and yaw angle The angular velocity can be obtained through Euler angular components. , and Calculated; , The weight of the quadcopter drone itself, The weight of the feeding box; ; ; ; , and These are the moments of inertia of the quadcopter drone about the X, Y, and Z axes, respectively. , and The moment of inertia that varies with time; This is the acceleration due to gravity.

[0087] S1012. Establish the state-space equations for the power system of the quadcopter UAV, and use the zero-order hold (ZOH) to discretize the state-space equations.

[0088] In this embodiment, the state-space equation is expanded using a first-order Taylor series, as follows:

[0089] ;

[0090] in, , for status and control inputs; It is the state Jacobian matrix; It controls the Jacobian matrix;

[0091] In this embodiment, the state-space equation is discretized as follows:

[0092] ;

[0093] in, , It is a discretized matrix; It is a discrete input matrix.

[0094] S102. Based on the mathematical model of the quadcopter UAV, design a model predictive controller.

[0095] In this embodiment, a mathematical model of a quadcopter UAV is constructed according to a preset time domain to achieve state prediction; a model prediction controller is designed, and after obtaining the optimal weight factor, it can be input into the model prediction controller for optimization and solution to obtain the optimal control input. The optimal control input is executed through the quadcopter UAV power system to control the attitude of the quadcopter UAV.

[0096] like Figure 2 As shown, the model predictive controller establishes a predictive model by predicting the system state over an n-step range. It uses a discrete-time model to derive the state sequence within the prediction range, specifically employing a discretized state-space equation. Starting from the current state, it iteratively propagates future states, as shown in the following equation:

[0097]

[0098] The recursive application of the discrete-time model allows state propagation within the prediction range to be represented as a matrix function of the control input, as follows:

[0099] ;

[0100] in, This is the state propagation matrix; To affect the input matrix; Input control needs to be optimized.

[0101] In this embodiment, the design of the cost function is the core part of achieving the control objective. Rolling time-domain optimization determines the optimal control input to minimize the deviation from the reference trajectory. The large payload capacity of the quadcopter UAV requires a multi-objective cost function to coordinate accurate attitude tracking and anti-interference capabilities during the feed operation. These considerations are integrated into a unified cost function, as shown in the following equation:

[0102] ;

[0103] in, Given the target matrix, the cost function is transformed into a quadratic form. The cost function 𝐽 can be expressed as a quadratic function of the control input 𝑈, as shown in the following equation:

[0104] ;

[0105] in, and Given the weight matrix; solve this quadratic programming (QP) problem to generate the optimal input sequence. Among them, take The first element is implemented on the system.

[0106] The control effectiveness of Model Predictive Control (MPC) is significantly dependent on the weight matrices 𝑄 (state penalty) and 𝑅 (control penalty). Although heuristic calibration of these weight factors is technically feasible, the lack of standardized tuning methods inherently limits the performance of manual optimization.

[0107] S103. Design an adaptive quantum niche genetic algorithm to find the optimal weight factor for the model predictive controller.

[0108] like Figure 3 As shown, the adaptive quantum niche genetic algorithm designed in this embodiment specifically includes:

[0109] S1031. Design a genetic algorithm as the framework of the overall algorithm and establish its fitness function.

[0110] In this embodiment, the fitness function of the genetic algorithm is related to the subsequent catastrophe triggering conditions. The fitness function is represented by a squared error term, and key parameters include the roll angle. ), pitch angle ( ), yaw angle ( ) and height ( The stability requirement is incorporated into the fitness function as follows:

[0111] ;

[0112] in, ; .

[0113] S1032. Encode the chromosomes of the genetic algorithm into the form of quantum superposition states. After determining whether a quantum catastrophe has occurred, decode the quantum chromosomes into binary-encoded chromosomes.

[0114] In this embodiment, to ensure high diversity in the offspring chromosomes of the algorithm, the chromosomes of the traditional genetic algorithm are encoded as quantum superposition states. Specifically, the parameters are encoded using qubits, where each parameter is represented by m qubits, and each qubit state is defined as a probability amplitude. Defined under normalization constraints All qubits are in a uniform superposition state. Initialize in order to ensure equal collapse probabilities. and Let represent the probabilities of collapsing to classical gene states 0 and 1 during the measurement process, respectively; for an optimization problem with n parameters, the chromosome structure can be mathematically represented as follows:

[0115] ;

[0116] After quantum-encoded chromosomes, the chromosomes are decoded into traditional binary-encoded chromosomes after determining whether a quantum catastrophe has occurred. Each qubit is measured and collapsed into a defined classical form, thereby generating a binary-encoded population S for the traditional genetic algorithm. The measurement result of this qubit is defined as follows:

[0117] ;

[0118] Decoding the quantum chromosome using the following formula:

[0119] ;

[0120] in, and express The feasible range of parameters, The qubits represent the number of quanta. When the population assessment does not meet the catastrophe triggering condition, the population undergoes a niche tournament (DNT) selection process, followed by subsequent iterations. If the catastrophe condition is met, then for the offspring of individuals with catastrophe aptitude, catastrophe activation is determined through fitness trajectory analysis. The catastrophe triggering condition is defined as follows:

[0121] ;

[0122] in, Indicates the size of the detection window. For the minimum allowable fitness improvement rate, The average fitness of the population. Indicates the fitness variance. The convergence threshold is used as the threshold. The conditions for triggering a catastrophe include: (a) convergence stall detection; and (b) population diversity index assessment. The catastrophe event is not activated in every generation, but only when either of the two triggering conditions is met.

[0123] When the catastrophe condition is triggered, quantum catastrophe is executed through the following protocol: elite individuals with the highest fitness values. The quantum probability amplitude is preserved with invariant values, while non-elite individuals undergo quantum state reset to the initial superposition state. This ensures that the collapse probabilities of classical states 0 and 1 are equal. This reset operation uniformly distributes the population in the solution space to restart the global search. Then, a control perturbation is applied to the selected qubits via a random rotation gate, injecting guiding noise to probe for the optimality within the reset domain; the probability amplitude perturbation is controlled by the following factors:

[0124] ;

[0125] Among them, rotation angle Dominant disturbance strength, rotation angle In mathematics, it is defined as follows:

[0126] ;

[0127] in, The learning rate represents the adjustment range of the control parameters.

[0128] ;

[0129] The converted values ​​remain normal. Preserve the superposition state with equal probability After quantum perturbation, the perturbed quantum population is remeasured to generate a real-valued population for subsequent fitness assessment.

[0130] S1033, forcibly divide the chromosomes into several independent microhabitats.

[0131] In this embodiment, to avoid a sharp drop in population diversity in the later stages of the algorithm, the chromosomes are forcibly divided into several independent microhabitats. The optimal individual is selected as the optimal weight factor through a tournament selection process within each independent microhabitat, and then crossover and mutation are performed.

[0132] Specifically, to balance selection pressure, expand the search domain, and alleviate the problem of a sharp decline in population diversity through a niche preservation mechanism, the distribution of the population in different regions of the solution space is enhanced by simulating niche isolation in natural ecosystems. To overcome the limitations of traditional niche algorithms, the niche radius parameter is made variable to enhance its adaptability. The population is adaptively clustered into subpopulations using the K-means algorithm, with each subpopulation representing a potential solution region. The niche radius is dynamically adjusted based on the distance between individuals: initially expanding the radius to promote global exploration, and then gradually shrinking it as evolution progresses to accelerate convergence.

[0133] In this embodiment, the niche allocation based on the K-means clustering algorithm is as follows:

[0134] ;

[0135] in, Indicates population size, The population size in each niche is represented by the population center definition, which is updated as follows:

[0136]

[0137] in, express A single set within a niche, with an adaptive niche radius defined as follows:

[0138] ;

[0139] in, The initial niche radius; .

[0140] Calculate the inter-individual distance in the solution space using the Euclidean distance metric:

[0141] ;

[0142] Integrating tournament selection into the niche, the competition selection rules are as follows: four candidate individuals are randomly selected from the population for comparative evaluation. If the pairs are far apart... Individuals are considered identical in the same habitat, and only samples with higher fitness are retained; when In this process, individuals from different niches are preserved intact. Among the retained candidates, the most suitable individuals are promoted to the next generation. Iterative selection drives the cluster centers to gradually migrate to high-fitness regions in the solution space.

[0143] S1034, Design adaptive crossover rate and mutation rate.

[0144] In this embodiment, to improve the evolution mechanism of traditional algorithms, an adaptive crossover rate is used. ) and variability ( In this approach, the parent chromosome with low contribution dimension receives an enhanced mutation probability, thereby accelerating the convergence of the entire population by enhancing the development of promising search subspaces.

[0145] Crossover rate is expressed as:

[0146] ;

[0147] The rate of variation is expressed as:

[0148] ;

[0149] The key parameters are shown in the table below:

[0150]

[0151] In this embodiment, the core of the genetic algorithm implementation lies in the representation of the fitness function. Considering the research objective of enhancing the attitude control during UAV feeding operations, the precise adjustment of the aerial attitude is crucial.

[0152] S104. Substitute the optimal weight factor into the model predictive controller for optimization to obtain the optimal control input. Execute the optimal control input through the quadcopter UAV power system to control the attitude of the quadcopter UAV.

[0153] The model predictive controller is integrated into the adaptive quantum niche genetic algorithm as a subfunction of the cost function to achieve the function of finding weight factors on its own. Simulation experiments are conducted in Matlab, and appropriate disturbances are applied in the simulation experiments. The cost function is used as the fitness evaluation of the improved genetic algorithm. After genetic iteration, the optimal weight factors are obtained and substituted into the model predictive controller. The optimal control input is obtained by solving the cost function in the model predictive controller through quadratic programming and applied to the attitude control of a quadrotor UAV.

[0154] Figure 4 This embodiment illustrates a simulation model for the attitude control of a quadcopter UAV, including: hardware environment 401, simulation environment configuration 402, simulation file creation 403, encapsulation of functions in each module 404, simulation duration and sampling frequency settings 405, comparison of different optimization algorithms 406, and simulation result analysis 407. The simulation in this example is based on Windows 11, with an Intel Core i5 processor and 16GB of RAM to ensure computational accuracy and simulation speed. The simulation file is created using MATLAB. The .m files created in R2023a contain functions for each module, including the UAV mathematical model, controller prediction model, and improved genetic algorithm. These are encapsulated as independent files. The overall simulation duration is set to 60 seconds, and the sampling time is set to 0.02 seconds. The different optimization algorithms include traditional genetic algorithm, particle swarm optimization, ant colony optimization, and grasshopper algorithm. Specifically, different files are created on a computer using simulation software. The main file is the main loop program, and the other files are for the UAV mathematical model, the model prediction controller construction, the prediction function construction, and the improved genetic algorithm construction, respectively. The simulation duration is set to 60 seconds and the sampling frequency is 0.02 seconds in the file definition variables. By using the same framework simulation model and modifying the improved genetic algorithm module in the encapsulated functions, the traditional genetic algorithm, particle swarm optimization, ant colony optimization, and grasshopper algorithm are ported to complete the simulation experiments under different optimization algorithms. By recording the data in the simulation software and creating a line graph, the results of different algorithms can be more intuitively reflected, highlighting the performance of the method in the above embodiment.

[0155] It should be noted that although the method operations of the above embodiments are described in a specific order, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the described steps may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0156] Example 2:

[0157] like Figure 5 As shown, this embodiment provides a quadcopter UAV attitude control device based on an improved model predictive controller. The device includes a setup module 501, a first design module 502, a second design module 503, and a control module 504. The specific functions of each module are as follows:

[0158] Module 501 is established to create a mathematical model of a quadcopter drone.

[0159] The first design module 502 is used to design a model predictive controller based on the mathematical model of the quadcopter UAV.

[0160] The second design module 503 is used to design an adaptive quantum niche genetic algorithm to find the optimal weight factor of the model prediction controller.

[0161] The control module 504 is used to substitute the optimal weight factors into the model predictive controller for optimization to obtain the optimal control input, and execute the optimal control input through the quadcopter UAV power system to control the attitude of the quadcopter UAV.

[0162] The specific implementation of each module in this embodiment can be found in Embodiment 1 above, and will not be repeated here. It should be noted that the device provided in this embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.

[0163] Example 3:

[0164] This embodiment provides a computer device, such as... Figure 6As shown, it includes a processor 602, a memory, an input device 603, a display device 604, and a network interface 605 connected via a system bus 601. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 606 and internal memory 607. The non-volatile storage medium 606 stores an operating system, computer programs, and a database. The internal memory 607 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the processor 602 executes the computer programs stored in the memory, it implements the quadcopter UAV attitude control method of Embodiment 1 described above, as follows:

[0165] Establish a quadcopter UAV attitude control model; design a model predictive controller based on the quadcopter UAV attitude control model; design an adaptive quantum niche genetic algorithm to find the optimal weight factor of the model predictive controller; substitute the optimal weight factor into the model predictive controller for optimization to obtain the optimal control input; execute the optimal control input through the quadcopter UAV power system to control the attitude of the quadcopter UAV.

[0166] Example 4:

[0167] This embodiment provides a storage medium, which is a computer-readable storage medium, storing a computer program. When the computer program is executed by a processor, it implements the quadcopter UAV attitude control method of Embodiment 1 above, as follows:

[0168] Establish a quadcopter UAV attitude control model; design a model predictive controller based on the quadcopter UAV attitude control model; design an adaptive quantum niche genetic algorithm to find the optimal weight factor of the model predictive controller; substitute the optimal weight factor into the model predictive controller for optimization to obtain the optimal control input; execute the optimal control input through the quadcopter UAV power system to control the attitude of the quadcopter UAV.

[0169] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0170] In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this embodiment, the computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0171] The computer-readable storage medium described above can be used to write computer programs for executing this embodiment in one or more programming languages ​​or combinations thereof. These programming languages ​​include object-oriented programming languages—such as Java, Python, and C++—and conventional procedural programming languages—such as C or similar programming languages. The program can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0172] In summary, this invention overcomes the shortcomings of traditional model predictive control, such as sensitivity to parameters leading to poor control performance and difficulty in parameter tuning. It enables the feeding quadcopter UAV to have advantages such as good dynamic performance, strong robustness, strong anti-disturbance ability, and low tuning difficulty. The proposed method can effectively enhance the control performance of UAV in complex disturbance environments, and provides a feasible high-precision control strategy for intelligent aquaculture operations.

[0173] The above description is merely a preferred embodiment of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects. The scope of the present invention is defined by the appended claims rather than the foregoing description, and thus all variations falling within the meaning and scope of the equivalents of the claims are intended to be included within the present invention.

Claims

1. A quadrotor unmanned aerial vehicle attitude control method based on a modified model predictive controller, characterized in that, The method comprises: a mathematical model of a quadrotor is established; a model predictive controller is designed according to the mathematical model of the quadrotor; an adaptive quantum niching genetic algorithm is designed to find optimal weight factors of the model predictive controller; the optimal weight factors are substituted into the model predictive controller to obtain optimal control inputs, and the optimal control inputs are executed through a power system of the quadrotor to control the attitude of the quadrotor. 2.The quadcopter attitude control method of claim 1, wherein, The mathematical model of the quadrotor specifically comprises: Newton-Euler equations of the quadrotor are established, and motion of the quadrotor is regarded as rigid body motion, which is decomposed into translational motion of a center of mass and rotational motion around the center of mass; state space equations are established for the power system of the quadrotor, and the state space equations are discretized using a zero-order holder. 3.The quadcopter attitude control method of claim 2, wherein, The Newton-Euler equations of the quadrotor are as follows: ; wherein, is the velocity component in the earth coordinate system, is its acceleration component; is the total lift coefficient; = is the drag coefficient; is the air density; is the wind resistance coefficient; is the effective area of the rotor; is the rotation speed of the th rotor, is the total lift of the rotor; , and are the angular velocities of the pitch angle , roll angle and yaw angle , respectively, which are calculated by the Euler angle components , and ; , is the weight of the quad-rotor unmanned aerial vehicle itself, is the weight of the feeding box; ; ; ; , and are the moments of inertia of the quad-rotor unmanned aerial vehicle itself around the X, Y, Z axes, respectively; , and are the moments of inertia which change with time; is the gravitational acceleration. 4.The quadcopter attitude control method of claim 2, wherein, The state space equations are discretized through first-order Taylor expansion as follows: ; wherein, is a state and control input; is a state Jacobian matrix; is a control Jacobian matrix; The state space equations are discretized as follows: ; wherein , is a discretized matrix; is a discretized input matrix. 5.The quadcopter attitude control method of claim 1, wherein, The model predictive controller establishes a prediction model by predicting system states within a range of n steps, and uses a discrete-time model to derive state sequences within the prediction range; recursive application of the discrete-time model makes state propagation within the prediction range expressed as a matrix form function of control inputs as follows: ; wherein, is a state propagation matrix; is an influence input matrix; is an input control to be optimized; A cost function of the model predictive controller is as follows: ; wherein is the target matrix; The cost function J is converted into a quadratic form to express a quadratic function of control inputs U as follows: ; wherein and is a weight matrix; solving the quadratic function yields the optimal input sequence . 6.The quadcopter attitude control method of claim 1, wherein, The adaptive quantum niching genetic algorithm specifically comprises: A genetic algorithm framework is designed, and a fitness evaluation function of the genetic algorithm is used to lay a foundation for subsequent quantum catastrophe, and the fitness evaluation function is defined as follows: ; wherein ; ; Chromosomes of the genetic algorithm are coded into a form of quantum superposition states, and after it is judged whether quantum catastrophe occurs, the quantum chromosomes are decoded into binary coded chromosomes, and the quantum chromosome coding is defined as follows: ; The chromosomes are forced to be divided into independent niches, and the independent niche division is defined as follows: ; where, represents the population size, represents the number of microhabitat populations per cluster, and the population center is defined as: ; wherein, represents The single set within the microhabitat is defined with an adaptive microhabitat radius of: ; wherein is the initial niche radius, ; An adaptive crossover rate and mutation rate are designed as follows: ; ; wherein, is expressed as the cross ratio; is expressed as the variation ratio.

7. The quadcopter attitude control method of claim 6, wherein, The condition for triggering catastrophe is defined as follows: ; wherein, represents a detection window size, is a minimum allowed fitness improvement rate, is a population average fitness, represents a fitness variance, is a convergence threshold; The quantum chromosomes are decoded into binary coded chromosomes as follows: ; wherein and denotes the feasible range of parameters, denotes the number of qubits.

8. A quadrotor unmanned aerial vehicle attitude control device based on a modified model predictive controller, characterized in that, The device comprises: an establishment module for establishing a mathematical model of a quadrotor; a first design module for designing a model predictive controller according to the mathematical model of the quadrotor; a second design module for designing an adaptive quantum niching genetic algorithm to find optimal weight factors of the model predictive controller; a control module for substituting the optimal weight factors into the model predictive controller to obtain optimal control inputs, and executing the optimal control inputs through a power system of the quadrotor to control the attitude of the quadrotor.

9. A computer device comprising a processor and a memory for storing a processor- executable program, characterized in that, The processor executes a program stored in the memory to implement the quadrotor attitude control method in any one of claims 1-7.

10. A storage medium storing a program, characterized by comprising: The program is executed by the processor to implement the quadrotor attitude control method in any one of claims 1-7.