The “Glass Lung” – A Lifelike Electromechanical Lung Simulator

Background: This contribution describes the hardware setup, control, and parametrization of an electromechanical test lung intended to perform tests with clinical ventilators. Methods: We use a nonlinear model to imitate the dynamic behavior of a real lung in terms of compliance and resistance. Both passive behavior and spontaneous breathing (weaning) are supported. In automated test sequences, the test lung mimics a variety of physiological and pathological lung conditions, including COVID-19. Results: We present the results obtained with an approved clinical ventilator in various modes including pressure-controlled and pressure support ventilation. Conclusions: All results are clinically consistent with the values expected from ventilation of a real patient.


Background
The rapid outbreak of COVID-19 in early 2020 caused a collapse of the health care systems in several countries of the world. One particular problem was and is the present or imminent shortage in intensive care unit (ICU) ventilators required to provide artificial respiration for critically ill patients.
As a result, numerous initiatives have been launched worldwide to develop and produce additional ventilators. Several competitions offered prizes for the best open source design suitable for reproduction all around the world, e. g. [1,2].
Due to the seriousness of the situation, several national regulators have relaxed the conditions for the approval of newly developed ventilators [3]. This makes it all the more important to subject these devices to thorough tests, during which possible malfunctions are identified under realistic conditions. Also, the general characteristics of the devices must be determined in order to develop recommendations for suitable application scenarios.
Therefore, an electromechanical lung simulator has been recently reset in our facilities. Its first setup dates from the year 2000 and was due to our late colleague Prof. Dr. rer. nat. habil. Dieter Heise. The electrically actuated cylinder piston shown in Figure 1 was intended to be used for the calibration of pneumotachographs, for educational purposes in anesthesia, and for performing reproducible tests of ventilators. The original test rig has been upgraded in early 2020 with purely digital hardware and is controlled by a programmable logical controller (PLC). This makes

Methods
In the following, we provide details on the hardware and software of the test lung.

Mechanical Setup
The main component is a custom-made glass cylinder as depicted in Figure 2. The piston sealing exhibits high fitting accuracy, small friction, little hysteresis, and excellent dry running properties. An earlier version of the test lung, which was used in intensive care research [4], had a cylinder made of Polymethyl methacrylate (PMMA) and a rubber sealing; in that setup, temporary adhesion during slow motion of the piston regularly caused measurement artifacts due to pressure impulses, which highlighted the importance of minimizing the slip-stick phenomenon.
Electrical Hardware Setup: Drive, Instrumentation, and Control Electrical Drive The piston is actuated with a linear servo drive and a digital servo amplifier; technical details are given in Table 1. The drive is controlled via its EtherCAT interface.

Instrumentation
The relative pressure within the cylinder is measured by two independent bidirectional differential pressure sensors of different range in order to obtain accurate measurements over a wide range of pressure values. Also, the test rig is equipped with a pneumotachograph whose differential pressure is also measured with two sensors of different range. All sensors are calibrated during the startup procedure and hardly exhibit drift.

Programmable Logical Controller
We currently use a Raspberry Pi as programmable logical controller (PLC). A custom add-on board is mounted on top of the 40-pin header to connect the pressure sensors to the I 2 C interface of the PLC. Also, the board contains safety circuits to disable the servo drive and open a blow-off valve in case of failure or emergency over-or underpressure.
The PLC is driven by the multicore capable runtime system CODESYS. All software is written in Structured Text according to IEC 61131-3. It provides the following core functionality: • Communication with servo drive.
• Reading and processing of sensor values.
• Evaluation of state machines and control law.
• High resolution logging of inputs, outputs, and internal variables, see below.

Operating Modes and Features
We have implemented several modes of operation for various use cases.

Calibration mode
In "calibration" mode, the piston performs periodic oscillations, where both the total displaced volume V * and the maximal flow rate Q * are adjustable.
Two different motion profiles are available: A sine profile, along which the piston position oscillates harmonically; or a ramping profile, in which the position curve describes periodic trapezoids with long periods of constant velocity, cf. Figure 3. Calibration mode can be used to generate a desired tidal volume and flow rate, for example in order to gauge sensors or measure the resistance of filter materials.

