PID system parameter setting method based on enhanced whale optimization algorithm

By introducing the enhanced whale optimization algorithm that introduces multiple random cross -crossing mutation mechanisms in the PID parameter setting, it solves the problem of effective exploration of search space in the existing technology, and achieves more efficient and accurate PID system parameters.

CN119376231AActive Publication Date: 2025-01-28HUBEI UNIV OF TECH +1

Patent Information

Application Number
CN202411403348.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-28
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

In the process of setting PID parameters, the obtained results are not the global optimal solution due to the limitation of the effective exploration of the search space.

Method used

The PID system parameter setting method based on the enhanced whale optimization algorithm is adopted, and the random cross -mutation mechanism is introduced to increase the randomness and scope of the mutation process, thereby enhancing the diversity of sub -generation individuals and the overall ability of the algorithm.

Benefits of technology

The improved whale optimization algorithm is more suitable for the setting problem of complex PID system parameters. It effectively solves the problem that the result is not the optimal solution of the overall situation, and improves the efficiency and accuracy of the setting process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376231A_ABST
    Figure CN119376231A_ABST
Patent Text Reader

Abstract

The invention relates to a PID (Proportion Integration Differentiation) system parameter setting method based on an enhanced whale optimization algorithm, and belongs to the technical field of PID setting. The PID system parameter setting method comprises the following steps: initializing parameters of the whale optimization algorithm, setting the maximum number of iterations, and setting the maximum number of iterations; pID system parameters including proportional gains, integral time constants and differential time constants serve as whale individuals, a plurality of initial values are randomly generated, and an initial whale population is formed; iteratively updating global optimal individuals in the initial whale population, and introducing a multi-random number transverse crossover variation mechanism into new individuals generated after updating, the new individuals representing PID system parameters after numerical value updating; and when a preset iteration stop condition is reached, outputting a new individual after updating variation, and finishing setting. According to the method, the problem that an obtained result is not a globally optimal solution due to the fact that effective exploration of a search space is limited in the prior art is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of PID tuning, and in particular to a PID system parameter tuning method based on an enhanced whale optimization algorithm. Background Art

[0002] PID parameter tuning is a complex process, which generally needs to be carried out slowly according to the object being controlled. The commonly used methods are the expanded critical proportionality tuning method and the expanded response curve method.

[0003] With the development of technology, the Whale Optimization Algorithm (WOA) has been widely used in the process of PID parameter tuning. However, in the mutation process of the traditional Whale Optimization Algorithm, the mutated offspring individuals are usually generated by a simple linear combination of the parent individuals, which may limit the effective exploration of the search space, especially when dealing with high-dimensional, nonlinear problems or problems with multiple local optimal solutions. Summary of the invention

[0004] In view of this, it is necessary to provide a PID system parameter tuning method based on the enhanced whale optimization algorithm to solve the problem that the results obtained in the prior art are not the global optimal solution due to the limited effective exploration of the search space.

[0005] In order to solve the above problems, the present invention provides a PID system parameter tuning method based on an enhanced whale optimization algorithm, comprising: Initialize the parameters of the whale optimization algorithm, set the maximum number of iterations, use the PID system parameters including proportional gain, integral time constant and differential time constant as whale individuals and randomly generate several initial values ​​to form an initial whale population; The global optimal individuals in the initial whale population are iteratively updated, and a multi-random number horizontal crossover mutation mechanism is introduced into the new individuals generated after the update, where the new individuals represent the PID system parameters after the numerical update; When the preset iteration stop condition is reached, the new individual after update and mutation is output to complete the tuning.

[0006] In a possible implementation, the iterative updating of the global optimal individual in the initial value includes: A stage selection parameter is randomly generated, and a next stage of the algorithm is determined according to the stage selection parameter.

[0007] In a possible implementation, the generation phase selection parameters include: a random number p and the coefficient vector A ; Determining the next stage of the algorithm according to the stage selection parameters includes: when When , it is determined that the algorithm enters the spiral attack stage; when and When , the algorithm is determined to enter the random search phase; when and When , it is determined that the algorithm enters the stage of surrounding the prey.

[0008] In a possible implementation, in the prey encirclement stage, the global optimal individual in the initial value is updated based on the following formula:

[0009] In the formula, t Indicates the number of iterations; A and C is the coefficient vector; is the position vector of the current optimal individual; is the current position vector of the remaining whales; Represents the position vector of the optimal individual after update.

