Control system design for a continuous positive airway pressure ventilator

Continuous Positive Airway Pressure (CPAP) ventilation remains a mainstay treatment for obstructive sleep apnea syndrome (OSAS). Good pressure stability and pressure reduction during exhalation are of major importance to ensure clinical efficacy and comfort of CPAP therapy. In this study an experimental CPAP ventilator was constructed using an application-specific CPAP blower/motor assembly and a microprocessor. To minimize pressure variations caused by spontaneous breathing as well as the uncomfortable feeling of exhaling against positive pressure, we developed a composite control approach including the feed forward compensator and feedback proportional-integral-derivative (PID) compensator to regulate the pressure delivered to OSAS patients. The Ziegler and Nichols method was used to tune PID controller parameters. And then we used a gas flow analyzer (VT PLUS HF) to test pressure curves, flow curves and pressure-volume loops for the proposed CPAP ventilator. The results showed that it met technical criteria for sleep apnea breathing therapy equipment. Finally, the study made a quantitative comparison of pressure stability between the experimental CPAP ventilator and commercially available CPAP devices.

In order to meet the above design requirements, it is very important to select a sensitive pressure sensor and a motor and blower with good performances such as fast response time and low noise level. In this design, we use an integrated silicon pressure transducer (model MPXV5004GC7U by Freescale Semiconductor, Inc., USA) with pressure range from 0 to 40 hPa and an application-specific CPAP blower (ebm-papst, Germany) that is able to change its speed rapidly to respond to the requirement of the patient. The blower's maximum air flow is 530 ± 10% l/min, maximum back pressure 48 ± 20% cmH 2 O, life expectancy at nominal speed of 30000 r/min more than 20000 h, while the mass is only 0.262 kg. The low noise design offers CPAP patients peaceful and quiet sleep.

A. System Structure
The CPAP system consists of a microprocessor, a pressure sensor, a brushless DC motor integrated with a blower, motor controller, flexible tubing and a nasal mask (See Figure 1). Ambient air is drawn through the air filter by the energized blower and is then pressurized. Ultimately, therapeutic pressure is directed to the patient airway via the flexible tubing and a nasal mask. The pressure signal near the nasal mask is detected by the pressure sensor and then fed to the microprocessor. Based on the error between the therapeutic or desired pressure and the measured pressure, the microprocessor regulates the rotational speed by varying the input voltage for the motor driver, which in turn adjusts and controls blower output pressure to keep pressure variations within allowable errors.

B. Controller Design
The control scheme of the experimental CPAP system is shown in Figure 2. The composite control system includes a feed forward compensator, G r (s), and a feedback controller, G c (s), which are designed to achieve the accurate control of therapeutic pressure [4,5]. In Figure 2, G p (s) represents the transfer function of the motor-blower assembly. u 1 (s) and u 2 (s) are the output voltage of the feedback controller and that of  the feed forward controller respectively. The disturbance caused by patient's breathing is designated as D(s). P s (s) is the desired (reference) pressure, and P v (s) signifies the actual pressure.
The feed forward controller plays a role in quickly stabilizing the pressure in the nasal mask at the desired set point. In particular, if the user would like to switch over the therapeutic pressure from a high setting to a low one, the feed forward controller can respond with a step signal with large amplitude to the motor driver to achieve its fast acceleration in turn sharp pressure change. That is, the forward feed controller is used to track reference input. To design the forward feed controller, we experimentally determine the relationship between the motor input voltage (u 2 ) and the blower output pressure (P) in open-loop as shown in Figure 3. At this time, the blower outlet is connected to a standard resistance with 4 mm internal diameter. Visually, the relationship of motor input voltage and blower output pressure takes the form of a piecewise linear mapping. A breakpoint around 8 cmH 2 O and another around 12 cmH 2 O divide the   Chen et al. BioMedical Engineering OnLine 2012, 11:5 http://www.biomedical-engineering-online.com/content/11/1/5 graph into three pieces. So we fit the experimental data as the following piecewise linear function: where u 2 is motor input voltage (unit: volt), and p is blower output pressure (unit: cmH 2 O). It can be seen that the error between the model (in red) and the experimental data (in blue) is very small. Therefore we use the piecewise linear function u 2 (P) to design the feed forward controller.
On the other hand, the function of the feedback controller is to deal with model uncertainty (such as unmodeled nonlinear dynamics) of blower-motor assembly and to reduce pressure variations caused by patient breath disturbances. We implement a digital PID feedback controller given by [6][7][8] as follows: where T is the sampling period, K P , K I and K D are the gains for proportional, integral and derivative controllers respectively. In practical implementation, the PID controller described by (2) is represented as the following incremental form where k is the sample interval, K P , K 1 and K D , are the proportional, integral and differential gains controller, respectively. Ultimately, the command input voltage u(S) of the motor driver is equivalent to u 1 (S) plus u 2 (S).
In order to determine the transfer function of the above PID controller, one needs to compute system parameters via some estimation procedure. Reference [9] established a second-order linear system model for similar CPAP devices and estimated system parameters using a least-squares method. The estimated parameters, however, were not satisfactory due to model errors occurring in the linearization procedure and needed to be refined further. Instead, we heuristically estimate the values of K P , K J and K D by generating step response and applying the well-known Ziegler and Nichols method (REF). It makes a priori assumption on the system model but does not require that the model be specifically known. Ziegler-Nichols formulae for specifying the controllers are just based on plant step response. Note that the patient is disconnected and the open side of nasal mask is open to atmosphere when the evaluating step response of the system (See Figure 4). PID gains at different pressure levels from 4 cmH 2 O-20 cmH 2 O are listed in the Table 1. The gain K D is omitted in Table 1 as it is zero throughout the pressure settings range. The results show that only using the PI controller can obtain the desired performance specifications.

