Precise regulation and control optimization method for respiratory flow based on PID

By improving the human conception algorithm to optimize the parameters of the ventilator flow PID controller, the problems of flow overshoot and parameter adjustment in traditional PID control in the ventilator system are solved, achieving higher control accuracy and system stability.

CN119909276AActive Publication Date: 2025-05-02THE FIRST MEDICAL CENT CHINESE PLA GENERAL HOSPITAL

Patent Information

Application Number
CN202510094158.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-02
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

Traditional PID control has flow overshoot problems in ventilator flow control systems. Relying on manual adjustment of Kp, Ki, and Kd parameters, the operation is complex and the accuracy is not high, making it difficult to achieve the optimal control effect in nonlinear systems.

Method used

By improving the human conception algorithm (IHCO), nonlinear inertial weights and superhero gene mutation mechanism are introduced, the Kp, Ki, and Kd parameters of the flow PID controller are optimized, and the stability, response speed and robustness of the controller are automatically adjusted.

Benefits of technology

It realizes higher accuracy and stability of the ventilator flow control system, reduces overshoot and oscillation of flow changes, and improves the system's response speed and patient comfort.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119909276A_ABST
    Figure CN119909276A_ABST
Patent Text Reader

Abstract

The invention discloses a precise regulation and control optimization method based on PID (Proportion Integration Differentiation) respiratory flow, which belongs to the technical field of fractional order PID optimization, improves a human pregnancy algorithm to optimize a fractional order flow PID controller by introducing a nonlinear inertia weight and a super-male gene variation mechanism, can automatically adjust Kp, Ki and Kd parameters of the flow PID controller in the operation process of a control system, and improves the accuracy of the flow control. The stability, the response speed and the robustness of the PID controller are improved, the performance of the breathing machine is improved, airflow is accurately controlled, the stability of the system and the comfort level of a patient can be enhanced, and the treatment effect is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of fractional-order PID control optimization, and in particular relates to a precise control optimization method for respiratory flow based on PID. Background Art

[0002] A ventilator is a medical device used to assist or replace a patient's breathing, and is usually used in intensive care units, operating rooms, and other emergency treatment locations. It can adjust the airflow according to the patient's breathing needs, provide a certain air pressure or flow rate, to maintain the patient's gas exchange, and help the patient obtain the required oxygen while expelling carbon dioxide. During the operation of the ventilator, the ventilator's flow control system plays a vital role, ensuring the precise regulation of the airflow and the comfort and safety of the patient. The main purpose of the ventilator's flow control system is to accurately control the gas flow delivered to the patient's airway. The ventilator's flow control system consists of multiple components working together, among which the flow PID controller is its core component.

[0003] In the flow control system of the ventilator, PID control adopts a closed-loop control method, and uses sensors to measure the difference between the actual flow and the target flow for feedback adjustment. It has the characteristics of closed-loop control, simple implementation, and high stability. However, traditional PID control also has shortcomings. First, in traditional PID control, there will be flow overshoot problems, which will cause pressure on the user's heart and lungs, thereby affecting health. Secondly, the traditional PID controller relies on the adjustment of Kp, Ki, and Kd parameters. In different usage scenarios and conditions, the staff manually adjusts these parameters, which is complicated to operate and has low accuracy. Finally, if the ventilator system has nonlinear characteristics such as airflow pressure, it is difficult for the traditional PID controller to achieve the optimal control effect.

[0004] In "A Ventilator Flow Control Method Based on ADRC", Wang Cheng et al. used ADRC control instead of PID control, effectively avoiding the problem of pressure on the user's heart and lungs due to flow overshoot; and in "A Respiratory Monitoring Prediction Method and Ventilator Based on Intelligent Algorithm", Liu Zhe et al. used fuzzy PID control to improve the flow control system, successfully avoiding the risk of a sudden increase in air flow in existing ventilators causing a large impact on users; in the control field, using intelligent algorithms to optimize PID control has always been a hot topic. The human conception algorithm (HCO) is an intelligent optimization algorithm based on human reproductive behavior. It simulates biological processes such as fertilization, pregnancy and childbirth to realize the search and development process in the algorithm; however, due to the high sensitivity of the algorithm parameters and the slow convergence speed, its application in optimizing the parameters of the ventilator flow PID controller is limited. Summary of the invention

[0005] The purpose of the present invention is to provide a precise control and optimization method for respiratory flow based on PID in view of the deficiencies in the prior art. By improving the human conception algorithm (IHCO) to optimize the flow PID controller, the Kp, Ki, and Kd parameters of the flow PID controller can be automatically adjusted during the operation of the control system, thereby improving the stability, response speed, and robustness of the PID controller, thereby improving the performance of the ventilator, not only accurately controlling the airflow, but also enhancing the stability of the system and the comfort of the patient, thereby ensuring the treatment effect.