[0010] In a possible implementation, during the spiral attack phase, the global optimal individual in the initial value is updated based on the following formula:

[0011] In the formula, Indicates the position between the whale and its prey, b is a constant that defines the shape of the helix. l is a random number in (-1,1).

[0012] In a possible implementation, in the random search phase, the global optimal individual in the initial value is updated based on the following formula:

[0013] In the formula, Represents the position of a random individual whale.

[0014] In a possible implementation, the introduction of a multi-random number horizontal crossover mutation mechanism to the new individuals generated after the update includes: A multi-random number horizontal crossover mutation mechanism is introduced for the new individuals generated in the prey encirclement stage of the whale algorithm.

[0015] In a possible implementation, the introduction of a multi-random number horizontal crossover mutation mechanism to the new individuals generated in the prey encirclement phase of the whale algorithm includes: Mutate the new individuals generated in the prey encirclement phase of the whale algorithm based on the mutation formula; Wherein, the variation formula includes:

[0016] In the formula, r 1 , c 1 is a random number in [0,1], , , For new individuals A i PID parameters, , , For new individuals A n PID parameters, , , The new individual after mutation A i+1 PID parameters, where Represents the proportional gain in PID parameters, represents the integration time constant, Represents the differential time constant.

[0017] In one possible implementation, r 1 , c 1 Used to calculate the proportional gain , integration time constant and the differential time constant The values ​​in the formula are independent of each other.

[0018] In a possible implementation, the preset iteration stop condition includes: The number of iterations of the whale algorithm reaches the maximum number of iterations set.

[0019] The beneficial effects of the present invention are as follows: the present invention provides a PID system parameter tuning method based on an enhanced whale optimization algorithm, applies the whale optimization algorithm to the parameter tuning process of the PID system, and introduces a multi-random number horizontal crossover mutation method into the whale optimization algorithm. Since the multi-random number horizontal crossover mutation method can increase the randomness and range in the mutation process, by increasing the number of random factors in the mutation process, the diversity of offspring individuals and the overall optimization ability of the algorithm are enhanced, making the improved whale optimization algorithm more suitable for the problem of complex PID system parameter tuning, thereby effectively solving the problem in the prior art that the results obtained are not the global optimal solution due to the limited effective exploration of the search space. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A method flow chart of an embodiment of a PID system parameter tuning method based on an enhanced whale optimization algorithm provided by the present invention; Figure 2 for Figure 1 Flow chart of the method for step S101 in FIG. DETAILED DESCRIPTION

[0021] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0022] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0023] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0024] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments. In order to solve the above problems, Figure 1 As shown, the present invention provides a PID system parameter tuning method based on an enhanced whale optimization algorithm, comprising: S101, initializing the parameters of the whale optimization algorithm, setting the maximum number of iterations, taking the PID system parameters including proportional gain, integral time constant and differential time constant as whale individuals and randomly generating several initial values ​​to form an initial whale population; S102, iteratively update the global optimal individuals in the initial whale population, and introduce a multi-random number horizontal crossover mutation mechanism to the new individuals generated after the update; Among them, the new individual represents the PID system parameters after the numerical update; S103. When the preset iteration stop condition is reached, the new individual after the update mutation is output to complete the tuning.

[0025] It should be noted that after each iteration, the fitness of the new individual is compared with the global optimal individual in the initial value, and the individual with better performance will be selected into the next generation population.

[0026] In a possible implementation, the preset iteration stop condition includes: the number of iterations of the whale algorithm reaches a set maximum number of iterations.

[0027] Compared with the prior art, the present invention provides a PID system parameter tuning method based on an enhanced whale optimization algorithm, which applies the whale optimization algorithm to the parameter tuning process of the PID system, and introduces a multi-random number horizontal crossover mutation method into the whale optimization algorithm. Since the multi-random number horizontal crossover mutation method can increase the randomness and range of the mutation process, by increasing the number of random factors in the mutation process, the diversity of offspring individuals and the overall optimization ability of the algorithm are enhanced, making the improved whale optimization algorithm more suitable for the tuning problem of complex PID system parameters, thereby effectively solving the problem of the prior art that the algorithm is inefficient in local search and is prone to falling into local optimality due to the lack of an effective control mechanism.

[0028] like Figure 2 In a possible implementation, step S102 includes: S201. Randomly generate stage selection parameters, and determine the next stage of the algorithm according to the stage selection parameters.

[0029] Furthermore, the generation phase selection parameters include: random number p and the coefficient vector A .