Results
To validate the efficiency of the proposed control method, gas flow analyzer (VT PLUS HF, Fluke Corporation, USA) is used to test the experimental CPAP ventilator (include in the additional file 1) performance. The test setup (see Figure 5) includes CPAP ventilator, the analyzer, standard breathing hoses, the exhalation port, the nasal mask, the test lung (a volunteer patient) and a PC. First, we connected the gas output port of the ventilator to the flow inlet port of the analyzer using a breathing tube. Then, we connected the flow outlet port of the analyzer to the assembly of the exhalation port and nasal mask using a breathing tube. Finally we applied the nasal mask to the patient. Data calculated by the analyzer is recorded by running the VT for Windows PC software using a PC. The flow and airway pressure waveforms during a few breath cycles are shown in Figure 6. The pressure setting is 8 cmH 2 O. Output port pressure of the ventilator is shown as Low Pressure (middle panel). We can see that it swings within the range of ± 0.5 cmH 2 O, indicating stability. The bottom panel is airway pressure waveform. Peak inspiratory pressure and peak expiratory pressure are about 6.6 cmH 2 O and 9.1 cmH 2 O respectively. Both the most positive and the negative pressure difference from the set value fall within the scope of ± 1.5 cmH 2 O, which meets the U. S. Food and Drug Administration (FDA) and 17510 criteria (± 2 cmH 2 O) for CPAP ventilators [10,11]. It is also observed that in Figure 6 the airway pressure fluctuation is ± 1.5 cmH 2 O while the output port pressure fluctuation is only ± 0.5 cmH 2 O. First, we don't expect the motor speed makes an excessive large or small change to avoid pressure unable to go back to the setpoint before the beginning of the next breathing cycle. Hence, a pressure threshold of 3 cmH 2 O is set in the computer. When the offset between the setpoint and the actual pressure is greater than 3 cmH 2 O the PI controller doesn't work any more. In normal CPAP therapy, the patient is directly connected to the output port. However, in Figure 5 additional breathing tube and the analyzer are included in the patient circuits. In this scenario, resistance of additional breathing tube and the flow sensor (between inlet and outlet of the analyzer and with dynamic resistance < 2 cmH 2 O at 60 lpm) is a non-negligible factor that impedes gas flow and undermines the automatic pressure compensation function played by the CPAP ventilator. Besides, gas leak in the exhalation port also partly weakens the contribution from the PI controller. Taken together, these reasons result in the observed airway pressure fluctuation.  Quite often, massive flow rate fluctuations occur during apnea and subsequent hyperpnea. Figure 8 shows a few original recordings of the flow rate and pressure from the experimental CPAP device during hyperventilation and high frequency ventilation with the set pressure at 8.5 cmH 2 O. Obviously, the pressure swings are dependent on flow rates during breathing, with pressure drop by approximate 1 cmH 2 O when the max instantaneous inspiratory flow rate (including gas leak) increase from 50 L/min (normal and resting breathing) to 80 L/min (hyperventilation). The pressure is also stable when the max instantaneous expiratory flow rate rises from -10 L/min (normal and resting breathing) to -55 L/min (hyperventilation). In the subsequent high frequency ventilation, pressure variations are relatively small.
Pressure-Volume loops [12,13] from the experimental CPAP ventilator with pressure set at 8.5 cmH 2 O are indicated in Figure 9. The left P-V loops are for CPAP ventilator with PI controller and the right P-V loops for CPAP ventilator without PI controller. The entire area which the loop encompasses represents the patient's work of breathing. In the left panel, the pressure drop during the inspiratory phase is less than that in the right panel due to the pressure compensation from the PI controller. Consequently, the loop area in the left panel is smaller than that in the right panel meaning a patient makes a smaller effort to combat the ventilator's inspiratory resistance. In addition, from the inspiratory limb of P-V loops, it can also be observed that the total volume (including gas leak in the exhalation port) during inspiratory period is different when the pressure is set at the same level. The left panel is approximately 2.75 L and the right panel is 2.25 L during one breathing cycle. That is to say the PI controller can regulate the flow rate according to the patient inspiratory efforts to provide the adequate tidal volume.

