Rotor unmanned aerial vehicle parameter adjustment method and device and related equipment
By generating and selecting the optimal PID parameter set for rotary-wing UAVs through multiple parameter optimization algorithms, the problem of difficulty in precise control under complex environments in existing PID parameter tuning methods is solved, achieving efficient and robust PID control.
Patent Information
- Application Number
- CN202411551490.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2024-11-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing PID parameter tuning methods for rotary-wing UAVs are difficult to achieve precise control when dealing with variable environments or complex parameter tuning tasks.
Multiple sets of candidate parameters are generated using various parameter optimization algorithms (such as deep learning, particle swarm optimization, and ant colony optimization). The optimal parameter set is selected using a performance evaluation formula. Finally, PID parameter tuning is performed using the performance evaluation formula S=ω1/(1+MSE)+ω2/(1+OS)+ω3/(1+ST)+ω4*EE+ω5*RB for evaluation and selection.
The PID control system after PID parameter tuning exhibits excellent overall performance in terms of efficiency, energy efficiency, and robustness. It can precisely adjust PID parameters to adapt to complex environments and perform complex flight missions.
Smart Images

Figure CN119045319A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of unmanned aerial vehicles, and in particular relates to a parameter adjustment method and device for a rotary-wing unmanned aerial vehicle and related equipment. Background Art
[0002] The existing PID parameter adjustment methods applied to rotary wing UAVs are generally manual parameter adjustment or parameter adjustment based on a single parameter optimization algorithm, where the parameter optimization algorithm includes existing algorithms that can optimize and adjust the PID parameter group, such as particle swarm optimization algorithm and genetic algorithm. However, manual parameter adjustment or parameter adjustment based on a single parameter optimization algorithm is difficult to achieve precise control when dealing with changing environments or complex parameter adjustment tasks.
[0003] Therefore, the existing technology needs to be improved and developed. Summary of the invention
[0004] The purpose of this application is to provide a rotor UAV parameter adjustment method, device and related equipment, aiming to solve the problem that the existing PID parameter adjustment method applied to UAVs is difficult to achieve precise control when dealing with dynamic environments or complex parameter adjustment tasks.
[0005] In a first aspect, the present application provides a rotorcraft UAV parameter adjustment method for performing PID parameter adjustment on a rotorcraft UAV, comprising the following steps: S1. Collect flight status data of the rotary-wing UAV; S2. Generate corresponding candidate parameter groups based on flight status data based on multiple parameter optimization algorithms; S3. Evaluate each candidate parameter group based on the performance evaluation formula to obtain the evaluation score of each candidate parameter group. The performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB; Among them, S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, ω1, ω2, ω3, ω4 and ω5 are the weights of MSE, OS, ST, EE and RB respectively; S4. PID parameters of the rotorcraft UAV are adjusted according to the candidate parameter group with the highest evaluation score.
[0006] The rotorcraft UAV parameter adjustment method of the present application generates multiple groups of alternative parameter groups based on multiple parameter optimization algorithms, and selects the best ones for PID parameter adjustment. The PID control system after PID parameter adjustment can have excellent comprehensive performance in terms of efficiency, energy efficiency and robustness, and can accurately adjust the PID parameters, thereby realizing precise PID control of the rotorcraft UAV; and the present application only needs to set ω1, ω2, ω3, ω4 and ω5 to appropriate values to unify the numerical magnitudes of the five evaluation indicators, prevent the weight differences between the five evaluation indicators from being too large, and configure the required weights for the five evaluation indicators, thereby improving the performance of the PID control system corresponding to the evaluation indicators with larger weights.
[0007] Furthermore, the various parameter optimization algorithms include deep learning algorithms, particle swarm optimization algorithms, and ant colony optimization algorithms.
[0008] Furthermore, the process of generating the candidate parameter group according to the flight status data based on the particle swarm optimization algorithm includes: A1. Randomly generate multiple particles in a preset space, and let the position of each particle in the preset space correspond to a parameter group, obtain the state deviation, and generate the fitness of each particle according to the state deviation. The state deviation is the deviation between the flight state data and the expected data; A2. Update the position of each particle in the preset space according to the global best position, the current position of each particle and the individual best position of each particle until the final best position is generated, and use the parameter group corresponding to the final best position as the candidate parameter group, wherein the global best position is the one with the highest corresponding fitness among the historical positions of all particles, and the individual best position of each particle is the one with the highest corresponding fitness among the historical positions of each particle, and the final best position is the global best position when the first preset condition is met; The location update process includes: A21. Generate a new position of each particle in a preset space according to the global optimal position, the current position of each particle and the individual optimal position of each particle; A22. Obtain the state deviation corresponding to the new position of each particle respectively, wherein the state deviation corresponding to the new position of each particle is the deviation between the flight state data and the expected data at several moments after the PID parameter adjustment and PID control of the rotorcraft based on the parameter group corresponding to each path in the simulated flight environment; A23. Generate a new fitness of each particle according to the state deviation corresponding to the new position of each particle, and update the individual best position and historical best position of each particle according to the new fitness of each particle.
[0009] Furthermore, the process of generating the fitness of each particle according to the state deviation is based on the fitness function, and the fitness function is: ; Among them, F1 is the fitness of each particle, i is the ordinal number of the moment, n is the total number of moments, t is the moment, e i (t) is the state deviation at the i-th moment, k1 is the weight factor of F1 and is a positive value.
[0010] In this embodiment, the rotor UAV parameter adjustment method of the present application can realize the continuous generation of parameter groups with smaller corresponding state deviations and slower corresponding state deviation change speeds, so that after the alternative parameter groups are generated based on the particle swarm optimization algorithm, the PID control based on the alternative parameter groups can be more precise, and the present application only needs to set k1 to an appropriate value to set the degree of correlation between the fitness and the speed at which the state deviation changes with time within n moments, thereby controlling the degree of importance attached to the speed of change of the state deviation corresponding to the position of each particle.
[0011] Furthermore, the process of generating the candidate parameter group according to the flight status data based on the ant colony optimization algorithm includes: B1. Randomly generate multiple paths, and let each path correspond to a parameter group; B2. Obtain the state deviation corresponding to each path respectively, and generate the fitness of each path according to the state deviation corresponding to each path, wherein the state deviation corresponding to each path is the deviation between the flight state data at several moments and the expected data after the PID parameter adjustment and PID control of the rotorcraft based on the parameter group corresponding to each path in the simulated flight environment; B3. Perform ant colony routing until the final optimal path is obtained, and the parameter group corresponding to the final optimal path is used as the candidate parameter group. The final optimal path is the path selected by the largest number of ants when the second preset condition is met; The process of ant colony path selection includes: B31. Randomly generate multiple ants that can choose different paths, and generate the current round of pheromones for each path based on the fitness of each path and the pheromone of the previous round of each path. When the pheromone of the current round of each path is generated for the first time, the pheromone of the previous round of each path is set to 0; B32. Generate the path selection probability of each ant for each path based on the pheromone of the current round of each path; B33. Let each ant choose a path based on its own probability of choosing each path.
[0012] Furthermore, the process of generating the fitness of each path according to the state deviation corresponding to each path is based on the fitness function, and the fitness function is: ; Among them, F2 is the fitness of each path, i is the ordinal number of the moment, n is the total number of moments, t is the moment, e i(t) is the state deviation at the i-th moment, k2 is the weight factor of F2 and is a positive value.
[0013] In this embodiment, the rotor UAV parameter adjustment method of the present application can gradually determine the paths in each path with smaller corresponding state deviations and slower corresponding state deviation changes, so that after the alternative parameter group is generated based on the ant colony optimization algorithm, the PID control based on the alternative parameter group can be more precise. In addition, the present application only needs to set k2 to an appropriate value to set the degree of correlation between the fitness and the speed at which the state deviation changes with time within n moments, thereby controlling the degree of importance attached to the speed of change of the state deviation corresponding to each path.
[0014] Further, step S1 includes: S11. Collect flight status data and environmental data of the rotorcraft drone; The process of generating candidate parameter groups based on flight status data based on deep learning algorithms includes: C1. Generate alternative parameter groups based on flight status data and environmental data based on a pre-trained neural network model.
[0015] In a second aspect, the present application provides a rotorcraft UAV parameter adjustment device for performing PID parameter adjustment on a rotorcraft UAV, comprising: A data acquisition module is used to collect flight status data of the rotary-wing UAV; An alternative generation module is used to generate corresponding alternative parameter groups according to flight status data based on multiple parameter optimization algorithms; The performance evaluation module is used to evaluate each candidate parameter group based on the performance evaluation formula to obtain the evaluation score of each candidate parameter group. The performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB; Among them, S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, ω1, ω2, ω3, ω4 and ω5 are the weights of MSE, OS, ST, EE and RB respectively; The parameter adjustment module is used to adjust the PID parameters of the rotary wing UAV according to the candidate parameter group with the highest evaluation score.
[0016] The rotorcraft UAV parameter adjustment device of the present application generates multiple groups of alternative parameter groups based on multiple parameter optimization algorithms, and selects the best ones from them for PID parameter adjustment, which can make the PID control system after PID parameter adjustment have excellent comprehensive performance in terms of efficiency, energy efficiency and robustness, and can accurately adjust the PID parameters, thereby realizing precise PID control of the rotorcraft UAV; and the present application only needs to set ω1, ω2, ω3, ω4 and ω5 to appropriate values to unify the numerical magnitudes of the five evaluation indicators, prevent the weight differences between the five evaluation indicators from being too large, and can configure the required weights for the five evaluation indicators, thereby improving the performance of the PID control system corresponding to the evaluation indicators with larger weights.
[0017] In a third aspect, the present application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, it runs the steps in any of the above methods.
[0018] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any of the above methods are performed.
[0019] From the above, it can be seen that the present application provides a method, device and related equipment for adjusting parameters of a rotary-wing UAV, wherein the method for adjusting parameters of a rotary-wing UAV provided by the present application generates multiple groups of alternative parameter groups based on multiple parameter optimization algorithms, and selects the best one from them for PID parameter adjustment, which can make the PID control system after PID parameter adjustment have excellent comprehensive performance in terms of efficiency, energy efficiency and robustness, and can accurately adjust the PID parameters, thereby realizing precise PID control of the rotary-wing UAV; and the present application only needs to set ω1, ω2, ω3, ω4 and ω5 to appropriate values to unify the numerical magnitudes of the five evaluation indicators, prevent the weight differences between the five evaluation indicators from being too large, and can configure the required weights for the five evaluation indicators, thereby improving the performance of the PID control system corresponding to the evaluation indicators with larger weights.
[0020] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a rotorcraft UAV parameter adjustment method provided in an embodiment of the present application.
[0022] Figure 2 A schematic diagram of the structure of a rotorcraft UAV parameter adjustment device provided in an embodiment of the present application.
[0023] Figure 3A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0024] Explanation of reference numerals: 1. Data acquisition module; 2. Alternative generation module; 3. Performance evaluation module; 4. Parameter adjustment module; 301. Processor; 302. Memory; 303. Communication bus. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0026] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0027] First, as Figure 1 As shown, the present application provides a rotor UAV parameter adjustment method for performing PID parameter adjustment on a rotor UAV, comprising the following steps: S1. Collect flight status data of the rotary-wing UAV; S2. Generate corresponding candidate parameter groups based on flight status data based on multiple parameter optimization algorithms; S3. Evaluate each candidate parameter group based on the performance evaluation formula to obtain the evaluation score of each candidate parameter group. The performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB (1) Among them, S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, ω1, ω2, ω3, ω4 and ω5 are the weights of MSE, OS, ST, EE and RB respectively; S4. PID parameters of the rotorcraft UAV are adjusted according to the candidate parameter group with the highest evaluation score.
[0028] Specifically, the flight status data is data that can characterize the flight status of the drone, which may be one or more of the drone's position data, speed data, attitude data, or altitude data.
[0029] More specifically, the parameter optimization algorithm may be an existing algorithm such as a particle swarm optimization algorithm or a genetic algorithm that can optimize the PID parameter group, and each candidate parameter group includes three PID parameters.
[0030] More specifically, in the present application, the PID control process of the rotorcraft UAV is: based on the PID control system, the expected data is generated according to the PID parameters and the flight status data is adjusted according to the expected data, so that the flight status data continuously approaches the expected data until it reaches and remains near the expected data.
[0031] More specifically, the mean square error is the expectation of the square value of the error between the flight status data and the expected data; the overshoot is the maximum percentage of the actual value of the flight status data exceeding the expected data; the stabilization time is the time from PID parameter adjustment to the flight status data reaching and remaining near the expected data; the energy efficiency is the energy efficiency in the process from PID parameter adjustment to the flight status data reaching and remaining near the expected data; the robustness score is a score that can characterize the PID control system's resistance to external interference and parameter changes. Among them, the mean square error, overshoot and stabilization time are evaluation indicators of the efficiency of the PID control system in adjusting the actual value of the flight status data to the expected data, the energy efficiency is an evaluation indicator of the energy efficiency level of the PID control system in the process of adjusting the actual value of the flight status data to the expected data, and the robustness score is an evaluation indicator of the PID control system's resistance to external interference and parameter changes. The five evaluation indicators corresponding to each alternative parameter group are obtained after the PID parameters of the rotorcraft are adjusted based on each alternative parameter group in a simulated flight environment.
[0032] More specifically, it can be seen from the performance evaluation formula that the evaluation score is inversely proportional to the mean square error, overshoot and stabilization time, and is directly proportional to the energy efficiency and robustness scores. Therefore, the alternative parameter group with the highest evaluation score is the optimal alternative parameter group selected from each alternative parameter group based on the five evaluation indicators in this application. Therefore, this application performs PID parameter adjustment on the rotorcraft UAV according to the alternative parameter group with the highest evaluation score, and can use the optimal alternative parameter group among the alternative parameter groups for PID control of the rotorcraft UAV.
[0033] More specifically, compared with manual parameter adjustment or parameter adjustment methods based on a single parameter optimization algorithm, the parameter adjustment method of the present application generates multiple groups of alternative parameter groups based on multiple parameter optimization algorithms, and selects the best from them for PID parameter adjustment, which can make the PID control system after PID parameter adjustment have excellent comprehensive performance in terms of efficiency, energy efficiency and robustness, and can accurately adjust the PID parameters, thereby realizing precise PID control of the rotorcraft UAV; and the present application selects the best of each alternative parameter group based on five evaluation indicators, which can make the rotorcraft UAV after PID parameter adjustment perform flight missions more stably and with less energy consumption; and the evaluation scores of each alternative parameter group of the present application are obtained after weighted summation of the five evaluation indicators, so that only ω1, ω2, ω3, ω4 and ω5 need to be set to appropriate values to unify the numerical magnitudes of the five evaluation indicators and prevent the weight differences between the five evaluation indicators from being too large, and only ω1, ω2, ω3, ω4 and ω5 need to be set to appropriate values to configure the required weights for the five evaluation indicators, thereby improving the performance of the PID control system corresponding to the evaluation indicators with larger weights.
[0034] More specifically, the parameter adjustment method of the rotary-wing UAV of the present application is particularly suitable for occasions where the environment changes frequently, complex flight missions need to be performed, and intermittent dynamic adjustment of PID parameters is required. The parameter adjustment method of the rotary-wing UAV of the present application generates multiple groups of candidate parameter groups based on multiple parameter optimization algorithms, and selects the best from them for PID parameter adjustment, which can make the PID control system after PID parameter adjustment have excellent comprehensive performance in terms of efficiency, energy efficiency and robustness, and can accurately adjust the PID parameters, thereby realizing precise PID control of the rotary-wing UAV; and the present application only needs to set ω1, ω2, ω3, ω4 and ω5 to appropriate values, so as to unify the numerical magnitudes of the five evaluation indicators, prevent the weight differences between the five evaluation indicators from being too large, and can configure the required weights for the five evaluation indicators, thereby improving the performance of the PID control system corresponding to the evaluation indicators with larger weights.
[0035] In some preferred embodiments, the multiple parameter optimization algorithms include a deep learning algorithm, a particle swarm optimization algorithm, and an ant colony optimization algorithm.
[0036] In this embodiment, the rotor UAV parameter adjustment method of the present application generates alternative parameter groups based on deep learning algorithm, particle swarm optimization algorithm and ant colony optimization algorithm, which can generate different alternative parameter groups and facilitate PID parameter adjustment by selecting the best one among different alternative parameter groups.
[0037] In some preferred embodiments, the process of generating an alternative parameter set according to flight status data based on a particle swarm optimization algorithm includes: A1. Randomly generate multiple particles in a preset space, and let the position of each particle in the preset space correspond to a parameter group, obtain the state deviation, and generate the fitness of each particle according to the state deviation. The state deviation is the deviation between the flight state data and the expected data; A2. Update the position of each particle in the preset space according to the global best position, the current position of each particle and the individual best position of each particle until the final best position is generated, and use the parameter group corresponding to the final best position as the candidate parameter group, wherein the global best position is the one with the highest corresponding fitness among the historical positions of all particles, and the individual best position of each particle is the one with the highest corresponding fitness among the historical positions of each particle, and the final best position is the global best position when the first preset condition is met; The location update process includes: A21. Generate a new position of each particle in a preset space according to the global optimal position, the current position of each particle and the individual optimal position of each particle; A22. Obtain the state deviation corresponding to the new position of each particle respectively, wherein the state deviation corresponding to the new position of each particle is the deviation between the flight state data and the expected data at several moments after the PID parameter adjustment and PID control of the rotorcraft based on the parameter group corresponding to each path in the simulated flight environment; A23. Generate a new fitness of each particle according to the state deviation corresponding to the new position of each particle, and update the individual best position and historical best position of each particle according to the new fitness of each particle.
[0038] Specifically, the current position of each particle refers to the position of each particle at the current moment.
[0039] More specifically, the historical position of a particle includes all positions that the particle has had since the particle was generated.
[0040] More specifically, the position of each particle is different after the position update, so the parameter groups corresponding to the position of each particle before and after the position update are also different.
[0041] More specifically, the first preset condition may be that the position of each particle has been updated for a preset number of times, or the global best position remains unchanged after the preset number of position updates, or the difference between the new and old global best positions after the new global best position is obtained is less than a preset threshold, or other conditions. More specifically, in the process of position update, when the fitness corresponding to the new position of the particle is higher than the fitness corresponding to the individual best position of the particle, the new position of the particle will be used as the new individual best position to participate in the generation of the new position of each particle in the next position update, and when there is a particle whose new position corresponds to a fitness higher than the fitness corresponding to the global best position, the new position of the particle will be used as the new global best position to participate in the generation of the new position of each particle in the next position update. Therefore, the present application can realize the update of the individual best position and the global best position of each particle based on the fitness of the particle, and continuously generate the new position of each particle with a higher corresponding fitness.
[0042] More specifically, since the fitness of each particle is generated according to its corresponding state deviation, and the present application can continuously generate new positions of each particle with higher corresponding fitness, the present application can continuously generate parameter groups with smaller corresponding state deviations, so that after generating alternative parameter groups based on the particle swarm optimization algorithm, the PID control based on the alternative parameter groups can be made more precise.
[0043] Preferably, the process of generating a new position of each particle according to the global optimal position, the current position of each particle and the individual optimal position of each particle is performed based on a position update formula and a velocity update formula; The position update formula is: (2) Where m is the ordinal number of the particle, t is the time, is the position of the mth particle at the next moment, is the position of the mth particle at the current moment, is the velocity of the mth particle at the next moment; The speed update formula is: (3) in is the velocity of the mth particle at the current moment, is the inertia weight, is the individual optimal position of the mth particle, is the global best position, and are the learning factors corresponding to the individual best position and the global best position, respectively. and are all random numbers in the interval [0,1].
[0044] Specifically, Corresponding to the “current position of each particle” in the above text, Corresponding to the “new position of each particle” mentioned above.
[0045] In this embodiment, the present application generates a new position of each particle according to the global optimal position and the individual optimal position of each particle based on the position update formula and the speed update formula, so that each particle can approach the individual optimal position of each particle and the global optimal position.
[0046] In some preferred embodiments, the process of generating the fitness of each particle according to the state deviation is based on a fitness function, and the fitness function is: (4) Among them, F1 is the fitness of each particle, i is the ordinal number of the moment, n is the total number of moments, t is the moment, e i (t) is the state deviation at the i-th moment, k1 is the weight factor of F1 and is a positive value.
[0047] Specifically, is the sum of the absolute values of the state deviations within n moments; It is the sum of the absolute values of the differential components of the state deviations within n moments, which characterizes the speed at which the state deviations within n moments change with time, and reflects the dynamic characteristics of the state deviations within the time period composed of n moments; and from the fitness function, it can be seen that the fitness of each particle is negatively correlated with the sum of the absolute values of the state deviations within n moments and the sum of the absolute values of the differential components of the state deviations within n moments, and the present application can continuously generate new positions of particles with higher corresponding fitness. Therefore, the present application can realize the continuous generation of parameter groups with smaller corresponding state deviations and slower corresponding state deviation changes, so that after generating an alternative parameter group based on the particle swarm optimization algorithm, the PID control based on the alternative parameter group can be more accurate.
[0048] In addition, the present application only needs to set k1 to an appropriate value to set the degree of correlation between the fitness and the speed at which the state deviation changes with time within n moments, thereby controlling the degree of importance attached to the speed of change of the state deviation corresponding to each particle position.
[0049] In this embodiment, the rotor UAV parameter adjustment method of the present application can realize the continuous generation of parameter groups with smaller corresponding state deviations and slower corresponding state deviation change speeds, so that after the alternative parameter groups are generated based on the particle swarm optimization algorithm, the PID control based on the alternative parameter groups can be more precise. In addition, the present application only needs to set k1 to an appropriate value to set the degree of correlation between the fitness and the speed at which the state deviation changes with time within n moments, thereby controlling the degree of importance attached to the state deviation change speed corresponding to each particle position.
[0050] In some preferred embodiments, the process of generating the candidate parameter set according to the flight status data based on the ant colony optimization algorithm includes: B1. Randomly generate multiple paths, and let each path correspond to a parameter group; B2. Obtain the state deviation corresponding to each path respectively, and generate the fitness of each path according to the state deviation corresponding to each path, wherein the state deviation corresponding to each path is the deviation between the flight state data at several moments and the expected data after the PID parameter adjustment and PID control of the rotorcraft based on the parameter group corresponding to each path in the simulated flight environment; B3. Perform ant colony routing until the final optimal path is obtained, and the parameter group corresponding to the final optimal path is used as the candidate parameter group. The final optimal path is the path selected by the largest number of ants when the second preset condition is met; The process of ant colony path selection includes: B31. Randomly generate multiple ants that can choose different paths, and generate the current round of pheromones for each path based on the fitness of each path and the pheromone of the previous round of each path. When the pheromone of the current round of each path is generated for the first time, the pheromone of the previous round of each path is set to 0; B32. Generate the path selection probability of each ant for each path based on the pheromone of the current round of each path; B33. Let each ant choose a path based on its own probability of choosing each path.
[0051] Specifically, the pheromone of each path in the previous round refers to the pheromone of each path in the previous round of ant colony routing process, and the pheromone of each path in the current round refers to the pheromone of each path in the current round of ant colony routing process.
[0052] More specifically, the ant colony path selection process is a process in which each ant selects a path from the paths available to it.
[0053] More specifically, since each ant has a different path to choose from, different ants have different probabilities of choosing the same path.
[0054] More specifically, the step of "randomly generating multiple ants that can choose different paths" and the step of "generating the current round pheromone of each path according to the fitness of each path and the pheromone of the previous round of each path" can be executed in any order or simultaneously.
[0055] More specifically, the second preset condition may be that ant colony routing has been performed for a preset number of times, or that the path with the highest routing probability remains unchanged after a preset number of ant colony routing, or that after generating new routing probabilities for each path, the difference between the new and old routing probabilities of the path with the highest routing probability is less than a preset threshold, or other conditions.
[0056] More specifically, in the ant colony routing process, since the routing probability of each ant for each path is generated based on the pheromone of each path, and the generation basis of the pheromone of each path in the current round includes the fitness of each path, the present application can make the path with higher fitness more likely to be selected in the ant colony routing process, so as to facilitate finding the path with the highest fitness among all paths; and since the fitness of each path is generated according to its corresponding state deviation, in this embodiment, the present application can accurately determine the path with the smallest corresponding state deviation based on the repeated ant colony routing process, so that after the alternative parameter group is generated based on the ant colony optimization algorithm, the PID control based on the alternative parameter group can be more precise.
[0057] In addition, the basis for generating the pheromones of the current round of each path also includes the pheromones of the previous round of each path. Therefore, the present application can make the probability of selecting a path with higher fitness higher and higher in the process of multiple rounds of ant colony routing, thereby accurately determining the path with the smallest corresponding state deviation based on multiple rounds of ant colony routing process.
[0058] In this embodiment, the rotor UAV parameter adjustment method of the present application can accurately determine the path with the smallest corresponding state deviation among each path, so that after generating an alternative parameter group based on the ant colony optimization algorithm, the PID control based on the alternative parameter group can be more precise.
[0059] Preferably, the process of generating the current round of pheromones for each path according to the fitness of each path and the previous round of pheromones for each path is performed based on a pheromone update formula; The pheromone update formula is: , t≥1 (5) Among them, t is the time, p and q are the starting point and the end point respectively. is the pheromone of the path with p and q as the starting point and end point respectively at the previous moment, when t = 1 is 0; is the volatilization rate of pheromone, is the pheromone of the path with p and q as the starting point and end point respectively at the current moment, is the pheromone increment of the path with p and q as the starting point and end point respectively, and it is positively correlated with the fitness of the path.
[0060] Specifically, Corresponding to the pheromone of the previous round of each path, Corresponding to the current round of pheromones of each path, in this embodiment, a round of ant colony routing is performed every time a moment passes.
[0061] In this embodiment, the present application generates pheromones for each path according to the fitness of each path based on the pheromone update formula, which can increase the pheromone value of the path with higher fitness during the ant colony routing process, so that each ant in the next round of ant colony routing process is more likely to choose a path with higher fitness than each ant in the current round of ant colony routing process; and the present application sets the pheromone volatilization rate, which can control the increase speed of the pheromone value of the path with higher fitness during the ant colony routing process, thereby encouraging ants to choose other paths and avoiding the premature end of the ant colony optimization process.
[0062] Preferably, the process of generating the path selection probability of each ant for each path according to the pheromone of the current round of each path is performed based on the path selection probability formula; The formula for path selection probability is: ,q∈allowk (6) Among them, p and q are the starting point and the end point respectively, k is the ordinal number of the ant, y is the end point that the k-th ant can choose, t is the time, and allowk is the set of end points that the k-th ant can choose. is the probability of the kth ant choosing a path with p and q as the starting and ending points respectively, (t) is the pheromone of the path with p and q as the starting point and end point respectively at the current moment, (t) is the heuristic information of the path with p and q as the starting point and end point respectively at the current moment (such as the inverse length of the path), is the pheromone of the path with p and y as the starting point and end point respectively at the current moment, is the heuristic information of the path with p and y as the starting point and end point at the current moment (such as the inverse length of the path), and are parameters that adjust the pheromone importance of the path and the heuristic information importance of the path, respectively.
[0063] In some preferred implementations, the process of generating the fitness of each path according to the state deviation corresponding to each path is performed based on a fitness function, and the fitness function is: (7) Among them, F2 is the fitness of each path, i is the ordinal number of the moment, n is the total number of moments, t is the moment, e i (t) is the state deviation at the i-th moment, k2 is the weight factor of F2 and is a positive value.
[0064] Specifically, is the sum of the absolute values of the state deviations within n moments; It is the sum of the absolute values of the differential components of the state deviation within n moments, which characterizes the speed at which the state deviation within n moments changes with time, and reflects the dynamic characteristics of the state deviation within the time period composed of n moments; and from the fitness function, it can be seen that the fitness of each path is negatively correlated with the sum of the absolute values of the state deviation within n moments and the sum of the absolute values of the differential components of the state deviation within n moments, and the present application can find the path with the highest fitness among all paths. Therefore, the present application can gradually determine the path with a smaller corresponding state deviation and a slower corresponding state deviation change speed in each path, so that after generating an alternative parameter group based on the ant colony optimization algorithm, the PID control based on the alternative parameter group can be more accurate.
[0065] In addition, the present application only needs to set k2 to an appropriate value to set the correlation between the fitness and the speed at which the state deviation changes with time within n moments, thereby controlling the degree of emphasis on the speed of change of the state deviation corresponding to each path.
[0066] In this embodiment, the rotor UAV parameter adjustment method of the present application can gradually determine the paths in each path with smaller corresponding state deviations and slower corresponding state deviation changes, so that after the alternative parameter group is generated based on the ant colony optimization algorithm, the PID control based on the alternative parameter group can be more precise. In addition, the present application only needs to set k2 to an appropriate value to set the degree of correlation between the fitness and the speed at which the state deviation changes with time within n moments, thereby controlling the degree of importance attached to the speed of change of the state deviation corresponding to each path.
[0067] In some preferred embodiments, step S1 comprises: S11. Collect flight status data and environmental data of the rotorcraft drone; The process of generating candidate parameter groups based on flight status data based on deep learning algorithms includes: C1. Generate alternative parameter groups based on flight status data and environmental data based on a pre-trained neural network model.
[0068] Specifically, the environmental data is data that can characterize the environmental information surrounding the rotary-wing drone.
[0069] In this embodiment, the rotor UAV parameter adjustment method of the present application generates alternative parameter groups based on the flight status data and environmental data based on the neural network model, which enables the PID control system to better cope with complex environments and better perform complex flight missions.
[0070] Second, as Figure 2 As shown, the present application provides a rotor UAV parameter adjustment device for performing PID parameter adjustment on a rotor UAV, comprising: Data acquisition module 1, used to collect flight status data of the rotorcraft drone; The alternative generation module 2 is used to generate corresponding alternative parameter groups according to the flight status data based on multiple parameter optimization algorithms; The performance evaluation module 3 is used to evaluate each candidate parameter group based on a performance evaluation formula to obtain an evaluation score for each candidate parameter group. The performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB (1) Among them, S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, ω1, ω2, ω3, ω4 and ω5 are the weights of MSE, OS, ST, EE and RB respectively; The parameter adjustment module 4 is used to adjust the PID parameters of the rotor UAV according to the candidate parameter group with the highest evaluation score.
[0071] The parameter adjustment device for a rotary-wing UAV in the present application generates multiple sets of alternative parameter groups based on multiple parameter optimization algorithms, and selects the best ones for PID parameter adjustment. The PID control system after PID parameter adjustment can have excellent comprehensive performance in terms of efficiency, energy efficiency and robustness, and can accurately adjust the PID parameters, thereby realizing precise PID control of the rotary-wing UAV; and the present application only needs to set ω1, ω2, ω3, ω4 and ω5 to appropriate values to unify the numerical magnitudes of the five evaluation indicators, prevent the weight differences between the five evaluation indicators from being too large, and can configure the required weights for the five evaluation indicators, thereby improving the performance of the PID control system corresponding to the evaluation indicators with larger weights.
[0072] Thirdly, Figure 3As shown, the present application provides an electronic device, including a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not shown). The memory 302 stores a computer program executable by the processor 301. When the electronic device is running, the processor 301 executes the computer program to execute the method in any optional implementation of the above embodiment to achieve the following functions: collect flight status data of the rotorcraft; generate corresponding candidate parameter groups according to the flight status data based on multiple parameter optimization algorithms; and optimize the flight status data based on the performance evaluation formula. Each alternative parameter group is evaluated to obtain the evaluation score of each alternative parameter group. The performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB; where S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, ω1, ω2, ω3, ω4 and ω5 are the weights of MSE, OS, ST, EE and RB, respectively; PID parameters of the rotorcraft are adjusted according to the alternative parameter group with the highest evaluation score.
[0073] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method in any optional implementation manner of the above embodiment is executed to achieve the following functions: collecting flight status data of the rotorcraft UAV; generating corresponding alternative parameter groups according to the flight status data based on multiple parameter optimization algorithms; evaluating each alternative parameter group based on a performance evaluation formula to obtain an evaluation score for each alternative parameter group, and the performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB; wherein S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are respectively the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, and ω1, ω2, ω3, ω4 and ω5 are respectively the weights of MSE, OS, ST, EE and RB; performing PID parameter adjustment on the rotorcraft UAV according to the alternative parameter group with the highest evaluation score. Among them, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0074] In summary, the present application provides a method, device and related equipment for adjusting parameters of a rotary-wing UAV, wherein the method for adjusting parameters of a rotary-wing UAV provided by the present application generates multiple groups of alternative parameter groups based on multiple parameter optimization algorithms, and selects the best ones for PID parameter adjustment, which can make the PID control system after PID parameter adjustment have excellent comprehensive performance in terms of efficiency, energy efficiency and robustness, and can accurately adjust the PID parameters, thereby realizing precise PID control of the rotary-wing UAV; and the present application only needs to set ω1, ω2, ω3, ω4 and ω5 to appropriate values to unify the numerical magnitudes of the five evaluation indicators, prevent the weight differences between the five evaluation indicators from being too large, and can configure the required weights for the five evaluation indicators, thereby improving the performance of the PID control system corresponding to the evaluation indicators with larger weights.
[0075] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0076] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0077] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0078] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0079] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A parameter adjustment method for a rotary-wing UAV, used for performing PID parameter adjustment on a rotary-wing UAV, characterized in that: The following steps are involved: S1. Collect flight status data of the rotary-wing UAV; S2. Generate corresponding candidate parameter groups based on the flight status data based on multiple parameter optimization algorithms; S3. Evaluate each candidate parameter group based on a performance evaluation formula to obtain an evaluation score for each candidate parameter group. The performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB; Among them, S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, ω1, ω2, ω3, ω4 and ω5 are the weights of MSE, OS, ST, EE and RB respectively; S4. PID parameters of the rotorcraft UAV are adjusted according to the candidate parameter group with the highest evaluation score.
2. The parameter adjustment method for a rotary wing UAV according to claim 1, characterized in that: The multiple parameter optimization algorithms include deep learning algorithm, particle swarm optimization algorithm and ant colony optimization algorithm.
3. The parameter adjustment method for a rotary wing UAV according to claim 2, characterized in that: The process of generating an alternative parameter group according to the flight status data based on the particle swarm optimization algorithm includes: A1. randomly generate multiple particles in a preset space, and make the position of each particle in the preset space correspond to a parameter group, obtain the state deviation, and generate the fitness of each particle according to the state deviation, wherein the state deviation is the deviation between the flight state data and the expected data; A2. updating the position of each particle in a preset space according to the global best position, the current position of each particle and the individual best position of each particle until a final best position is generated, and taking the parameter group corresponding to the final best position as the candidate parameter group, wherein the global best position is the one with the highest corresponding fitness among the historical positions of all particles, the individual best position of each particle is the one with the highest corresponding fitness among the historical positions of each particle, and the final best position is the global best position when the first preset condition is met; The location update process includes: A21. Generate a new position of each particle in a preset space according to the global optimal position, the current position of each particle and the individual optimal position of each particle; A22. Obtain the state deviation corresponding to the new position of each particle respectively, wherein the state deviation corresponding to the new position of each particle is the deviation between the flight state data and the expected data at several moments after the PID parameter adjustment and PID control of the rotorcraft based on the parameter group corresponding to each path in the simulated flight environment; A23. Generate a new fitness of each particle according to the state deviation corresponding to the new position of each particle, and update the individual best position and historical best position of each particle according to the new fitness of each particle.
4. The parameter adjustment method for a rotary wing UAV according to claim 3, characterized in that: The process of generating the fitness of each particle according to the state deviation is performed based on the fitness function, and the fitness function is: ; Among them, F1 is the fitness of each particle, i is the ordinal number of the moment, n is the total number of moments, t is the moment, e i (t) is the state deviation at the i-th moment, k1 is the weight factor of F1 and is a positive value.
5. The parameter adjustment method for a rotary wing UAV according to claim 2, characterized in that: The process of generating an alternative parameter group according to the flight status data based on the ant colony optimization algorithm includes: B1. Randomly generate multiple paths, and let each path correspond to a parameter group; B2. Obtain the state deviation corresponding to each path respectively, and generate the fitness of each path according to the state deviation corresponding to each path, wherein the state deviation corresponding to each path is the deviation between the flight state data at several moments and the expected data after the PID parameter adjustment and PID control of the rotorcraft based on the parameter group corresponding to each path in the simulated flight environment; B3. Perform ant colony routing until the final optimal path is obtained, and the parameter group corresponding to the final optimal path is used as the candidate parameter group. The final optimal path is the path selected by the largest number of ants when the second preset condition is met; The process of ant colony routing includes: B31. Randomly generate multiple ants that can choose different paths, and generate the current round of pheromones for each path based on the fitness of each path and the pheromone of the previous round of each path. When the pheromone of the current round of each path is generated for the first time, the pheromone of the previous round of each path is set to 0; B32. Generate the path selection probability of each ant for each path based on the pheromone of the current round of each path; B33. Let each ant choose a path based on its own probability of choosing each path.
6. The parameter adjustment method for a rotary wing UAV according to claim 5, characterized in that: The process of generating the fitness of each path according to the state deviation corresponding to each path is performed based on the fitness function, and the fitness function is: ; Among them, F2 is the fitness of each path, i is the ordinal number of the moment, n is the total number of moments, t is the moment, e i (t) is the state deviation at the i-th moment, k2 is the weight factor of F2 and is a positive value.
7. The parameter adjustment method for a rotary wing UAV according to claim 2, characterized in that: Step S1 includes: S11. Collect flight status data and environmental data of the rotorcraft drone; The process of generating an alternative parameter group according to the flight status data based on a deep learning algorithm includes: C1. Generate an alternative parameter group based on the flight status data and the environmental data based on a pre-trained neural network model.
8. A parameter adjustment device for a rotary-wing UAV, used for performing PID parameter adjustment on a rotary-wing UAV, characterized in that: include: A data acquisition module is used to collect flight status data of the rotary-wing UAV; An alternative generation module, used to generate corresponding alternative parameter groups according to the flight status data based on a plurality of parameter optimization algorithms; The performance evaluation module is used to evaluate each candidate parameter group based on a performance evaluation formula to obtain an evaluation score for each candidate parameter group. The performance evaluation formula is: S=ω1 / (1+MSE)+ω2 / (1+OS)+ω3 / (1+ST)+ω4*EE+ω5*RB; Among them, S is the evaluation score of the corresponding parameter group, MSE, OS, ST, EE and RB are the mean square error, overshoot, stabilization time, energy efficiency and robustness scores under the control of the corresponding alternative parameter group, ω1, ω2, ω3, ω4 and ω5 are the weights of MSE, OS, ST, EE and RB respectively; The parameter adjustment module is used to adjust the PID parameters of the rotary wing UAV according to the candidate parameter group with the highest evaluation score.
9. An electronic device, characterized in that: The invention comprises a processor (301) and a memory (302), wherein the memory (302) stores a computer program executable by the processor (301), and when the processor (301) executes the computer program, the steps in any one of the methods according to claims 1 to 7 are performed.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor (301), the steps of the method according to any one of claims 1 to 7 are performed.
Citation Information
Patent Citations
Fixed-wing unmanned aerial vehicle PID parameter control method based on ant colony algorithm
CN106886148A
Algorithm selection method and device and electronic equipment
CN112766402A
PID parameter setting dynamic multi-objective optimization method for attitude control of unmanned system
CN116774573A
Coupled forest soil attribute mapping method
CN118094170A
Unmanned aerial vehicle control method and system
CN118534932A