[0030] Step S201 includes: Based on randomly generated random numbers p and the coefficient vector A Determine that the algorithm enters the attack phase for updating the optimal individual, including: when When , it is determined that the algorithm enters the spiral attack stage; when and When , the algorithm is determined to enter the random search phase; when and When , it is determined that the algorithm enters the stage of surrounding the prey.

[0031] In a possible implementation, in the stage of surrounding the prey, the global optimal individual in the initial value is updated based on the following formula: (1) In formula (1), tIndicates the number of iterations; A and C is the coefficient vector; is the position vector of the current optimal individual; is the current position vector of the remaining whales; Represents the position vector of the optimal individual after update.

[0032] In a possible implementation, in the spiral attack phase, the global optimal individual in the initial value is updated based on the following formula: (2) In formula (2), Indicates the position between the whale and its prey, b is a constant that defines the shape of the helix. l is a random number in (-1,1).

[0033] In a possible implementation, during the random search phase, the global optimal individual in the initial value is updated based on the following formula: (3) In formula (3), Represents the position of a random individual whale.

[0034] In a possible implementation, step S102 further includes: S202. Introduce a multi-random number horizontal crossover mutation mechanism for the new individuals generated in the prey encirclement stage of the whale algorithm.

[0035] In a possible implementation, step S202 includes: Mutate the new individuals generated in the prey encirclement phase of the whale algorithm based on the mutation formula; The mutation formula includes: (4) In formula (4), r 1 , c 1 is a random number in [0,1], , , For new individuals A i PID parameters, , , For new individuals A n PID parameters, , , The new individual after mutation Ai+1 PID parameters, where Represents the proportional gain in PID parameters, represents the integration time constant, Represents the differential time constant.

[0036] Specifically, after the WOA whale algorithm completes the generation of a generation of individuals, the following procedure is introduced, and the next round of iteration is carried out after the following procedure is completed: (1) Initiate the mutation program of offspring individuals % Add arithmetic crossover for cross_idx = 1:floor(SearchAgents_no / 2) % Cross half of the individuals % Randomly select two different individuals idx1 = randi(SearchAgents_no); idx2 = idx1; while idx2 == idx1 idx2 = randi(SearchAgents_no); end % Calculate the fitness of two individuals separately fitness1 = Obj_PID_IAE(Positions(idx1,:)); fitness2 = Obj_PID_IAE(Positions(idx2,:)); (2) Generate random numbers to facilitate individual variation in offspring % Calculate the new offspring individuals a1=rand(); c1=2*rand-1; a2=rand(); c2=2*rand-1; a3=rand(); c3=2*rand-1; (3) Use the formula to generate new offspring individuals K p , K i , K d value avg_Kp=a1*(Positions(idx1,1))+(1-a1)*(Positions(idx2,1))+c1*(Positions(idx1,1)-Positions(idx2,1)); avg_Ki=a2*(Positions(idx1,2))+(1-a2)*(Positions(idx2,2))+c2*(Positions(idx1,2)-Positions(idx2,2)); avg_Kd=a3*(Positions(idx1,3))+(1-a3)*(Positions(idx2,3))+c3*(Positions(idx1,3)-Positions(idx2,3)); % Create a new individual new_individual = [avg_Kp, avg_Ki, avg_Kd]; % Ensure that the parameters of the new individual are within the limits new_individual = max(min(new_individual, ub), lb); % Evaluate the fitness of new individuals new_fitness = Obj_PID_IAE(new_individual); (5) Perform offspring replacement % If the fitness of the new individual is better than that of one of the parent individuals, replace if new_fitness <fitness1% Change '<' to '> ' for maximization problems Positions(idx1,:) = new_individual; elseif new_fitness <fitness2% Change '<' to '> ' for maximization problems Positions(idx2,:) = new_individual; end end In one possible implementation, r 1 , c 1Used to calculate the proportional gain , integration time constant and the differential time constant The values ​​in the formula are independent of each other.

[0037] It should be noted that in the present invention, the mutation mechanisms used include: Introduction of multiple random numbers: For each PID controller parameter (proportional gain K p , integration time constant K i , differential time constant K d ), generate two independent sets of random numbers r 1 and c 1 , a total of six random numbers are used to increase the randomness and range of mutation. By introducing more random numbers, the mutation range of offspring individuals is significantly increased, which helps to avoid the algorithm from converging to the local optimal solution too early.