Discussion
The aim of this part is to make a comparison of pressure stability between the experimental CPAP ventilator and commercially available CPAP devices. The test setup is completely similar to that in Figure 5. Flow, volume and pressure are continuously recorded and stored using the VT for Windows PC software.
Four devices including the experimental CPAP, floton™(CURATIVE Medical Technology Beijing Ltd, China), S8 AutoSet Spirit (ResMed Ltd, Australia) and REMstar Auto (Respironics, Inc., USA) were compared in the study. We first identified five feature points on the pressure wave during one breath cycle as shown in Figure 10. Pmin and Pmax are the minimum and maximum airway pressure value respectively. Point A is the inspiration onset point. Point B is a transitional point at which the airway pressure equals the pre-set pressure. Point C represents the end expiratory level with the airway pressure dropping down to the pre-set pressure. Kc, the ratio of pressure drop during inspiration to time interval ΔT 1 , reflects the dynamical pressure compensation performance of CPAP devices. The smaller Kc is, the better pressure compensation. ΔT 2 is the time interval during which airway pressure is greater than the pre-set pressure. Obviously, a shorter time ΔT 2 reflects more comfortable breathing. Therefore, we select four parameters Pmin, Pmax, Kc and ΔT 2 to quantitatively compare comfort level across different CPAP devices as shown in Figure 11 and 12. These parameters for each device have been averaged over 10 breaths during visually confirmed steady state. From Figure 11 we can see that pressure swings of our experimental CPAP are smaller than floton™ and S8 AutoSet Spirit. In addition, Figure 12 indicates that the experimental CPAP is superior to floton™ in terms of shorter Δ T 2 and smaller Kc value.
Another specification that needs to be taken into account is device's noise level. With the output pressure set at 10 cmH 2 O as specified by ISO 17510 we acoustically compare their A-weighted sound power levels and find no significant difference. Further, taking measurements using a sound level meter (TES 1350A, Taiwan), the Aweighted sound power level caused by the experimental CPAP is 44.5 dB and that is 5.8 dB above the A-weighted background level of extraneous noise, 38.7 dB. This device additional noise level is slightly smaller than 6 dB specified by ISO 17510.
After going through an aging test for over four weeks, we evaluated the clinical performance from 6 volunteers. Among them, 2 subjects were OSAS patients. Each subject was tested by standard procedures for 30 minutes. The demographic data and CPAP performance results are shown in Table 2. We can see that the pressure variations during half an hour's CPAP breathing are within the range of ± 2 cmH 2 O for subjects No.3-No.5. And for subject No.1, No.2 and No.6, occasional deep inspiration and expiration cause pressure fluctuation more than 2 cmH 2 O, but in the case of normal and even breathing the pressure fluctuation is still kept within the allowable range of ± 2 cmH 2 O.

Conclusions
Using a fast-response blower, pressure transducer and microprocessor, an experimental CPAP ventilator has been built for the treatment for OSAS. A compensation that Figure 10 Graphic measurement of minimum inspiratory pressure Pmin, maximum expiratory pressure Pmax, time interval from inspiration onset to Pmin(ΔT1) and time interval during which airway pressure is greater than the pre-set pressure(ΔT2) Chen et al. BioMedical Engineering OnLine 2012, 11:5 http://www.biomedical-engineering-online.com/content/11/1/5 comprises feed forward control and feedback control integrating PI compensator is proposed to maintain the therapeutic pressure and minimize pressure variations during spontaneous breathing. Comparison of pressure-time curves and P-V loops indicates that a CPAP ventilator with PI pressure feedback control outperforms the ventilator without pressure feedback control.
Taking a close look at Figure 7, one finds when the CPAP pressure is set at 8 cmH 2 O even if the experimental CPAP ventilator operates in the open-loop mode, the output port pressure variations are still less than ± 2 cmH 2 O. Hence, the present study shows that a fast-response motor/blower is the dominant factor determining performance of a CPAP ventilator.  Figure 12 Kc and ΔT2 in four CPAP devices. Kc is the ratio of pressure drop during inspiration to time interval ΔT1. ΔT2 is time interval during which airway pressure is greater than the pre-set pressure.
A future study is needed to further eliminate the uncomfortable feeling of exhaling against positive pressure. A feasible solution is to let the controller actively reduce the CPAP pressure during the expiration and then return the setting CPAP pressure before the onset of inspiration. In fact, several commercial CPAP ventilator companies such as Respironics and Resmed have introduced this new technology to their own products [14][15][16]. To implement this, besides using a pressure sensor, an additional flow sensor is needed to determine the transitional points between exhalation and inhalation. The flow sensor typically has fast response time of 1 to 3 ms, ranges from ± 200 to ± 1000 sccm and features bi-directional sensing capability. It senses the patient's breathing effort by monitoring airflow amount and direction. Then this flow signal is used to control a sleeve valve whose one of the ports is pneumatically connected to the blower pressure and the other is an exhaust outlet. Since the airflow direction is reversed from exhalation to inhalation it is technically easy to identify the breathing phase and to adjust the pressure correspondingly. Another advantage that the flow transducer offers is it makes it possible to compensate flow loss caused by air leaks, which in turn is helpful in maintaining constant CPAP [17,18].