PID system parameter setting method, device, electronic equipment and storage medium

By applying whale optimization algorithm and tangent random parameters in hydrogen fuel cell system to adjust the PID system parameters, the problem that traditional PID controllers are difficult to achieve ideal control effects in complex systems is solved, and more efficient control effects are achieved.

CN119181826BActive Publication Date: 2025-05-09HUBEI UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411675999.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-05-09
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

Traditional PID controllers are difficult to achieve ideal control effects in complex, nonlinear systems, especially in hydrogen fuel cell systems that are highly dynamic and susceptible to external interference.

Method used

The whale optimization algorithm is used to adjust the parameters of the PID system. By initializing the parameters of the whale optimization algorithm, the objective function value of the whale position is calculated, and the tangent random parameters are introduced during the iterative update process to dynamically adjust the control parameters.

Benefits of technology

It realizes that the PID system analyzes the system operation data in a highly dynamic and susceptible to external interference in an environment, dynamically adjusts the control parameters, and adapts to changing working conditions and external environments, thereby improving the control effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119181826B_ABST
    Figure CN119181826B_ABST
Patent Text Reader

Abstract

The present invention relates to a PID system parameter setting method, device, electronic device and storage medium, belonging to the field of PID setting technology, wherein the PID system parameter setting method comprises: initializing the parameters of a whale optimization algorithm, determining the size of a whale population, and randomly generating the position of a whale, wherein the size of the whale population represents the maximum number of iterations, the position of the whale represents the PID system parameter, the PID system uses the error between the target air flow rate and the air flow rate at the current moment as input, and uses the air flow rate supplied to the hydrogen fuel cell by the air supply system as output; calculating the objective function value to obtain the position of the optimal individual; iteratively updating the optimal individual, and introducing a tangent random parameter in the updating process; and outputting the updated position of the optimal individual when the number of iterations reaches the maximum. The present invention effectively solves the problem that it is not suitable for highly dynamic hydrogen fuel cells that are susceptible to external interference due to being limited by fixed mathematical models and empirical formulas.
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 setting, and in particular to a PID system parameter setting method, device, electronic equipment and storage medium. Background Art

[0002] Hydrogen fuel cell technology, as an important pillar of the future clean energy field, is leading the profound transformation of the global energy structure with its high efficiency and environmental protection characteristics. However, to fully tap the potential of hydrogen fuel cells, ensure their long-term stable operation and achieve optimal performance, the optimization and control of the air supply system is particularly critical.

[0003] Faced with the challenges faced by traditional PID controllers in complex and nonlinear systems, that is, relying on fixed mathematical models and empirical formulas for parameter tuning, its control effect is often difficult to achieve ideal conditions. Especially in highly dynamic and easily disturbed systems such as hydrogen fuel cells, the limitations of traditional PID controllers are more prominent. Summary of the invention

[0004] In view of this, it is necessary to provide a PID system parameter tuning method, device, electronic device and storage medium to solve the problem that the prior art is not suitable for highly dynamic and susceptible to external interference hydrogen fuel cells due to being limited by fixed mathematical models and empirical formulas.

[0005] In order to solve the above problems, the present invention provides a PID system parameter tuning method, comprising:

[0006] Initialize the parameters of the whale optimization algorithm, determine the size of the whale population, and randomly generate the position of the whale, wherein the size of the whale population represents the maximum number of iterations, and the position of the whale represents the PID system parameters including the proportional gain, the integral time constant, and the differential time constant, and the PID system uses the error between the target air flow rate and the air flow rate at the current moment as input, and uses the air flow rate supplied to the hydrogen fuel cell by the air supply system as output;

[0007] Calculate the objective function value of the whale's position and obtain the optimal individual position;

[0008] Iteratively update the optimal individual and introduce tangent random parameters in the updating process;

[0009] When the number of iterations reaches the maximum, the updated position of the optimal individual is output to complete the tuning.

