A precise control and optimization method of respiratory flow based on PID

By improving the human conception algorithm to optimize the flow PID controller, the complex problems of traditional PID control overshoot and parameter adjustment in the flow control of ventilator are solved, and more stable and fast flow control is achieved, improving the performance of ventilator and patient comfort.

CN119909276BActive Publication Date: 2025-08-22THE FIRST MEDICAL CENT CHINESE PLA GENERAL HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional PID control has problems such as flow overshoot, complex parameter adjustment, and low accuracy in ventilator flow control, which can affect patients' health and comfort.

Method used

The improved human conception algorithm (IHCO) is used to optimize the flow PID controller, and the Kp, Ki, and Kd parameters are automatically adjusted by introducing nonlinear inertial weights and superhero gene mutation mechanisms, and combined with fractional-order PID controllers, the ventilator flow control is optimized.

Benefits of technology

It improves the stability and response speed of the PID controller, reduces overshoot and oscillation of flow changes, ensures the stability of oxygen flow and the comfort of the patient, and improves the therapeutic effect of the ventilator.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119909276B_ABST
    Figure CN119909276B_ABST
Patent Text Reader

Abstract

The present invention discloses a precise control optimization method for respiratory flow based on PID, which belongs to the field of fractional-order PID optimization technology. By introducing nonlinear inertia weights and super-male gene mutation mechanisms to improve the human conception algorithm and optimize the fractional-order flow PID controller, the method can automatically adjust the Kp, Ki, and Kd parameters of the flow PID controller during the operation of the control system, thereby improving the stability, response speed, and robustness of the PID controller, thereby enhancing the performance of the ventilator, accurately controlling the airflow, and enhancing the stability of the system and the comfort of the patient, thereby ensuring the treatment effect.
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 typically 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, 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 precise regulation of the airflow and the patient's comfort and safety. The main purpose of the ventilator's flow control system is to precisely control the gas flow delivered to the patient's airway. The ventilator's flow control system consists of multiple components working together, of which the flow PID controller is its core component.

[0003] In the flow control system of a ventilator, PID control uses a closed-loop control method, using sensors to measure the difference between the actual flow rate and the target flow rate for feedback adjustment. This method features closed-loop control, ease of implementation, and high stability. However, traditional PID control also has its shortcomings. First, flow overshoot can occur in traditional PID control, putting pressure on the user's heart and lungs, thereby affecting their health. Second, traditional PID controllers rely on the adjustment of the Kp, Ki, and Kd parameters. In different usage scenarios and conditions, staff manually adjust these parameters, which is complex and inaccurate. Finally, if the ventilator system has nonlinear characteristics such as airflow pressure, traditional PID controllers will have difficulty achieving optimal control.