[0006] To achieve the above object, the present invention provides the following technical solution: a method for optimizing precise control of respiratory flow based on PID, comprising: an improved human conception algorithm (IHCO) and a fractional-order PID control algorithm, the specific steps of which are:

[0007] S1. Establish a simulation model for the ventilator flow control system through Simulink software, and the simulation model is: Sf1. Establish a performance evaluation index model in the simulation model, and use the performance evaluation index of the control system as the objective function of the IHCO algorithm; Sf2. In the simulation model, a flow PID controller model is established, and a fractional-order PID controller is used as the control model of the flow PID controller; Sf3. In the simulation model, a ventilator working model is established to simulate the actual situation of the ventilator delivering oxygen to the patient during operation.

[0008] S2, introduce nonlinear inertia weight and super male gene mutation mechanism to improve the human conception algorithm, the specific improvements are: Ss1, introduce nonlinear terms to improve the inertia weight ω1 of the speed update formula; Ss2. Introduce the super male gene mutation mechanism to improve the position update formula of the algorithm.

[0009] S3. Matlab software is used to establish a mathematical model for the improved human conception algorithm (IHCO). The improved human conception algorithm is based on simulating biological phenomena such as fertilization, pregnancy and childbirth in the human reproductive process, and the algorithm is iteratively updated. During the iteration process, the algorithm continuously searches for individual solutions at different positions in the search space and gradually approaches the individual optimal solution. After the iteration is terminated, the values ​​of the individual optimal solution in different dimensions are decoded into a control parameter sequence of the PID controller, thereby obtaining the optimal ventilator flow PID control method. This method can effectively improve the control accuracy and robustness of the flow PID controller.

[0010] S4. Apply the improved human conception algorithm to optimize the flow PID controller and apply it to the ventilator flow control system, so that the system can accurately control the airflow and provide patients with a more stable, precise and comfortable treatment environment.

[0011] Furthermore, in the Sf1, a performance evaluation index model is established for the control system, and the performance evaluation index is used as the objective function of the IHCO algorithm, and the overshoot, response time, steady-state error, integral time error and other aspects of the system are comprehensively considered. The established performance evaluation index model is: In formula (1), J is the quantified performance index, that is, the objective function value of the algorithm, e sys is the steady-state error value of the system, t is the actual running time of the system, T is the total running time of the system, ξ1, ξ2, ξ3 are the weights of the steady-state error, integral time error and integral square error respectively; Furthermore, e sys The mathematical model is: e ss =|Q out -Q set | (2); In formula (2), Q out is the actual output flow of the system, Q set The target flow rate set for the system.

[0012] Furthermore, in the Sf2, a flow PID controller model is established, and a fractional-order PID controller is used as a control model of the flow PID controller. The mathematical model of the fractional-order PID controller is established as follows: U(τ)=K p e(τ)+K i D -λ e(τ)+K d D μ e(τ) (3); In formula (3), U(τ) is the output control signal, e(τ) is the difference between the system target flow and the actual output flow, and K p is the proportional gain parameter, K i is the integral gain parameter, K d is the differential gain parameter, D -λ is a fractional integral operator, D μ is a fractional differential operator; Furthermore, D -λ e(τ) and D μ The mathematical model of e(τ) is: In formula (4), λ is the integration order, which is between (0, 1], μ is the differential order, which is between (0, 1], Γ() is the gamma function, δ is the time delay in the fractional integration, and E(s) is the Laplace transform of the error.

[0013] Furthermore, in the Ss3, in order to simulate the actual situation of the ventilator delivering airflow to the patient during operation, a ventilator flow control working model is established, which comprehensively considers factors such as the air flow output by the ventilator, gas pressure, patient lung volume, and airway resistance. The working model includes: lung model, airway resistance, and ventilator flow output; Furthermore, the lung volume V lung (t) and lung pressure P lung The mathematical model between (t) is: In formula (5), R lung is lung resistance, C lung is the compliance of the lungs, which describes the response of lung volume to changes in pressure; Furthermore, the airway resistance R airway The mathematical model of the relationship between and air flow is: In formula (6), P machine (τ) is the pressure output by the ventilator, which controls the output of the gas flow, R airway It is the resistance of the airway; Furthermore, in order to make the actual gas flow Q out Accurately and stably reach the set flow rate Q set , establish a fractional-order flow PID controller to adjust P machine (τ), the mathematical model of the fractional-order flow PID controller is: P machine (τ) = K p e(τ)+K i D -λ e(τ)+K d D μ e(τ) (7); In formula (7), the parameters have the same meaning as above; Furthermore, in order to simulate and optimize the flow control system of the ventilator in Simulink, a second-order transfer function is established as: In formula (8), Q(s) is the actual output gas flow of the ventilator, and s is the complex frequency domain variable after Laplace transformation.