[0010] In a possible implementation, the iterative updating of the optimal individual includes:

[0011] Based on randomly generated random numbers p and the coefficient vector ADetermine that the algorithm enters the attack phase for updating the optimal individual;

[0012] The attack phases include: a spiral attack phase, a random search phase, and a prey encirclement phase.

[0013] In a possible implementation, the random number generated randomly p and the coefficient vector A Determine that the algorithm enters the attack phase for updating the optimal individual, including:

[0014] when When , it is determined that the algorithm enters the spiral attack stage;

[0015] when and When , the algorithm is determined to enter the random search phase;

[0016] when and When , it is determined that the algorithm enters the stage of surrounding the prey.

[0017] In a possible implementation, in the prey encirclement stage, the position of the optimal individual is updated based on the first formula;

[0018] In the spiral attack phase, the position of the optimal individual is updated based on the second formula;

[0019] In the random search phase, the position of the optimal individual is updated based on the third formula;

[0020] Among them, the first formula includes:

[0021]

[0022] 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;

[0023] The second formula includes:

[0024]

[0025] 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);

[0026] The third formula includes:

[0027]

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

[0029] In a possible implementation, the step of introducing a tangent random parameter in the updating process includes:

[0030] Introducing tangent random parameters in the whale algorithm's encirclement phase.

[0031] In a possible implementation, the introduction of tangent random parameters in the prey encirclement stage of the whale algorithm includes:

[0032] Introduce tangent random parameters to replace the original convergence factor of the whale algorithm in the prey encirclement stage;

[0033] A new coefficient vector is calculated based on the tangent random parameter A and C ;

[0034] The calculation formula of the tangent random parameter includes:

[0035]

[0036] In the formula, x is a randomly generated variable.

[0037] The present invention also provides a PID system parameter setting device, comprising:

[0038] A parameter setting module, used to initialize the parameters of the whale optimization algorithm, determine the size of the whale population, and randomly generate the position of the whale, wherein the size of the whale population represents the maximum number of iterations, and the position of the whale represents the PID system parameters including the proportional gain, the integral time constant, and the differential time constant, wherein the PID system uses the error between the target air flow rate and the air flow rate at the current moment as input, and uses the air flow rate supplied to the hydrogen fuel cell by the air supply system as output;

[0039] The calculation module is used to calculate the objective function value of the whale's position and obtain the position of the optimal individual;

[0040] The attack strategy module is used to iteratively update the optimal individual and introduce tangent random parameters in the updating process;

[0041] The output module is used to output the updated position of the optimal individual when the number of iterations reaches the maximum to complete the tuning.

[0042] In a possible implementation, the attack strategy module further includes:

[0043] Phase selection parameter calculation module for random numbers based on random generation p and the coefficient vector A Determine that the algorithm enters the attack phase for updating the optimal individual;

[0044] Spiral Attack Module, used when When , it is determined that the algorithm enters the spiral attack stage;

[0045] Random search module, used when and When , the algorithm is determined to enter the random search phase;

[0046] Surrounding prey module, used when and When , it is determined that the algorithm enters the stage of surrounding the prey.

[0047] The present invention also provides an electronic device, comprising:

[0048] Memory, used to store programs;

[0049] A processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the PID system parameter tuning method described in any one of the above method items.

[0050] The present invention also provides a storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps in the PID system parameter tuning method described in any one of the above-mentioned method items.

[0051] The beneficial effects of the present invention are as follows: the present invention provides a PID system parameter tuning method, which applies the whale optimization algorithm to the parameter tuning process of the PID system, and introduces tangent random parameters for the random parameters in the whale optimization algorithm. Since the tangent random parameters are more controllable, the PID system can analyze the system operation data in real time and dynamically adjust the control parameters to adapt to the changing working conditions and external environment, thereby effectively solving the problem that the prior art is not suitable for hydrogen fuel cells that are highly dynamic and susceptible to external interference due to being limited by fixed mathematical models and empirical formulas. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A method flow chart of an embodiment of a PID system parameter tuning method provided by the present invention;