Artificial lung
In "artificial lung" operating mode, on the other hand, the test rig realistically simulates a human lung by imitating its dynamic behavior in terms of compliance C and resistance R. The key idea is to continuously control the volume flow with a speed controller, based on the measured pressure inside the cylinder, such that the actual flow imitates the expectable nonlinear airflow for a real patient; details are given in the appendix.
Simulation of spontaneous breathing In the artificial lung mode, the program can also simulate spontaneous breathing, which in reality is caused by the patient inducing a negative pressure in the thorax by muscle power, which results in an airflow into the lungs. Therefore, breathing is simulated by superposing a trapezoid underpressure signal. This simplistic approach does not contain feedback (for instance in a way that the artificial patient would actively try to minimize breathing effort by synchronizing to the ventilator), but turns out to generate realistic behavior both without ventilation and in a closed loop during pressure support ventilation (PSV).
The breathing frequency and under-pressure can be independently configured. Optionally, they can be varied in a pseudo random way, i. e. seemingly random, but reproducibly, to obtain a less robotic and more physiological behavior.  Simulation of coughing Also, the artificial lung can imitate coughing by rapid exhalation. The goal of this feature is to measure the maximum occurring pressure and to make sure that a certain threshold is not exceeded during ventilation, as this could otherwise cause barotrauma on a real patient. Coughing is represented by a sudden increase in volume flow, followed by an exponential decay. The signal is mathematically described bẏ and exemplarily depicted in Figure 4. The shape was originally chosen based on the pressure and air flow curves of healthy test subjects as measured by Feinstein et al. [5], and confirmed by own measurements.

Standardized Ventilator Test Sequences
To perform thorough testing on ventilators, we have designed a standardized test sequence. During the sequence, the program systematically runs through a grid of different parameter configurations and thus covers numerous patient types.

Determination of lung parameters for automatic tests
Parameters for airway resistance and lung compliance are chosen such that they represent the typical spectrum of lung diseases, e. g. chronic obstructive pulmonary disease (COPD) and acute respiratory distress syndrome (ARDS), including COVID-19. Values of lung compliance C and airway resistance R for typical lung diseases are published by Arnal et al. Depending on the already occurred internal destruction of lung tissue, the compliance lies between normal and reduced values [7]. Taking this into account, we defined the test grid of C and R values as shown in Table 2.

Parameters for spontaneous breathing
In healthy subjects, a typical negative pressure in the pleural space during normal breathing is between -0.5 kPa and -0.8 kPa [8]. In order to simulate the increasing exhaustion of a patient, the negative pressure in the pleural space p pleura is reduced in steps (cf. Table 3).

Data Evaluation Tool
We have implemented a custom software tool to evaluate the recorded data and automatically generate standardized reports from the records. A typical report contains the following diagrams for all combinations of resistance R and compliance C: • pressure over time, with superposition of several breathing cycles, • volume over time, as above, • flow over time, as above, • volume over pressure, • flow over volume.
Also, the report comprises colored overview diagrams that illustrate trends over R and C, for instance regarding PEEP, maximum pressure, breathing frequency, minute volume, and tidal volume.

Results
We connected the glass lung to an available and approved Siemens Servo 900C ventilator [1] . In the following it should be approved, that the artificial lung shows a realistic behavior.
The ventilation parameters are given in Table 4. The selected values for PEEP and P insp are recommended for ventilation of COVID-19 patients to avoid a ventilatorinduced lung injury (VILI) [7].  [1] Unfortunately, a more modern model was not at our disposal, since all available ventilators are currently needed by the university medical center to maximize ICU capacity.

Volume controlled ventilation (VCV)
The target tidal volume V target = 0.5 L could be achieved for all lung conditions. The respective pressure curves can be seen in Figure 5. The pressure maxima p max are additionally visualized in a heatmap diagram, cf. Figure 6. Pressure controlled ventilation (PCV) In this experiment, the inspiratory pressure was set to a value of P insp = 1.1kP a above PEEP, typical for healthy subjects. The resulting lung volumes over time are given in Figure 7 and the heat diagram for the tidal volumes are shown in Figure 8.  Pressure support ventilation (PSV) In PSV mode, the ventilator should detect and support every breath that is initiated by a patient. To examine this operating mode, we first let the glass lung breath on its own with various under-pressure amplitudes; the obtained flow-volume-curves are depicted in Figure 9. Then, we connected the ventilator in PSV mode and repeated the experiment to investigate if the ventilator was able to capture the breaths of the artificial patient. The resulting curve for p pleura = 0.4 kPa is also shown in the figure. In the automated test sequence, our goal is to determine the minimum under-pressure required to reliably : Flow-volume-curves for spontaneous breathing trigger assisted ventilation. Additionally the time delay between patient trigger and ventilator support can be measured, because this is an important factor for a long-time comfortable ventilation [10].

Effectiveness of ventilation in ARDS and COVID-19 patients
It is crucial to maintain the PEEP (P EEP ≤ 10−15 kPa) during ventilation. The test procedure shows the maintained PEEP over all lung conditions (see e. g. Figure 10).