[0014] Furthermore, in S2, nonlinear inertia weight and super male gene mutation mechanism are introduced to improve the human conception algorithm, and Matlab software is used to establish a mathematical model for improving the human conception algorithm, specifically: Ss1, introduce nonlinear terms to improve the inertia weight ω1 of the speed update formula, enhance the particle's approach speed to the global optimal solution, and the mathematical model of the improved ω1 is: In formula (9), ω init is the initial value of the inertia weight, ω max is the maximum value of the inertia weight, ω min is the minimum value of the inertia weight, t is the current iteration number of the algorithm, T max is the maximum number of iterations of the algorithm, X i (t) is the position of the individual in the current iteration of the algorithm, i = 1, ..., N, N is the population size of the algorithm, X gbest is the global best individual position in the algorithm, D max is the sum of all individuals and X in the current iteration gbest The maximum distance between Furthermore, D max The mathematical model is: In formula (10), max() is the maximum value function, which is used to calculate the maximum value of all individuals and X in the current iteration. gbest The distance between them takes the maximum value, and the other parameters have the same meanings as above; Ss2. The position update formula of the improved algorithm using the super male gene mutation mechanism is introduced. The mathematical model of the super male gene mutation mechanism is: In formula (11), X i new X is the individual position after the super male gene mutation mechanism changes. i (t) is the position of the individual in the current iteration, Y1 and Y2 are super male gene mutation factors; Furthermore, the mathematical model of Y1 and Y2 is: In formula (12), α and β are variation control factors, r1 and r2 are random numbers between [0, 1], and the other parameters have the same meanings as above.

[0015] Furthermore, in S3, a mathematical model is established for an improved human conception algorithm (IHCO) using Matlab software, and the specific steps are as follows: St1, initialize the population size N of the improved human conception algorithm (IHCO), the maximum number of iterations T max , the dimension dim of the individual solution, the algorithm search space [ub, lb], ub and lb represent the upper and lower bounds of the algorithm search space respectively; St2, set the initial inertia weight ω init , maximum inertia weight ω max and ω min , initialize the individual sperm position of the improved human conception algorithm, and the mathematical model of the initial individual sperm position of the improved human conception algorithm is: X init =lb+r3×(ub-lb) (13); In formula (13), X init is the initial sperm individual position generated by pseudo-random number method, r3 is a random vector with a value between [0, 1], ub and lb are the upper and lower bounds of the algorithm; St3, the reverse sperm individual position of the algorithm is generated by the reverse learning strategy. The mathematical model of the reverse learning strategy is: X oppo =ub+lb-X init (14); In formula (14), X oppo is the individual position of the reverse sperm generated by the reverse learning strategy, and the other parameters have the same meanings as above; St4. Calculate the fitness of all initial sperm individual positions and the fitness of all reverse sperm individual positions through the objective function, and determine the position of the sperm individual by comparing the fitness between all initial sperm individual positions and all reverse sperm individual positions. The mathematical model for comparison is: In formula (15), X inpo is the individual position obtained after comparison, F() is the objective function of the algorithm, and the other parameters have the same meaning as above; St5, based on the healthy sperm selection mechanism, the generated sperm population is selected in quantity, so as to select the most suitable population. Only the most suitable population can participate in the subsequent algorithm iteration optimization. The mathematical model of the healthy sperm selection mechanism is: In formula (16), the parameters have the same meaning as above. destroy means destruction. When the fitness of the individual sperm position is worse than the health evaluation index Pfit, this position is destroyed in the sperm population and does not participate in the subsequent algorithm iteration optimization process. The mathematical model of Pfit is: P fit =[F(X worst )-F(X gbest )]×ω+F(X gbest ) (17); In formula (17), X worst is the worst individual sperm position in the population, X gbestis the best individual sperm position in the population, F() is the objective function, and ω is the weighting factor; St6, update the sperm population quantity and sperm individual fitness sequence, use the selected healthy gene population to participate in the algorithm's iterative optimization, and mark the best sperm individual position X in the current iteration in the healthy gene population Pbest and the worst sperm individual position X worst , and the global optimal sperm individual position Xg best ; St7, simulate sperm movement to establish a mathematical model and update the sperm position. The mathematical model of sperm movement is: In formula (18), X i (t) is the position of the sperm individual in the current iteration, V i (t) is the individual sperm movement speed, X i (t+1) is the position of the sperm individual after update, V i (t+1) The mathematical model is: In formula (19), ω1 is the improved inertia weight, V i (t+1) is the updated sperm individual movement speed, C1 and C2 are the sperm individual movement disturbance coefficients, A1 is the relationship between the i-th sperm individual and X Pbest A2 is the distance between the i-th sperm individual and X gbest The distance between i (t) The mathematical model is: In formula (20), γ and η are random numbers between [0, 1], and R is the gbest )-F(X i (t) ) value, r is F(X avg )-F(X i (t) ) value, L is F(X gbest )-F(X avg ), X avg is the average position of all individual sperm positions in a genetically healthy population; St8, simulate that a part of sperm will produce XYY chromosomes in the process of combining with eggs, use super male gene mutation mechanism to improve the algorithm, update the sperm position, and the mathematical model of super male gene mutation mechanism is the same as above; St9, simulate the process of sperm super-activation to establish a mathematical model, the mathematical model of sperm super-activation is: X hyper =X gbest ×(1+r4×sin(2πm1)×cos(2πm2)) (21); In formula (21), X hyper is a hyperactivated sperm individual, r4 is a random number between [0, 1], m1 and m2 are sperm flagellar motion parameters, and other parameters are the same as above; St10, when the global optimal solution X gbest When the value is the same in two or more iterations, the new global best sperm individual is determined by comparing the individual fitness of the super-activated sperm with the individual fitness of the global best sperm. The mathematical model for the comparison is: In formula (22), To compare the updated global optimal sperm individual position, F(X hyper ) is X hyper The fitness of F(X gbest ) is X gbest Adaptability; St11, check whether all sperm individuals participating in the iteration have crossed the boundary, calculate the fitness of all sperm individuals, and sort them according to the fitness size, mark the individual with the smallest fitness as the global best sperm individual, and the individual with the largest fitness as the worst sperm individual; St12, check whether the current number of iterations t is greater than T max If yes, then output the global best sperm individual X gbest For the individual optimal solution, the optimal solution is converted into the optimal Kp, Ki, and Kd parameters of the flow PID controller. If not, return to step St6 to continue iterative optimization.

