A human breathing simulation system and adaptive control method

By designing a human respiratory simulation system containing a control module and a breathing path, using sensors and fuzzy PID algorithms, the existing simulated lungs have complex structure, complex control and insufficient research on gas exchange during simulated breathing, and realizes the problem of the existing simulated lungs being complex in the simulated breathing process. Accurate simulation and control of respiratory characteristics of different populations is achieved, and the accuracy and general applicability of the system are improved.

CN118859684BActive Publication Date: 2025-02-14SHANDONG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411311622.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-02-14
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

The existing active simulated lungs have complex structure, large physical inertia, complex control and insufficient research on gas exchange during simulated respiration, resulting in insufficient generalization of simulations for different populations.

Method used

A human respiratory simulation system was designed, including a control module and a breathing path, using proportional valve, flow sensor, pressure sensor, oxygen concentration sensor and carbon dioxide concentration sensor, combined with the breathing model library and fuzzy PID algorithm to realize the respiratory flow data and Accurate simulation and control of gas exchange data.

Benefits of technology

It realizes accurate simulation of respiratory characteristics of different populations, improves the accuracy and generality of the system, can quickly respond and accurately simulate the respiratory process, and facilitates ventilator detection and calibration and clinical teaching and training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118859684B_ABST
    Figure CN118859684B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of medical devices, and specifically provides a human breathing simulation system and an adaptive control method, the method comprising: obtaining respiratory flow data; when the respiratory flow data is greater than zero, obtaining required gas concentration data; calculating the flow data of the gas paths of three gas sources according to the respiratory flow data and the gas concentration data; calculating the deviation between the current cycle flow data and the feedback data and calculating the rate of change of the deviation; realizing adaptive adjustment of PID parameters based on fuzzy PID algorithm, performing PID control processing after parameter adjustment to output control signals to the proportional valves at corresponding positions to control the operation of the proportional valves at the exhalation path; when the respiratory flow data is less than or equal to zero, performing PID control processing after parameter adjustment to output control signals to the proportional valves at corresponding positions to control the operation of the proportional valves at the inhalation path. The parameters can be adaptively adjusted, and the overshoot, oscillation and other problems in the control process can be effectively reduced, thereby improving the stability and control accuracy of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical devices, and in particular to a human breathing simulation system and an adaptive control method. Background Art

[0002] With the continuous improvement of people's living standards and the advancement of science and technology, ventilators have gradually become standard equipment in almost all hospitals. They are indispensable in the clinical rescue of patients with respiratory failure, daily treatment of respiratory diseases, and clinical teaching and training. Since the breathing process has a great impact on the life and health of patients, any adjustment of ventilator parameters will directly affect the treatment effect of patients. In order to ensure the safe use of ventilators and good treatment effects, the detection and correction of ventilator performance is very important.

[0003] The simulated lung can simulate the respiratory flow, pressure, gas composition and other characteristics of different groups of people. It can be used for ventilator parameter calibration and is also an indispensable tool in clinical teaching, training and scientific research. At present, the commonly used simulated lung is a passive simulated lung with a balloon, which cannot simulate the active breathing process of people and cannot meet some usage requirements. With the increase of ventilator functions, the characteristics that need to be tested and calibrated also increase. The active simulated lung with accurate and reliable technology and diverse technical indicators can provide an effective means for the detection and calibration of ventilators and the training of personnel. The existing active simulated lung is based on a reciprocating cylinder structure. Although it has active breathing capabilities, it has a complex structure, large physical inertia, and complex control. It mainly simulates the mechanical characteristics of breathing, such as flow and pressure, lacks research on gas exchange, and is not versatile enough for simulation of different groups of people. Summary of the invention

[0004] In view of the problem that the existing simulated lung system is not versatile enough for simulating different groups of people, the present invention provides a human breathing simulation system and an adaptive control method.

[0005] In a first aspect, the technical solution of the present invention provides a human breathing simulation system, including a control module and a breathing air circuit; the breathing air circuit is provided with a proportional valve, a flow sensor, a pressure sensor, an oxygen concentration sensor and a carbon dioxide concentration sensor;

[0006] The pressure sensor, oxygen concentration sensor, carbon dioxide concentration sensor and flow sensor are respectively connected to the control module to transmit the collected sensor information to the control module;

[0007] The control module is provided with a breathing model library and a fuzzy PID algorithm;

[0008] The respiratory model library includes data models trained according to the respiratory characteristics of different groups of people for generating respiratory flow data and gas exchange data;

[0009] The fuzzy PID algorithm is used to combine the respiratory flow data, gas exchange data and the sensor information collected by each sensor. First, fuzzy calculation processing is performed to realize the adaptive adjustment of PID parameters. After the parameters are adjusted, PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the gas flow of the respiratory airway.

[0010] As a preferred embodiment of the technical solution of the present invention, the respiratory model library includes a respiratory flow data model and a gas exchange data model;

[0011] The respiratory flow data model is based on the C-DCGAN data model. The training process is as follows:

[0012] The data feature C and the random number automatically generated by the model are passed through the C-DACAN generator to generate M data points; the result of the generator is combined with the input data feature C of this time as the input value of the discriminator, and the discriminator passes through three convolution layers + LeakyReLU layers, and finally passes through the sigmoid layer to generate a judgment result to train the generator; the data feature C includes tidal volume, inspiration-expiration ratio, and respiratory rate;

