An unmanned aerial vehicle flight control method and system based on particle swarm optimization fuzzy PID
By using a particle swarm optimization fuzzy PID control method, fuzzy PID control rules are constructed and combined with particle swarm optimization to solve the adaptive optimal control problem of UAVs under multiple flight states, thereby improving the control adaptability and stability of UAVs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
- Filing Date
- 2026-04-17
- Publication Date
- 2026-06-12
AI Technical Summary
Existing UAV flight control algorithms cannot achieve adaptive optimal control under multiple flight states. Traditional PID control parameters are fixed or rely on fuzzy rules based on experience and cannot adapt to different flight states.
A fuzzy PID control method based on particle swarm optimization is adopted. By constructing fuzzy PID control rules and combining them with particle swarm optimization, the adjustable parameters of the UAV under different states are iteratively optimized to form a parameter library. The optimal parameter set is then called for fuzzy inference in the current state.
It improves the control adaptability, stability and control accuracy of UAVs under different flight conditions, and achieves optimal control under multiple flight conditions.
Smart Images

Figure CN122194618A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of unmanned aerial vehicle (UAV) flight control technology, and relates to a UAV flight control method and system based on particle swarm optimization fuzzy PID. Background Technology
[0002] With the rapid modernization of urban life and the proliferation of high-rise buildings in city centers, the internal environment of these buildings has become increasingly complex due to improved construction conditions and innovative material applications. Various unsafe factors intertwine, making rescue efforts extremely difficult in the event of a fire. In high-rise fire rescues, traffic congestion caused by haphazardly parked vehicles obstructs fire truck access, and the significant vertical height of high-rises often renders elevators unusable, preventing firefighters from reaching the scene with rescue equipment in a timely manner. Furthermore, the complex architectural structure and unknown fire hazards within high-rises exacerbate the difficulty of rescue operations. The use of advanced materials in construction also accelerates the rapid spread of fire. During a fire, the dimly lit stairwells, coupled with the heightened emotions of those trapped, increase the risk of stampedes. These added uncertainties further complicate the escape process for those trapped within the fire.
[0003] Considering that fires can easily cause traffic congestion and that large fires may damage building structures, preventing firefighters from entering upper floors and corridors to rescue trapped individuals, drones can leverage their advantages of small size, maneuverability, ease of control, and high reliability. Drones can be deployed to the fire scene in advance, equipped with infrared cameras, smoke sensors, and other detection devices to quickly locate the fire source, smoke distribution, and the position of trapped individuals. This information can then be transmitted back to the command center in real time, providing a basis for rescue decisions. Simultaneously, drones can carry simple rescue supplies (such as smoke masks and emergency lighting) and deliver them to trapped individuals to assist them in awaiting rescue or escaping on their own. Therefore, drones have significant application value in high-rise building fire rescue. However, indoor environments are much more confined than outdoor environments, and fires can lead to complex situations such as partial building collapse, dense smoke, and turbulent airflow. This necessitates that drones be able to fly at low speeds, stably, and safely in indoor environments, and possess a certain degree of resistance to environmental interference such as fire, smoke, and wind. However, most existing flight control algorithms cannot meet these specific requirements, thus necessitating optimization and improvement of current drone flight control algorithms.
[0004] Quadrone drones need to switch between several distinct flight states when performing missions. Typical flight states include: hovering, constant speed straight-line cruise, sharp turns and high maneuvers, and vertical takeoff and landing. During hovering, the system requires precise attitude control to resist small disturbances; during cruise, the system strives to balance energy consumption and tracking accuracy; during sharp turns, the system needs extremely fast dynamic response speed to change attitude.
[0005] In existing UAV control methods, whether traditional PID control algorithms or conventional fuzzy PID control algorithms, only a fixed set of PID control parameters or a fixed set of fuzzy rule bases and membership functions are typically set. However, this compromise design approach of PID control algorithms can only satisfy certain specific flight states. When faced with different flight states, the fixed control parameters often cannot control the UAV to make timely adjustments. Similarly, although existing fuzzy PID control algorithms have a certain degree of adaptability, their fuzzy rule bases and membership functions are fixed and usually determined by expert experience and expertise, making it impossible to provide optimal solutions under various flight states. Summary of the Invention
[0006] The purpose of this invention is to solve the problem that existing UAV flight control algorithms cannot achieve adaptive optimal control under multiple flight states due to fixed control parameters or fuzzy rules relying on experience. This invention provides a UAV flight control method and system based on particle swarm optimization fuzzy PID.
[0007] To achieve the above objectives, the present invention employs the following technical solution: A UAV flight control method based on particle swarm optimization fuzzy PID includes the following steps: Construct a kinematic and dynamic model of the unmanned aerial vehicle (UAV); Establish membership functions for the input and output variables of the UAV. Based on the influence of each parameter on the performance of the UAV, formulate fuzzy decision rules and form a fuzzy rule base. Integrate the membership functions, fuzzy rule base and the basic PID controller of the UAV to obtain fuzzy PID control rules. Particle swarm optimization is introduced, and the adjustable parameters in the fuzzy PID control rule are iteratively optimized in combination with different states of the UAV to obtain the optimal parameter set corresponding to each operating state. The optimal parameter set is then associated with the corresponding operating state and stored as a parameter library. Determine the current operating state of the UAV, and based on the current operating state, call the corresponding optimal parameter set from the parameter library. Using the current input variables of the UAV as input, perform fuzzy inference based on the corresponding optimal parameter set to obtain the control variables of the UAV.
[0008] A further improvement of the present invention is that: The construction of the fuzzy PID control rules includes: Establish membership functions for the input and output variables of the UAV. The input variables of the UAV include error e and error change rate ec. The output variables of the UAV include the proportional control parameter correction ΔKp, integral control parameter correction ΔKi, and derivative control parameter correction ΔKd of the PID controller. Based on the influence of PID parameters on system performance, fuzzy tuning rules are formulated for the proportional control parameter correction ΔKp, integral control parameter correction ΔKi, and derivative control parameter correction ΔKd, and a fuzzy rule base is established based on the fuzzy tuning rules. By combining the membership function with the fuzzy rule base, a fuzzy inference mechanism is formed. By combining the fuzzy inference mechanism with the basic PID controller, fuzzy PID control rules are obtained.
[0009] The real-time parameters of the fuzzy PID controller are obtained according to the fuzzy PID control rules as follows:
[0010] in, This represents the real-time proportional gain of the fuzzy PID controller. This represents the real-time integral gain of the fuzzy PID controller. This represents the real-time derivative gain of the fuzzy PID controller. Indicates the initial values of the fuzzy PID control parameters; Indicates the initial values of the fuzzy PID control parameters; This represents the initial values of the fuzzy PID control parameters.
[0011] All membership functions are triangular membership functions.
[0012] The introduced particle swarm optimization method iteratively optimizes the adjustable parameters in the fuzzy PID control rule based on different UAV states, obtaining the optimal parameter set corresponding to each operating state. The optimal parameter set is then associated with and stored as a parameter library, including: The flight state of the drone is determined based on its current flight speed and attitude angle. The particle swarm optimization algorithm is used to perform offline iterative optimization of the parameters of the membership function of the UAV under different flight states and the rules in the fuzzy rule base to obtain the optimal parameter set for each flight state, and the optimal parameter set is associated with and stored with the corresponding flight state. In the particle swarm optimization algorithm, the fitness function is the weighted sum of the integral of time multiplied by the absolute error and the integral of the square of the control quantity, and the parameters are iteratively optimized.
[0013] Using the current error e and the current error change rate ec of the UAV as input, fuzzy inference is performed using the optimal parameter set called, and the proportional control parameter correction amount ΔKp, integral control parameter correction amount ΔKi, and derivative control parameter correction amount ΔKd of the PID are output. The control quantity is calculated based on the obtained correction amount.
[0014] A UAV flight control system based on particle swarm optimization fuzzy PID includes: Construct a kinematic and dynamic model of the unmanned aerial vehicle (UAV); Establish membership functions for the input and output variables of the UAV. Based on the influence of each parameter on the performance of the UAV, formulate fuzzy decision rules and form a fuzzy rule base. Integrate the membership functions, fuzzy rule base and the basic PID controller of the UAV to obtain fuzzy PID control rules. Particle swarm optimization is introduced, and the adjustable parameters in the fuzzy PID control rule are iteratively optimized in combination with different states of the UAV to obtain the optimal parameter set corresponding to each operating state. The optimal parameter set is then associated with the corresponding operating state and stored as a parameter library. Determine the current operating state of the UAV, and based on the current operating state, call the corresponding optimal parameter set from the parameter library. Using the current input variables of the UAV as input, perform fuzzy inference based on the corresponding optimal parameter set to obtain the control variables of the UAV.
[0015] A computer program product includes a computer program that, when executed by a processor, implements any one of the methods described.
[0016] A terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of any of the methods described above.
[0017] A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, comprises the steps of any one of the methods.
[0018] Compared with the prior art, the present invention has the following beneficial effects: This invention discloses a UAV flight control method based on particle swarm optimization fuzzy PID. By constructing fuzzy PID control rules, the method achieves dynamic adjustment of PID parameters. At the same time, it introduces particle swarm optimization to perform offline iterative optimization of adjustable parameters under different flight states and stores them as a parameter library. Then, based on the current operating state, it calls the corresponding optimal parameter set for fuzzy inference. This solves the problem in the prior art where the control parameters are fixed or the fuzzy rules rely on experience, making it impossible to achieve adaptive optimal control under multiple flight states. This allows the UAV to obtain the optimal control parameters that match the current state under different flight states, improving the adaptability, stability and control accuracy of flight control. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the structure of the fuzzy PID controller disclosed in this embodiment; Figure 2 This is a schematic diagram of the fuzzy PID controller structure optimized by the particle swarm optimization algorithm disclosed in this embodiment; Figure 3 The control quantity output by a conventional PID controller when the roll angle is as disclosed in this embodiment; Figure 4 For the roll angle disclosed in this embodiment, the control quantity of the fuzzy PID output optimized by the particle swarm algorithm; Figure 5 The control quantity output by a conventional PID controller when the pitch angle is as disclosed in this embodiment; Figure 6 For the pitch angle disclosed in this embodiment, the control quantity of the fuzzy PID output optimized by the particle swarm algorithm; Figure 7 When the X-direction is as disclosed in this embodiment, the control quantity output by a conventional PID controller is used. Figure 8 When the X-direction is as disclosed in this embodiment, the control quantity of the fuzzy PID output optimized by the particle swarm algorithm; Figure 9 When the Y-axis is as disclosed in this embodiment, the control quantity output by a conventional PID controller is used. Figure 10 For the Y-direction disclosed in this embodiment, the control quantity of the fuzzy PID output optimized by the particle swarm optimization algorithm; Figure 11 For the Z-direction disclosed in this embodiment, the control quantity output by a conventional PID controller is used. Figure 12 The control quantity of the fuzzy PID output optimized by the particle swarm algorithm is as disclosed in this embodiment when it is in the Z direction. Detailed Implementation
[0021] 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 only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0023] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0024] In the description of the embodiments of the present invention, it should be noted that if terms such as "upper," "lower," "horizontal," or "inner" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of the invention is in use, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Furthermore, terms such as "first" and "second" are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0025] Furthermore, the use of the term "horizontal" does not imply that the component must be absolutely horizontal, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0026] In the description of the embodiments of the present invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.
[0027] The present invention will now be described in further detail with reference to the accompanying drawings: This embodiment mainly relates to the field of unmanned aerial vehicle (UAV) flight control technology. First, the relevant methods used will be explained: Particle swarm optimization method: an optimization algorithm based on swarm intelligence. By simulating the foraging behavior of bird flocks, each particle represents a set of parameters to be optimized. The particle position and velocity are iteratively updated based on its own historical best position and the global best position of the group in order to find the optimal solution. In this invention, it is used to perform offline iterative optimization of the membership function parameters and / or fuzzy rule base of the fuzzy controller.
[0028] PID controller: A linear controller that controls the controlled object by forming a control quantity based on the deviation e between the given value and the actual output value, using a linear combination of proportional (P), integral (I), and derivative (D) components. Its control parameters Kp, Ki, and Kd are fixed and cannot adapt to changes in multiple flight states. The fuzzy controller in this invention specifically refers to a nonlinear controller based on fuzzy logic. By defining the membership functions and fuzzy rule base of the input and output variables, the precise input quantity is fuzzified. Fuzzy inference is then used to obtain the fuzzy output, which is then defuzzified back into a precise control quantity. In this invention, the parameter correction quantity of the PID controller is used to dynamically adjust the control parameters to achieve adaptive adjustment.
[0029] Fuzzy inference refers to the process of fuzzifying the precise input quantity through a membership function based on preset rules in a fuzzy rule base, activating the corresponding rules through logical operations, and synthesizing the output of each rule to obtain a fuzzy output set. In this invention, the output of fuzzy inference is the fuzzy value of the PID parameter correction quantities ΔKp, ΔKi, and ΔKd, which is then defuzzified to obtain the precise correction quantity, used for real-time adjustment of PID control parameters.
[0030] The following is a detailed description of this embodiment; see [link to relevant documentation]. Figure 1This embodiment discloses a UAV flight control method based on particle swarm optimization fuzzy PID. It introduces a fuzzy control strategy into the traditional PID control algorithm to achieve real-time dynamic adjustment of control parameters. Addressing the issue that membership functions and fuzzy rule bases in fuzzy control often rely on expert prior knowledge, a particle swarm optimization algorithm is further introduced to optimize the fuzzy controller. This embodiment can significantly improve the stability and accuracy of UAV flight control.
[0031] The main steps of this embodiment are as follows: First, the UAV uses its own angle sensor to sense its current angle, judges its flight state based on the current angle, and performs fuzzy inference to convert it to the corresponding fuzzy rule base and membership function. Then, it calculates the angle error and error rate between the desired angle and the actual angle and inputs them into the angle loop particle swarm optimization fuzzy PID controller to generate the desired angular velocity and calculate the UAV's tangential torque. Finally, it uses the obtained desired torque to further calculate the UAV's desired thrust to control the UAV's motion, including the following steps: Step S1: Establish a mathematical model of the UAV During UAV flight, its attitude constantly changes, and the body coordinate system also changes accordingly, while the world coordinate system remains fixed. Therefore, the attitude information of the UAV, such as rotation angles, can be transformed to the world coordinate system using a homogeneous linear transformation through rotation matrices. Based on the transformation relationship from the body coordinate system to the world coordinate system, the rotation matrices of the UAV around the x, y, and z axes of the body coordinate system are as follows:
[0032]
[0033]
[0034] Furthermore, the complete rotation matrix from the body coordinate system to the world coordinate system is obtained:
[0035] Furthermore, a kinematic and dynamic mathematical model is established based on this. The dynamic model is mainly used to describe the dynamic relationship between the thrust acting on the UAV and the angular velocity of the airframe.
[0036]
[0037] Kinematic models are primarily used to describe the kinematic relationships between the position, velocity, and attitude of a UAV.
[0038]
[0039]
[0040] Step S2: Introduce fuzzy control algorithm A fuzzy inference engine is introduced to fuzzify the PID controller. Fuzzy subsets and universes of discourse are defined for error e, error rate of change ec, Kp change, Ki change, and Kd change, respectively. Based on these, corresponding membership functions are established. Taking into account the coverage of the universe of discourse and the feasibility of parameter adjustment, triangular membership functions are used for all fuzzy subsets.
[0041] Furthermore, based on the impact of various PID parameters on system performance, tuning rules for the changes in Kp, Ki, and Kd are summarized, and a fuzzy rule base is established based on these principles. Ultimately, the real-time parameters of the fuzzy PID controller can be obtained as follows:
[0042] This enables fuzzy PID control of UAVs, allowing the UAVs to adjust control parameters under different conditions to improve the applicability and stability of the flight control system.
[0043] For details, see Figure 1 The diagram shows the structure of a fuzzy PID controller, which consists of a fuzzy inference engine and a PID controller. The inputs to the inference engine are the error e and the rate of change of error ec, and the outputs are the correction values of the three PID parameters.
[0044] Step S3: Optimize the fuzzy controller using the offline particle swarm optimization algorithm. The flight state of the UAV is determined based on its current flight speed and attitude angle. According to the main control objectives and requirements of the UAV in different flight states, the membership function and fuzzy rule base established in step S2 are optimized on the computer using the particle swarm algorithm and stored in the UAV's onboard computer. When the UAV flies to different flight states, the algorithm is switched to achieve offline particle swarm algorithm optimization of the fuzzy controller.
[0045] The fitness function is used to evaluate the performance of each particle, i.e., each set of fuzzy controller parameters to be optimized. To balance the dynamic performance and control energy of the system, the integral of time multiplied by the absolute error is chosen as the main performance indicator, and a square integral term of the control quantity is introduced to suppress excessive control energy consumption. The fitness function J is defined as:
[0046] Further, see Figure 2This is a schematic diagram of a fuzzy PID controller structure optimized by particle swarm optimization. It introduces an offline particle swarm optimization algorithm on the basis of the fuzzy PID controller, and uses the particle swarm optimization algorithm to optimize the fuzzy rule base and membership function, which are crucial for fuzzy control.
[0047] Step S4: Deploy on a drone for real-device verification The optimized UAV flight control algorithm was deployed on the UAV for flight experiment verification. Flight data was extracted and re-plotted to experimentally verify several commonly used UAV control parameters. See details below. Figures 3 to 12 And Table 1.
[0048] Table 1 Comparison of Errors in Different Directions
[0049] Therefore, compared with existing traditional UAV flight control algorithms, this invention has the following advantages: First, fuzzy control was introduced into the traditional PID control algorithm, which solved the problem of fixed control parameters in the traditional PID control algorithm and improved its applicability. Secondly, the fuzzy rule base and membership function are optimized using an offline particle swarm optimization algorithm, which solves the problem that the fuzzy rule base and membership function in traditional fuzzy control are usually determined by expert experience.
[0050] This invention discloses a UAV flight control system based on particle swarm optimization fuzzy PID, comprising: Construct a kinematic and dynamic model of the unmanned aerial vehicle (UAV); Establish membership functions for the input and output variables of the UAV. Based on the influence of each parameter on the performance of the UAV, formulate fuzzy decision rules and form a fuzzy rule base. Integrate the membership functions, fuzzy rule base and the basic PID controller of the UAV to obtain fuzzy PID control rules. Particle swarm optimization is introduced, and the adjustable parameters in the fuzzy PID control rule are iteratively optimized in combination with different states of the UAV to obtain the optimal parameter set corresponding to each operating state. The optimal parameter set is then associated with the corresponding operating state and stored as a parameter library. Determine the current operating state of the UAV, and based on the current operating state, call the corresponding optimal parameter set from the parameter library. Using the current input variables of the UAV as input, perform fuzzy inference based on the corresponding optimal parameter set to obtain the control variables of the UAV.
[0051] A schematic diagram of a terminal device according to an embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the various method embodiments described above. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the various device embodiments described above.
[0052] The computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention.
[0053] The terminal device can be a desktop computer, laptop computer, cloud server, or other device with strong computing power. The terminal device may include, but is not limited to, a processor and memory.
[0054] The optimal choice for the processor is a multi-core high-speed central processing unit (CPU).
[0055] The memory can be used to store the computer program and / or module. The processor implements various functions of the terminal device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory.
[0056] If the modules / units integrated into the terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0057] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A UAV flight control method based on particle swarm optimization fuzzy PID, characterized in that, Includes the following steps: Construct a kinematic and dynamic model of the unmanned aerial vehicle (UAV); Establish membership functions for the input and output variables of the UAV. Based on the influence of each parameter on the performance of the UAV, formulate fuzzy decision rules and form a fuzzy rule base. Integrate the membership functions, fuzzy rule base and the basic PID controller of the UAV to obtain fuzzy PID control rules. Particle swarm optimization is introduced, and the adjustable parameters in the fuzzy PID control rule are iteratively optimized in combination with different states of the UAV to obtain the optimal parameter set corresponding to each operating state. The optimal parameter set is then associated with the corresponding operating state and stored as a parameter library. Determine the current operating state of the UAV, and based on the current operating state, call the corresponding optimal parameter set from the parameter library. Using the current input variables of the UAV as input, perform fuzzy inference based on the corresponding optimal parameter set to obtain the control variables of the UAV.
2. The UAV flight control method based on particle swarm optimization fuzzy PID according to claim 1, characterized in that, The construction of the fuzzy PID control rules includes: Establish membership functions for the input and output variables of the UAV. The input variables of the UAV include error e and error change rate ec. The output variables of the UAV include the proportional control parameter correction ΔKp, integral control parameter correction ΔKi, and derivative control parameter correction ΔKd of the PID controller. Based on the influence of PID parameters on system performance, fuzzy tuning rules are formulated for the proportional control parameter correction ΔKp, integral control parameter correction ΔKi, and derivative control parameter correction ΔKd, and a fuzzy rule base is established based on the fuzzy tuning rules. By combining the membership function with the fuzzy rule base, a fuzzy inference mechanism is formed. By combining the fuzzy inference mechanism with the basic PID controller, fuzzy PID control rules are obtained.
3. The UAV flight control method based on particle swarm optimization fuzzy PID according to claim 2, characterized in that, The real-time parameters of the fuzzy PID controller are obtained according to the fuzzy PID control rules as follows: in, This represents the real-time proportional gain of the fuzzy PID controller. This represents the real-time integral gain of the fuzzy PID controller. This represents the real-time derivative gain of the fuzzy PID controller. Indicates the initial values of the fuzzy PID control parameters; Indicates the initial values of the fuzzy PID control parameters; This represents the initial values of the fuzzy PID control parameters.
4. The UAV flight control method based on particle swarm optimization fuzzy PID according to claim 3, characterized in that, All membership functions are triangular membership functions.
5. The UAV flight control method based on particle swarm optimization fuzzy PID according to claim 1, characterized in that, The introduced particle swarm optimization method iteratively optimizes the adjustable parameters in the fuzzy PID control rule based on different UAV states, obtaining the optimal parameter set corresponding to each operating state. The optimal parameter set is then associated with and stored as a parameter library, including: The flight state of the drone is determined based on its current flight speed and attitude angle. The particle swarm optimization algorithm is used to perform offline iterative optimization of the parameters of the membership function of the UAV under different flight states and the rules in the fuzzy rule base to obtain the optimal parameter set for each flight state, and the optimal parameter set is associated with the corresponding flight state and stored. In the particle swarm optimization algorithm, the fitness function is the weighted sum of the integral of time multiplied by the absolute error and the integral of the square of the control quantity, and the parameters are iteratively optimized.
6. The UAV flight control method based on particle swarm optimization fuzzy PID according to claim 1, characterized in that, Using the current error e and the current error change rate ec of the UAV as input, fuzzy inference is performed using the optimal parameter set called, and the proportional control parameter correction amount ΔKp, integral control parameter correction amount ΔKi, and derivative control parameter correction amount ΔKd of the PID are output. The control quantity is calculated based on the obtained correction amount.
7. A UAV flight control system based on particle swarm optimization fuzzy PID, characterized in that, include: Construct a kinematic and dynamic model of the unmanned aerial vehicle (UAV); Establish membership functions for the input and output variables of the UAV. Based on the influence of each parameter on the performance of the UAV, formulate fuzzy decision rules and form a fuzzy rule base. Integrate the membership functions, fuzzy rule base and the basic PID controller of the UAV to obtain fuzzy PID control rules. Particle swarm optimization is introduced, and the adjustable parameters in the fuzzy PID control rule are iteratively optimized in combination with different states of the UAV to obtain the optimal parameter set corresponding to each operating state. The optimal parameter set is then associated with the corresponding operating state and stored as a parameter library. Determine the current operating state of the UAV, and based on the current operating state, call the corresponding optimal parameter set from the parameter library. Using the current input variables of the UAV as input, perform fuzzy inference based on the corresponding optimal parameter set to obtain the control variables of the UAV.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.