[0016] The present invention proposes a method for optimizing precise control of respiratory flow based on PID, and optimizes the flow PID controller of the ventilator by improving the human conception algorithm (IHCO). Compared with the prior art, the present invention has the following beneficial effects: G1, by improving the inertia weight ω1, the algorithm can adaptively adjust the search speed and search accuracy of the algorithm at different stages, and the introduction of the super male gene mutation mechanism can improve the diversity of the search, increase the exploration ability of the population, and avoid premature convergence in the search process; G2. By improving the human conception algorithm to optimize the PID controller, the Kp, Ki, and Kd parameters in the PID controller can be automatically optimized, saving the time of manual parameter adjustment by the staff. In addition, due to the improvement of the algorithm, the PID controller can control the flow change more smoothly, reduce overshoot and oscillation, and improve the stability and response speed of the system. G3. The optimized PID controller can quickly respond to changes in the set flow rate and can better adapt to the actual needs of patients, ensuring that the ventilator outputs a stable and accurate oxygen flow rate and improving the comfort and safety of patients. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is the overall technical optimization framework diagram of the ventilator flow PID controller.

[0018] Figure 2 Flowchart for optimizing flow PID controller parameters for improved human conception algorithm.

[0019] Figure 3 Graph of the best parameter evolution for optimizing the flow PID controller for the improved human conception algorithm.

[0020] Figure 4 Comparison of the evolution curves of the flow PID controller optimized for the improved human conception algorithm and the ordinary human conception algorithm.

[0021] Figure 5 Comparison chart of the effect of optimizing the flow PID controller for the improved human conception algorithm and the ordinary human conception algorithm. DETAILED DESCRIPTION

[0022] The following will further illustrate the content of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention, but it should not be understood as limiting the present invention. Without departing from the spirit and essence of the present invention, modifications or replacements made to the method, steps or conditions of the present invention all belong to the protection scope of the present invention.

[0023] See also Figure 1-Figure 5 The present invention provides a method for optimizing the precise control of respiratory flow based on PID. The human conception algorithm (IHCO) is improved by introducing nonlinear inertia weight and super male gene mutation mechanism, and the improved human conception algorithm is used to optimize the control parameters of the ventilator flow PID controller to enhance the overall performance of the ventilator flow control system. The implementation process uses Matlab mathematical modeling software and Simulink simulation software, such as Figure 1 As shown, the specific steps are S1 to S4.

[0024] S1. Use Simulink software to establish a simulation model for the ventilator flow control system. The simulation model is: Sf1. Use Simulink software to establish a performance evaluation index model, and use the performance evaluation index of the control system as the objective function of the IHCO algorithm. The established performance evaluation index model is: In formula (1), J is the quantified performance index, that is, the objective function value of the algorithm, esys is the steady-state error value of the system, t is the actual operating time of the system, T is the total operating time of the system, ξ1 is set to 0.1, ξ2 is set to 0.5, and ξ3 is set to 0.4; Sf2. Use Simulink software to establish a flow PID controller model, and use the fractional-order PID controller as the control model of the flow PID controller. The fractional-order flow PID controller model includes: Input signal module, error calculation module, fractional-order flow PID controller module, ventilator working model, feedback loop, oscilloscope module; Further, the fractional-order flow PID controller module includes: a Kp gain module, a Ki gain module, a Kd gain module, a fractional-order integral module, and a fractional-order differential module; Furthermore, in order to simulate the flow control of the ventilator in actual working conditions, a second-order transfer function is established as the working model of the ventilator. The second-order transfer function is: In formula (8), Q(s) is the actual output gas flow of the ventilator, and s is the complex frequency domain variable after Laplace transformation.

