A Method and System for Optimizing UAV PID Parameters Based on Jellyfish Optimization Algorithm
By using a jellyfish-based optimization algorithm to optimize UAV PID parameters and dynamically adjust the search strategy, the problem of traditional PID parameters being unable to adapt to changes in multiple operating conditions is solved. This enables high-precision control and rapid response of UAVs in complex scenarios, supporting logistics inspection and disaster relief missions.
Patent Information
- Application Number
- CN202511195763.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-08-26
AI Technical Summary
Traditional PID parameters are fixed and cannot adapt to changes in multiple operating conditions. This results in existing optimization algorithms lacking the ability to perceive operating conditions and cannot dynamically switch search strategies. Consequently, parameter optimization deviates from actual needs, and control parameters lag when operating conditions change, leading to decreased control accuracy and slow dynamic response of UAVs in complex scenarios.
A UAV PID parameter optimization method based on jellyfish optimization algorithm is adopted. By establishing a UAV dynamic model and calculating the fitness function, combined with working condition identification and real-time state vector, the search strategy is dynamically adjusted. A multi-leader group interaction mechanism and ocean current following mechanism are used for local development or global search, realizing millisecond-level strategy switching and real-time state guidance.
It improves the control accuracy and dynamic response speed of drones in complex scenarios, meets the high-precision control requirements of scenarios such as high-speed maneuvering and emergency obstacle avoidance, and supports logistics inspection and disaster relief missions.
Smart Images