[0013] The gas exchange data model is a BP neural network model based on Bayesian regularization, which is used to describe the exchange of oxygen and carbon dioxide in the lungs. The inspired oxygen concentration, inspired carbon dioxide partial pressure, blood carbon dioxide partial pressure, respiratory rate, and minute ventilation volume are input into the model, and after calculation by the Bayesian regularized BP neural network, the values ​​of two characteristics, exhaled oxygen concentration and end-tidal carbon dioxide, are generated.

[0014] As a preferred embodiment of the technical solution of the present invention, the control module receives the pressure, flow, oxygen concentration, and carbon dioxide concentration data collected by each sensor, compares them with the set values ​​to calculate the corresponding deviations, and calculates the rate of change of the deviations. The deviations and the rate of change of the deviations are used as inputs of the fuzzy PID algorithm module to perform fuzzy calculation and output PID parameters. The PID algorithm is used to process the data generated by the respiratory flow data model and the gas exchange data model to calculate the flow of gas in the respiratory airway and generate a control signal.

[0015] As a preferred embodiment of the technical solution of the present invention, the process of adjusting the PID parameters by the fuzzy algorithm includes:

[0016] Linearly map the deviation and deviation change rate collected in the current control cycle to the domain of the pre-set fuzzy quantity to obtain the membership degree of the fuzzy quantity to different fuzzy subsets;

[0017] According to the membership degree obtained by fuzzification, the fuzzy rule table is queried to determine the membership degree of the output quantity to the fuzzy subset;

[0018] The output quantity is defuzzified by the Mamdani algorithm and the PID parameters are output.

[0019] As a preferred embodiment of the technical solution of the present invention, the respiratory airway includes an exhalation path and an inhalation path; the control target of the exhalation path by the PID algorithm mainly includes the gas concentration in the exhalation path and gas flow The control target of the air intake circuit is the gas flow rate. ;

[0020] The PID algorithm control is as follows:

[0021] According to the data model in the respiratory model library, the exhaled oxygen concentration, end-tidal carbon dioxide partial pressure data and the expiratory flow data are generated, and the carbon dioxide concentration at the expiratory path outlet is set to , oxygen concentration is , the flow rate is , calculate the oxygen gas flow in the exhalation path , nitrogen gas flow rate , CO2 gas flow rate as follows:

[0022] ;

[0023] When Q>0, the proportional valve controlling the inhalation circuit is closed, and when Q<0, the proportional valve controlling the exhalation circuit is closed.

[0024] As a preferred embodiment of the technical solution of the present invention, at least three proportional valves are provided on the exhalation path, the input ports of the proportional valves are respectively connected to a nitrogen gas source, a carbon dioxide gas source and an oxygen gas source, and the output ports of the three proportional valves are respectively merged into a four-way gas mixing pipe after passing through a flow sensor, and are mixed into an output pipeline through the four-way gas mixing pipe, and a pressure sensor, an oxygen concentration sensor and a carbon dioxide concentration sensor are provided on the output pipeline;

[0025] There is at least one proportional valve on the inhalation path, the output port of the proportional valve is connected to the negative pressure gas source, the input port of the proportional valve is connected to the input pipeline, and the input pipeline is provided with a flow sensor, an oxygen concentration sensor, and a carbon dioxide concentration sensor; the input end of the input pipeline and the output end of the output pipeline are connected through a tee and merged into the output port of the entire human breathing simulation system.

[0026] As a preferred embodiment of the technical solution of the present invention, the proportional valve on the exhalation path is an electrical proportional valve, and the proportional valve on the inhalation path is a vacuum proportional valve.

[0027] As a preferred embodiment of the technical solution of the present invention, the system also includes an I / O module, which receives control data from the control module, and converts the received control data into a voltage signal through a DA converter and transmits it to the proportional valve to adjust the opening of the proportional valve throttle port and thereby control the gas flow.

[0028] As a preferred embodiment of the technical solution of the present invention, the I / O module includes an AD converter and a DA converter;

[0029] The DA converter converts the digital control signal output by the control module into an analog control signal and transmits it to the proportional valve;

[0030] The oxygen sensor, carbon dioxide concentration sensor, flow sensor and pressure sensor in the gas circuit feed back gas concentration data, pressure and flow data which are input into the control module through the AD converter.

[0031] In a second aspect, the technical solution of the present invention provides an adaptive control method for a human breathing simulation system, comprising the following steps:

[0032] Obtain respiratory flow data;

[0033] When the respiratory flow data is greater than zero, the required gas concentration data is obtained;

[0034] Calculate the flow data of the gas paths of the three gas sources according to the acquired respiratory flow data and the required gas concentration data;

[0035] Receive feedback data from the flow sensor, calculate the deviation between the current cycle flow data and the feedback data, and calculate the rate of change of the deviation;

[0036] The adaptive adjustment of PID parameters is realized based on the fuzzy PID algorithm. After the parameters are adjusted, the PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the operation of the proportional valve of the expiratory path.

[0037] When the respiratory flow data is less than or equal to zero, receiving the flow sensor feedback data, calculating the deviation between the current cycle flow data and the feedback data and calculating the change rate of the deviation;

[0038] The adaptive adjustment of PID parameters is realized based on the fuzzy PID algorithm. After the parameters are adjusted, the PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the operation of the proportional valve in the air intake circuit.

[0039] As a preferred embodiment of the technical solution of the present invention, the step of obtaining the required gas concentration data includes:

[0040] Obtain gas concentration data;

[0041] Receive feedback data from the gas concentration sensor and calculate the deviation between the gas concentration data and the feedback data;