[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 and 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 existing ventilators causing a large impact on users due to a sudden increase in air flow; 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 proposed 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 strong parameter sensitivity and slow convergence speed of the algorithm, its application in optimizing the parameters of ventilator flow PID controller is limited. Summary of the Invention

[0005] The purpose of the present invention is to address the shortcomings of the existing technology and provide a method for precise control and optimization of respiratory flow based on PID. 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 effectiveness of treatment.

[0006] To achieve the above objectives, the present invention provides the following technical solutions: a method for precise control and optimization 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 using Simulink software. The simulation model is as follows: 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;

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

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

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

[0011] Ss2. Introduce the super male gene mutation mechanism to improve the position update formula of the algorithm.

[0012] 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 the simulation of biological phenomena such as fertilization, pregnancy and childbirth in the human reproductive process, and the algorithm is iteratively updated. During the iterative 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.

[0013] 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, accurate and comfortable treatment environment.

[0014] Furthermore, in 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. Taking into account the overshoot, response time, steady-state error, integral time error and other aspects of the system, the established performance evaluation index model is:

[0015]

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

[0017] Furthermore, e sys The mathematical model is:

[0018] e ss =|Q out -Q set | (2);

[0019] In formula (2), Q out is the actual output flow of the system, Q set The target flow rate set for the system.

[0020] Furthermore, in Sf2, a flow PID controller model is established, and a fractional-order PID controller is used as the control model of the flow PID controller. The mathematical model of the fractional-order PID controller is established as follows:

[0021] U(τ)=K p e(τ)+K i D -λ e(τ)+K d D μ e(τ) (3);

[0022] In formula (3), U(τ) is the output control signal, e(τ) is the difference between the system target flow and the actual output flow, 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-order integral operator, D μ is a fractional differential operator;

[0023] Furthermore, D-λ e(τ) and D μ The mathematical model of e(τ) is:

[0024]

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

[0026] Furthermore, in 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;

[0027] Furthermore, the lung volume V lung (t) and lung pressure P lung The mathematical model between (t) is:

[0028]

[0029] In formula (5), R lung is the lung resistance, C lung is the compliance of the lungs, which describes the response of lung volume to changes in pressure;

[0030] Furthermore, the airway resistance R airway The mathematical model of the relationship between θ and air flow is:

[0031]

[0032] In formula (6), P machine (τ) is the pressure output by the ventilator, which controls the output of the air flow, R airway It is the resistance of the airway;

[0033] Furthermore, in order to make the actual air 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:

[0034] P machine (τ) = K p e(τ)+K i D -λ e(τ)+K d D μ e(τ) (7);

[0035] In formula (7), the meanings of the parameters are the same as above;

[0036] Furthermore, to simulate and optimize the ventilator flow control system in Simulink, a second-order transfer function is established:

[0037]

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

[0039] 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 the improved human conception algorithm, specifically:

[0040] 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:

[0041]

[0042] In formula (9), ω init is the initial value of the inertia weight, ω max is the maximum value of 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 For all individuals in the current iteration and X gbest The maximum distance between them;

[0043] Furthermore, D max The mathematical model is:

[0044]

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

[0046] Ss2. Introducing the super-male gene mutation mechanism to improve the algorithm’s position update formula. The mathematical model of the super-male gene mutation mechanism is:

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

[0048] Furthermore, the mathematical model of Y1 and Y2 is:

[0049]

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

[0051] Furthermore, in S3, Matlab software is used to establish a mathematical model for the Improved Human Conception Algorithm (IHCO), with the following specific steps:

[0052] St1. Initialize the population size N and the maximum number of iterations T of the improved human conception algorithm (IHCO) 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;

[0053] St2, set the initial inertia weight ω init , maximum inertia weight ω max and ω min , initialize the individual sperm position of the improved human conception algorithm. The mathematical model of the initial individual sperm position of the improved human conception algorithm is:

[0054] X init =lb+r3×(ub-lb) (13);

[0055] In formula (13), X init is the initial individual sperm position generated by the 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;

[0056] St3, the reverse sperm individual position of the reverse learning strategy generation algorithm, the mathematical model of the reverse learning strategy is:

[0057] X oppo =ub+lb-X init (14);

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

[0059] St4. Calculate the fitness of all initial sperm individual positions and the fitness of all reverse sperm individual positions through the objective function. 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:

[0060]

[0061] 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 meanings as above; St5, based on the healthy sperm selection mechanism, the generated sperm population is selected in quantity 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:

[0062]

[0063] In formula (16), the parameters have the same meaning as above. destroy represents destruction. When the fitness of an 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 iterative optimization process. The mathematical model of Pfit is:

[0064] P fit =[F(X worst )-F(X gbest )]×ω+F(X gbest ) (17);

[0065] In formula (17), X worst is the worst individual sperm position in the population, X gbest is the optimal individual sperm position in the population, F() is the objective function, and ω is the weighting factor;

[0066] St6, update the sperm population and sperm individual fitness sequence, use the selected healthy gene population to participate in the iterative optimization algorithm, 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 ;

[0067] St7, simulate sperm movement to establish a mathematical model and update the sperm position. The mathematical model of sperm movement is:

[0068]

[0069] In formula (18), X i (t) is the position of the sperm individual in the current iteration, Vi (t) is the individual sperm movement speed, X i (t+1) is the updated position of the sperm individual, V i (t+1) The mathematical model is:

[0070]

[0071] 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, 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:

[0072]

[0073] In formula (20), γ and η are random numbers between [0, 1], and R is the value of F(X 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;

[0074] St8. Simulate that some sperm will produce XYY chromosomes during the process of combining with the egg. Use the super-male gene mutation mechanism to improve the algorithm and update the sperm position. The mathematical model of the super-male gene mutation mechanism is the same as above.

[0075] St9, simulate the sperm hyperactivation process to establish a mathematical model, the mathematical model of sperm hyperactivation is:

[0076] X hyper =X gbest ×(1+r4×sin(2πm1)×cos(2πm2)) (21);

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

[0078] St10, when the global optimal solution Xgbest When the same value is obtained in two or more iterations, the new global optimal sperm individual is determined by comparing the individual fitness of the super-activated sperm with the individual fitness of the global optimal sperm. The mathematical model for the comparison is:

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

[0080] 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. The individual with the smallest fitness is marked as the global best sperm individual, and the individual with the largest fitness is marked as the worst sperm individual;

[0081] St12, check whether the current number of iterations t is greater than T max If so, 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.

[0082] The present invention proposes a method for optimizing precise control of respiratory flow based on PID. By improving the human conception algorithm (IHCO), the flow PID controller of the ventilator is optimized. Compared with the prior art, the present invention has the following beneficial effects:

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

[0084] 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 staff time of manually adjusting the parameters. In addition, due to the improvement of the algorithm, the PID controller can control flow changes more smoothly, reduce overshoot and oscillation, and improve the stability and response speed of the system.

[0085] G3. The optimized PID controller can quickly respond to changes in the set flow rate and better adapt to the patient's actual needs, ensuring that the ventilator outputs a stable and accurate oxygen flow rate, improving patient comfort and safety. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0087] Figure 2 Flowchart for optimizing flow PID controller parameters for improving the human conception algorithm.

[0088] Figure 3 Evolution of optimal parameters for optimizing the flow PID controller for improving the human conception algorithm.

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

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

[0091] The present invention will be further described below with reference to the accompanying drawings in the embodiments of the present invention, but should not be construed as limiting the present invention. Modifications or replacements made to the method, steps or conditions of the present invention without departing from the spirit and substance of the present invention are within the scope of protection of the present invention.

[0092] See also Figure 1-Figure 5 The present invention provides a method for optimizing the precise control of respiratory flow based on PID. By introducing nonlinear inertia weight and super-male gene mutation mechanism, the human conception algorithm (IHCO) is improved. The improved human conception algorithm is used to optimize the control parameters of the ventilator flow PID controller, thereby enhancing 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.

[0093] 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:

[0094]

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

[0096] Sf2. Use Simulink software to establish a flow PID controller model, using a fractional-order PID controller as the control model of the flow PID controller. The fractional-order flow PID controller model includes:

[0097] Input signal module, error calculation module, fractional-order flow PID controller module, ventilator working model, feedback loop, oscilloscope module;

[0098] Furthermore, 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;

[0099] 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:

[0100]

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

[0102] 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 speed at which particles approach the global optimal solution. The mathematical model of the improved ω1 is:

[0103]

[0104] In formula (9), ω init is the initial value of the inertia weight, ω max is the maximum value of 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 For all individuals in the current iteration and X gbest The maximum distance between them;

[0105] Furthermore, D max The mathematical model is:

[0106]

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

[0108] Ss2. Introducing the super-male gene mutation mechanism to improve the algorithm’s position update formula. The mathematical model of the super-male gene mutation mechanism is:

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

[0110] Furthermore, the mathematical models of Y1 and Y2 are:

[0111]

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

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

[0114] 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 mathematical model of the initial individual sperm positions of the improved human conception algorithm is:

[0115] X init =lb+r3×(ub-lb) (13);

[0116] In formula (13), X init is the initial individual sperm position generated by the 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;

[0117] St3, the reverse sperm individual position of the reverse learning strategy generation algorithm, the mathematical model of the reverse learning strategy is:

[0118] X oppo=ub+lb-X init (14);

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

[0120] St4. Calculate the fitness of all initial sperm individual positions and the fitness of all reverse sperm individual positions through the objective function. 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:

[0121]

[0122] 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 meanings as above; St5, based on the healthy sperm selection mechanism, the generated sperm population is selected in quantity 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:

[0123]

[0124] In formula (16), the parameters have the same meaning as above. destroy represents destruction. When the fitness of an 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 iterative optimization process. The mathematical model of Pfit is:

[0125] Pfit=[F(X worst )-F(X gbest )]×ω+F(X gbest ) (17);

[0126] In formula (17), X worst is the worst individual sperm position in the population, X gbest is the optimal individual sperm position in the population, F() is the objective function, and ω is the weighting factor, which is set to 0.65;

[0127] St6, update the sperm population and sperm individual fitness sequence, use the selected healthy gene population to participate in the iterative optimization algorithm, 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 ;

[0128] St7, simulate sperm movement to establish a mathematical model and update the sperm position. The mathematical model of sperm movement is:

[0129]

[0130] 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 updated position of the sperm individual, V i (t+1) The mathematical model is:

[0131]

[0132] 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:

[0133]

[0134] In formula (20), γ and η are random numbers between [0, 1], and R is the value of F(X 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;

[0135] St8. Simulate that some sperm will produce XYY chromosomes during the process of combining with the egg. Use the super-male gene mutation mechanism to improve the algorithm and update the sperm position. The mathematical model of the super-male gene mutation mechanism is the same as above.

[0136] St9, simulate the sperm hyperactivation process to establish a mathematical model, the mathematical model of sperm hyperactivation is:

[0137] X hyper =X gbest×(1+r4×sin(2πm1)×cos(2πm2)) (21);

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

[0139] St10, when the global optimal solution X gbest When the same value is obtained in two or more iterations, the new global optimal sperm individual is determined by comparing the individual fitness of the super-activated sperm with the individual fitness of the global optimal sperm. The mathematical model for the comparison is:

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

[0141] 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. The individual with the smallest fitness is marked as the global best sperm individual, and the individual with the largest fitness is marked as the worst sperm individual;

[0142] St12, check whether the current number of iterations t is greater than T max If so, 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.

[0143] S4. Apply the improved human conception algorithm to optimize the flow PID controller and apply it to the ventilator flow control system. The specific steps are as follows:

[0144] Se1. Set the running time of the ventilator flow control system to 5s, the sampling time to 0.05s, the initial flow rate to 0L / s, and the target flow rate to 0.2L / s;

[0145] Se2, the input signal output target flow rate is 0.2L / s, and the error calculation module is used to calculate the error e(τ) between the target flow rate and the actual output flow rate;

[0146] 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 3As shown, the optimal Kp, Ki, and Kd parameters are: 40.97, 5.60, and 3.22;

[0147] Se4. Input e(τ) into the fractional-order PID controller model and output the control value P of the gas flow machine (τ);

[0148] Se5, P machine (τ) is input into the transfer function, which simulates the actual flow output of the ventilator working model, and the actual output flow curve is observed through an oscilloscope;

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

[0150] 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 escape 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.

[0151] The effects 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 are as follows: Figure 5 As shown in the figure, the ordinary PID control exhibits a more obvious overshoot, while 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. The overshoot of the improved human conception algorithm is zero, which can fully avoid overshoot to ensure patient safety. 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 reaching the stabilization time, the flow PID controller optimized by the improved human conception algorithm has the shortest time to reach stabilization, which is 0.45s, and always maintains at the target flow without any fluctuation. The flow PID controller optimized by the human conception algorithm takes a much longer time to reach stabilization, which is 1.35s. The ordinary flow PID controller takes the longest time to reach stabilization, which is 1.8s. Therefore, from the aspects of overshoot, response speed, steady-state error, etc., it can be concluded that the flow PID controller optimized by the improved human conception algorithm has the best performance. The improvement method proposed in the present invention is effective.

[0152] In summary, the present invention provides a method for precise control and optimization of respiratory flow based on PID. By introducing nonlinear inertia weights and super-male gene mutation mechanisms 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. It not only accurately controls the airflow, but also enhances the stability of the system and the comfort of the patient, thereby ensuring the treatment effect.

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 weights and super-male gene mutation mechanisms 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; 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, the 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 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 For all individuals in the current iteration and X gbest The maximum distance between them; Furthermore, D max The mathematical model is: In formula (4), max() is the 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. Introducing the super-male gene mutation mechanism to improve the algorithm’s position update formula. 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. A PID respiratory flow precise control optimization method according to claim 1, characterized in that: In S3, a mathematical model is established to improve the human conception algorithm. 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 to select a population to participate in the next algorithm iteration optimization; St4, update the sperm population number 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, update 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 hyperactivation process to establish a mathematical model. The mathematical model of sperm hyperactivation 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 is compared with the fitness of the global best sperm individual to determine the new global best sperm individual; St8, check whether the sperm individuals participating in the iteration have crossed the boundary, 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 so, 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 If not, return to step St6 to continue iterative optimization.

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 and 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. 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 individual sperm position generated by the 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 represents destruction. When the fitness of an 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 iterative 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 optimal 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 updated position of the sperm individual, V i (t+1) The mathematical model is: In formula (13), ω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, 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 (14), γ and η are random numbers between [0, 1], and R is the value of F(X 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.

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 with 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 's adaptability.