[0053] Figure 2 A schematic diagram of the structure of an embodiment of a PID system parameter tuning device provided by the present invention;

[0054] Figure 3 A schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The preferred embodiments of the present invention are 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.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] In order to solve the above problems, Figure 1 As shown, the present invention provides a PID system parameter tuning method, comprising:

[0060] S101, initializing the parameters of the whale optimization algorithm, determining the size of the whale population, and randomly generating the positions of the whales;

[0061] It should be noted that in the whale optimization algorithm, the size of the whale population represents the maximum number of iterations of the algorithm, and the position of the whale represents the solution of the algorithm, that is, the PID system parameters including the proportional gain, integral time constant, and differential time constant in this embodiment;

[0062] It should also be noted that the PID system in this embodiment uses the error between the target air flow and the current air flow as input, and uses the air flow supplied to the hydrogen fuel cell by the air supply system as output.

[0063] S102, calculating the objective function value of the whale's position to obtain the position of the optimal individual;

[0064] S103, iteratively updating the optimal individual, and introducing a tangent random parameter in the updating process;

[0065] In a possible implementation, step S103 includes:

[0066] Based on random numbers generated by p and the coefficient vector A The algorithm is determined to enter an attack phase for updating the optimal individual, and the attack phase includes: a spiral attack phase, a random search phase, and a prey encirclement phase.

[0067] Furthermore, when When , it is determined that the algorithm enters the spiral attack stage;

[0068] when and When , the algorithm is determined to enter the random search phase;

[0069] when and When , it is determined that the algorithm enters the stage of surrounding the prey.

[0070] In the stage of surrounding prey, the position of the optimal individual is updated based on the first formula:

[0071] (1)

[0072] In formula (1), 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;

[0073] In the spiral attack phase, the position of the optimal individual is updated based on the second formula:

[0074] (2)

[0075] 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);

[0076] In the random search phase, the position of the optimal individual is updated based on the third formula:

[0077] (3)

[0078] In formula (3), Represents the position of a random individual whale.

[0079] Introducing tangent random parameters during the update process, including:

[0080] Introducing tangent random parameters in the whale algorithm's encirclement phase.

[0081] In a possible implementation, a tangent random parameter is introduced to replace the original convergence factor of the whale algorithm in the prey encirclement stage.

[0082] Specifically, the new coefficient vector is calculated based on the tangent random parameter A and C ;

[0083] Among them, the calculation formula of the tangent random parameter includes:

[0084] (4)

[0085] In formula (4), x is a randomly generated variable.

[0086] It should be noted that the coefficient vector in the original whale algorithm A , C The calculation formula is as follows:

[0087] (5)

[0088] In formula (5), a is a random vector that changes linearly from 2 to 0 as the number of iterations increases, r 1 and r 2 are all random vectors in [0, 1].

[0089] It is understandable that replacing the random variables with a range of [0, 1] with more stable tangent random parameters makes z The value of is close to 0, thus limiting the search range to the vicinity of the current optimal solution and accelerating convergence; at the same time, z Occasionally generate large values ​​to facilitate global search and avoid premature convergence.

[0090] S104. When the number of iterations reaches the maximum, the updated position of the optimal individual is output to complete the tuning.

[0091] Compared with the prior art, a PID system parameter tuning method provided by the present invention applies the whale optimization algorithm to the parameter tuning process of the PID system, and improves the problem that the whale optimization algorithm lacks an effective control mechanism, especially for the random parameters in the whale optimization algorithm. By introducing tangent random parameters, the tangent random parameters are more controllable, so that the PID system can analyze the system operation data in real time and dynamically adjust the control parameters to adapt to the changing working conditions and external environment, thereby effectively solving the problem that the prior art is not suitable for hydrogen fuel cells that are highly dynamic and susceptible to external interference due to being limited by fixed mathematical models and empirical formulas.