[0025] S2. Introducing nonlinear inertia weight and super male gene mutation mechanism to improve the human conception algorithm. The specific improvements are as follows: Ss1. Introducing nonlinear terms to improve the inertia weight ω1 of the speed update formula, enhancing the particle's approach speed to the global optimal solution. The mathematical model of the improved ω1 is: In formula (9), ω init is the initial value of the inertia weight, ω max is the maximum value of the inertia weight, ω min is the minimum value of the inertia weight, t is the current iteration number of the algorithm, T max is the maximum number of iterations of the algorithm, X i (t) is the position of the individual in the current iteration of the algorithm, i = 1, ..., N, N is the population size of the algorithm, X gbest is the global best individual position in the algorithm, D max is the sum of all individuals and X in the current iteration gbest The maximum distance between Furthermore, D max The mathematical model is: In formula (10), max() is the maximum value function, which is used to calculate the maximum value of all individuals and X in the current iteration. gbest The distance between them takes the maximum value, and the other parameters have the same meanings as above; Ss2. The position update formula of the improved algorithm using the super male gene mutation mechanism is introduced. The mathematical model of the super male gene mutation mechanism is: In formula (11), X i new X is the individual position after the super male gene mutation mechanism changes. i (t) is the position of the individual in the current iteration, Y1 and Y2 are super male gene mutation factors; Furthermore, the mathematical model of Y1 and Y2 is: In formula (12), α and β are variation control factors, which are set to 0.02 and 0.03 respectively, r1 and r2 are random numbers between [0, 1], and the other parameters have the same meanings as above.

[0026] S3. Use Matlab software to establish a mathematical model for the improved human conception algorithm (IHCO). The specific steps are as follows: St1. Initialize the population size N of the improved human conception algorithm (IHCO) to 30 and the maximum number of iterations T max is 20, the dimension dim of the individual solution is 3, and the algorithm search space [ub, lb] is set to [0, 100], where ub and lb represent the upper and lower bounds of the algorithm search space respectively; St2, set ω init is 0.001, ω max is 0.01, ω min is 0.0001, and the individual sperm positions of the improved human conception algorithm are initialized. The initial individual sperm positions mathematical model of the improved human conception algorithm is: X init =lb+r3×(ub-lb) (13); In formula (13), X init is the initial sperm individual position generated by pseudo-random number method, r3 is a random vector with a value between [0, 1], ub and lb are the upper and lower bounds of the algorithm; St3, the reverse sperm individual position of the algorithm is generated by the reverse learning strategy. The mathematical model of the reverse learning strategy is: X oppo =ub+lb-X init (14); In formula (14), X oppo is the individual position of the reverse sperm generated by the reverse learning strategy, and the other parameters have the same meanings as above; St4. Calculate the fitness of all initial sperm individual positions and the fitness of all reverse sperm individual positions through the objective function, and determine the position of the sperm individual by comparing the fitness between all initial sperm individual positions and all reverse sperm individual positions. The mathematical model for comparison is: In formula (15), X inpo is the individual position obtained after comparison, F() is the objective function of the algorithm, and the other parameters have the same meaning as above; St5, based on the healthy sperm selection mechanism, the generated sperm population is selected in quantity, so as to select the most suitable population. Only the most suitable population can participate in the subsequent algorithm iteration optimization. The mathematical model of the healthy sperm selection mechanism is: In formula (16), the parameters have the same meaning as above. destroy means destruction. When the fitness of the individual sperm position is worse than the health evaluation index Pfit, this position is destroyed in the sperm population and does not participate in the subsequent algorithm iteration optimization process. The mathematical model of Pfit is: Pfit=[F(X worst )-F(X gbest )]×ω+F(X gbest ) (17); In formula (17), X worst is the worst individual sperm position in the population, X gbest is the best individual sperm position in the population, F() is the objective function, and ω is the weighting factor, which is set to 0.65; St6, update the sperm population quantity and sperm individual fitness sequence, use the selected healthy gene population to participate in the algorithm's iterative optimization, and mark the best sperm individual position X in the current iteration in the healthy gene population Pbest and the worst sperm individual position X worst , and the global optimal sperm individual position Xg best ; St7, simulate sperm movement to establish a mathematical model and update the sperm position. The mathematical model of sperm movement is: In formula (18), X i (t) is the position of the sperm individual in the current iteration, V i (t) is the individual sperm movement speed, X i (t+1) is the position of the sperm individual after update, V i (t+1) The mathematical model is: In formula (19), ω1 is the improved inertia weight, V i (t+1) is the updated individual sperm movement speed, C1 and C2 are the individual sperm movement disturbance coefficients, both set to 1.4, A1 is the difference between the i-th sperm individual and X Pbest A2 is the distance between the i-th sperm individual and X gbest The distance between i (t) The mathematical model is: In formula (20), γ and η are random numbers between [0, 1], and R is the gbest )-F(X i (t) ) value, r is F(X avg )-F(X i (t) ) value, L is F(X gbest )-F(X avg ), X avg is the average position of all individual sperm positions in a genetically healthy population; St8, simulate that a part of sperm will produce XYY chromosomes in the process of combining with eggs, use super male gene mutation mechanism to improve the algorithm, update the sperm position, and the mathematical model of super male gene mutation mechanism is the same as above; St9, simulate the process of sperm super-activation to establish a mathematical model, the mathematical model of sperm super-activation is: X hyper =X gbest ×(1+r4×sin(2πm1)×cos(2πm2)) (21); In formula (21), X hyper is a hyperactivated sperm individual, r4 is a random number between [0, 1], m1 and m2 are sperm flagellar motion parameters, and other parameters are the same as above; St10, when the global optimal solution X gbest When the value is the same in two or more iterations, the new global best sperm individual is determined by comparing the individual fitness of the super-activated sperm with the individual fitness of the global best sperm. The mathematical model for the comparison is: In formula (22), To compare the updated global optimal sperm individual position, F(X hyper ) is X hyper The fitness of F(X gbest ) is X gbest Adaptability; St11, check whether all sperm individuals participating in the iteration have crossed the boundary, calculate the fitness of all sperm individuals, and sort them according to the fitness size, mark the individual with the smallest fitness as the global best sperm individual, and the individual with the largest fitness as the worst sperm individual; St12, check whether the current number of iterations t is greater than T max If yes, then output the global best sperm individual X gbest For the individual optimal solution, the optimal solution is converted into the optimal Kp, Ki, and Kd parameters of the flow PID controller. If not, return to step St6 to continue iterative optimization.