Discussion
The aim of this work is to show that the implemented artificial lung behaves realistically like a human lung. To demonstrate this, the lung was ventilated with an approved ventilator (Siemens 900C).
The observed pressures for VCV and volumes for PCV under the given C/R combinations were as clinically expected and comprehensible. This could be seen in Figures 5 to 8. The results show a typical drop in tidal volume for pressurecontrolled ventilation when compliance decreases and/or airway resistance increases, cf. Figure 8.
Also, Figure 9 clearly shows that in PSV mode, faint breaths of the artificial lung are successfully amplified by the ventilator to obtain a sufficient tidal volume. It has thus been demonstrated that the artificial lung can realistically imitate spontaneous breathing in order to examine the ability of a pressure-support ventilator to detect and support the patient's breath.
Finally, the artificial lung can reveal the degree of expansion of the lung. Higher compliance leads to a higher intra-thoracic volume level, which is clinically within a realistic range (cf. Figure 7). It can also be measured whether the ventilator can maintain PEEP. This is an important parameter for assessing suitability for an effective therapy (cf. Figure 10). Additionally the arising pressures under ventilation can be measured (cf. Figure 5), which are important to rate the potential danger for a ventilator-induced lung injury (VILI), if pressures are too high.
All results are clinically consistent with the expected values under ventilation.

Limitations
Due to the purely mechanical design, the artificial lung cannot model metabolic reactions (leading to changes in oxygen or carbon dioxide concentration) or physical effects like moistening or warming of the air inside the lung, diffusion or perfusion. Also, at this time, we assume the air to be incompressible, i. e., we expect the volume flow Q to be the derivative of the geometric volume V enclosed in the cylinder. In reality, however, fast pressure changes do have a visible impact on the actual air flow, which can cause discrepancy from the desired behavior, in particular for high artificial resistance. For instance, when the pressure is suddenly released at the end of inspiration, the expansion of the air yields a significant flow that does not result from the movement of the piston and is undesired. We are working on an improved controller design to counteract these effects.

Conclusion
We have demonstrated a versatile artificial lung that is well-suited for tests on ventilators. Its core feature is its nonlinear dynamic behavior that can be configured in software and flexibly parametrized to imitate various physiological and pathophysiological conditions. Due to its ability to imitate spontaneous breathing and coughing, the artificial lung can also simulate the weaning phase. Its interaction with an approved ventilator showed highly realistic behavior and proves its eligibility. Standardized test sequences can be run and evaluated automatically to generate significant test protocols.
The Glass Lung has already come into operation for first tests with newly developed ventilators, and more tests are planned. In particular, we will investigate the longterm behavior in terms of conformity and repeatability of our tests. Also, we plan to quantitatively compare the results of our experiments to data recorded during the ventilation of real patients. Several improvements and additional features will be incorporated in the near future. For example, we will improve the control law to take account of air compressibility. Also, we want to study the interaction between ventilator and artificial patient during PSV in the presence of a patient will to reduce their breathing effort.

Appendix: Feedback control law for Artificial Lung
The basic feedback control structure for the operating mode "artificial lung" is illustrated in Figure 11.
In a first step, the current volume V enclosed inside the cylinder is computed based on the piston position x. Next, the theoretic alveolar pressure p Alv is determined from the lung volume V using the nonlinear characteristic which is depicted in Figure 12 and further discussed below. Then, the pressure within the cylinder is measured and slightly softened by a low-pass filter; it is assumed to equal the pressure in the mouthpiece and therefore represents the airway pressure p Resp . From the pressure gradient ∆p = p Alv − p Resp , we compute the expected flow Q assuming proportional resistance Finally, we translate the expected flow Q into a desired piston speed v set , which we pass on to the speed controller of the electrical drive.
This control law is updated every 5ms on the PLC and offers two main degrees of freedom: One is the nonlinear compliance curve (2), for which we can independently choose the residual volume RV , the functional residual capacity F RC, and the total lung capacity T LC to describe an artificial patient. The slope of p Alv (V ) at V = F RC constitutes a forth degree of freedom and describes the linear compliance C = δp δV for the relaxed lung around atmospheric pressure, p ≈ 0. Please note that as the lung volume approaches RV or T LC, the alveolar pressure tends to −∞ or +∞, respectively, and creates a counterforce which prohibits further yielding.
The second main influencing parameter is the resistance model (3). In our basic test sequence, we assume R to be constant. However, the control structure naturally enables more sophisticated behavior of that subsystem. In preliminary tests, for instance, we added hysteresis behavior to the resistance (depending on the alveolar pressure) in order to model obstruction of the airways as exhibited by asthmatic patients. As expected, the results then depended heavily upon the positive endexpiratory pressure. This approach will therefore be investigated more closely in the future.
Ethics approval and consent to participate Not applicable.

Consent for publication
Not applicable.

Availability of data and material
The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.