Patent Publication Number: US-11027080-B2

Title: System and method for determining ventilator leakage during stable periods within a breath

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application is a continuation application of U.S. patent application Ser. No. 13/059,711 entitled “SYSTEM AND METHOD FOR DETERMINING VENTILATOR LEAKAGE DURING STABLE PERIODS WITHIN A BREATH,” filed on Jul. 8, 2011, which application is a national stage entry of PCT/US2009/038819, filed Mar. 30 2009, which claims benefit of U.S. Provisional Application Ser. No. 61/041,070, filed Mar. 31, 2008, and U.S. Provisional Application Serial No. 61/122,288, filed Dec. 12, 2008, the entire disclosures of which are hereby incorporated herein by reference. 
    
    
     BACKGROUND 
     The present description pertains to ventilator devices used to provide breathing assistance. Modern ventilator technologies commonly employ positive pressure to assist patient ventilation. For example, after determining a patient-initiated or timed trigger, the ventilator delivers a specified gas mixture into an inhalation airway connected to the patient to track a specified desired pressure or flow trajectory, causing or assisting the patient&#39;s lungs to fill. Upon reaching the end of the inspiration, the added support is removed and the patient is allowed to passively exhale and the ventilator controls the gas flow through the system to maintain a designated airway pressure level (PEEP) during the exhalation phase. Other types of ventilators are non-triggered, and mandate a specified breathing pattern regardless of patient effort. 
     Modern ventilators typically include microprocessors or other controllers that employ various control schemes. These control schemes are used to command a pneumatic system (e.g., valves) that regulates the flow rates of breathing gases to and from the patient. Closed-loop control is often employed, using data from pressure/flow sensors. 
     Many therapeutic settings involve the potential for leaks occurring at various locations on the ventilator device. The magnitude of these leaks can vary from setting to setting, and/or dynamically within a particular setting, dependent upon a host of variables. Leaks can impair triggering (transition into inhalation phase) and cycling (transition into exhalation phase) of the ventilator; and thus cause problems with patient-device synchrony; undesirably increase patient breathing work; degrade advisory information available to treatment providers; and/or otherwise comprise the desired respiratory therapy. 
     Determining Ventilator Leakage from Data Taken During a Stable Period within a Breath 
     This disclosure describes systems and methods for compensating for leaks in a ventilation system based on data obtained during periods within a breath in which the patient is neither inhaling nor exhaling. The methods and systems described herein more accurately and quickly identify changes in leakage. This information is then to estimate leakage later in the same breath or in subsequent breaths to calculate a more accurate estimate of instantaneous leakage based on current conditions. The estimated leakage is then used to compensate for the leak flow rates, reduce the patient&#39;s work of breathing and increase the patient&#39;s comfort (patient-ventilator breath phase transition synchrony). Without the improvements provided by the disclosed methods and systems, changes in the leak conditions during a breath may not be identified and/or accurately characterized until the following breath or later. 
     In part, this disclosure describes a method for identifying leakage in a respiratory gas supply system. In the method, data indicative of at least one of pressure and flow in the respiratory gas supply system is monitored during the delivery of respiratory gas to a patient. The method includes identifying that the data meet at least one stability criterion indicating that pressure and flow conditions have been stable for a period of time within a breath. These stability criteria are selected to identify stable periods within a breath in which the patient is neither inhaling nor exhaling. Upon identification of a stable period, the method calculates leakage information based at least in part on the data taken during the period of time within the breath. This leakage information may take the form of one or more orifice constants, leak conductances, leak factors, exponents, or other leak characteristics as required by the leakage model utilized by the ventilator to estimate instantaneous leakage from the current status (e.g., pressure or flow) of the ventilator. The method then uses the leakage information to determine a leakage rate in subsequent calculations performed after the stable period. This may include estimating an instantaneous leakage after the period of time based at least in part on the leakage information derived from data taken during the stable period. 
     This disclosure also describes a respiratory gas supply system that identifies stable periods within a breath and derives leakage information for use later in the same breath or in subsequent breaths in estimating instantaneous leakage. The system includes a pressure generating system capable of controlling the flow of breathing gas through a patient circuit and a patient interface to a patient, a stable period identification module that identifies a stable period within a breath, and a leak compensation module that calculates leakage information using data obtained during the stable period identified by the stable period identification module and that calculates, during subsequent stable and unstable periods within the breath or a later breath, an instantaneous leakage rate based on the leakage information. 
     This disclosure also describes another method for determining leakage from a respiratory gas supply system providing respiratory gas to a breathing patient. The method includes identifying at least one stable period within a patient breath and calculating leakage information based on pressure and flow data obtained during the at least one stable period. The method also, at times subsequent to the stable period, estimates the leakage from the respiratory gas supply system based on the leakage information calculated from the data obtained during the at least one stable period and the current data. 
     These and various other features as well as advantages which characterize the systems and methods described herein will be apparent from a reading of the following detailed description and a review of the associated drawings. Additional features are set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the technology. The benefits and features of the technology will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. 
     It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are intended to provide further explanation of the invention as claimed. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       The following drawing figures, which form a part of this application, are illustrative of described technology and are not meant to limit the scope of the invention as claimed in any manner, which scope shall be based on the claims appended hereto. 
         FIG. 1  illustrates an embodiment of a ventilator connected to a human patient. 
         FIG. 2  schematically depicts exemplary systems and methods of ventilator control. 
         FIG. 3  illustrates an embodiment of a method for identifying the leakage from a ventilation tubing system of a respiratory gas supply system. 
         FIG. 4  illustrates another embodiment of a method for identifying the leakage from a ventilation tubing system of a respiratory gas supply system. 
         FIG. 5  illustrates a functional block diagram of modules and other components that may be used in an embodiment of ventilator that compensates for leaks. 
     
    
    
     DETAILED DESCRIPTION 
     Although the techniques introduced above and discussed in detail below may be implemented for a variety of medical devices, the present disclosure will discuss the implementation of these techniques in the context of a medical ventilator for use in providing ventilation support to a human patient. The reader will understand that the technology described in the context of a medical ventilator for human patients could be adapted for use with other systems such as ventilators for non-human patients and general gas transport systems in which leaks may cause a degradation of performance. 
     As a threshold issue, the terms “leakage” and “leak” shall be used to refer to only the inadvertent escape of gas from unknown locations in ventilation system and does not include any measured or known intentional discharges of gas (such as through an exhaust port, relief valve or an expiratory limb). A leakage may be expressed as a rate (flow) or a volume depending on the situation. 
       FIG. 1  illustrates an embodiment of a respiratory gas supply system in the form of a ventilator  20  connected to a human patient  24 . Ventilator  20  includes a pneumatic system  22  (also referred to as a pressure generating system  22 ) for circulating breathing gases to and from patient  24  via the ventilation tubing system  26 , which couples the patient to the pneumatic system via physical patient interface  28  and ventilator circuit  30 . Ventilator circuit  30  could be a dual-limb circuit (as shown) for carrying gas to and from the patient or a single-limb system that delivers breathing gas to the patient after which it is discharged directly to the atmosphere without being returned to the pneumatic system  22 . In a dual-limb embodiment as shown, a wye fitting  36  may be provided as shown to couple the patient interface  28  to the inspiratory limb  32  and the expiratory limb  34  of the circuit  30 . Exhaled gas is discharged from the expiratory limb  34  through the ventilator  20  which discharge of gas may be both monitored and controlled by the ventilator  20  as part of the delivery of gas to the patient. 
     The present systems and methods have proved particularly advantageous in noninvasive settings, such as with facial breathing masks, as those settings typically are more susceptible to leaks. However, leaks do occur in a variety of settings, and the present description contemplates that the patient interface may be invasive or non-invasive, and of any configuration suitable for communicating a flow of breathing gas from the patient circuit to an airway of the patient. Examples of suitable patient interface devices include a nasal mask, nasal/oral mask (which is shown in  FIG. 1 ), nasal prong, full-face mask, tracheal tube, endotracheal tube, nasal pillow, etc. 
     Pneumatic system  22  may be configured in a variety of ways. In the present example, system  22  includes an expiratory module  40  coupled with an expiratory limb  34  and an inspiratory module  42  coupled with an inspiratory limb  32 . Compressor  44  or another source(s) of pressurized gas (e.g., air and oxygen) is coupled with inspiratory module  42  to provide a gas source for ventilatory support via inspiratory limb  32 . 
     The pneumatic system may include a variety of other components, including sources for pressurized air and/or oxygen, mixing modules, valves, sensors, tubing, accumulators, filters, etc. Controller  50  is operatively coupled with pneumatic system  22 , signal measurement and acquisition systems, and an operator interface  52  may be provided to enable an operator to interact with the ventilator (e.g., change ventilator settings, select operational modes, view monitored parameters, etc.). Controller  50  may include memory  54 , one or more processors  56 , storage  58 , and/or other components of the type commonly found in command and control computing devices. 
     The memory  54  is computer-readable storage media that stores software that is executed by the processor  56  and which controls the operation of the ventilator  20 . In an embodiment, the memory  54  comprises one or more solid-state storage devices such as flash memory chips. In an alternative embodiment, the memory  54  may be mass storage connected to the processor  56  through a mass storage controller (not shown) and a communications bus (not shown). Although the description of computer-readable media contained herein refers to a solid-state storage, it should be appreciated by those skilled in the art that computer-readable storage media can be any available media that can be accessed by the processor  56 . Computer-readable storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer-readable storage media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer. 
     As described in more detail below, controller  50  issues commands to pneumatic system  22  in order to control the breathing assistance provided to the patient by the ventilator. The specific commands may be based on inputs received from patient  24 , pneumatic system  22  and sensors, operator interface  52  and/or other components of the ventilator. In the depicted example, operator interface includes a display  59  that is touch-sensitive, enabling the display to serve both as an input and output device. 
       FIG. 2  schematically depicts exemplary systems and methods of ventilator control. As shown, controller  50  issues control commands  60  to drive pneumatic system  22  and thereby circulate breathing gas to and from patient  24 . The depicted schematic interaction between pneumatic system  22  and patient  24  may be viewed in terms of pressure and/or flow “signals.” For example, signal  62  may be an increased pressure which is applied to the patient via inspiratory limb  32 . Control commands  60  are based upon inputs received at controller  50  which may include, among other things, inputs from operator interface  52 , and feedback from pneumatic system  22  (e.g., from pressure/flow sensors) and/or sensed from patient  24 . 
     In many cases, it may be desirable to establish a baseline pressure and/or flow trajectory for a given respiratory therapy session. The volume of breathing gas delivered to the patient&#39;s lung (L 1 ) and the volume of the gas exhaled by the patient (L 2 ) are measured or determined, and the measured or predicted/estimated leaks are accounted for to ensure accurate delivery and data reporting and monitoring. Accordingly, the more accurate the leak estimation, the better the baseline calculation of delivered and exhaled volume as well as event detection (triggering and cycling phase transitions). 
     When modeling the delivery of gas to and from a patient  24  via a closed-circuit ventilator, one simple assumption is that compliance of the ventilator circuit  30  is fixed and that all gas injected into the ventilator circuit  30  that does not exit the circuit  30  via the expiratory limb  34  fills the circuit as well as the patient&#39;s lungs and causes an increase in pressure, As gas is injected (L t ), the lung responds to the increased gas pressure in the circuit  30  by expanding. The amount the lung expands is proportional to the lung compliance and is defined as a function of gas pressure differential (Compliance=volume delivered/pressure difference). 
     Errors may be introduced due to leaks in the system. For example, in a perfect dual-limb system the difference in gas input into the system and gas exiting the system at any point in time is the instantaneous lung flow of the patient. However, if this method is used to calculate lung flow when there is, in actuality, some gas that is unknowingly leaking out the instantaneous lung flow calculation will be incorrect. Lung flow calculations may be used for many different purposes such as synchronizing the operation of the ventilatory support provided by the ventilator  20  with a patient&#39;s actual breathing. In order to improve the overall operation of the ventilator, then, it is desirable to, where possible, identify and account for any leaks in the system that may affect the lung flow calculation. 
     Leaks may occur at any point in the ventilation tubing system  26 . The term ventilation tubing system  26  is used herein to describe the ventilator circuit  30 , any equipment attached to or used in the ventilator circuit  30  such as water traps, monitors, drug delivery devices, etc. (not shown), and the patient interface  28 . Depending on the embodiment, this may include some equipment contained in the inspiration module  42  and/or the expiration module  40 . When referring to leaks in or from the ventilation tubing system  26 , such leaks include leaks within the tubing system  26  and leaks where the tubing system  26  connects to the pressure generator  22  or the patient  24 . Thus, leaks from the ventilation tubing system  26  include leaks from the ventilator circuit  30 , leaks from the patient interface  28  (e.g., masks may be provided with holes or other pressure relief devices through which some leakage may occur), leaks from the points of connection between components in the tubing system  26  (e.g., due to a poor connection between the patient interface  28  and the circuit  30 ), and leaks from where the patient interface  28  connects to the patient  24  (e.g., leaks around the edges of a mask due to a poor fit or patient movement). 
       FIG. 3  illustrates an embodiment of a method for identifying the leakage from a ventilation tubing system of a respiratory gas supply system. In the embodiment shown, a ventilator such any of those described above is delivering gas to a patient as illustrated by the respiratory gas delivery operation  302 . The patient may be initiating breaths on his/her own (i.e., actively breathing) or the delivery of gas may be completely controlled by the ventilator so that respiratory gas is forced into and out of the lungs of the patient without any action on the patient&#39;s part. 
     In addition to delivering gas, the method  300  includes a monitoring operation  304  in which data on the pressure, flow and other operational parameters are gathered while the ventilator is delivering gas. Monitoring refers to taking measurements or otherwise obtaining data indicative of the operational condition of the ventilator (e.g., pressure or flow) at one or more locations. For example, in a dual-limb ventilator embodiment the pressure and flow in both the inspiratory limb and the expiratory limb may be recorded by the monitoring operation  304 . In an embodiment in which a sensor or sensors are provided at a wye or the patient interface, the monitoring operation  304  may include obtaining data from these sensors. 
     The monitoring operation  304  may include periodically or occasionally requesting or receiving data from a sensor or other data source. For example, in a digital system monitoring may be performed by gathering data from each sensor every time the sensor is polled by the ventilator&#39;s control system or every computational cycle in which a data analysis routine is performed. In one such embodiment, monitoring includes obtaining data from all sensors every computational cycle). Monitoring may also be performed continuously such as in an analog system in which analog signals from sensors are continuously feed into comparators or other analog components for evaluation. 
     As part of the monitoring operation  304 , the data are evaluated in order to identify stable periods of operation in which the operational conditions such as pressure and flow within the ventilation tubing system are relatively constant and indicative of a period during which the patient is neither breathing in nor breathing out significantly. Such stable periods, for example, may appear at the end of an inhalation just prior to the patient beginning exhalation, at the end of an exhalation prior to the patient initiating the next inhalation and at times when a patient is, consciously or unconsciously, holding his/her breath. 
     In an embodiment, stable periods are identified by comparing the data obtained by the monitoring operation  304  to one or more predetermined stability criteria, illustrated by the stable period determination operation  306 . The comparison may include comparing data from a fixed “window” or period of time to the stability criteria. For example, in an embodiment, a fixed window (i.e., a window of 50 milliseconds (ms) of data or of ten consecutive measurement obtained from the sensors) of the most recent data may be compared to the stability criteria. 
     The stability criteria are selected specifically to identify such stable periods during which the patient is neither breathing in nor breathing out significantly. In an embodiment, the stability criteria may include static criteria (e.g., a predetermined threshold that remains fixed based on operator selected settings such as a positive end expiratory pressure (PEEP) level) and dynamic criteria that must be recalculated based on the current conditions as indicated by the data itself (e.g., a flow threshold that is a function of the amount of flow delivered up to that point in time). In addition, different stability criteria may be used depending on whether the current breath phrase is inhalation or exhalation. 
     Examples of stability criteria include a) a pressure based criterion such as a requirement that the average pressure during the window being evaluated is greater than a minimum pressure threshold or less than a maximum pressure threshold in which the threshold may be a static pressure based on the current ventilator settings or a dynamically generated pressure threshold based on current data; b) a pressure variation criterion identifying a maximum pressure variation within the window (e.g., a rate of change of pressure or a difference between pressure measurements within the window); c) a flow variation criterion identifying a maximum flow variation within the window; d) a mode criterion that verifies that a specific type of patient circuit, patient interface or ventilation mode is currently being used; e) a flow criterion identifying a minimum or maximum flow threshold; f) a time criterion identifying a minimum or maximum amount of time since some predefined event such as since the start of the current inhalation or exhalation cycle; and g) a volume criterion identifying a specific volume of gas that must have been inhaled or exhaled since the start of the current breath phase. As mentioned above, all of these criteria may be static criteria (unchanging during a breath) or may be dynamic criteria (that is criteria that recalculated based on current data either periodically or every time the stable period check is performed). Other types of criteria could also be used to identify stable periods including criteria based on patient effort as determined by ancillary equipment and criteria that are based on sensors other than pressure or flow sensors. 
     If the comparison of the data to the stability criteria indicates that the gas delivery by the ventilator does not meet the predetermined stability criteria, the conditions in the current window are not considered stable enough to use in determining the current leakage of the system. In this case, the determination operation  306  branches to an estimate instantaneous leakage operation  310  in which the instantaneous leakage from the ventilation tubing system is calculated using previously determined leakage information, that is leakage information gathered prior to the comparison, such as during a previous breath, set of breaths or stable period. 
     The estimate instantaneous leakage operation  310  may calculate the instantaneous leakage using any one (or more) of known leakage modeling techniques. These include calculating an instantaneous leak using an algorithm that estimates instantaneous leakage based on the current (or instantaneous) pressure within the system and some predetermined leakage information, such as a leak conductance, a leak factor or one or more hypothetical orifice constants. For example, in one embodiment, the instantaneous leakage is modeled as a hypothetical rigid orifice in which the instantaneous leakage from the system is simply a function of a predetermined orifice constant and the square root of the instantaneous pressure. In another embodiment, a leak conductance may be calculated and the instantaneous leakage from the system is a function of a predetermined conductance and the square root of the instantaneous pressure. In yet another embodiment, a leak factor may be calculated and the instantaneous leakage from the system is a function of a predetermined leak factor and the instantaneous pressure or some other parameter indicative of the current operation of the system. In yet another embodiment, the instantaneous leakage may be modeled as a set of different hypothetical orifices each representing different aspects of leakage (e.g., a rigid orifice of constant size and one or more dynamic orifices that change in size based on instantaneous pressure) in which the instantaneous leakage from the system is a function of the predetermined orifice constant for each orifice and the instantaneous pressure. Any suitable leakage model may be used in the estimate instantaneous leakage operation  310  now known or later developed. 
     However, if the comparison of the data to the stability criteria indicates that the window of data meets the predetermined stability criteria, the window is considered stable and the patient is assumed to not be inhaling or exhaling. In this case, the determination operation  306  branches to an update leakage information operation  308 . 
     In the update leakage information operation  308 , the data from the time period of the stable window is used to generate leakage information from which the instantaneous leakage may be determined. The type of leakage information generated is determined by the leakage model used in the estimate instantaneous leakage operation  310 . As discussed above, any suitable leakage model may be used in the estimate instantaneous leakage operation  310  now known or later developed. However, it is presumed that each leakage model will require some type of predetermined leakage information in order to estimate instantaneous leakage at any particular moment from a current pressure measurement. This leakage information may take the form of one or more orifice constants, leak conductances, leak factors, exponents, or other leak characteristics as required by a leakage model. 
     The term leakage information, as used herein, refers to any such predetermined information that is later used in to estimate instantaneous leakage from the system based on the current system&#39;s conditions. The leakage information differs from prior art systems in that it is calculated from data taken during a narrow window of time that is entirely within a breath. In an embodiment, windows are limited a fixed duration within either the exhalation or inhalation phase of a breath so that no window will span time within two phases. In an alternative embodiment, depending on the stability criteria used embodiments of the leakage determining systems and methods described herein may or may not require identification of whether the patient is in an inhalation or exhalation phase. Note that because the onset of either phase of a breath will exhibit significant instability in that the pressure and/or flow will be changing, appropriate selection of length of the window to be analyzed and the stability criteria will prevent the possibility that of a window being identified as stable when it straddles two phases. 
     The update leakage information operation  308  uses some or all of the data from the identified stable window of time to calculate new leakage information. This new leakage information may then be used instead of the previously calculated leakage information or may be used in conjunction with some or all of the previously calculated leakage information. For example, in an embodiment in which a multiple orifice model is used to model the leakage from the ventilation tubing system, one or more of the orifice constants may be updated (i.e., changed based on the data within the window) while other constants used in the model may be retained from earlier calculations. 
     In an embodiment, the update leakage information operation  308  may update the leakage information to one or more default values based on the data in the stable window instead of calculating new values from the data. For example, if the data in the stable window indicates that the leakage during the time period of the stable window was very low, the leakage information may be set to some default minimum value. Likewise, if the data in the stable window indicates that the leakage during the time period of the stable window was very high, the leakage information may be set to some default maximum value. 
     After the leakage information operation  308  has updated some or all of the leakage information based on the data from the stable window, in the embodiment shown the estimate instantaneous leakage information  310  is performed. In an embodiment, this may be performed in the same computational cycle that the leakage information is updated. Alternatively, this may be performed in a later cycle, wherein the current instantaneous leakage information is obtained from a different method. For example, in a dual-limb ventilation system during a stable period the estimated instantaneous leakage may be discarded in favor of the direct measurement of the leakage, i.e., the difference between the measured inflow into the inspiratory limb and the measured outflow out of the expiratory limb. 
     The method  300  also compensates the delivery of respiratory gas based on the instantaneous leakage, as illustrated by the compensate operation  312 . As discussed above, this may include compensating a lung flow estimate for instantaneous leakage or changing the amount of gas delivered to the inspiratory limb in order to compensate for the estimated instantaneous leakage. Other compensation actions may also be performed. 
     The method  300  then repeats so that the ventilator is continuously monitoring the delivery of gas to identify stable periods within a breath phase and update the leakage information based on the data from those stable periods. In an embodiment, additional leakage information may be determined at specified points in the respiratory cycle. For example, in an embodiment leakage information may be determined at the end of every breath for use in the next breath. The method  300  may then be used in order to check the leakage information determined at the end of a breath. This embodiment is described in greater detail with reference to  FIG. 4 . 
       FIG. 4  illustrates another embodiment of a method for identifying the leakage from a ventilation tubing system of a respiratory gas supply system. In the embodiment shown, a ventilator such any of those described above is delivering gas to a patient. Again, the patient may be initiating breaths on his/her own (i.e., actively breathing) or the delivery of gas may be completely controlled by the ventilator so that respiratory gas is forced into and out of the lungs of the patient without any action on the patient&#39;s part. 
     In the method  400 , at the beginning of each new breath, leakage information is calculated from data taken during one or more prior breaths in a calculate leakage information operation  402 . Unless changed by the later update leakage operation  418  (discussed below) this leakage information will be used in the estimate instantaneous leakage operation  406  for the remainder of the breath; this will occur, for instance, if no stable periods are identified during the breath. 
     In the embodiment shown, the remaining operations in the method  400 , i.e., operations  404 - 422 , are repeated until the next breath is triggered. During this time, the ventilator is providing ventilatory support to the patient as directed by a caregiver. 
     The method  400  includes obtaining the current flow and pressure measurements from the various sensors in the ventilator in an obtain data operation  404 . 
     An estimate instantaneous leakage operation  404  is then performed as described above with reference to the estimate instantaneous leakage operation  310  in  FIG. 3 . This operation  404  calculates an instantaneous leakage based on the current pressure measurements (and/or other data depending on the leakage model used). 
     The ventilator then compensates for the estimated instantaneous leakage in a compensate operation  408  as described above with reference to the compensate operation  312  in  FIG. 3 . 
     The method  400  also performs a comparison of the data obtained in the obtain data operation  404  as illustrated by the compare data operation  410 . The compare data operation  410  compares data from a recent window of time in order to identify a stable period as described above with reference to  FIG. 3 . The comparison may include comparing a fixed window of data to the stability criteria. For example, in an embodiment, a fixed window (i.e., a window of 50 milliseconds (ms) of data or of ten consecutive measurement obtained from the sensors) of the most recent data including the current data may be compared to the stability criteria. 
     If the compare data operation  410  determines that the window being analyzed is not sufficiently stable (i.e., it does not meet the predetermined stability criteria) as determined by a first determination operation  412 , the current leakage information is not updated and another determination operation  420  is performed to determine if a new breath should be triggered or not and the method  400  then repeats as shown. 
     If the compare data operation  410  determines that the window being analyzed contains data that are sufficiently stable (i.e., the data in the window meet the predetermined stability criteria) as determined by the first determination operation  412 , operations  414 - 418  are performed to check the accuracy of the current leakage information to determine if some or all of that information should be updated based on the data in the stable window. 
     The accuracy check includes a determine actual leakage operation  414  in which the actual leakage during the stable window is determined based on known information and data obtained from the stable window. In a dual-limb embodiment, this may include calculating the difference between the measured inflow into the inspiratory limb and the measured outflow from the expiratory limb. In a single-limb embodiment, this may include calculating the difference between the measured inflow into the inspiratory limb and a measured or otherwise known exhaust(s) from the limb and/or patient interface. For example, the exhaust from an exhaust port in a patient interface may be monitored or otherwise determinable based on a known size or known features of the exhaust port and the current conditions. The actual leakage may be an average leakage rate during the window, a total leakage volume that leaked out during some or all of the window, or some other element of information that describes the leakage during or within the stable window. 
     The actual leakage during the window is then compared in a second compare operation  416  to the estimated leakage previously determined in the estimate leakage operation  406 . If the actual leakage does not differ from the estimated leakage by more than a threshold amount, as illustrated by determination operation  417 , the current leakage information is not updated and another determination operation  420  is performed to determine if a new breath should be triggered or not. However, if the actual leakage differs from the estimated leakage by more than a threshold amount an update leakage information operation  418  is performed. 
     The update leakage information operation  418  updates some or all of the leakage information as described above with reference to the update leakage information operation  308  in  FIG. 3 . 
       FIG. 5  illustrates a functional block diagram of modules and other components that may be used in an embodiment of ventilator that compensates for leaks. In the embodiment shown, the ventilator  500  includes pressure sensors  504  (two are shown placed at different locations in the system), flow sensors (one is shown), and a ventilator control system  502 . The ventilator control system  502  controls the operation of the ventilator and includes a plurality of modules described by their function. In the embodiment shown, the ventilator control system  502  includes a processor  508 , memory  514  which may include mass storage as described above, a leak compensation module  512  incorporating at least one leak model such as that described in commonly-owned U.S. Provisional Application 61/041,070 hereby incorporated herein, a stable period identification module  516 , a pressure and flow control module  518 , and a monitoring module  522 . The processor  508  and memory  514  have been discussed above. Each of the other modules will be discussed in turn below. 
     The main functions of the ventilator such as receiving and interpreting operator inputs and changing pressure and flow of gas in the ventilator circuit are performed by the control module  518 . In the context of the methods and systems described herein, the module  518  may perform one or more actions upon the determination that a patient receiving therapy is inhaling or exhaling. 
     The current conditions in the ventilation system are monitored by the monitoring module  522 . This module  522  collects the data generated by the sensors  504 ,  506  and may also perform certain calculations on the data to make the data more readily usable by other modules or may process the current data and or previously acquired data or operator input to derive auxiliary parameters or attributes of interest. In an embodiment, the monitoring module  522  receives data and provides it to each of the other modules in the ventilator control system  502  that need the current pressure or flow data for the system. 
     The ventilator  500  further includes a stable period identification module  516 . The stable period identification module  516  analyzes data obtained by the monitoring module  522  in order to identify periods of stability within a breath during which the patient is neither inhaling nor exhaling. The methods discussed above describe various embodiments for identifying stable periods using dynamic and/or static stability criteria. Other embodiments are also possible and any method that can accurately identify a stable period may be used. 
     When a stable period is identified, this information is passed to the leak compensation module  512 . The leak compensation module  512  may then update the current leak information to leak information derived from the stable period. In an embodiment, the leak compensation module  512  may first compare the actual leakage during the stable period to the amount of leakage estimated for the period using the current leakage information. The results of this comparison may then dictate whether and how the current leakage information is updated by leakage information calculated from the data taken during the stable period. 
     In the embodiment shown, the current or instantaneous inelastic leak is also calculated by the leak compensation module  512  using one or more predetermined leakage models. The leak compensation module  512  may estimate a new instantaneous flow or volume for each sampling period using data taken by the monitoring module  522 . The estimated instantaneous leak may then be provided to any other module as needed. 
     In an embodiment, the leak compensation module  512  uses the two orifice leak compensation model described in U.S. Provisional Application 61/041,070 which is provided as an attachment hereto and which forms a part of this application. In this embodiment, the leak compensation module  512  calculates leakage information that includes the orifice constant K 1  which represents leakage through an orifice of fixed size and the orifice constant K 2  which represents a dynamic orifice that changes size in response to changes in pressure. After calculating the leakage information, the leak compensation module  512  then uses the following equation to calculate instantaneous leakage at later points in time:
 