[0027] S4. Apply the improved human conception algorithm to optimize the flow PID controller to the ventilator flow control system. The specific steps are as follows: Se1. Set the running time of the ventilator flow control system to 5s, the sampling time to 0.05s, the initial flow to 0L / s, and the target flow to 0.2L / s; Se2, the input signal output target flow rate is 0.2L / s, and the error e(τ) between the target flow rate and the actual output flow rate is calculated through the error calculation module; Se3, improve the human conception algorithm to output the best Kp, Ki, Kd parameters to the fractional-order PID controller, and optimize the fractional-order PID controller, such as Figure 3 As shown, the optimal Kp, Ki, and Kd parameters are: 40.97, 5.60, and 3.22; Se4. Input e(τ) into the fractional-order PID controller model and output the control value P of the gas flow rate machine (τ); Se5, P machine (τ) is input into the transfer function, the transfer function simulates the actual flow rate output by the working model of the ventilator, and the actual output flow rate curve is observed through an oscilloscope; Se6. The feedback loop feeds back the actual output flow to the error calculation module to achieve closed-loop control of the ventilator flow control system.

[0028] like Figure 4 As shown in the figure, the evolution curves of the improved human conception algorithm and the human conception algorithm are comprehensively analyzed. The improved human conception algorithm (IHCO) introduces nonlinear inertia weights and super male gene mutation mechanisms. Compared with the human conception algorithm (HCO), it has faster convergence speed, stronger ability to jump out of local optimality, and better global search performance. It can reach a better solution in a shorter number of iterations. It can be seen that the fitness of the optimal solution of the improved human conception algorithm is much smaller than that of the human conception algorithm.

[0029] The effect comparison of the improved human conception algorithm, the human conception algorithm optimized flow PID controller and the ordinary flow PID controller observed by the oscilloscope module is as follows Figure 5 As shown, the ordinary PID control shows a more obvious overshoot, and the flow PID controller optimized by the human conception algorithm shows a smaller overshoot. Although there are some fluctuations, the overshoot amplitude is smaller than that of the ordinary PID, and the overshoot of the improved human conception algorithm has no overshoot, which can fully avoid overshoot to ensure the safety of patients. The response speed of the flow PID controller optimized by the improved human conception algorithm is not slower than that of the flow PID controller optimized by the human conception algorithm and the ordinary flow PID controller in the early stage. When the stabilization time is reached, the flow PID controller optimized by the improved human conception algorithm has the shortest time to reach the stabilization time, which is 0.45s, and has been maintained at the target flow without any fluctuations. The time for the flow PID controller optimized by the human conception algorithm to reach the stabilization time is greatly extended to 1.35s, and the time for the ordinary flow PID controller to reach the stabilization time is the longest, which is 1.8s. Therefore, from the aspects of overshoot, response speed, steady-state error, etc., it can be compared that the flow PID controller optimized by the improved human conception algorithm has the best performance, and the improvement method proposed in the present invention is effective.