[0042] The gas concentration value is updated by the incremental PI algorithm to obtain the required gas concentration data.

[0043] It can be seen from the above technical scheme that the present invention has the following advantages: it has the advantages of multiple simulation features, high precision, and strong versatility. It can generate corresponding respiratory data according to the input respiratory characteristics, and the fuzzy PID algorithm can perform rapid response and accurate simulation, which is convenient for ventilator detection and calibration and clinical teaching and training.

[0044] DCGAN and BP neural network are used to build a respiratory model library, and respiratory flow data and gas exchange data are generated respectively. According to the different training data, respiratory process-related data that meet the characteristics of the object can be generated for different types of groups (such as different airway obstruction degrees and different ages). An electric proportional valve is used to replace the traditional piston cylinder actuator, and three flow sensors are set up upstream of the exhalation path to control the three-way flow respectively, and then merged into one outlet through the mixing pipe, which improves the feasibility of controlling the exhaled gas composition and the accuracy of the gas flow in each gas path. The fuzzy PID algorithm is used to control the actuator, which has better stability and response speed and higher control accuracy than the traditional PID control algorithm. By introducing the fuzzy PID algorithm to realize the adaptive adjustment of PID parameters, the system can automatically optimize the control parameters according to the dynamic changes of respiratory flow data, thereby effectively reducing overshoot, oscillation and other problems in the control process, and improving the stability and control accuracy of the system. This adaptive control strategy enables the system to maintain good control performance when facing complex and changeable breathing patterns. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 It is a system overall architecture diagram of an embodiment of the present invention.

[0047] Figure 2 It is a schematic diagram of the respiratory flow data model structure according to an embodiment of the present invention.

[0048] Figure 3 It is a schematic diagram of the structure of a BP neural network model based on Bayesian regularization in an embodiment of the present invention.

[0049] Figure 4 It is a schematic diagram of the adaptive control operation flow in an embodiment of the present invention.

[0050] Figure 5It is a schematic diagram of the control flow of the control module in an embodiment of the present invention.

[0051] Figure 6 It is a schematic diagram of adjusting PID parameters by a fuzzy algorithm in an embodiment of the present invention.

[0052] Figure 7 4 is a diagram showing a membership function in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0054] The overall framework of the present invention is as follows Figure 1 As shown, the operation process is shown in FIG4. An embodiment of the present invention provides a human breathing simulation system, including a control module and a breathing air circuit; the breathing air circuit is provided with a proportional valve, a flow sensor, a pressure sensor, an oxygen concentration sensor and a carbon dioxide concentration sensor;

[0055] The pressure sensor, oxygen concentration sensor, carbon dioxide concentration sensor and flow sensor are respectively connected to the control module to transmit the collected sensor information to the control module;

[0056] The control module is provided with a breathing model library and a fuzzy PID algorithm;

[0057] The respiratory model library is trained according to the respiratory characteristics of different groups of people to generate respiratory flow data and gas exchange data;

[0058] The fuzzy PID algorithm is used to combine the respiratory flow data, gas exchange data and the sensor information collected by each sensor. First, fuzzy calculation processing is performed to realize the adaptive adjustment of PID parameters. After the parameters are adjusted, PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the gas flow of the respiratory airway.

[0059] In some embodiments, the respiratory model library includes a respiratory flow data model and a gas exchange data model;

[0060] The respiratory flow data model is based on the C-DCGAN data model. The training process is as follows:

[0061] The data feature C and the random number automatically generated by the model are passed through the C-DACAN generator to generate M data points; the result of the generator is combined with the input data feature C of this time as the input value of the discriminator, and the discriminator passes through three convolution layers + LeakyReLU layers, and finally passes through the sigmoid layer to generate a judgment result to train the generator; the data feature C includes tidal volume, inspiration-expiration ratio, and respiratory rate;

[0062] The gas exchange data model is a BP neural network model based on Bayesian regularization, which is used to describe the exchange of oxygen and carbon dioxide in the lungs. The inspired oxygen concentration, inspired carbon dioxide partial pressure, blood carbon dioxide partial pressure, respiratory rate, and minute ventilation volume are input into the model, and after calculation by the Bayesian regularized BP neural network, the values ​​of two characteristics, exhaled oxygen concentration and end-tidal carbon dioxide, are generated.

[0063] In the embodiment of the present invention, the respiratory model library includes two parts, namely a respiratory flow data model and a gas exchange data model.

[0064] The respiratory flow data model is a data model based on C-DCGAN (Deep Convolutional Conditional Generative Adversarial Network). This data model is trained with the respiratory characteristics of a large number of different types of people, such as elderly men and women, adult men and women, patients, etc., and can generate respiratory flow data that conforms to the respiratory characteristics of the above different groups of people. The input of the model is tidal volume, inspiratory-expiratory ratio, respiratory rate, and 13 random numbers automatically generated by the model. After the generator of C-DACAN, 128 data points are generated. The curve formed by these data points is the flow curve of the simulated breathing process, which can be used by the control module to control the flow of the hardware. The structure of the model is as follows Figure 2 As shown, Figure 2In the figure, only the input data, i.e., C (conditional) in C-DCGAN, is shown as the three conditions of tidal volume, I / O ratio, and respiratory rate. The input feature has 16 channels (except C, the other 13 are random noises), which are deconvolved to generate 512 channels, and then convolved to 256 channels after passing through batchnormal and ReLU layers. After that, a 128*1 output result is finally obtained after multiple convolution + batchnormal + ReLU layers. Its physical meaning is 128 respiratory flow data points in one cycle. The result of the generator will be combined with the input data feature C of this time as the input value of the discriminator. In one iteration of model training, the discriminator will receive two inputs of the generator and the training set data. For each input of 131*1 data points, it will pass through three convolution layers + LeakyReLU layers in the discriminator, and finally pass through the sigmoid layer to generate the judgment result. The loss function of the generator will make the generator continuously generate results that are closer and closer to the real training set data, while the loss function of the discriminator will make the discriminator distinguish as much as possible which input data is the True data of the training set and which is the Fake data generated by the generator. The above is a single round of training for the respiratory flow model. The entire model needs to go through multiple rounds of training before it can converge.