Instantaneous Leakage= K   1   P   0.5   +K   2   P   1.5  
 
     in which P is the instantaneous pressure. During a stability check, if it is determined that the leakage information should be changed, either the K 1  or the K 2  or both constants may be changed. 
     In addition, in the embodiment shown the leak compensation module  512  also is responsible for compensating for the estimated instantaneous leakage. This may include compensation the estimates of other parameters such as lung flow and may include providing information to the control module  518  to change the pressure or flow of the delivery of gas to the patient. 
     The system  500  illustrated will perform a dynamic compensation of lung flow based on the changing leak conditions of the ventilation system and the instantaneous pressure and flow measurements. By identifying stable periods within a breath from which accurate leakage information may be determined, the medical ventilator can more quickly, accurately and precisely identify changes the leakage from the ventilation tubing system and control the delivery of gas to compensate for such changes in leakage. 
     It will be clear that the systems and methods described herein are well adapted to attain the ends and advantages mentioned as well as those inherent therein. Those skilled in the art will recognize that the methods and systems within this specification may be implemented in many manners and as such is not to be limited by the foregoing exemplified embodiments and examples. In other words, functional elements being performed by a single or multiple components, in various combinations of hardware and software, and individual functions can be distributed among software applications at either the client or server level. In this regard, any number of the features of the different embodiments described herein may be combined into one single embodiment and alternate embodiments having fewer than or more than all of the features herein described are possible. For example, the various operations in the embodiments of methods described above may be combined or reordered as desired without deviating from the overall teaching of this disclosure. 
     While various embodiments have been described for purposes of this disclosure, various changes and modifications may be made which are well within the scope of the present invention. For example, leak information need not be calculated in real time for immediate use in determining instantaneous leakage. In an embodiment, leak information from one or more stable periods during a breath phase may be calculated and/or used after that breath in calculating instantaneous leakage during one or more subsequent breaths. 
     Numerous other changes may be made which will readily suggest themselves to those skilled in the art and which are encompassed in the spirit of the disclosure and as defined in the appended claims.