[0030] In summary, the present invention provides a method for precise control and optimization of respiratory flow based on PID. By introducing nonlinear inertia weight and super-male gene mutation mechanism to improve the human conception algorithm and optimize the flow PID controller, the Kp, Ki, and Kd parameters of the flow PID controller can be automatically adjusted during the operation of the control system, thereby improving the stability, response speed, and robustness of the PID controller, thereby improving the performance of the ventilator, and not only accurately controlling the airflow, but also enhancing the stability of the system and the comfort of the patient, thereby ensuring the effect of the treatment.

Claims

1. A method for optimizing precise control of respiratory flow based on PID, characterized in that: Specifically include: S1. Use Simulink software to establish a simulation model for the ventilator flow control system. The simulation model includes: Sf1. In the simulation model, a performance evaluation index model is established, and the performance evaluation index of the control system is used as the objective function for improving the human conception algorithm; Sf2. In the simulation model, a flow PID controller model is established, and a fractional-order PID controller is used as the control model of the flow PID controller; Sf3. In the simulation model, a ventilator working model is established to simulate the actual situation of the ventilator delivering oxygen to the patient during operation; S2. Introducing nonlinear inertia weight and super male gene mutation mechanism to improve the human conception algorithm. The specific improvements are: Ss1, introduce nonlinear terms to improve the inertia weight ω1 of the speed update formula; Ss2, introduce super male gene mutation mechanism to improve the position update formula of the algorithm; S3, establish a mathematical model for the improved human conception algorithm (IHCO) using Matlab software; S4. Apply the improved human conception algorithm to optimize the flow PID controller and apply it to the ventilator flow control system.

2. A PID respiratory flow precise control optimization method according to claim 1, characterized in that: In S2, nonlinear inertia weight and super male gene mutation mechanism are introduced to improve the human conception algorithm, specifically: Ss1, introduce nonlinear terms to improve the inertia weight ω1 of the speed update formula. The mathematical model of the improved ω1 is: In formula (3), ω init is the initial value of the inertia weight, ω max is the maximum value of the inertia weight, ω min is the minimum value of the inertia weight, t is the current iteration number of the algorithm, T max is the maximum number of iterations of the algorithm, X i (t) is the position of the individual in the current iteration of the algorithm, i = 1, ..., N, N is the population size of the algorithm, X gbest is the global best individual position in the algorithm, D max is the sum of all individuals and X in the current iteration gbest The maximum distance between Furthermore, D max The mathematical model is: In formula (4), max() is a maximum value function, which is used to calculate the relationship between all individuals and Xgbes in the current iteration. t The distance between them takes the maximum value, and the other parameters have the same meanings as above; Ss2. The position update formula of the improved algorithm using the super male gene mutation mechanism is introduced. The mathematical model of the super male gene mutation mechanism is: In formula (5), X i new X is the individual position after the super male gene mutation mechanism changes. i (t) is the position of the individual in the current iteration, Y1 and Y2 are super male gene mutation factors; Furthermore, the mathematical model of Y1 and Y2 is: In formula (6), α and β are variation control factors, r1 and r2 are random numbers between [0, 1], and the other parameters have the same meanings as above.

3. The method for optimizing the precise control of respiratory flow based on PID according to claim 1, characterized in that: In S3, a mathematical model is established to improve the human conception algorithm, and the specific steps are as follows: St1, initialize the improved human conception algorithm, calculate the fitness of all initial sperm individual positions and the fitness of all reverse sperm individual positions; St2, determine the position of the sperm individual by comparing the fitness between all initial sperm individual positions and all reverse sperm individual positions; St3, based on the healthy sperm selection mechanism, the generated sperm population is selected in quantity, so as to select a population to participate in the next algorithm iteration optimization; St4, update the sperm population quantity and sperm individual fitness sequence, mark the best sperm individual position X in the current iteration in the healthy gene population Pbest and the worst sperm individual position X worst , and the global optimal sperm individual position Xg best ; St5, simulate sperm movement to establish a mathematical model and update sperm position; St6, updating sperm position based on super male gene mutation mechanism, the mathematical model of super male gene mutation mechanism is the same as above; St7, simulate the sperm super-activation process to establish a mathematical model, the mathematical model of sperm super-activation is: X hyper =X gbest ×(1+r4×sin(2πm1)×cos(2πm2)) (7); In formula (7), X hyper is a hyperactivated sperm individual, r4 is a random number between [0, 1], m1 and m2 are sperm flagellar motion parameters, and other parameters are the same as above; St8, when the global best sperm individual X gbest When the value is the same in two or more iterations, the fitness of the super-activated sperm individual and the fitness of the global best sperm individual are compared to determine the new global best sperm individual; St8, check whether the sperm individuals participating in the iteration are out of bounds, calculate the fitness of all sperm individuals, mark the individual with the smallest fitness as the global best sperm individual, and mark the individual with the largest fitness as the worst sperm individual; St10, check whether the current number of iterations t is greater than T max If yes, then output the global best sperm individual X gbest is the individual optimal solution, and the optimal solution is converted into the optimal K of the flow PID controller p , K i , K d Parameters, if not, return to step St6 to continue iterating and optimizing.