[0092] like Figure 2 The present invention also provides a PID system parameter setting device 20, comprising:

[0093] a parameter setting module 210, for initializing parameters of the whale optimization algorithm, determining the size of the whale population, and randomly generating the position of the whale, wherein the size of the whale population represents the maximum number of iterations, and the position of the whale represents the PID system parameters including the proportional gain, the integral time constant, and the differential time constant, and the PID system uses the error between the target air flow rate and the air flow rate at the current moment as input, and uses the air flow rate supplied to the hydrogen fuel cell by the air supply system as output;

[0094] A calculation module 220, used to calculate the objective function value of the whale's position to obtain the position of the optimal individual;

[0095] An attack strategy module 230, used for iteratively updating the optimal individual and introducing a tangent random parameter in the updating process;

[0096] The output module 240 is used to output the updated position of the optimal individual when the number of iterations reaches the maximum, thereby completing the tuning.

[0097] In a possible implementation, the attack strategy module 230 further includes:

[0098] The phase selection parameter calculation module 2301 is used to calculate the random number based on the random number generated p and the coefficient vector A Determine that the algorithm enters the attack phase for updating the optimal individual;

[0099] Spiral attack module 2302, used when When , it is determined that the algorithm enters the spiral attack stage;

[0100] Random search module 2303, used when and When , the algorithm is determined to enter the random search phase;

[0101] The prey encirclement module 2304 is used when and When , it is determined that the algorithm enters the stage of surrounding the prey.

[0102] like Figure 3 As shown, the present invention also provides an electronic device 30, including:

[0103] A memory 310, used for storing programs;

[0104] The processor 320 is coupled to the memory 310 and is used to execute the program stored in the memory 310 to implement the steps in the PID system parameter tuning method described in any one of the above embodiments.

[0105] Figure 3 Only some of the components of the electronic device 30 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0106] In some embodiments, the processor 320 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 310, such as the PID system parameter tuning method of the present invention.

[0107] In some embodiments, the processor 320 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 320 may be local or remote. In some embodiments, the processor 320 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0108] In some embodiments, the memory 310 may be an internal storage unit of the electronic device 30, such as a hard disk or memory of the electronic device 30. In other embodiments, the memory 310 may also be an external storage device of the electronic device 30, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 30.

[0109] Furthermore, the memory 310 may include both an internal storage unit of the electronic device 30 and an external storage device. The memory 310 is used to store application software installed in the electronic device 30 and various data.

[0110] In one embodiment, when the processor 320 executes the PID system parameter tuning program in the memory 310, the following steps may be implemented:

[0111] Initialize the parameters of the whale optimization algorithm, determine the size of the whale population, and randomly generate whale positions;

[0112] Calculate the objective function value of the whale's position and obtain the optimal individual position;

[0113] Iteratively update the optimal individual and introduce tangent random parameters in the updating process;

[0114] When the number of iterations reaches the maximum, the updated position of the optimal individual is output to complete the tuning.

[0115] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 30 mentioned, and the electronic device 30 may be a portable device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable devices include but are not limited to portable devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable devices may also be other portable devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 30 may not be a portable device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0116] The present invention also provides a storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the PID system parameter tuning method described in any one of the above-mentioned method items.

[0117] 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.