Figure CN120742689B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of unmanned aerial vehicle (UAV) control technology, and in particular to a method and system for optimizing UAV PID parameters based on the jellyfish optimization algorithm. Background Technology
[0002] As a core technology of autonomous systems, UAV flight control has important application value in logistics inspection, agricultural plant protection, disaster relief and other fields. Due to its simple structure and high stability, the PID controller has become the mainstream solution for UAV attitude control, but its parameter tuning is heavily dependent on the adaptability of working conditions. Existing optimization methods are mainly divided into three categories: (1) the empirical trial-and-error method, which involves manually adjusting parameters repeatedly, which is inefficient and difficult to cope with complex working condition changes; (2) the traditional intelligent optimization algorithm, which achieves automatic parameter tuning, but the fixed search strategy cannot distinguish the working condition requirements; and (3) the hybrid optimization method, which enhances the adaptive capability, but does not integrate real-time status feedback, and the algorithm complexity leads to insufficient real-time performance.
[0003] In the prior art, patent publication number CN119247984A discloses a pitch control method and system for UAVs using fuzzy immune control and optimized PID, specifically including: S1, decoupling and linearly simplifying the UAV motion equations to obtain a longitudinal motion mathematical model, wherein the longitudinal motion mathematical model is the PID control object; S2, initializing the parameters of the PID controller according to the system response requirements and performance indicators; S3, building a UAV PID control system, establishing a fuzzy control module and performing fuzzy inference adjustment, wherein the fuzzy control module includes fuzzy sets and fuzzy rules, wherein the fuzzy control module takes the error quantity and the error change rate of the UAV PID control system as input data, and the parameter adjustment quantity of the UAV PID controller as output data; S4, initializing the immune algorithm parameters and determining the optimization termination condition of the immune algorithm to obtain an initial UAV PID control system; S5, optimizing the initial UAV PID control system to obtain an optimized UAV PID control system, connecting the optimized UAV PID control system to the controlled object and running it; S6, optimizing and adjusting the fuzzy control module and immune algorithm parameters according to the real-time running effect. While this method improves anti-interference capabilities, the fuzzy rules rely on expert experience for design, making it difficult to cover the dynamic characteristics of drones under various operating conditions such as acceleration and hovering; the immune algorithm has fixed parameters and does not introduce real-time status feedback, resulting in lag in parameter adjustment when switching operating conditions; and no operating condition recognition mechanism has been established, making it impossible to specifically enhance local development or global search.
[0004] Patent publication number CN120161710A proposes a PID intelligent tuning method for a quadcopter UAV based on the whale optimization algorithm. Specifically, it includes: establishing a dynamic model of the quadcopter UAV and determining the control objective of the PID controller; adjusting the proportional gain of the PID controller... Integral coefficient and differential coefficients As optimization variables, a fitness function is defined to evaluate the control performance of the PID controller. The whale optimization algorithm is used to perform a global search in the parameter space to optimize the PID parameters. The optimized PID parameters are then applied to the flight control system of the quadcopter UAV to achieve stable control. While this avoids manual parameter tuning, it lacks operational condition awareness, and excessive global search during hovering causes parameter oscillations. The optimization direction lacks state guidance, relying solely on historical optimal solutions and ignoring crucial information such as real-time attitude errors. Furthermore, the convergence speed is affected by random behavior, making it difficult to meet the real-time requirements of high-speed UAV maneuvers. Summary of the Invention
[0005] The first objective of this invention is to provide a method for optimizing PID parameters of unmanned aerial vehicles (UAVs) based on a jellyfish optimization algorithm. This aims to address the problem that traditional fixed PID parameters cannot adapt to changes in multiple operating conditions, resulting in a lack of operating condition awareness in existing optimization algorithms. This leads to a lack of real-time state guidance and the inability to dynamically switch search strategies, resulting in parameter optimization deviating from actual requirements and control parameter lag during operating condition switching. Consequently, this leads to technical bottlenecks such as decreased control accuracy, delayed dynamic response, and insufficient anti-interference capability of UAVs in complex scenarios. To solve the above technical problems, a method for optimizing PID parameters of UAVs based on a jellyfish optimization algorithm is provided, comprising the following steps:
[0006] S1. Establish the UAV dynamics model: Define the PID parameter solution space boundary. Randomly generated Group PID parameters As the location of an individual jellyfish, among which PID parameters generated randomly The minimum and maximum boundary values are respectively and , These are the proportional, integral, and differential coefficients, respectively.
[0007] S2. Calculate fitness: Input the current PID parameters into the UAV simulation model, and evaluate the control performance using the fitness index (ITAE) as the fitness function. , The error between the desired position signal and the actual position signal output by the UAV simulation model is defined as follows: the UAV simulation model is a computer simulation environment built based on the UAV dynamics model, used to simulate the dynamic response of the UAV under different PID parameters; the actual position signal refers to the three-dimensional position coordinates or attitude Euler angles of the UAV output by the simulation model.
[0008] S3, Operating Condition Recognition: Based on the real-time speed of the drone and acceleration Calculation of operating condition indicators :
[0009] ;
[0010] S4. Dynamic optimization strategy execution: When At that time, strengthen the group interaction mechanism for local development, and adopt a multi-leader position update strategy. At the same time, the ocean current following mechanism is enhanced for global search, and a real-time state vector is introduced. Guiding the search direction, among which This represents the error between the expected roll angle and the actual roll angle.
[0011] S5. Iteratively output the optimal PID parameters: Iterate through S2-S4 until the termination condition is met, and output the globally optimal PID parameters. .
[0012] In one embodiment, the execution of the dynamic optimization strategy includes a dynamic fusion mechanism:
[0013] Ocean currents follow the update volume Update volume of group interaction New positions are synthesized based on working condition weights. To update :
[0014] ;
[0015] Among them, the weighting coefficient Dynamically adjust according to operating conditions:
[0016] ;
[0017] And when The ocean current follows the update volume When it is 0, At that time, the group interaction update quantity It is 0.
[0018] In one embodiment, when In this case, the group interaction mechanism is implemented through a multi-leader weighted approach:
[0019] ;
[0020] in , This indicates the population with the lowest fitness ITAE value. The position vector of each leader, by evaluating all The fitness of ITAE is ranked and then selected.
[0021] In one embodiment, when At that time, the ocean current following mechanism is implemented through state guidance:
[0022] ;
[0023] in This represents the globally optimal position of the individual with the lowest fitness ITAE value in the current jellyfish population, determined by evaluating all... Fitness ITAE was ranked and then selected. This is the real-time state vector. for within the interval Random vectors of the same dimension , as well as .
[0024] In one embodiment, the The position of the globally optimal individual within each generation of the population during the algorithm iteration process, the These are the final globally optimal PID parameters output after the algorithm terminates.
[0025] In one embodiment, the termination condition is:
[0026] The rate of change of fitness ITAE is less than a threshold or the number of iterations reaches the preset maximum number of iterations. .
[0027] The second objective of this invention is to provide a UAV PID parameter optimization system based on the jellyfish optimization algorithm. This system aims to address the problems of low modularity leading to poor scalability, insufficient real-time performance caused by the separation of condition identification and parameter optimization, and decreased control accuracy due to the lack of a state feedback mechanism in existing systems. By implementing a closed-loop optimization architecture of condition perception-strategy switching-state guidance, the system achieves hardware-level decoupling, millisecond-level strategy switching, and real-time state injection into the control loop, thereby comprehensively improving system performance.
[0028] To address the aforementioned technical issues, a UAV PID parameter optimization system based on the jellyfish optimization algorithm is provided. The system implements the aforementioned UAV PID parameter optimization method based on the jellyfish optimization algorithm, including a model initialization module, a population generation module, a working condition identification module, a strategy switching module, a parameter optimization module, a boundary constraint module, and an iterative control module.
[0029] In one embodiment, the model initialization module configures the UAV transfer function and sets the PID parameter solution space boundary. The population generation module generates populations containing... The jellyfish population with set PID parameters; the operating condition identification module receives real-time status data from the UAV. Output operating condition indicators The strategy switching module is based on Activate the ocean current following or group interaction calculation channel; the parameter optimization module performs position update calculation. To update The boundary constraint module updates the constraints using the truncation method. Parameter range: The iterative control module monitors whether the rate of change of the fitness ITAE is less than a threshold or whether the number of iterations reaches the preset maximum number of iterations. Output the optimal PID parameters.
[0030] In one embodiment, the parameter optimization module includes an ocean current following unit, a group interaction unit, and a fusion unit. The ocean current following unit is used to implement an ocean current following mechanism through state guidance; the group interaction unit is used to implement a multi-leader weighted average mechanism or a single-leader perturbation mechanism; and the fusion unit is used to optimize the parameters according to weight coefficients. The outputs of the ocean current following unit and the swarm interaction unit are combined to form the final update. .
[0031] In one embodiment, the operating condition identification module includes a zero-value detector, a state vector generator, and an identifier outputter, wherein the zero-value detector is used to determine the real-time speed. and acceleration Whether both are 0; the state vector generator is used to construct the real-time state vector. The identifier output device is used to generate operating condition identifiers. And transmit it to the policy switching module.
[0032] In one embodiment, the group interaction unit is configured to: when When, select Each local leader generates a weighted average update; when At that time, only the globally optimal leader is retained and a random perturbation is added. ,in The disturbance coefficient is... for within the interval Random vectors of the same dimension.
[0033] Implementing the embodiments of the present invention will have the following beneficial effects:
[0034] 1. The UAV PID parameter optimization method based on the jellyfish optimization algorithm in this embodiment 1 uses a working condition identification function. The system dynamically distinguishes between hovering and dynamic operating conditions. During hovering, a multi-leader group interaction mechanism is used to enhance local development and improve steady-state accuracy. During dynamic operating conditions, a state vector is introduced. The ocean current following mechanism enhances the global search to accelerate the response; by fusing weights A dynamic balancing strategy is proposed, and performance is quickly evaluated using ITAE as the fitness function. Compared with existing technologies, this method solves the problems of traditional PID parameters being unable to adapt to multiple operating conditions, the convergence direction deviation caused by the optimization algorithm not considering real-time state guidance, and the lag of control parameters when switching operating conditions.
[0035] 2. The UAV PID parameter optimization system based on the jellyfish optimization algorithm in this embodiment uses the zero-value detector of the operating condition identification module to judge the operating condition in real time, driving the strategy switching module to activate the ocean current following or group interaction channel; the global search or multi-leader local development guided by the three-level pipeline execution state of the ocean current following unit, group interaction unit, and fusion unit in the parameter optimization module achieves millisecond-level dynamic optimization. Compared with the existing system, this system solves the technical defects of the existing technology that cannot dynamically balance local development and global search, supports real-time dynamic parameter optimization, meets the high-precision control requirements of UAVs in high-speed maneuvering and emergency obstacle avoidance scenarios, and provides reliable technical support for tasks such as logistics inspection and disaster relief. Attached Figure Description
[0036] 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 these drawings without creative effort.
[0037] Figure 1 This is a flowchart of the UAV PID parameter optimization method based on the jellyfish optimization algorithm described in Embodiment 1 of the present invention;
[0038] Figure 2 This is the architecture of the UAV PID parameter optimization system based on the jellyfish optimization algorithm described in Embodiment 2 of the present invention;
[0039] Figure 3 This is a schematic diagram of the UAV PID parameter optimization method based on the jellyfish optimization algorithm described in Embodiment 1 of the present invention.
[0040] Figure 4 This is a flowchart illustrating the implementation of the UAV PID parameter optimization system based on the jellyfish optimization algorithm as described in Embodiment 2 of the present invention. Detailed Implementation
[0041] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0042] It should be noted that when a component is said to be "fixed to" another component, it can be directly attached to the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0044] Example 1
[0045] Please refer to Figure 1 , 3 Embodiment 1 of the present invention provides a method for optimizing PID parameters of unmanned aerial vehicles based on a jellyfish optimization algorithm. This embodiment includes:
[0046] First, a six-degree-of-freedom dynamic model of the UAV is established, and the transfer function is obtained through Laplace transform. Then, the PID parameter solution space boundary is defined. ,in And randomly generated The group of PID parameters is used as the location of individual jellyfish:
[0047] ;
[0048] Then, the current PID parameters are input into the UAV simulation model to obtain the system dynamic response. And calculate the error between the expected output and the actual output:
[0049] ;
[0050] The control performance was then evaluated using the fitness index (ITAE) as the fitness function.
[0051] ;
[0052] Where the transfer function The Laplace transform, derived from the UAV dynamics model, describes the UAV's own dynamic characteristics. Its input is the control variable. The output is the dynamic response of the drone's attitude or position. In a PID control system, the control variable is... From error signal Generated using the PID algorithm:
[0053]
[0054] Therefore, the transfer function PID parameters With system output The relationship can be expressed as: system output It is a transfer function by The response generated for the input, and Then determined by PID parameters and error A joint decision.
[0055] Real-time speed of drones and acceleration Computational state recognition :
[0056] ;
[0057] when That is, when the drone is in hovering mode, the group interaction mechanism is strengthened, a multi-leader position update mechanism is adopted, and the leader with the smallest fitness ITAE value is selected. One leader The position update amount is:
[0058] ;
[0059] when That is, when the UAV is in dynamic operating conditions, the enhanced ocean current following mechanism introduces a state vector. To guide the search direction, the ocean current direction vector is calculated as follows:
[0060] ;
[0061] in for within the interval Random vectors of the same dimension are then combined and their positions are updated as follows:
[0062] ;
[0063] Wherein the weighting coefficients are:
[0064] ;
[0065] And when The ocean current follows the update volume When it is 0, At that time, the group interaction update quantity It is 0.
[0066] Finally, the parameter range is constrained using the truncation method:
[0067] ;
[0068] Repeat the above steps until the rate of change of fitness ITAE is less than the threshold or the number of iterations reaches the preset maximum number of iterations. The iteration terminates when the optimal PID parameters are reached, and the best PID parameters are output. .
[0069] Implementing Embodiment 1 of the present invention, through the operating condition identification function Dynamically distinguish between hovering and dynamic operating conditions, and employ a multi-leader group interaction mechanism during hovering. Strengthen local development and introduce state vectors in dynamic operating conditions. Ocean current following mechanism (global search) Enhance global search; by fusing weights An adaptive balancing strategy is employed, with ITAE used as the fitness function for rapid performance evaluation. Compared to existing technologies, this method addresses the issue of fixed parameters in traditional PID control, resulting in reduced hovering steady-state error and improved dynamic response speed.
[0070] Example 2
[0071] The UAV PID parameter optimization system based on the jellyfish optimization algorithm in this second embodiment differs from the UAV PID parameter optimization method based on the jellyfish optimization algorithm in the first embodiment in terms of the subject matter protected. Specifically, the UAV PID parameter optimization system based on the jellyfish optimization algorithm includes a model initialization module, a population generation module, a working condition identification module, a strategy switching module, a parameter optimization module, a boundary constraint module, and an iterative control module.
[0072] In an optional embodiment, the UAV transfer function is configured via the model initialization module. Set PID parameters to solve space boundary Subsequently, the population generation module randomly generates populations within the solution space. A jellyfish population with set PID parameters was used to construct an initial jellyfish population matrix. The zero-value detector in the operating condition identification module is used to analyze the received real-time status data of the UAV. judge and state vector generator construction The identifier outputter then generates a working condition identifier. And transmit it to the policy switching module, while also sending the state vector This data is then transmitted to the parameter optimization module; the strategy switching module then... Activate ocean current following or group interaction calculation channels: The group interactive computing channel is activated at the specified time. The ocean current following calculation channel is activated at the specified time; the parameter optimization module executes the ocean current following unit to calculate the ocean current following mechanism through state guidance; the group interaction unit implements a multi-leader weighted average mechanism or a single-leader perturbation mechanism; and the fusion unit calculates the ocean current following mechanism according to the weight coefficient. The final update is synthesized; subsequently, the boundary constraint module uses a truncation method to constrain the parameter range.
[0073] ;
[0074] Finally, the iteration control module monitors the fitness ITAE rate of change, which is less than a threshold or the number of iterations reaches the preset maximum number of iterations. The optimal PID parameters are output to the flight control system.
[0075] Implementing Embodiment 2 of the present invention will have the following beneficial effects:
[0076] An adaptive optimization architecture for operating conditions is constructed through a model initialization module (configuring the dynamic model and boundaries), a working condition identification module (linking zero-value detection and state vector generation), and a parameter optimization module (a three-stage pipeline combining ocean current following, group interaction, and fusion). Compared to existing systems, this system solves the technical deficiency of being unable to dynamically balance local development and global search, supports millisecond-level dynamic parameter updates, meets the high-precision control requirements of UAVs in high-speed maneuvering scenarios, and provides core technical support for tasks such as logistics inspection and disaster relief.
Claims
1. A method for optimizing PID parameters of a UAV based on a jellyfish optimization algorithm, characterized in that Comprising: S1, establish a UAV dynamics model: define the PID parameter solution space boundary , randomly generate a set of PID parameters as the jellyfish individual position, where is the randomly generated PID parameter The minimum and maximum boundary values of the PID parameter are respectively proportional, integral and differential coefficients; S2, calculating fitness: inputting the current PID parameters into the UAV simulation model based on the UAV dynamics model, and evaluating the control performance with the fitness ITAE index as the fitness function, wherein , is the error between the desired position signal and the actual position signal output by the UAV simulation model. S3, working condition recognition: based on real-time speed of unmanned aerial vehicle and acceleration calculate working condition identification : ; S4, dynamic optimization strategy execution: when the reinforcement group interaction mechanism carries out local development, and a multi-leader position update strategy is adopted; when the reinforcement current following mechanism carries out global search, and a real-time state vector is introduced to guide the search direction, wherein is the error between the expected roll angle and the actual roll angle; S5, output the optimal PID parameters: iteratively execute S2-S4 until the termination condition is met, and output the globally optimal PID parameters ; The dynamic optimization strategy execution comprises a dynamic fusion mechanism: Current following update amount Group interaction update amount New position by operating condition weight synthesis With update : ; where the weight coefficient Dynamic adjustment according to working conditions: ; When the ocean current follows the update amount is 0, the group interaction mechanism is implemented by multi-leader weighting: ; in , , This indicates the population with the lowest fitness ITAE value. The position vector of each leader, by evaluating all The fitness of ITAE is sorted and then selected; When the population interaction update quantity is 0, the ocean current following mechanism is implemented by state steering. ; in This represents the globally optimal position of the individual with the lowest fitness ITAE value in the current jellyfish population, determined by evaluating all... Fitness ITAE was ranked and then selected. For real-time state vectors, for within the interval Random vectors of the same dimension , as well as .
2. The jellyfish optimization algorithm based PID parameter optimization method for UAV according to claim 1, characterized in that, The termination condition is: a rate of change of the fitness ITAE is less than a threshold or a number of iterations reaches a preset maximum number of iterations .
3. A jellyfish optimization algorithm-based PID parameter optimization system for unmanned aerial vehicles for performing the jellyfish optimization algorithm-based PID parameter optimization method for unmanned aerial vehicles according to claim 1 or 2, characterized in that, Comprising: a model initialization module configured to configure a UAV transfer function, set a PID parameter solution space boundary ; a population generation module that generates a population comprising a set of PID parameters jellyfish population; A working condition recognition module receives real-time state data of the UAV and outputs a working condition identifier a policy switching module that switches policies according to activating a current following or flock interaction computing channel; a parameter optimization module that performs position update calculations to update ; a boundary constraint module that constrains the parameter range of the updated parameters using a clipping method : ; An iteration control module monitors whether a change rate of the fitness ITAE is less than a threshold value or an iteration number reaches a preset maximum iteration number , and outputs optimal PID parameters.
4. The jellyfish optimization algorithm based PID parameter optimization system for UAVs according to claim 3, wherein, The parameter optimization module comprises a current following unit, a group interaction unit and a fusion unit, the current following unit is used to realize a current following mechanism through state guidance; the group interaction unit is used to realize a multi-leader weighted average mechanism or a single-leader disturbance mechanism; the fusion unit is used to fuse the outputs of the current following unit and the group interaction unit according to weight coefficients The output of the current following unit and the output of the group interaction unit are synthesized into a final update amount Wherein the final update amount represents the position of a jellyfish individual of a new generation.
5. The jellyfish optimization algorithm based PID parameter optimization system for UAVs according to claim 4, wherein, The working condition recognition module comprises a zero value detector, a state vector generator and an identification outputter, the zero value detector is used for judging whether the real-time speed and acceleration are zero at the same time; the state vector generator is used for constructing a real-time state vector ; and the identification outputter is used for generating a working condition identification and transmitting to a strategy switching module.
6. The jellyfish optimization algorithm based UAV PID parameter optimization system according to claim 5, wherein, The group interaction unit is configured to: When , the position vector of the leader with the minimum fitness ITAE value is selected , and a weighted average update amount is generated ; when , only the global optimal individual position with the minimum fitness ITAE value is retained and a random disturbance is added , wherein is a disturbance coefficient, is a random vector of the same dimension as in the interval.
Citation Information
Patent Citations
Unmanned aerial vehicle pitching control method and system based on fuzzy immune control optimization PID (Proportion Integration Differentiation)
CN119247984A
Four-axis unmanned aerial vehicle PID intelligent setting method based on whale optimization algorithm
CN120161710A
Method for searching global shortest optimal path based on hybrid improved artificial jellyfish algorithm
CN117215193A
Intelligent optimization control method for wave power generation device based on improved MPC
CN120426163A