4. A PID respiratory flow precise control optimization method according to claim 3, characterized in that: In said S3, step St1, initializing the improved human conception algorithm is specifically as follows: Stf1, initialize the population size N of the improved human conception algorithm, the maximum number of iterations T max , the dimension dim of the individual solution, the algorithm search space [ub, lb], ub and lb represent the upper and lower bounds of the algorithm search space respectively; Sff2, set the initial inertia weight ω init , maximum inertia weight ω max and ω min , initialize the individual sperm position of the improved human conception algorithm, and the mathematical model of the initial individual sperm position of the improved human conception algorithm is: X init =lb+r3×(ub-lb) (7); In formula (7), X init is the initial sperm individual position generated by pseudo-random number method, r3 is a random vector with a value between [0, 1], ub and lb are the upper and lower bounds of the algorithm; Stf3, the reverse sperm individual position generated by the reverse learning strategy algorithm, the mathematical model of the reverse learning strategy is: X oppo =ub+lb-X init (8); In formula (8), X oppo is the individual position of the reverse sperm generated by the reverse learning strategy, and the other parameters have the same meanings as above.

5. The method for optimizing precise control of respiratory flow based on PID according to claim 3, characterized in that: In step St2 of S3, the mathematical model for comparing the fitness between all initial sperm individual positions and all reverse sperm individual positions is: In formula (9), X inpo is the individual position obtained after comparison, F() is the objective function of the algorithm, and the other parameters have the same meanings as above.

6. The method for optimizing precise control of respiratory flow based on PID according to claim 3, characterized in that: In said S3, step St3, the mathematical model of the healthy sperm selection mechanism is: In formula (10), the parameters have the same meaning as above. destroy means destruction. When the fitness of the individual sperm position is worse than the health evaluation index Pfit, this position is destroyed in the sperm population and does not participate in the subsequent algorithm iteration optimization process. The mathematical model of Pfit is: Pfit=[F(X worst )-F(X gbest )]×ω+F(X gbest ) (11); In formula (11), X worst is the worst individual sperm position in the population, X gbest is the best individual sperm position in the population, F() is the objective function, and ω is the weighting factor.

7. The method for optimizing precise control of respiratory flow based on PID according to claim 3, characterized in that: In step S3, step St5, the mathematical model of sperm movement is: In formula (12), X i (t) is the position of the sperm individual in the current iteration, V i (t) is the individual sperm movement speed, X i (t+1) is the position of the sperm individual after update, V i (t+1) The mathematical model is: In formula (13), ω1 is the improved inertia weight, V i (t+1) is the updated sperm individual movement speed, C1 and C2 are the sperm individual movement disturbance coefficients, A1 is the relationship between the i-th sperm individual and X Pbest A2 is the distance between the i-th sperm individual and X gbest The distance between i (t) The mathematical model is: In formula (14), γ and η are random numbers between [0, 1], and R is the gbest )-F(X i (t) ) value, r is F(X avg )-F(X i (t) ) value, L is F(X gbest )-F(X avg ), X avg is the average position of the values ​​of the individual positions of all sperm in a genetically healthy population.

8. The method for optimizing precise control of respiratory flow based on PID according to claim 3, characterized in that: In step St8 of S3, the mathematical model for comparing the fitness of individual super-activated sperm and the fitness of individual global optimal sperm is: In formula (15), To compare the updated global optimal sperm individual position, F(X hyper ) is X hyper The fitness of F(X gbest ) is X gbest The fitness of .

Citation Information

Patent Citations

  • Magnetic flux leakage testing defect reconstruction method based on improved particle swarm optimization algorithm

    CN104897769A

  • Dose control optimization method for radiotherapy electron linear accelerator

    CN118341003A

  • Molar water spraying speed control optimization method for dental unit

    CN118391241A

  • Insulin refrigeration temperature optimization control method

    CN118502510A

  • Unmanned aerial vehicle three-dimensional path planning method based on improved whale optimization algorithm

    CN118915810A

Cited By

  • Negative pressure control optimization method for electric aspirator

    CN121059917A