Flow control method and device for optimizing fuzzy PID (Proportion Integration Differentiation) based on particle swarm optimization
By adopting a fuzzy PID control method based on particle swarm algorithm optimization in the gas flow control system, the problem of insufficient control effect of traditional PID control algorithms when dealing with load variability and parameter uncertainty is solved, and higher control accuracy and response speed are achieved.
Patent Information
- Application Number
- CN202411912627.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When traditional PID control algorithms deal with load variability and parameter uncertainty in gas flow control systems, it is difficult to achieve high-precision and fast response control effects.
The fuzzy PID control method optimized based on particle swarm algorithm is adopted. By using sample flow error and error change rate as input variables, a PID controller model is created, and the control parameters are optimized using fuzzification and particle swarm algorithm to improve control accuracy and response speed.
It significantly improves the response speed and stability of the gas flow control system, reduces steady-state error and overshoot, and achieves a more accurate and stable control effect.
Smart Images

Figure CN119759109A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology, and in particular to a flow control method and device based on particle swarm algorithm optimization of fuzzy PID. Background Art
[0002] With the continuous improvement of the level of industrial automation, gas flow control plays a vital role in many fields such as chemical industry, energy, and environmental protection. In the process of gas sampling, ensuring that the gas flow is accurate, fast, and stable is the key factor in sampling. In this process, the flow control valve is the core component of gas flow control, and its opening size directly determines the size of the gas flow. Therefore, studying and improving the control performance of the flow control valve is a key research issue in the constant gas flow control method. The improvement of these technologies can not only significantly improve the accuracy of the flow, but also enhance the response speed and stability, thereby ensuring that more reliable and consistent results can be obtained in gas sampling tasks.
[0003] Traditional gas flow control systems usually use traditional PID control algorithms, which are widely used for their simple structure, mature algorithms and stable operation. However, they need to be designed based on accurate system models, have poor robustness and adaptability, and are difficult to control nonlinear and uncertain complex systems. In addition, traditional PID control parameters usually rely on manual adjustment, which has its limitations. For the load variability and parameter uncertainty of the flow control system, it is often unable to obtain a good control effect. How to improve the flow control accuracy and response speed according to the requirements of the flow control valve for fast, accurate and stable control during the gas sampling process has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The purpose of the present invention is to solve the problem that the current flow control system often cannot obtain a good control effect due to load variability and parameter uncertainty. The present invention provides a flow control method and device based on particle swarm algorithm to optimize fuzzy PID.
[0005] The technical solution of the embodiment of the present application is implemented as follows: The first aspect of the embodiment of the present application provides a flow control method based on particle swarm algorithm optimization of fuzzy PID, comprising: The sample flow error and the sample error change rate are used as sample input variables, and the first control parameter Kp, the second control parameter Ki and the third control parameter Kd are used as sample output parameters to create a PID controller model; Perform fuzzification processing on the current input variables to generate a fuzzy set, and input the fuzzy set into the PID controller model to complete defuzzification based on the fuzzy set matching weighted rule to obtain a corrected output parameter; the current input variables include the current flow error and the current error change rate; Using a particle swarm algorithm to optimize the corrected output parameters to obtain target output parameters; The flow control parameters under the current gas flow control environment are determined based on the target output parameters.
[0006] Optionally, the fuzzification processing is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on a weighted rule and input into the PID controller model to complete defuzzification to obtain a corrected output parameter, including obtaining the corrected output parameter based on the following formula: ; in, To adjust the previous PID control parameters, that is, the current input variables, is the parameter adjustment amount obtained according to the fuzzy rule, To adjust the PID control parameters, that is, to correct the output parameters.
[0007] Optionally, the fuzzification process is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on a weighted rule and input into the PID controller model to complete defuzzification to obtain a corrected output parameter, including: The current input variable and the parameter adjustment amount are divided into 7 fuzzy language set parts in the corresponding domain, and the language values of input and output are allocated in the order of negative large (NL), negative middle (NM), negative small (NS), zero (ZE), positive small (PS), positive middle (PM), and positive large (PL); wherein the domain of the current input variable is defined as [-6, 6], and the domain of the parameter adjustment amount is defined as [-1, 1].
[0008] Optionally, the fuzzification process is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on a weighted rule and input into the PID controller model to complete defuzzification to obtain a corrected output parameter, including: When the current flow error is greater than a preset value, a trapezoidal function is used to adjust the PID control parameters; When the current flow error is less than a preset value, a triangular function is used to adjust the PID control parameters.
[0009] Optionally, before fuzzifying the current input variable to generate a fuzzy set, and inputting the fuzzy set into the PID controller model to complete defuzzification based on the fuzzy set matching weighted rule to obtain the corrected output parameter, the method further includes: A second range interval corresponding to the corrected output parameter is determined according to a first range interval where the current flow error and the current error change rate are located.
[0010] Optionally, the current input variable is fuzzified to generate a fuzzy set, and the fuzzy set is matched based on a weighted rule and input into the PID controller model to complete defuzzification to obtain a corrected output parameter, including: The defuzzification is completed using the centroid method to obtain the corrected output parameters.
[0011] Optionally, the adopting of a particle swarm algorithm to optimize the corrected output parameter to obtain a target output parameter includes: Determining a current fitness value of each particle according to the modified output parameter; Determine the optimal position of the individual particle based on the current fitness value of the particle and the historical fitness value of the historical optimal position; Based on the fitness values corresponding to the individual optimal positions of all particles, the global optimal position is determined; A target output parameter is determined according to the individual optimal position and the global optimal position.
[0012] The second aspect of the embodiment of the present application provides a flow control device based on particle swarm algorithm to optimize fuzzy PID, including: a creation module, a correction module, an optimization module and a determination module; wherein, The creation module is configured to use the sample flow error and the sample error change rate as sample input variables, and the first control parameter Kp, the second control parameter Ki and the third control parameter Kd as sample output parameters to create a PID controller model; The correction module is configured to perform fuzzification processing on the current input variables, generate a fuzzy set, and input the fuzzy set into the PID controller model to complete defuzzification based on the weighted rule matching the fuzzy set, so as to obtain a corrected output parameter; the current input variables include the current flow error and the current error change rate; The optimization module is configured to optimize the corrected output parameters using a particle swarm algorithm to obtain target output parameters; The determination module is configured to determine the flow control parameters under the current gas flow control environment based on the target output parameters.
[0013] A third aspect of an embodiment of the present application provides an electronic device, comprising a processor and a memory; the memory stores a computer program, wherein the computer program, when executed by the processor, implements the flow control method based on particle swarm algorithm optimization of fuzzy PID described in the first aspect.
[0014] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0015] Compared with the prior art, the technical solution provided by this application has the following beneficial effects: The present invention provides a flow control method and device based on particle swarm algorithm optimization fuzzy PID, by taking sample flow error and sample error change rate as sample input variables, first control parameter Kp, second control parameter Ki and third control parameter Kd as sample output parameters, creating PID controller model, fuzzifying current input variables, generating fuzzy sets, and inputting into the PID controller model to complete defuzzification based on the fuzzy set matching weighted rule, and obtaining corrected output parameters, on this basis, using particle swarm algorithm to optimize the corrected output parameters, obtaining target output parameters, and determining the flow control parameters under the current gas flow control environment based on the target output parameters. By designing a fuzzy PID controller and optimizing it using particle swarm algorithm, the response speed and stability of the constant gas flow control system are significantly improved, and the steady-state error and overshoot are effectively reduced, thereby achieving a more accurate and stable control effect in gas flow control. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a pipeline flow control valve throttling provided in an embodiment of the present application; Figure 2 A flow chart of a flow control method based on particle swarm algorithm optimization of fuzzy PID provided in an embodiment of the present application; Figure 3 A fuzzy control flow chart of a fuzzy self-tuning PID controller provided in an embodiment of the present application; Figure 4 A fuzzy control input-output membership function diagram provided in an embodiment of the present application; Figure 5 A corresponding relationship diagram of fuzzy control input and output variables provided in an embodiment of the present application; Figure 6 A comparison diagram of simulation models of three different control methods provided in the embodiments of the present application; Figure 7 A comparison graph of step responses of three different control methods provided in the embodiment of the present application; Figure 8 A schematic diagram of the structure of a flow control device based on particle swarm algorithm optimization of fuzzy PID provided in an embodiment of the present application; Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] Below, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present application.
[0018] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "include", "comprising", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0019] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0020] Some block diagrams and / or flow charts are shown in the accompanying drawings. It should be understood that some blocks or combinations thereof in the block diagrams and / or flow charts may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that these instructions, when executed by the processor, may create a device for implementing the functions / operations described in these block diagrams and / or flow charts.
[0021] When the flow control valve is installed in the pipeline system, the pipeline flow rate is controlled by throttling. For example, please refer to Figure 1 , Figure 1 A schematic diagram of a pipeline flow control valve throttling provided in an embodiment of the present application; In the pipe AB, when a hole with a diameter of When the regulating valve is opened, the flow state of the fluid will be affected by the valve opening, resulting in changes in flow rate and pressure. At this time, the differential pressure transmitter connected at CD monitors the pressure characteristics of the fluid through two pressure measuring tubes a and b. Pressure measuring tube a corresponds to a larger pipe cross-sectional area. In this area, the flow rate of the fluid is low, so its static pressure is relatively high. Relatively speaking, pressure measuring tube b corresponds to a position with a smaller pipe cross-sectional area. At this position, the flow rate of the fluid is high, resulting in a relatively low static pressure. The differential pressure transmitter usually has a sealed diaphragm inside and is equipped with a pressure sensor. Due to the different pressures at both ends of the pressure measuring tubes a and b, this pressure difference causes deformation on the diaphragm, thereby forming a measurable pressure difference signal, and the pressure sensor converts the pressure difference applied to the diaphragm into an electrical signal. The electrical signal is then sent to the electronic device housing for processing, conversion and amplification into current or voltage output for reading by the control system. The current output is usually a 4-20 mA signal, or in some cases a 0 to 10 volt voltage signal. Among them, there is a linear relationship between the electrical output generated by the differential pressure transmitter electronic module and the pressure difference, while in fluid dynamics, there is a nonlinear relationship between the pressure difference and the gas flow and flow rate.
[0022] The heights of the incompressible fluid columns are and , water level difference for: ; Where: h is the water pressure difference; is the fluid density; is the pressure at the measuring point of the high pressure chamber; is the pressure at the measuring point of the low-pressure chamber; g is the acceleration due to gravity.
[0023] The principle of the differential pressure transmitter is based on the Bernoulli equation and the continuity equation of fluid dynamics. In the same pipeline, according to the law of conservation of energy, the total pressure head at different positions is the same. From sections C and D, it can be concluded from the Bernoulli equation: ; ; Where: is the medium flow rate at the measuring point of the high-pressure chamber; is the medium flow velocity at the measuring point of the low-pressure chamber.
[0024] From the continuity equation of fluid dynamics, we can conclude that: ; Where: is the cross-sectional area at point C in the pipe; is the cross-sectional area at point D in the pipe.
[0025] According to the calculation formula of pipeline cross-sectional area and pipe diameter, we can get:
[0026] Where: is the diameter of the pipe at C; is the diameter of the pipe at D.
[0027] In the above formula by Expressed in functional form and substituted into the original formula, we can get: ; ; so: ; ; Where: Q is the volume flow rate of the pipeline fluid.
[0028] Let the drag coefficient:
[0029] Substituting the resistance coefficient into the volume flow formula of the pipeline fluid, we get: ; Command-up ,have to: ; Where: It is the difference between the high-pressure chamber pressure and the low-pressure chamber pressure, referred to as differential pressure; is the flow coefficient. In practical applications, The value of is usually obtained through experiments or field calibration, and is used to describe the fluid flow capacity of a valve or pipeline under specific conditions. The above formula is the flow equation of the flow control valve. It can be observed from the formula that the pressure difference is proportional to the square of the gas flow rate. This means that when the gas flow rate increases, the pressure difference will also increase accordingly, but the increase is relatively small. This phenomenon can be understood as that as the flow rate increases, the flow characteristics of the fluid in the valve body change, resulting in a slower growth rate of pressure loss. Therefore, a method is needed to achieve the purpose of improving flow control accuracy and response speed according to the requirements of the flow control valve for fast, accurate and stable control during the gas sampling process.
[0030] In some embodiments, see Figure 2 , Figure 2A flow chart of a flow control method based on particle swarm algorithm optimization of fuzzy PID provided in an embodiment of the present application; A flow control method based on particle swarm algorithm optimization of fuzzy PID provided in an embodiment of the present application includes: S210, using the sample flow error and the sample error change rate as sample input variables, and the first control parameter Kp, the second control parameter Ki and the third control parameter Kd as sample output parameters, to create a PID controller model.
[0031] The principle of PID controller (Proportion Integration Differentiation) is based on the combination of three control algorithms: proportional (P), integral (I) and differential (D). It continuously adjusts the output of the controller to maintain the state of the controlled object near the set value, thus achieving stable and accurate automatic control. Specifically, it includes adjusting the output of the controller according to the current error size, adjusting the output of the controller according to the amount of error accumulated over time, and adjusting the output of the controller according to the rate of error change. Figure 3 , Figure 3 A fuzzy control flow chart of a fuzzy self-tuning PID controller provided in an embodiment of the present application.
[0032] S220, fuzzify the current input variables to generate a fuzzy set, and input the fuzzy set into the PID controller model based on the fuzzy set matching weighted rule to complete defuzzification and obtain the corrected output parameters; the current input variables include the current flow error and the current error change rate.
[0033] In this embodiment, the objects of fuzzy processing include three control parameters of PID, sample flow error and sample error change rate. The PID controller usually calculates the control quantity by the following formula: ; Each parameter remains unchanged during the entire adjustment process. Fuzzy processing of the current input variable means that the PID control parameters are continuously adjusted according to the fuzzy rules during the control process, and then the new PID control parameters are used to obtain the control amount. The corrected output parameters include the change in the proportional factor. , the change of the integral factor and the differential factor change .
[0034] In some embodiments, S120, fuzzification is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete defuzzification, and a modified output parameter is obtained, including obtaining the modified output parameter based on the following formula: ; in, To adjust the previous PID control parameters, that is, the current input variables, is the parameter adjustment amount obtained according to the fuzzy rule, To adjust the PID control parameters, that is, to correct the output parameters.
[0035] In some embodiments, S120, fuzzification is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete defuzzification, thereby obtaining a modified output parameter, including: The current input variable and parameter adjustment amount are divided into 7 fuzzy language set parts in the corresponding domain, and the language value of input and output is assigned in the order of negative large (NL), negative medium (NM), negative small (NS), zero (ZE), positive small (PS), positive medium (PM), and positive large (PL); among which, the domain of the current input variable is defined as [-6, 6], and the domain of the parameter adjustment amount is defined as [-1, 1]. Here, please refer to Figure 4 and Figure 5 , Figure 4 The fuzzy control input-output membership function diagram provided in the embodiment of the present application is as follows: Figure 5 A corresponding relationship diagram between fuzzy control input and output variables provided in an embodiment of the present application.
[0036] In some embodiments, S120, fuzzification is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete defuzzification, thereby obtaining a modified output parameter, including: When the current flow error is greater than the preset value, the trapezoidal function is used to adjust the PID control parameters; When the current flow error is less than the preset value, the triangular function is used to adjust the PID control parameters.
[0037] In this embodiment, the membership function graph of the sample flow error and the sample error change rate adopts a membership function that combines a trapezoidal function and a triangular function. When the current flow error is greater than the preset value, a trapezoidal function with a larger value range is used to significantly adjust the PID control parameters. When the current flow error is less than the preset value, a triangular function with high sensitivity and a small range is used to precisely adjust the PID control parameters. Output value and The membership function of is composed of a triangular function and a smooth Gaussian function without zero points.
[0038] In some embodiments, before performing fuzzification processing on the current input variable to generate a fuzzy set at S120, and inputting the fuzzy set into the PID controller model to complete defuzzification based on the fuzzy set matching weighted rule, and obtaining the corrected output parameter, the method further includes: A second range interval corresponding to the corrected output parameter is determined according to the first range interval where the current flow error and the current error change rate are located.
[0039] In this embodiment, when the absolute value of the current flow error is relatively large, in order to increase the response speed of the controlled object, it is necessary to significantly increase or decrease At this time, if the current flow error is large, the system may If the value is too large, a large overshoot and integral saturation will occur. At the same time, in order to avoid the occurrence of differential saturation, a smaller value should be taken. ; When the current error change rate is small, it is necessary to stabilize the system as soon as possible and reduce the steady-state error, slightly increase , Remain unchanged.
[0040] When the absolute value of the current flow error is moderate, the overshoot of the system needs to be reduced. Slightly lower, take the middle value, then The value of has a greater impact, so The value of should be moderate to ensure the response speed of the system; when the current error change rate is large, some integral effects on control can be increased. Take a larger value; when the current error change rate is small, in order to prevent integral saturation, Take the smaller value.
[0041] When the absolute value of the current flow error is small, in order to improve the response speed and accuracy of the system, , Take a larger value to suppress system disturbance and adjust time compensation. Generally, when the current error change rate is small, It can be larger, otherwise it should be lowered.
[0042] The rule tables are shown in Table 1, Table 2, and Table 3.
[0043] Table 1 rule
[0044] Table 2 rule
[0045] Table 3 rule .
[0046] Here, the designed fuzzy self-tuning PID and Input the fuzzy rules into the fuzzy rule editor to complete the rule setting. After completing the editing of fuzzy subsets, fuzzy rules and reasoning methods, observe the fuzzy rules.
[0047] In some embodiments, S120, fuzzification is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete defuzzification, thereby obtaining a modified output parameter, including: The defuzzification is completed using the centroid method to obtain the corrected output parameters.
[0048] In this embodiment, the centroid method is used for precise calculation, which contains all the information in the fuzzy subset and has a smoother output reasoning control. The principle is to take the centroid of the area enclosed by the fuzzy membership function curve and the horizontal coordinate as the final output value of the fuzzy reasoning, that is: ; In the formula, M is the membership degree, F is the fuzzy quantization value, is the output value, is the membership degree of the i-th fuzzy set, is the output value of the i-th fuzzy set; the numerator is the sum of the product of the membership of all fuzzy sets and the output value, and the denominator is the sum of the membership of all fuzzy sets; According to the characteristics of the membership function, the sum of the membership calculated in any direction is 1, omitting the denominator. The calculation of each object is actually a matrix operation, and the formula is as follows: ; In the formula, is the defuzzification matrix, are the two membership degrees to which the error belongs, are the two memberships corresponding to the rate of change of the error, , , , is the corresponding rule table matrix, and the defuzzification output is the product of these three matrices.
[0049] S130, optimizing the corrected output parameters using a particle swarm algorithm to obtain target output parameters.
[0050] In some embodiments, S130, optimizing the corrected output parameters using a particle swarm algorithm to obtain target output parameters includes: Determine the current fitness value of each particle according to the modified output parameter; Determine the optimal position of the individual particle based on the current fitness value of the particle and the historical fitness value of the historical optimal position; Based on the fitness values corresponding to the individual optimal positions of all particles, the global optimal position is determined; According to the individual optimal position and the global optimal position, the target output parameters are determined.
[0051] In one example, the particle swarm algorithm is used to optimize the fuzzy self-tuning PID controller for control optimization. The specific steps are as follows: Design transfer function: The universal fatigue testing machine in this experiment is affected by the uncertainty of the shape and size of the material, so the specific coefficient of its transfer function cannot be determined, and it can only be approximated as a second-order system. After experimental fitting, its transfer function is obtained as follows: ; Where s is the complex variable in the Laplace transform.
[0052] Design of particle swarm algorithm optimized fuzzy self-tuning PID controller: The controller in this experiment uses particle swarm algorithm to optimize the fuzzy self-tuning PID controller, where the parameters are set as follows, the inertia weight n is 0.9; the learning factor , Take 2; take the particle swarm size N as 50; take the dimension D as 5; and take the maximum number of iterations t as 20.
[0053] Matlab2021a was used to carry out simulation experiments. Based on a large number of experiments and theoretical basis, an approximate mathematical model of the controlled object of the gas flow control valve PID control system was obtained. The present invention has improved on this model by adding a fuzzy control module to form a fuzzy PID control system, and optimized the fuzzy control using a particle swarm algorithm to design a simulation circuit model diagram. In order to prove the superiority of the control method proposed in the present invention, the experimental design uses PID control, fuzzy PID control, and fuzzy PID control optimized by a particle swarm algorithm to simulate the system under the same transfer function and the same input. Please participate Figure 6 and Figure 7 , Figure 6 A comparison diagram of simulation models of three different control methods provided in the embodiments of the present application; Figure 7 The step response comparison curve diagram of the three different control methods provided in the embodiment of the present application is shown; the overshoot, rise time, adjustment time and other indicators of the three control algorithms are compared, and the comparison table is shown in Table 4 below.
[0054] Table 4 Step response performance indicators
[0055] from Figure 7 It can be seen from the step response comparison curve of different control methods and the performance index table in Table 4 that the maximum overshoot of traditional PID control reaches 28%, the maximum overshoot of fuzzy PID with fuzzy control is 14%, and the maximum overshoot of fuzzy PID after particle swarm optimization is 2%. Compared with PID control, the overshoot under fuzzy PID control decreased by 14 percentage points, and the overshoot of the control method optimized by particle swarm algorithm decreased by 12 percentage points again. The rise time of the actuator to reach the set value for the first time under conventional PID control is 0.019 seconds, the rise time of the actuator to reach the set value for the first time under fuzzy PID control is 0.029 seconds, and the rise time of the actuator under fuzzy PID control improved by particle swarm is 0.038 seconds. Conventional PID control reaches steady state at 0.15 seconds, fuzzy PID with fuzzy control reaches steady state at 0.1 seconds, and fuzzy PID after ordinary particle swarm optimization also reaches steady state at 0.1 seconds. Compared with traditional PID control, the adjustment time is reduced by 33%. The traditional PID has the most oscillations before reaching stability, and the fuzzy PID optimized by ordinary particle swarm has the least oscillations before reaching steady state.
[0056] After simulation analysis, the control method based on particle swarm algorithm to optimize fuzzy PID takes the least time to reach steady state when responding, has the lowest overshoot, the shortest adjustment time, and the least oscillation number, which is superior to traditional PID control and fuzzy PID control.
[0057] S140, determining flow control parameters under the current gas flow control environment based on the target output parameters.
[0058] The flow control parameters under the current gas flow control environment can be directly determined by combining the mapping function relationship between the target output parameters and the flow parameters.
[0059] The embodiment of the present invention designs a fuzzy PID controller and optimizes it using a particle swarm algorithm, thereby significantly improving the response speed and stability of the constant gas flow control system, effectively reducing the steady-state error and overshoot, and thus achieving a more precise and stable control effect in gas flow control.
[0060] In some embodiments, see Figure 8 , Figure 8A schematic diagram of the structure of a flow control device based on particle swarm algorithm to optimize fuzzy PID provided in an embodiment of the present application; an embodiment of the present application provides a flow control system 800 based on particle swarm algorithm to optimize fuzzy PID, including: a creation module 810, a correction module 820, an optimization module 830 and a determination module 840; wherein, A creation module 810 is configured to use the sample flow error and the sample error change rate as sample input variables, and the first control parameter Kp, the second control parameter Ki and the third control parameter Kd as sample output parameters to create a PID controller model; The correction module 820 is configured to perform fuzzification processing on the current input variables, generate a fuzzy set, and input the fuzzy set into the PID controller model to complete defuzzification based on the fuzzy set matching weighted rule to obtain a corrected output parameter; the current input variables include the current flow error and the current error change rate; The optimization module 830 is configured to optimize the modified output parameters using a particle swarm algorithm to obtain target output parameters; The determination module 840 is configured to determine the flow control parameters under the current gas flow control environment based on the target output parameters.
[0061] In some embodiments, the correction module is specifically configured to obtain the corrected output parameter based on the following formula: ; in, To adjust the previous PID control parameters, that is, the current input variables, is the parameter adjustment amount obtained according to the fuzzy rule, To adjust the PID control parameters, that is, to correct the output parameters.
[0062] In some embodiments, the correction module 820 is specifically configured as follows: The current input variable and parameter adjustment amount are divided into 7 fuzzy language set parts in the corresponding domain, and the language value allocation of input and output is carried out in the order of negative large (NL), negative middle (NM), negative small (NS), zero (ZE), positive small (PS), positive middle (PM), and positive large (PL); among which, the domain of the current input variable is defined as [-6, 6], and the domain of the parameter adjustment amount is defined as [-1, 1].
[0063] In some embodiments, the correction module 820 is specifically configured as follows: When the current flow error is greater than a preset value, a trapezoidal function is used to adjust the PID control parameters; When the current flow error is less than a preset value, a triangular function is used to adjust the PID control parameters.
[0064] In some embodiments, the correction module 820 is further configured to: A second range interval corresponding to the corrected output parameter is determined according to the first range interval where the current flow error and the current error change rate are located.
[0065] In some embodiments, the correction module 820 is specifically configured as follows: The defuzzification is completed using the centroid method to obtain the corrected output parameters.
[0066] In some embodiments, the optimization module 830 is specifically configured as follows: Determine the current fitness value of each particle according to the modified output parameter; Determine the optimal position of the individual particle based on the current fitness value of the particle and the historical fitness value of the historical optimal position; Based on the fitness values corresponding to the individual optimal positions of all particles, the global optimal position is determined; According to the individual optimal position and the global optimal position, the target output parameters are determined.
[0067] The flow control device based on particle swarm algorithm optimization of fuzzy PID provided in the embodiment of the present application can realize the various processes in the embodiment corresponding to the flow control method based on particle swarm algorithm optimization of fuzzy PID, which will not be described again here to avoid repetition.
[0068] It should be noted that the flow control device based on particle swarm algorithm optimization of fuzzy PID provided in the embodiment of the present application and the flow control method based on particle swarm algorithm optimization of fuzzy PID provided in the embodiment of the present application are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned flow control method based on particle swarm algorithm optimization of fuzzy PID, and the repeated parts will not be repeated.
[0069] In some embodiments, see Fig. 9 , Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. An electronic device 900 provided in an embodiment of the present application includes a processor 910 and a memory 920; the memory 920 stores a computer program, wherein the computer program implements the above-mentioned flow control method based on particle swarm algorithm optimization fuzzy PID when executed by the processor.
[0070] Specifically, the processor 910 may include, for example, a general-purpose microprocessor, an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 910 may also include an onboard memory for cache purposes. The processor 910 may be a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.
[0071] The memory 920 may be any medium capable of containing, storing, conveying, propagating or transmitting instructions. For example, the memory 920 may include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device, component or propagation medium. Specific examples of the memory 920 include: a magnetic storage device, such as a magnetic tape or a hard disk (HDD); an optical storage device, such as a compact disk (CD-ROM); a random access memory (RAM) or flash memory; and / or a wired / wireless communication link.
[0072] The present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned flow control method based on particle swarm algorithm optimization of fuzzy PID is implemented. The computer-readable medium may be included in the device / apparatus / system described in the above-mentioned embodiment; or it may exist independently without being assembled into the device / apparatus / system. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed, the method according to the embodiment of the present application is implemented.
[0073] According to an embodiment of the present application, a computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, optical cable, radio frequency signal, etc., or any suitable combination of the above.
[0074] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present application. Therefore, the scope of the present application should not be limited to the above-described embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.
Claims
1. A flow control method based on particle swarm algorithm to optimize fuzzy PID, characterized in that: include: The sample flow error and the sample error change rate are used as sample input variables, and the first control parameter Kp, the second control parameter Ki and the third control parameter Kd are used as sample output parameters to create a PID controller model; Perform fuzzification processing on the current input variables to generate a fuzzy set, and input the fuzzy set into the PID controller model to complete defuzzification based on the fuzzy set matching weighted rule to obtain a corrected output parameter; the current input variables include the current flow error and the current error change rate; Using a particle swarm algorithm to optimize the corrected output parameters to obtain target output parameters; The flow control parameters under the current gas flow control environment are determined based on the target output parameters.
2. The flow control method based on particle swarm algorithm optimization of fuzzy PID according to claim 1 is characterized in that: The fuzzification process is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete the defuzzification, and the corrected output parameter is obtained, including obtaining the corrected output parameter based on the following formula: ; in, To adjust the previous PID control parameters, that is, the current input variables, is the parameter adjustment amount obtained according to the fuzzy rule, To adjust the PID control parameters, that is, to correct the output parameters.
3. The flow control method based on particle swarm algorithm optimization of fuzzy PID according to claim 2 is characterized in that: The fuzzification process is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete the defuzzification to obtain the corrected output parameter, including: The current input variable and the parameter adjustment amount are divided into 7 fuzzy language set parts in the corresponding domain, and the language values of input and output are allocated in the order of negative large (NL), negative middle (NM), negative small (NS), zero (ZE), positive small (PS), positive middle (PM), and positive large (PL); wherein the domain of the current input variable is defined as [-6, 6], and the domain of the parameter adjustment amount is defined as [-1, 1].
4. The flow control method based on particle swarm algorithm optimization of fuzzy PID according to claim 2 is characterized in that: The fuzzification process is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete the defuzzification to obtain the corrected output parameter, including: When the current flow error is greater than a preset value, a trapezoidal function is used to adjust the PID control parameters; When the current flow error is less than a preset value, a triangular function is used to adjust the PID control parameters.
5. The flow control method based on particle swarm algorithm optimization of fuzzy PID according to claim 1 is characterized in that: Before fuzzification processing is performed on the current input variable to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete defuzzification and obtain the corrected output parameter, the method further includes: A second range interval corresponding to the corrected output parameter is determined according to a first range interval where the current flow error and the current error change rate are located.
6. The flow control method based on particle swarm algorithm optimization of fuzzy PID according to claim 1 is characterized in that: The current input variable is fuzzified to generate a fuzzy set, and the fuzzy set is matched based on the weighted rule and input into the PID controller model to complete the defuzzification, and the corrected output parameters are obtained, including: The defuzzification is completed using the centroid method to obtain the corrected output parameters.
7. The flow control method based on particle swarm algorithm optimization of fuzzy PID according to claim 1 is characterized in that: The particle swarm algorithm is used to optimize the corrected output parameters to obtain target output parameters, including: Determining a current fitness value of each particle according to the modified output parameter; Determine the optimal position of the individual particle based on the current fitness value of the particle and the historical fitness value of the historical optimal position; Based on the fitness values corresponding to the individual optimal positions of all particles, the global optimal position is determined; A target output parameter is determined according to the individual optimal position and the global optimal position.
8. A flow control device based on particle swarm algorithm to optimize fuzzy PID, characterized in that: include: Create module, modify module, optimize module and determine module; among them, The creation module is configured to use the sample flow error and the sample error change rate as sample input variables, and the first control parameter Kp, the second control parameter Ki and the third control parameter Kd as sample output parameters to create a PID controller model; The correction module is configured to perform fuzzification processing on the current input variables, generate a fuzzy set, and input the fuzzy set into the PID controller model to complete defuzzification based on the weighted rule matching the fuzzy set, so as to obtain a corrected output parameter; the current input variables include the current flow error and the current error change rate; The optimization module is configured to optimize the corrected output parameters using a particle swarm algorithm to obtain target output parameters; The determination module is configured to determine the flow control parameters under the current gas flow control environment based on the target output parameters.
9. An electronic device comprising a processor and a memory; the memory stores a computer program, wherein: When the computer program is executed by the processor, the flow control method based on particle swarm algorithm optimization of fuzzy PID according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Fussily self-adaptive PID temperature and humidity control system and method based on improved PSO (Particle Swarm Optimization) algorithm
CN104019526A
Accelerator control system based on fuzzy PID control
CN110617152A
PSO optimization method, adjustment control method and aerodynamic thermal simulation test system
CN118534770A
Method for controlling constant pressure using fuzzy PID controller
KR1020130126125A
Thermal management method for fuel cell
WO2023216150A1
Cited By
Screw anchor foundation grouting pressure-flow-deformation intelligent coupling control method
CN120595568A
An intelligent coupling control method for pressure-flow-deformation of spiral anchor foundation grouting
CN120595568B