[0065] The gas exchange data model is a BP neural network model based on Bayesian regularization. The gas exchange model mainly describes the exchange of oxygen and carbon dioxide in the lungs. The training data of this model includes elderly men and women, young men and women, and some patients, so that the model can simulate the gas exchange of the above various groups of people according to the input and give the gas exchange result data. The input of this model is the inspired oxygen concentration, inspired carbon dioxide partial pressure, blood carbon dioxide partial pressure, respiratory rate, and minute ventilation. After calculation by the Bayesian regularized BP neural network, two characteristic values ​​of exhaled oxygen concentration and end-tidal carbon dioxide are generated. These two values ​​can be used by the control module to control the gas composition of the hardware. The structure of the model is as follows Figure 3 As shown in the figure, during the training process, the input data includes the inhaled oxygen concentration, the inhaled carbon dioxide partial pressure, the blood carbon dioxide partial pressure, the respiratory rate, the minute ventilation volume, etc., which will pass through the intermediate layer composed of the fully connected layer + BN + ReLU in sequence, and finally calculate and generate two output features, the exhaled oxygen concentration and the end-tidal carbon dioxide. The loss function of the model will make the prediction results of the model as close as possible to the results of the training data.

[0066] In some embodiments, the control module receives the pressure, flow, oxygen concentration, and carbon dioxide concentration data collected by each sensor, compares them with the set values ​​to calculate the corresponding deviations, and calculates the rate of change of the deviations. The deviations and the rate of change of the deviations are used as inputs of the fuzzy PID algorithm module to perform fuzzy calculation and output PID parameters. The PID algorithm is used to process the data generated by the respiratory flow data model and the gas exchange data model to calculate the flow of gas in the respiratory airway and generate a control signal.

[0067] The fuzzy algorithm adjusts the PID parameters in the following ways:

[0068] Linearly map the deviation and deviation change rate collected in the current control cycle to the domain of the pre-set fuzzy quantity to obtain the membership degree of the fuzzy quantity to different fuzzy subsets;

[0069] According to the membership degree obtained by fuzzification, the fuzzy rule table is queried to determine the membership degree of the output quantity to the fuzzy subset;

[0070] The output quantity is defuzzified by the Mamdani algorithm and the PID parameters are output.

[0071] In some embodiments, at least three proportional valves are provided on the exhalation path, the input ports of the proportional valves are respectively connected to a nitrogen gas source, a carbon dioxide gas source and an oxygen gas source, and the output ports of the three proportional valves are respectively merged into a four-way gas mixing pipe after passing through a flow sensor, and are mixed into an output pipeline through the four-way gas mixing pipe, and a pressure sensor, an oxygen concentration sensor and a carbon dioxide concentration sensor are provided on the output pipeline;

[0072] There is at least one proportional valve on the inhalation path, the output port of the proportional valve is connected to the negative pressure gas source, the input port of the proportional valve is connected to the input pipeline, and the input pipeline is provided with a flow sensor, an oxygen concentration sensor, and a carbon dioxide concentration sensor; the input end of the input pipeline and the output end of the output pipeline are connected through a three-way connection and merged into the output port of the entire human breathing simulation system. Among them, the proportional valve on the exhalation path is an electrical proportional valve, and the proportional valve on the inhalation path is a vacuum proportional valve.

[0073] The control module receives the respiratory flow data and gas exchange data generated by the respiratory model library, and controls the electrical proportional valves on the two gas paths of the exhalation and inhalation to achieve the purpose of simulating the breathing process. There are three proportional valves on the exhalation path, and the input ports are connected to the nitrogen gas source, the carbon dioxide gas source and the oxygen gas source respectively. The output ports are respectively merged into a four-way mixing pipe after passing through a throttle valve and a flow sensor. The gases in the three pipelines are mixed into one pipeline through the mixing pipe, and then connected to an oxygen concentration sensor and a carbon dioxide concentration sensor; there is a proportional valve on the inhalation path, the input port is connected to the negative pressure gas source, and the output port is connected to a throttle valve, a flow sensor, an oxygen concentration sensor, and a carbon dioxide concentration sensor. The ends of the two pipelines are connected by a three-way connection and merged into the output port of the entire simulated lung platform. The control module receives the pressure, flow, oxygen concentration, and carbon dioxide concentration data collected by each sensor, and compares them with the set value. The deviation is: .

[0074] in, is the set value, is the feedback value, is the deviation. The fuzzy PID algorithm will Control this module. It should be noted that the PID algorithm is one of the commonly used algorithms in the field of industrial control. The PID algorithm has three hyperparameters: , , , according to the deviation of sensor feedback , the PID algorithm calculates the deviation e and three parameters to obtain the output value of the PID algorithm. The specific algorithm is as follows:

[0075] ;

[0076] in is the PID algorithm output, is the deviation at time t.

[0077] When deploying the PID algorithm, the following discrete form is often used:

[0078]

[0079] in is the deviation at time i, is the deviation at time i-1, and T is the sampling period of the algorithm.

[0080] The three hyperparameters of the PID algorithm represent the proportional link, the integral link, and the differential link. The proportional link directly converts the measured deviation When the deviation When it is too large, the proportional link can usually quickly increase the input to the controlled object. , so that the feedback value Make adjustments accordingly to reduce ; The integral part is usually based on the past Accumulate and eliminate steady-state errors; the differential link can predict deviations at future times The changing trend of the output at the current moment Make adjustments to try to mitigate the deviation Overall, the three links of PID, the proportional link is responsible for quickly responding to deviations The integral link is responsible for maintaining the output , eliminating steady-state errors, and the differential link is responsible for reducing future deviations However, the traditional PID has the defects of slow response speed and insufficient control accuracy in proportional valve control. One of the main reasons is that three hyperparameters , , It is implemented as set, regardless of the deviation in the control process No matter how they change, these three hyperparameters remain constant. The fuzzy PID algorithm can make up for this shortcoming. Fuzzy PID advocates that the three hyperparameters of PID change according to the size of several characteristics during the control process, and the criteria for the change are formulated based on general human judgment.

[0081] In the fuzzy PID algorithm of the present invention, the parameters , , According to the deviation and the rate of change of deviation The specific method is as follows: artificially set two fuzzy quantities: and The domain (upper and lower limits) of the two fuzzy quantities is divided into several fuzzy subsets on the domain, either evenly or unevenly, according to the general understanding of humans on the size of these two fuzzy quantities. Each fuzzy subset has its own membership function on the domain. This step is called fuzzification. In this way, each time a specific value of the fuzzy quantity is input, it will become the membership of different fuzzy subsets after fuzzification. The fuzzy quantity input each time may belong to two or more fuzzy subsets. At this time, the fuzzy rule table is used to confirm the fuzzy subset to which the output belongs. The so-called fuzzy rule table is the correspondence between the output quantity and the input quantity (fuzzy quantity) specified by humans. This step is called fuzzy reasoning. For the output quantities belonging to different fuzzy subsets, it is necessary to calculate their specific values. In this algorithm, the Mamdani algorithm + centroid method is used for calculation;

[0082] The total output of fuzzy logic reasoning is: ;

[0083] in, , where and are the membership degrees of two fuzzy quantities under the i-th fuzzy rule in the fuzzy rule table, The membership function determined by this fuzzy rule.

[0084] In addition: ;

[0085] Therefore, for each fuzzy rule, we have: ;

[0086] Final Output It is a composite function of n functions. By finding its center of gravity in the x-axis direction, we can get the final output of the entire fuzzy operation.

[0087] The above is the calculation of the fuzzy algorithm for a certain target output, and the PID algorithm has three parameters. Therefore, it is necessary to set the corresponding membership function and fuzzy rules for the three parameters and calculate them separately. , , With the deviation and the rate of change of deviation The specific value can be adjusted automatically at any time to improve the response speed and control accuracy.

[0088] In some embodiments, the system also includes an I / O module, which receives control data from the control module, and converts the received control data into a voltage signal through a DA converter and transmits it to the proportional valve to adjust the opening of the proportional valve throttle port and thereby control the gas flow.

[0089] In some embodiments, the I / O module includes an AD converter and a DA converter;

[0090] The DA converter converts the digital control signal output by the control module into an analog control signal and transmits it to the proportional valve; the oxygen sensor, carbon dioxide concentration sensor, flow sensor and pressure sensor in the gas circuit feedback gas concentration data, pressure and flow data are input into the control module through the AD converter.

[0091] That is, the I / O module receives control data from the control module, mainly including voltage control signals of four proportional valves (three electrical proportional valves and one vacuum proportional valve), and collects some characteristic data in the gas circuit during operation, mainly including flow data, pressure data and gas concentration data. After the fuzzy PID algorithm in the control module calculates, the control signal of each proportional valve is obtained. The I / O module converts the digital signal into a 0-10V voltage signal through a 12-bit DA converter and transmits it to the proportional valve. The control program of the proportional valve product controls the pressure at the outlet of the proportional valve, indirectly controlling the gas circuit flow.

[0092] The hardware gas circuit of this system is mainly composed of pipelines, proportional valves, throttle valves, sensors, and gas sources. It is divided into an exhalation circuit and an inhalation circuit. There are three sub-circuits upstream of the exhalation circuit, which are respectively connected with oxygen, 10% carbon dioxide mixed gas, and nitrogen. These three gas circuits merge into one downstream of the exhalation circuit, while there is one gas circuit for the inhalation circuit. The exhalation and inhalation gas circuits merge into one output port at their respective final outlets, which is used to connect peripherals such as ventilators and monitors. In the hardware gas circuit, the input end of the proportional valve is connected to various gas sources. The proportional valve itself receives the voltage control signal sent by the I / O module, adjusts its own throttle opening, controls the pressure of the output port, and serves the purpose of indirectly controlling the flow. Each proportional valve output port is equipped with a throttle valve to stabilize the gas circuit flow. Subsequently, each is connected to a flow sensor to collect flow data on each gas circuit. After that, the three air paths on the exhalation path are merged into one air path through the mixing pipe, and then connected to oxygen and carbon dioxide sensors to collect the oxygen and carbon dioxide concentrations at the end of the entire exhalation path; similarly, the inhalation path is directly connected to oxygen and carbon dioxide concentration sensors after the throttle valve. Finally, the exhalation and inhalation air paths are merged into one outlet. In the entire hardware air path, the voltage control data of the proportional valve is received from the I / O module, and the oxygen, nitrogen, and carbon dioxide flow data on the exhalation path, the oxygen and carbon dioxide concentration data, the inhalation gas flow data on the inhalation path, and the oxygen and carbon dioxide concentration data are fed back. These feedback data will be used as feedback values ​​in the control module , used for and setting values Calculate the deviation together and the rate of change of deviation , as the input data of the subsequent fuzzy PID algorithm. At the same time, the oxygen and carbon dioxide concentration data will be fed back to the gas exchange data model as two input features to calculate the set value in the control module under the current inhaled gas composition conditions. The appropriate value of .