[0118] The PID system parameter tuning method, device, electronic device and storage medium provided by the present invention are 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 setting method, applied to the real-time regulation of the hydrogen fuel cell air supply system, characterized in that: include: Initialize the parameters of the whale optimization algorithm, determine the size of the whale population, and randomly generate the position of the whale, wherein the size of the whale population represents the maximum number of iterations, and the position of the whale represents the PID system parameters including the proportional gain, the integral time constant, and the differential time constant, and the PID system uses the error between the target air flow rate and the air flow rate at the current moment as input, and uses the air flow rate supplied to the hydrogen fuel cell by the air supply system as output; Calculate the objective function value of the whale's position and obtain the optimal individual position; Iteratively update the optimal individual and introduce tangent random parameters in the updating process; When the number of iterations reaches the maximum, the updated position of the optimal individual is output to complete the tuning; The step of introducing a tangent random parameter in the updating process includes: Introducing tangent random parameters in the whale algorithm's prey encirclement phase; The introduction of tangent random parameters in the prey encirclement stage of the whale algorithm includes: Introduce tangent random parameters to replace the original convergence factor of the whale algorithm in the prey encirclement stage; A new coefficient vector is calculated based on the tangent random parameter A and C ; The calculation formula of the tangent random parameter includes: In the formula, x is a randomly generated variable.

2. The PID system parameter tuning method according to claim 1, characterized in that: The iterative updating of the optimal individual comprises: Based on random numbers generated by p and the coefficient vector A Determine that the algorithm enters the attack phase for updating the optimal individual; The attack phases include: a spiral attack phase, a random search phase, and a prey encirclement phase.

3. The PID system parameter tuning method according to claim 2, characterized in that: The random number generated based on 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.

4. The PID system parameter tuning method according to claim 3, characterized in that: In the prey encirclement stage, the position of the optimal individual is updated based on the first formula; In the spiral attack phase, the position of the optimal individual is updated based on the second formula; In the random search phase, the position of the optimal individual is updated based on the third formula; Among them, the first formula includes: 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; The second formula includes: 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); The third formula includes: In the formula, Represents the position of a random individual whale.

5. A PID system parameter setting device, applied to the real-time adjustment of the hydrogen fuel cell air supply system, characterized in that: include: A parameter setting module, used to initialize the parameters of the whale optimization algorithm, determine the size of the whale population, and randomly generate the position of the whale, wherein the size of the whale population represents the maximum number of iterations, and the position of the whale represents the PID system parameters including the proportional gain, the integral time constant, and the differential time constant, wherein the PID system uses the error between the target air flow rate and the air flow rate at the current moment as input, and uses the air flow rate supplied to the hydrogen fuel cell by the air supply system as output; The calculation module is used to calculate the objective function value of the whale's position and obtain the position of the optimal individual; An attack strategy module, used for iteratively updating the optimal individual and introducing a tangent random parameter in the updating process, wherein the introducing the tangent random parameter in the updating process comprises: introducing the tangent random parameter in the prey encirclement phase of the whale algorithm; The introduction of tangent random parameters in the prey encirclement stage of the whale algorithm includes: Introduce tangent random parameters to replace the original convergence factor of the whale algorithm in the prey encirclement stage; A new coefficient vector is calculated based on the tangent random parameter A and C ; The calculation formula of the tangent random parameter includes: In the formula, x is a randomly generated variable; The output module is used to output the updated position of the optimal individual when the number of iterations reaches the maximum to complete the tuning.

6. The PID system parameter setting device according to claim 5, characterized in that: The attack strategy module also includes: Phase selection parameter calculation module for random numbers based on random generation p and the coefficient vector A Determine that the algorithm enters the attack phase for updating the optimal individual; Spiral Attack Module, used when When , it is determined that the algorithm enters the spiral attack stage; Random search module, used when and When , the algorithm is determined to enter the random search phase; Surrounding prey module, used when and When , it is determined that the algorithm enters the stage of surrounding the prey.

7. An electronic device, characterized in that: include: Memory, used to store programs; A processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the PID system parameter tuning method described in any one of claims 1 to 4.

8. A storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the PID system parameter tuning method described in any one of claims 1 to 4 above.

Citation Information

Patent Citations

  • Wavelet denoising optimal threshold setting method based on whale optimization algorithm

    CN113408336A

  • Fuel cell hydrogen pressure control method based on whale optimization algorithm

    CN116826119A