[0038] Horizontal crossover mutation: Mutation is no longer a simple linear combination between two individuals, but a horizontal crossover method is adopted, that is, for each parameter, different random numbers are used for independent mutation, which enhances the mutation ability of the offspring individuals. In addition, the horizontal crossover mutation method also helps the algorithm to perform a more detailed search when approaching the optimal solution area, accelerating the local optimization process.

[0039] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer medium, wherein the computer medium is a disk, an optical disk, a read-only storage memory, or a random access storage memory, etc.

[0040] The PID system parameter tuning method based on the enhanced whale optimization algorithm provided by the present invention is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A PID system parameter tuning method based on enhanced whale optimization algorithm, characterized in that: include: Initialize the parameters of the whale optimization algorithm, set the maximum number of iterations, use the PID system parameters including proportional gain, integral time constant and differential time constant as whale individuals and randomly generate several initial values ​​to form an initial whale population; Iteratively update the global optimal individuals in the initial whale population, and introduce a multi-random number horizontal crossover mutation mechanism to the new individuals generated after the update, where the new individuals represent the PID system parameters after the numerical update; When the preset iteration stop condition is reached, the new individual after update and mutation is output to complete the tuning.

2. The PID system parameter tuning method according to claim 1, characterized in that: The iterative updating of the global optimal individual in the initial value includes: A stage selection parameter is randomly generated, and a next stage of the algorithm is determined according to the stage selection parameter.

3. The PID system parameter tuning method according to claim 2, characterized in that: The generation phase selection parameters include: random number p and the coefficient vector A ; Determining the next stage of the algorithm according to the stage selection parameters includes: when When , it is determined that the algorithm enters the spiral attack stage; when and When , the algorithm is determined to enter the random search phase; when and When , it is determined that the algorithm enters the stage of surrounding the prey.

4. The PID system parameter tuning method according to claim 3, characterized in that: In the stage of surrounding the prey, the global optimal individual in the initial value is updated based on the following formula: In the formula, t Indicates the number of iterations; A and C is the coefficient vector; is the position vector of the current optimal individual; is the current position vector of the remaining whales; Represents the position vector of the optimal individual after update.

5. The PID system parameter tuning method according to claim 3, characterized in that: In the spiral attack phase, the global optimal individual in the initial value is updated based on the following formula: In the formula, Indicates the position between the whale and its prey, b is a constant that defines the shape of the helix. l is a random number in (-1,1).

6. The PID system parameter tuning method according to claim 3, characterized in that: In the random search phase, the global optimal individual in the initial value is updated based on the following formula: In the formula, Represents the position of a random individual whale.

7. The PID system parameter tuning method according to claim 4, characterized in that: The method of introducing a multi-random number horizontal crossover mutation mechanism to the new individuals generated after the update includes: A multi-random number horizontal crossover mutation mechanism is introduced for the new individuals generated in the prey encirclement stage of the whale algorithm.

8. The PID system parameter tuning method according to claim 7, characterized in that: The new individuals generated in the prey encirclement phase of the whale algorithm are introduced into a multi-random number horizontal crossover mutation mechanism, including: Mutate the new individuals generated in the prey encirclement phase of the whale algorithm based on the mutation formula; Wherein, the variation formula includes: In the formula, r 1. c 1 is a random number in [0,1], , , For new individuals A i PID parameters, , , For new individuals A n PID parameters, , , The new individual after mutation A i+1 PID parameters, where Represents the proportional gain in PID parameters, represents the integration time constant, Represents the differential time constant.

9. The PID system parameter tuning method according to claim 8, characterized in that: r 1. c 1 is used to calculate the proportional gain , integration time constant and the differential time constant The values ​​in the formula are independent of each other.

10. The PID system parameter tuning method according to claim 1, characterized in that: The preset iteration stop condition includes: The number of iterations of the whale algorithm reaches the maximum number of iterations set.

Citation Information

Patent Citations

  • AGV and machine integrated scheduling method based on discrete whale optimization algorithm

    CN112783172A

  • Resonant frequency tracking control method based on improved whale optimization algorithm

    CN117277351A

  • Fractional order PID parameter setting method for adaptive hybrid strategy whale optimization algorithm

    CN117706911A

  • Driving behavior classifier parameter selection method and device, equipment, medium and program product

    CN118245901A

  • Wind power prediction method and system for optimizing deep transformer network

    US20220197233A1

Cited By

  • Current control parameter optimization method and device based on whale optimization PID algorithm

    CN119846945A