Valve positioner control method based on genetic fusion PID optimization algorithm
Through the control method based on the genetic fusion PID optimization algorithm, the relay feedback method and improved genetic algorithm optimize PID parameters are solved, and the problems of overshoot and response time extension in traditional valve positioner control are realized, and efficient and stable valve positioner is achieved control.
Patent Information
- Application Number
- CN202411190384.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-11-29
AI Technical Summary
There is an overshoot during the control process of traditional valve positioners, which leads to a longer response time of the system, reduced robustness, poor control effect, and difficult to effectively optimize PID tuning parameters.
The control method based on the genetic fusion PID optimization algorithm is adopted, and the initial PID parameter range is obtained through the relay feedback method, and the improved genetic algorithm is used to optimize the PID parameter, introduce a penalty mechanism and adaptive cross-mutation probability, and calculate the optimal PID control amount to control it. Opening of pneumatic regulating valve.
The valve positioner is close to overshoot-free control, which improves control accuracy and system robustness, shortens adjustment time, and improves the quality and control stability of PID tuning parameters.
Smart Images

Figure CN119045316A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of valve positioners, and more particularly to a valve positioner control method based on a genetic fusion PID optimization algorithm. Background Art
[0002] The electric valve positioner is a key component in the electric control system and an indispensable terminal control element. It is used to control the valve opening and thus the flow rate. Pneumatic control valves have the characteristics of simple structure, stable performance, and good explosion-proof performance. They are widely used in industrial production processes in the petroleum, chemical and other industries. The electric valve positioner is the core of the pneumatic control valve, which can realize the stable, accurate and fast adjustment process of the pneumatic control valve. In the process of flow control, the transfer function of the system will change due to factors such as the influence of ambient temperature and humidity, changes in fluid composition, and wear of the valve mechanism. Therefore, for the electric valve positioner, online system identification and PID self-tuning are necessary. The traditional valve positioner control process is usually accompanied by overshoot, which makes the system response time longer and the system robustness reduced, which will increase the instability of the system and ultimately lead to poor system control effect.
[0003] Therefore, how to further improve the quality of the PID tuning parameters of the electric valve positioner, improve the robustness of the system, shorten the adjustment time while strictly controlling the overshoot of the valve positioner, and thereby improve the stability and efficiency of the control of the regulating valve; is a problem that technical personnel in this field urgently need to solve. Summary of the invention
[0004] In view of the above technical problems, the present invention provides a valve positioner control method based on a genetic fusion PID optimization algorithm that solves at least some of the above technical problems. This method strictly controls the overshoot of the valve positioner while shortening the adjustment time and improving control stability and efficiency.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] The embodiment of the present invention provides a valve positioner control method based on a genetic fusion PID optimization algorithm, the method comprising the following steps:
[0007] S1, obtaining the initial range of the valve positioner PID parameters and generating an initial population;
[0008] S2, encode the initial population;
[0009] S3, calculate the fitness of individuals in the encoded population, and if it meets the requirements, obtain the optimal individual;
[0010] S4. Decode the obtained optimal individual to obtain the optimal PID parameters, calculate the optimal PID control amount, and control the opening of the pneumatic control valve with the optimal control amount.
[0011] Furthermore, in step S1, a relay feedback method is used to obtain an initial range of the valve positioner PID parameter setting, and the description function of the relay feedback method is:
[0012] Where d is the output amplitude of the relay and A is the limit cycle amplitude.
[0013] Furthermore, in step S2, the encoding method is: encoding by unsigned binary numbers, and each PID parameter corresponds to a 10-bit binary number.
[0014] Furthermore, in step S3, the function for calculating individual fitness is:
[0015]
[0016] Among them, J1 represents the calculated individual fitness, u(k) represents the PID control quantity, t u represents the response time, e(k) is the error at time k, represents the deviation between the set value and the current value, ω1, ω2, and ω3 represent weight coefficients respectively.
[0017] Furthermore, a penalty mechanism is introduced into the function of calculating individual fitness, and the calculation formula is:
[0018]
[0019] Among them, J2 represents the individual fitness calculated after adding the penalty mechanism, ω4 represents the weight coefficient, and ω4 is much larger than ω1.
[0020] Furthermore, in step S3, if the calculated individual fitness does not meet the requirements, adaptive crossover probability and mutation probability calculations are performed to obtain a new population, and the individual fitness calculations are iterated again until the requirements are met; the calculation formulas for the crossover probability and mutation probability are:
[0021] P c =-k1Z 2 +1
[0022] P m =k2Z 2
[0023] Among them, P c represents the crossover probability, P m represents the probability of mutation, k1 and k2 are both values greater than 0, and Z= represents the degree of convergence of the population.
[0024] Furthermore, in step S4, the calculation formula of the PID control amount is:
[0025]
[0026] Among them, K p is the proportionality coefficient, K i is the integration coefficient, K d is the differential coefficient, e(k) is the error at time k, e(j) is the error at time j, k is a value greater than 0, and j is a value greater than or equal to 0 and less than or equal to k.
[0027] Compared with the prior art, the present invention has at least the following beneficial technical effects:
[0028] The present invention provides a valve positioner control method based on genetic fusion PID optimization algorithm, which can make the valve positioner close to zero overshoot control, improve control accuracy, shorten adjustment time, improve the quality of valve positioner PID setting parameters, and improve the robustness of the system.
[0029] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0030] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0032] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0033] Figure 1 A flow chart of a valve positioner control method based on a genetic fusion PID optimization algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0035] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0037] In the past, there were few improvements in PID parameter optimization during the design of electric valve positioner control, and the types of intelligent algorithms proposed for use were relatively simple. In the process of optimizing the PID parameters of the valve positioner, the overshoot is often increased to further shorten the system adjustment time, which will increase the instability of the system.
[0038] The present invention aims to improve the above-mentioned defects and provides a valve positioner control method based on genetic fusion PID optimization algorithm. The method of the present invention comprises the following steps:
[0039] S1, obtaining the initial range of the valve positioner PID parameters and generating an initial population;
[0040] S2, encode the initial population;
[0041] S3, calculate the fitness of individuals in the encoded population, if it meets the requirements, obtain the optimal individual; if it does not meet the requirements, perform adaptive crossover probability and mutation probability calculation to obtain a new population, and iterate again to calculate the fitness of individuals until it meets the requirements;
[0042] S4. Decode the obtained optimal individual to obtain the optimal PID parameters, calculate the optimal PID control amount, and control the opening of the pneumatic control valve with the optimal control amount.
[0043] Combine the following Figure 1 , the specific implementation mode of the method of the present invention is introduced:
[0044] Since the genetic algorithm will reduce the accuracy if the optimization range of PID parameters is too large, firstly, the PID parameters are obtained by the relay feedback method as the range of genetic optimization; secondly, the genetic algorithm is used to optimize the PID parameters. The overall method flow is as shown in the attached figure. Figure 1 shown.
[0045] (1) Relay feedback method to obtain the initial range of parameters
[0046] In order to improve the accuracy of PID tuning, the present invention first obtains a set of PID parameters through a relay feedback method, and provides a parameter optimization range for the genetic algorithm, thereby reducing the amount of calculation of the genetic algorithm and reducing uncertain factors in the calculation process.
[0047] The PID tuning of the relay feedback method includes the feedback loop of the relay characteristics and the PID control part. Due to the presence of relays in the feedback loop, the device has a nonlinear link, and its input and output phase angles differ by -2π. When the relay link is an ideal link, its description function is Where d is the output amplitude of the relay and A is the limit cycle amplitude.
[0048] The critical frequency, i.e., the crossing frequency ω, can be obtained according to the following formula: c Gain: The oscillation period of the system is T c It can be read from the system critical oscillation curve.
[0049] In this embodiment, the critical proportionality setting formula under different controller modes can be calculated according to the ZN critical proportionality setting formula. When the controller is a P-type controller, the proportionality coefficient K p =0.5K u , when the controller is a PI type controller, the proportional coefficient K p =0.4K u , when the controller is a PID controller, the proportional coefficient K p =0.6K u , when the controller is a PI type controller, the proportional coefficient T i =0.8T i When the controller is a PID controller, the proportional coefficient T i =0.5T i When the controller is a PID controller, the proportional coefficient T d =0.12T d , K p is the proportionality coefficient, K i is the integration coefficient, K d is the differential coefficient.
[0050] (2) Encoding the initial population
[0051] PID control controls the controlled object by performing proportional, integral, and differential operations on the deviation value. In the process of PID parameter tuning, the genetic algorithm mainly uses the fitness function as a benchmark to p , K i , K dThe three parameters are optimized generation by generation, and finally the output response meets the design requirements.
[0052] To optimize the PID parameters through genetic algorithm, the initial population needs to be encoded first. In this embodiment, the encoding is performed through unsigned binary numbers, and each PID parameter corresponds to a 10-bit binary number, K p , K i , K d The three parameters correspond to a total of 30 binary digits.
[0053] (3) Calculate individual fitness
[0054] By constructing a fitness function, the system can be controlled without overshoot, and the adjustment and response time can be shortened. The fitness function calculation formula is:
[0055]
[0056] In this embodiment, in order to strictly control the overshoot, a penalty mechanism is introduced into the fitness function. When the system overshoots e(k)<0, an item is added to the original fitness function calculation formula, and the calculation formula is as follows:
[0057]
[0058] Among them, u(k) represents the control quantity of PID, t u represents the response time of the control system, e(k) is the error at time k, represents the deviation between the set value and the current value, ω1, ω2, ω3, and ω4 represent weight coefficients respectively. In this embodiment, in order to improve the overshoot removal effect, ω4 is much larger than ω1.
[0059] After calculating the individual fitness, if the actual conditions are met, the optimal individual is obtained, and the optimal PID parameters can be obtained by decoding the code; if the optimal individual obtained at this time does not meet the requirements, adaptive crossover mutation is required to obtain a new population, and the individual fitness is calculated again in an iterative cycle until it meets the requirements.
[0060] (4) Adaptive crossover and mutation probability calculation
[0061] Traditional genetic algorithms are usually prone to fall into local optimal results during the optimization process. In order to obtain global optimization, in this embodiment, a new indicator is introduced To evaluate whether the genetic algorithm is trapped in the local optimum, combined with the traditional genetic algorithm crossover probability P c and mutation probability P m , establish new crossover probability and mutation probability as follows:
[0062] P c=-k1Z 2 +1
[0063] P m =k2Z 2
[0064] Among them, Z represents the degree of convergence of the population. The larger its value is, the higher the similarity of individuals in the population is, and the more consistent the entire population is. The smaller the value is, the greater the individual differences in the population are, and the more divergent they are. Its value range is [0, 1]. Ftmax represents the average fitness of individuals greater than the average fitness of the entity. Genmost represents the individual with the best fitness in the current generation of the population. Both k1 and k2 are values greater than 0. The crossover probability P c The range is [1-k1, 1], and the mutation probability P m The range is [0, k2].
[0065] In the method of the present invention, an iterative cycle is performed according to the above process until the optimal PID parameters are determined.
[0066] Finally, after obtaining the parameter optimization results, the PID control quantity is calculated, and the calculation formula is:
[0067]
[0068] Among them, K p is the proportionality coefficient, K i is the integration coefficient, K d is the differential coefficient, e(k) is the error at time k, e(j) is the error at time j, k is a value greater than 0, and j is a value greater than or equal to 0 and less than or equal to k;
[0069] Finally, the opening of the pneumatic control valve is controlled with the optimal control amount.
[0070] From the description of the above embodiments, those skilled in the art can know that the present invention discloses a valve positioner control method based on a genetic fusion PID optimization algorithm. The method obtains the approximate range of the system PID parameters based on the relay feedback method, and uses an improved genetic algorithm to optimize the PID parameters. On the one hand, the improved genetic algorithm can effectively shorten the adjustment time of the system. On the other hand, the optimal control parameters are obtained by optimizing, which helps to make the valve positioner close to zero overshoot control, improve control accuracy, shorten adjustment time, improve the quality of the valve positioner PID setting parameters, improve the robustness of the system, and have a better control effect.
[0071] The embodiments of the present invention are described in detail above, and the principles and implementation methods of the present invention are explained. The description of the above embodiments is only used to help understand the method and core concept of the present invention.
[0072] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to the embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A valve positioner control method based on genetic fusion PID optimization algorithm, characterized in that: The method comprises the following steps: S1, obtaining the initial range of the valve positioner PID parameters and generating an initial population; S2, encode the initial population; S3, calculate the fitness of individuals in the encoded population, and if it meets the requirements, obtain the optimal individual; S4. Decode the obtained optimal individual to obtain the optimal PID parameters, calculate the optimal PID control amount, and control the opening of the pneumatic control valve with the optimal control amount.
2. A valve positioner control method based on genetic fusion PID optimization algorithm according to claim 1, characterized in that: In step S1, a method for obtaining the initial range of the valve positioner PID parameter setting is adopted by a relay feedback method, and the description function of the relay feedback method is: Where d is the output amplitude of the relay and A is the limit cycle amplitude.
3. The valve positioner control method based on genetic fusion PID optimization algorithm according to claim 1 is characterized in that: In the step S2, the encoding method is: encoding by unsigned binary numbers, and each PID parameter corresponds to a 10-bit binary number.
4. The valve positioner control method based on genetic fusion PID optimization algorithm according to claim 1 is characterized in that: In step S3, the function for calculating individual fitness is: Among them, J1 represents individual fitness, u(k) represents PID control quantity, t u represents the response time, e(k) is the error at time k, represents the deviation between the set value and the current value, ω1, ω2, and ω3 represent weight coefficients respectively.
5. The valve positioner control method based on genetic fusion PID optimization algorithm according to claim 4 is characterized in that: A penalty mechanism is introduced into the function of calculating individual fitness. The calculation formula is: Among them, J2 represents the individual fitness calculated after adding the penalty mechanism, ω4 represents the weight coefficient, and ω4 is much larger than ω1.
6. The valve positioner control method based on genetic fusion PID optimization algorithm according to claim 1 is characterized in that: In step S3, if the calculated individual fitness does not meet the requirements, adaptive crossover probability and mutation probability calculations are performed to obtain a new population, and the individual fitness calculations are iterated again until the requirements are met; The calculation formulas for crossover probability and mutation probability are: P.S c 1-k1Z 2 +1 P m =k2Z 2 Among them, P c represents the crossover probability, P m represents the probability of mutation, k1 and k2 are both values greater than 0, and Z= represents the degree of convergence of the population.
7. The valve positioner control method based on genetic fusion PID optimization algorithm according to claim 1 is characterized in that: In step S4, the calculation formula of the PID control amount is: Among them, K p is the proportionality coefficient, K i is the integration coefficient, K d is the differential coefficient, e(k) is the error at time k, e(j) is the error at time j, k is a value greater than 0, and j is a value greater than or equal to 0 and less than or equal to k.
Citation Information
Cited By
Mining mechanical arm trajectory planning and control method based on double-layer optimization algorithm
CN122165390A