[0093] The relevant parts of the software are deployed on the CODESYS industrial control software platform. Some characteristic parameters of the simulated breathing process are input into the CODESYS human-computer interaction interface, including inspired oxygen concentration, inspired carbon dioxide partial pressure, blood carbon dioxide partial pressure, respiratory rate, minute ventilation, tidal volume, and inspiration-expiration ratio. The inspired oxygen concentration and inspired carbon dioxide partial pressure are updated by sensor feedback in subsequent control, and the initial value can be set to the component data in the air, that is, oxygen concentration 21% and carbon dioxide concentration 0.04%. Among these input characteristic data, inspired oxygen concentration, inspired carbon dioxide partial pressure, blood carbon dioxide partial pressure, respiratory rate, and minute ventilation are used as input data for the gas exchange data model, which is constructed by BP neural network, and the output is end-tidal carbon dioxide and exhaled oxygen concentration. Tidal volume, inspiration-expiration ratio, and respiratory rate are used as input data for the respiratory flow model, which is constructed by DCGAN, and the output is the flow data of one cycle.

[0094] The output data of the above two data models can be classified as respiratory flow data and gas concentration data, which are the set values ​​of the control system. The actual flow data and gas concentration data in the gas path obtained by the control system through feedback are the feedback values. The difference between the set value and the feedback value and the rate of change of this difference are used as the input of the fuzzy PID algorithm in the control system.

[0095] The control flow of the control module is as follows Figure 5 As shown in the figure, the adaptive adjustment process of PID parameters is as follows: Figure 6 As shown. For the three PID parameters , , , each with its own membership function ( Figure 7 One of them is shown), the fuzzy rule table (as shown in Table 1) and the defuzzification function, which will be run in each control cycle after the platform starts running.

[0096] Table 1: Fuzzy rules table

[0097]

[0098] The fuzzy algorithm adjusts the PID parameters as follows: Figure 6 There are three steps shown:

[0099] (1) Fuzzification: The algorithm first converts the deviations collected in the current control cycle into and the rate of change of deviation Linear mapping to the domain of the pre-set fuzzy quantity will obtain the membership of the fuzzy quantity to different fuzzy subsets.

[0100] (2) Fuzzy reasoning: Query the fuzzy rule table based on the membership degree obtained by fuzzification to determine the membership degree of the output quantity to the fuzzy subset.

[0101] (3) Defuzzification: Finally, the output is defuzzified using the Mamdani algorithm. The logic of the Mamdani algorithm written in ST language on the CODESYS platform is as follows: and The membership degrees of fuzzy subsets {NB, NS, ZO, PS, PB} are { }and{ }, so there are 25 fuzzy rules in the fuzzy rule table for these fuzzy subsets. Get 100 points evenly in the entire domain { }, for each fuzzy rule term, there is a function Indicates that when calculating the contribution of this item to the output, the following is calculated at each point:

[0102] .

[0103] After calculating all 25 functions, the output value is .

[0104] The pseudo code of this process on the Codesys platform is as follows:

[0105] Algorithm: mamdani anti-fuzzy

[0106] Input SLe[5], SLec[5], fuzzyrules[5][5], slavefunc[5]

[0107] OutputK

[0108] 1.Tmp=linspace(-2,100,2);

[0109] 2.Fori=0;i<5;++i

[0110] 3. Forj=0;j<5;++j

[0111] 4.Fork=0;k<100;++k

[0112] 5.Arr[1*5+j][k]=min(SLe[i],SLec[j],slavefunc[fuzzyrules[i][j]](Tmp[k]))

[0113] 6.End for

[0114] 7. End for

[0115] 8.End for

[0116] 9.Fori=0;i<100;++i

[0117] 10.Res[i]=max(Arr[:][ i]);

[0118] 11.Endfor

[0119] 12.return (Tmp · Res) / (sum(Res))

[0120] This code segment will be based on the deviation in each control cycle and the rate of change of deviation The membership degree of , , Adaptive adjustment is performed, and the output of the code is the current control cycle , , Value. , , The fuzzy rule tables are different, so the above steps should be performed for all three parameters to obtain the PID parameter values ​​in the current control cycle, and then perform PID control. The control targets of PID are mainly the concentration of gas in the expiratory path and gas flow The specific method is: according to the data of exhaled oxygen concentration, end-tidal carbon dioxide partial pressure and exhaled flow rate generated by the data model, the carbon dioxide concentration at the outlet of the exhaled path is set to , oxygen concentration is , the flow rate is , then the oxygen gas flow rate in the exhalation path can be calculated , nitrogen gas flow rate , CO2 gas flow rate as follows:

[0121]

[0122] (Note: The carbon dioxide gas source is 10% carbon dioxide + 90% nitrogen, so the above formula needs to be multiplied by 10 to calculate the carbon dioxide flow rate).

[0123] The inhaled gas composition needs to be monitored in the inhalation circuit as the input part of the blood oxygen exchange model, and the flow of the inhaled gas needs to be controlled at the same time. Unlike the expiratory circuit, the inhalation circuit is a separate gas circuit, so its control target is Q. In addition, when Q>0, the proportional valve of the inhalation circuit is closed, and when Q<0, the proportional valve of the expiratory circuit is closed.

[0124] In summary, the fuzzy PID algorithm will calculate the control signal transmitted to the I / O module. The control signal can control the size of the throttle opening of the proportional valve, thereby controlling the outlet pressure and flow rate. The size of the control signal is positively correlated with the size of the throttle opening.

[0125] The main body of the control module is a computer program deployed on the CODESYS industrial control software. The computer communicates with the I / O module through the EtherCAT communication bus, and transmits control digital signals to the I / O module in each control cycle. The I / O module is mainly composed of an AD converter (analog signal to digital signal) and a DA converter (digital signal to analog signal). The DA converter converts the digital control signal into an analog control signal and transmits it to the proportional valve for pressure control, indirectly controlling the flow rate. In the exhalation line, since the final outlet is formed by the merger of the oxygen gas line, the carbon dioxide gas line and the nitrogen gas line, the gas concentration at the outlet can also be controlled.

[0126] The actuators in the gas circuit are four proportional valves. Three positive pressure valves are connected to oxygen, carbon dioxide, and nitrogen gas sources respectively, and one negative pressure valve is connected to a negative pressure gas source. With the alternation of exhalation and inhalation, the positive and negative pressure valves also work alternately. The proportional valve receives the analog control signal transmitted by the I / O module, controls the opening of the throttle inside the valve body, and adjusts the outlet pressure and flow. At the same time, during operation, the oxygen and carbon dioxide concentration sensors and flow sensors in the gas circuit will feedback gas concentration data and flow data to the I / O module as support for the next control cycle.

[0127] The above process is repeated in a cycle and can stably and reliably simulate human breathing movements.

[0128] like Figure 5 As shown, an embodiment of the present invention provides an adaptive control method for a human breathing simulation system, comprising the following steps:

[0129] Obtain respiratory flow data;

[0130] When the respiratory flow data is greater than zero, the required gas concentration data is obtained;

[0131] Calculate the flow data of the gas paths of the three gas sources according to the acquired respiratory flow data and the required gas concentration data;

[0132] Receive feedback data from the flow sensor, calculate the deviation between the current cycle flow data and the feedback data, and calculate the rate of change of the deviation;

[0133] The adaptive adjustment of PID parameters is realized based on the fuzzy PID algorithm. After the parameters are adjusted, the PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the operation of the proportional valve of the expiratory path.

[0134] When the respiratory flow data is less than or equal to zero, receiving the flow sensor feedback data, calculating the deviation between the current cycle flow data and the feedback data and calculating the change rate of the deviation;

[0135] The adaptive adjustment of PID parameters is realized based on the fuzzy PID algorithm. After the parameters are adjusted, the PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the operation of the proportional valve in the air intake circuit.

[0136] It should be noted that the steps for obtaining the required gas concentration data include:

[0137] Obtain gas concentration data;

[0138] Receive feedback data from the gas concentration sensor and calculate the deviation between the gas concentration data and the feedback data;

[0139] The gas concentration value is updated by the incremental PI algorithm to obtain the required gas concentration data.

[0140] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person skilled in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, and they shall be within the scope of protection of the present invention.

Claims

1. A human breathing simulation system, characterized in that: It includes a control module and a breathing air circuit; the breathing air circuit is provided with a proportional valve, a flow sensor, a pressure sensor, an oxygen concentration sensor and a carbon dioxide concentration sensor; The pressure sensor, oxygen concentration sensor, carbon dioxide concentration sensor and flow sensor are respectively connected to the control module to transmit the collected sensor information to the control module; The control module is provided with a breathing model library and a fuzzy PID algorithm; The respiratory model library includes data models trained according to the respiratory characteristics of different groups of people for generating respiratory flow data and gas exchange data; The fuzzy PID algorithm is used to combine the respiratory flow data, gas exchange data and the sensor information collected by each sensor. First, fuzzy calculation processing is performed to realize the adaptive adjustment of PID parameters. After the parameters are adjusted, PID control processing is performed to output control signals to the proportional valve at the corresponding position to control the gas flow of the respiratory airway. The respiratory model library includes a respiratory flow data model and a gas exchange data model; The respiratory flow data model is based on the C-DCGAN data model. The training process is as follows: The data feature C and the random number automatically generated by the model are passed through the generator of C-DCGAN to generate M data points; the result of the generator is combined with the input data feature C of this time as the input value of the discriminator, and the discriminator passes through three convolution layers and LeakyReLU layers, and finally passes through the sigmoid layer to generate a judgment result, and the generator is trained; the data feature C includes tidal volume, inspiration-expiration ratio, and respiratory rate; The gas exchange data model is a BP neural network model based on Bayesian regularization, which is used to describe the exchange of oxygen and carbon dioxide in the lungs. The inspired oxygen concentration, inspired carbon dioxide partial pressure, blood carbon dioxide partial pressure, respiratory rate, and minute ventilation are input into the model. After calculation by the Bayesian regularized BP neural network, the values ​​of the two features, the exhaled oxygen concentration and the end-tidal carbon dioxide partial pressure, are generated. The control module receives the pressure, flow, oxygen concentration, and carbon dioxide concentration data collected by each sensor, compares them with the set values ​​to calculate the corresponding deviations, and calculates the rate of change of the deviations. The deviations and the rate of change of the deviations are used as inputs of the fuzzy PID algorithm module to perform fuzzy calculations and output PID parameters. The PID algorithm is used to process the data generated by the respiratory flow data model and the gas exchange data model to calculate the flow of gas in the respiratory airway and generate a control signal. The respiratory airway includes the exhalation path and the inhalation path; the control targets of the PID algorithm for the exhalation path are mainly the gas concentration in the exhalation path. and gas flow The control target of the air intake circuit is the gas flow rate. ; The PID algorithm control is as follows: According to the data model in the respiratory model library, the exhaled oxygen concentration, end-tidal carbon dioxide partial pressure data and the expiratory flow data are generated, and the carbon dioxide concentration at the expiratory path outlet is set to , oxygen concentration is , the flow rate is , calculate the oxygen gas flow in the exhalation path , nitrogen gas flow rate , CO2 gas flow rate as follows: ; The gas flow set value is compared with the flow data collected by the sensor to calculate the corresponding deviation e, and the control signal is obtained according to the PID calculation to control the proportional valve; when Q>0, the control proportional valve of the inhalation circuit is closed, and when Q<0, the control proportional valve of the exhalation circuit is closed.

2. The human breathing simulation system according to claim 1, characterized in that: The fuzzy algorithm adjusts the PID parameters in the following ways: Linearly map the deviation and deviation change rate collected in the current control cycle to the domain of the pre-set fuzzy quantity to obtain the membership degree of the fuzzy quantity to different fuzzy subsets; According to the membership degree obtained by fuzzification, the fuzzy rule table is queried to determine the membership degree of the output quantity to the fuzzy subset; The output quantity is defuzzified by the Mamdani algorithm and the PID parameters are output.

3. The human breathing simulation system according to claim 2, characterized in that: At least three proportional valves are arranged on the exhalation path, the input ports of the proportional valves are connected to a nitrogen gas source, a carbon dioxide gas source and an oxygen gas source respectively, and the output ports of the three proportional valves are respectively merged into a four-way gas mixing pipe after passing through a flow sensor, and then mixed into an output pipeline through the four-way gas mixing pipe, and a pressure sensor, an oxygen concentration sensor and a carbon dioxide concentration sensor are arranged on the output pipeline; There is at least one proportional valve on the inhalation path, the output port of the proportional valve is connected to the negative pressure gas source, the input port of the proportional valve is connected to the input pipeline, and the input pipeline is provided with a flow sensor, an oxygen concentration sensor, and a carbon dioxide concentration sensor; the input end of the input pipeline and the output end of the output pipeline are connected through a tee and merged into the output port of the entire human breathing simulation system.

4. The human breathing simulation system according to claim 1, characterized in that: The system also includes an I / O module, which receives control data from the control module, and converts the received control data into a voltage signal through a DA converter and transmits it to the proportional valve to adjust the opening of the proportional valve throttle port and thus control the gas path flow.

5. The human breathing simulation system according to claim 4, characterized in that: The I / O module includes an AD converter and a DA converter; The DA converter converts the digital control signal output by the control module into an analog control signal and transmits it to the proportional valve; The oxygen sensor, carbon dioxide concentration sensor, flow sensor and pressure sensor in the gas circuit feed back gas concentration data, pressure and flow data which are input into the control module through the AD converter.

6. An adaptive control method for a human breathing simulation system, characterized in that: The method is applied to the system according to any one of claims 1 to 5, and the method comprises the following steps: Obtain respiratory flow data; When the respiratory flow data is greater than zero, the required gas concentration data is obtained; Calculate the flow data of the gas paths of the three gas sources according to the acquired respiratory flow data and the required gas concentration data; Receive feedback data from the flow sensor, calculate the deviation between the current cycle flow data and the feedback data, and calculate the rate of change of the deviation; The adaptive adjustment of PID parameters is realized based on the fuzzy PID algorithm. After the parameters are adjusted, the PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the operation of the proportional valve of the expiratory path. When the respiratory flow data is less than or equal to zero, receiving the flow sensor feedback data, calculating the deviation between the current cycle flow data and the feedback data and calculating the change rate of the deviation; The adaptive adjustment of PID parameters is realized based on the fuzzy PID algorithm. After the parameters are adjusted, the PID control processing is performed to output the control signal to the proportional valve at the corresponding position to control the operation of the proportional valve in the air intake circuit.

7. The adaptive control method of the human breathing simulation system according to claim 6, characterized in that: The steps to obtain the required gas concentration data include: Obtain gas concentration data; Receive feedback data from the gas concentration sensor and calculate the deviation between the gas concentration data and the feedback data; The gas concentration value is updated by the incremental PI algorithm to obtain the required gas concentration data.

Citation Information

Patent Citations

  • System and method for maintaining regular respiration of tumor radiotherapy patient

    CN115518247A

  • Pneumatic proportional valve control system and control method based on noninvasive ventilator

    CN116850414A

  • Smart control system and method based on machine learning for modulating end-tidal concentration levels by means of adjustments to the volume and concentration of an incoming respiratory gas flow in real time

    US20200368464A1