PUMP CONTROLLER USING ACOUSTIC SPECTRAL ANALYSIS

Abstract: A system for controlling the flow of fluid through a line (3). The system may include first and second valves (A, B; and 6, 7) in the line (3) between is located a chamber (52, 82), part of which may be filled with fluid having a variable volume (52), and another part is filled with a measurement gas (V1), such as air. The chamber may be isolated from the pressure effects in the rest of the line by closing both valves. The valves may also permit fluid to flow into or out of the chamber. The second portion of the chamber has a common boundary with the first part in such a way that tha combined volume of the first and second parts is constant. A loudspeaker (22, 33, 571) creates sound waves in the gas in the second part of the chamber, in order to mesure the volume of the fluid in the first part, and for directing the operation of the valves and creating subsonic pressure variations to produce the desired flow. The volume measurement is achieved by acoustic volume measurement techniques.

Description: PUMP CONTROLLER USING ACOUSTIC SPECTRAL ANALYSIS Technical Field The invention relates generally to systems that control flow through a line, and in particular intravenous fluid delivery systems. Background Art It is known in the art to measure the free volume of a confined space by applying to the gas within the space repeated compressions of predetermined waveform by means of a diaphragm, for example, of a loudspeaker, and generating electrical signals representative of the resultant variation of pressure by means, for example of a microphone, and calculating the free volume of the confined space by measuring the electrical signals so generated. See, for example. United States patents 4,561,298, for an invention of Pond, and 3,237,451, for an invention of Haeff; these patents are hereby incorporated herein by reference. In accordance with this approach, a reference container of known volume may be disposed adjacent to the unknown volume, and a common loudspeaker at the boundary between the two volumes may be used to apply repeated compressions simultaneously to both volumes. The resultant pressure variations can then be monitored by microphones placed in each volume, and the electrical outputs from the two microphones may be compared to obtain a signal whose amplitude is representative of the unknown volume. Pond (col. 2, lines 26-29) teaches that the frequency of the repeated compressions should be sufficiently low to avoid problems associated with Helmholtz resonance. The accuracy of volume measurement systems of the acoustic-pressure type disclosed in these two patents is dependent upon the degree to which differences between the two microphones can be eliminated or compensated and also upon the recalibration of the systems to take into account drift caused, for example, by changes in temperature and humidity or other pertinent characteristics of the system and of the air or other gas used in the measurement. The accuracy may also be adversely affected by gas leaks in the reference or unknown volumes. Summary of Invention In accordance with one embodiment, the invention provides a system for determining the volume of a chamber. The system includes an arrangement for associating with the chamber a resonatable mass of known acoustic characteristics so as to form an acoustic resonant system and an arrangement for determining the frequency of self-resonance of the system. In a preferred embodiment, the resonatable mass is achieved by use of a port affixed to the chamber, and self- resonance is achieved using a microphone and loudspeaker acoustically coupled to the resonant system and in electrical communication with one another. In accordance with another embodiment of the invention, there is provided a system for controlling the flow of fluid through a line. • Such a system includes first and second valves in the line between is located a chamber, part of which may be filled with fluid having a variable volume, and another part is filled with a measurement gas (such as air) . The chamber may be isolated from the pressure effects in the rest of the line by closing both valves. The valves may also permit fluid to flow into or out of the chamber. The second portion of the chamber has a common boundary with the first part in such a way that the combined volume of the first and second parts is constant. There are also means for creating sound waves in the gas in the second part of the chamber, in order to measure the volume of the fluid in the first part, and for directing the operation of the valves and creating subsonic pressure variations to produce the desired flow. The volume measurement is achieved by acoustic volume measurement techniques. The system determines a frequency of self-resonance of the system, and, based on the frequency of self-resonance, the volume of liquid in the chamber. In one embodiment the system controls the two valves according to a cycle comprising the steps of (i) closing the second valve, which leads to the line downstream of the chamber, (ii) opening the first valve, which leads to the line upstream of the chamber, (iii) then closing the first valve, after fluid has flowed into the chamber, (iv) then determining the volume of liquid in the chamber, (v) then opening the second valve, and (vi) then determining the volume of liquid left in the chamber, tracking the volume while fluid is flowing is flowing from the chamber, and/or determining the amount of fluid left in the chamber after the second valve is closed again. To determine the volume of fluid in the chamber the controller generates an electrical signal having a spectrum of frequencies, which is converted through a loudspeaker into sound waves in the chamber. The acoustic response to the signal input into the chamber is picked up by a microphone. Based on the response the controller determines whether a frequency in the spectrum causes the resonatable mass to resonate, and calculates, based on a determined resonant frequency, the volume of liquid in the chamber. To determine the resonant frequency the controller measures, at a frequency in the spectrum, the gain of the acoustic response relative to the electrical signal. The controller may also measure the phase angle of the acoustic response relative to the electrical signal, in order to determine the resonant frequency. The controller may also detect the presence of a gas-bubble in the liquid by examining the phase and gain information. Brief Description of the Drawings The foregoing features of the invention will be more readily understood by reference to the following description taken with the accompanying drawings, in which: Fig. 1 is a schematic representation of an acoustic resonant system including a volume and an associated port; Fig. 2 presents schematic representations of three embodiments of the invention for measurement of the volume V_ using self-resonance; Fig. 3 illustrates schematically an embodiment, of the invention utilizing a pair of embodiments of the type shown in Fig. 2 to produce a system for volume measurement in which differences between the two microphones as well as any drift caused by changes in the measurement gas characteristics or in other parts of the system may be automatically compensated; Fig. 4 is an electrical schematic of a circuit for driving the loudspeaker and connecting the microphones of the embodiments shown in Figs. 3 and 7; Fig. 5 is a schematic representation of an embodiment of the invention providing a fluid management system, capable of pumping fluid and controlling fluid flow, employing an acoustic-pressure volume measurement system; Fig. 6 is a schematic representation of a further embodiment of the invention providing a fluid management system employing an acoustic-pressure volume measurement system that uses differentially driven microphones and a duplexed reference volume arrangement to permit automatic compensation for microphone differences and system drift; Fig. 7 is a schematic representation of another embodiment of the invention providing a fluid management system employing an acoustic resonance volume measurement system of the general type shown in Fig. 3; Fig. 8 shows another acoustic resonant system designed to control the flow of fluid through a line. Figs. 9 and 10 show electrical and mechanical models of the acoustic system shown in Fig. 8. Fig. 11 shows plots of the phase angle and gain of the acoustic response of the acoustic system shown in Fig. 8, when the loudspeaker applies a range of frequencies to the system. Fig. 12 is a block diagram of the signal processing and control elements of the pump controller. Fig. 13 is a more detailed block diagram of the signal processing circuitry. Fig. 14 shows a peak detector that may be used in the signal processor shown in Fig. 14. Fig. 15 is a flow chart showing the overall sequence of steps taken by the pump controller. Fig. 16 is a flow chart showing the the sequence of steps taken during the SCAN mode. Fig. 17 is a flow chart showing the sequence of steps taken during the TRACK mode, which uses a modified phase- locked loop while the fluid in the chamber is being depleted. Detailed Description of Specific Embodiments Turning now to Fig. 1, there is shown a schematic representation of an acoustically resonant system including a chamber having a volume V_ and an associated port VL_. Assuming that the system employs air as the gas in the chamber, it is known in the art that such a system has a resonance at frequency f 0 given by the formula where ___ = the density of air in the system, £3 = the cross sectional area of the port M.,, L = the length of the port M 1f _Z_ = barometric pressure of the air in the system, and ___ = constant for adiabatic compression. If . is known, V, is given by Vi - <J≤) <—i—) <-£ » ) . (2) L 4TL-£l Po If furthermore V,, and f_ are known, the ratio can be determined as These equations can be used in the manner described below with respect to certain embodiments of the invention to determine an unknown volume. In Fig. 2 are shown schematic representations of three embodiments of the invention that utilize self-resonance for determination of the volume of a chamber. In each case, the chamber has a volume V 1f and there has been associated with the chamber a port M 1 to form an acoustic system of the type described in connection with Fig. 1. Microphone 21 (or other suitable acousto-electrical transducer) and a loudspeaker 22 (or other suitable electro-acoustical transducer) are acoustically coupled to this acoustic system. The electrical output of the microphone is placed in communication with the electrical input of the loudspeaker 22, in such a way that the amplitude and phase relationships of the signals promote acoustic resonance of the system. (A suitable circuit for achieving such acoustic resonance is discussed below in connection with Fig. 4.) Measurement of a quantity related to the frequency t_ of self-resonance of the system can permit determination of the volume in accordance with equation (2) set forth above. Such a frequency measurement may be achieved in a microprocessor circuit, for example, by counting the number of clock pulses in a period of the self-oscillation signal; this count can then be used by the microprocessor to implement the calculations of equation (2) . In using equation (2) , the ratio P &m.) can be entered manually into the microprocessor. Alternatively, an additional chamber of known volume, configured with a port in a manner similar to one of the embodiments of Fig. 2, may be employed to produce self-resonance, and a quantity related to the frequency of this self-resonance may be measured in the manner just described. Then with knowledge of V., and ___, the ratio (-E o ≥ o ) can be determined using equation (3) , and this value may be used in equation (2) in determining the unknown volume. In the simplest case, embodiment (1) of Fig. 2, the microphone is placed within the chamber and the loudspeaker forms a portion of the wall of the chamber. However, because the self-resonance technique described herein does not require that the chamber be sealed in the fashion required for acoustic-pressure type systems, the transducers employed in these embodiments do not need to be located in the chamber forming part of the self-resonant system. It is necessary only that the transducers be acoustically coupled to the system. In embodiments (2) and (3) of Fig. 2, a second volume V 2 is associated with the system and coupled to volume V., via the port M,. In order for the equations set forth above to remain accurate, it is assumed that V 2 » V.,; however, if this is not the case, the effects of V 2 may be readily calculated by those skilled in the art. In each of embodiments (2) and (3) the loudspeaker 22 forms a portion of the wall of volume V 2 . Such a configuration is beneficial when volume y. is too small to permit ready mounting of the loudspeaker, and can also permit the loudspeaker to serve in a second system employed in tandem, for example, as discussed below in connection with Fig. 3. In embodiment (2) , the microphone 21, here preferably of the velocity type, forms a part of the wall between volumes V 1 and V 2 and responds only to differences in pressure between the two volumes; because the pressure differences between the two volumes tend to be near zero at frequencies below the frequency of natural resonance of the system, noise in the microphone is effectively canceled out. In embodiment (3), the microphone is disposed in volume V 2 ; the microphones in embodiments (1) and (3) are preferably of the pressure type. The use of the second volume V 2 protects the area surrounding the opening of the port M 1 to prevent disturbance of the air flow, clogging, and dust that would affect resonance. The second volume also isolates the combined Y j -Y g -M, system, including the microphone, from the environment. Although the embodiments of Fig. 2 have been described in connection with a port , associated with the chamber of volume _7. , it is necessary only to associate any resonatable mass of known acoustic characteristics to form a resonant system that includes the chamber, and methods analogous to those described above may be used to determine Yι and the ratio (2 ~) • As mentioned above, it is possible to use a pair of the embodiments (regardless whether or not such embodiments happen to be the same type) illustrated in Fig. 2 to determine an unknown volume and to determine the gas constant t iZ r , necessary for the volume calculation. Fig. 3 illustrates the use of a pair of the second Fig. 2 embodiments configured in tandem for this purpose. In this case it is desired to know the volume of fluid in variable volume 35 order to control the flow of fluid along a path that includes inlet 351, volume 35, and outlet 352. (The use of volume measurement using acoustic resonance for the purpose of fluid flow control is discussed in further detail below in connection with Figs. 7 and 8.) Because the total of volume 35 and volume V., remains constant, the determination of V 1 permits the determination of volume 35. In this arrangement, one resonant system of the second embodiment of Fig. 2 is formed with V 1f M 1 and V 2 and a second resonant system of the second embodiment of Fig. 2 is formed with V 3 , M 2 and Y^,. A conduit 34 (not drawn to scale) conducts low frequency (i.e. those not associated with self- resonance) pressure changes between chambers V 2 and V 3 . The loudspeaker 33 is selectively switched into a circuit permitting alternately the self-resonance of each resonant system. Because V 3 , M 2 and γ 4 are all fixed, it is clear from equation (1) that the only factor affecting the resonant frequency of the second resonant system is a change in the ratio EyM-.- Thus the resonant frequency of the second resonant system is used in determining the ratio £y£>_ that in turn is used in the calculation of the volume v., in based on the resonant frequency of the first system. In the embodiment of Fig. 3 (and that of Figs. 7 and 8) , piezo crystal loudspeakers may be advantageously employed because their rigidity provides good isolation between the volumes (to minimize the affect of one volume on resonance of the system employing the other volume) between which they are disposed and because they are relatively efficient and inexpensive. Electret microphones are advantageous because they are sensitive, relatively low- noise, relatively inexpensive, and can configured to measure either pressure or velocity. The speaker and the microphone should have resonant frequencies that are sufficiently high so as not to interfere with the resonant frequency of the acoustic resonant system. Foam rubber may be used advantageously to damp out standing waves in the main chambers. In cases where the variable volume V 1 results from the displacement primarily of one wall, it is preferable that the port M 1 be disposed with its long axis transverse to the direction of displacement of the wall. Fig. 4 is a schematic of a circuit suitable for effecting self-resonance measurements in accordance with the embodiments of Figs. 3, 7, and 8. The FETs Ql and Q2 are alternately switched into conducting and non-conducting states depending on the state of a signal from a microprocessor system obtained as an input from jack J4, and in this manner, the microprocessor selects whether MIC1 (connected via Jl) or MIC2 (connected via J2) is live. The microphone signal is coupled via C2 or C3, depending on the microphone, to the amplifier circuit utilizing U1A, the output of which drives the loudspeaker through J3. Automatic gain control is provided when the voltage across zener diode DI exceeds a threshold via Q3 and Ql. The oscillation resulting from the proximity of the loudspeaker and microphone in the acoustic resonant system described above in connection with Figs. 1-3 is generally sinusoidal, and in the applications described below is at approximately 1 kHz. Although a sinusoid is a desirable waveform for the resonance, since it is substantially free of harmonics, it is not well suited to use in digital calculations. Accordingly a Schmidt trigger circuit associated with U1B provides a square wave output over J5 at the frequency of resonance. The frequency determination is made utilizing clock pulses running in the vicinity of 1 to 10 MHz, and the number of clock pulses occurring in duration of a signal pulse from the output over J5 is counted and stored. In one embodiment, signal pulses are clocked, 100 signal pulses are clocked, and the clock counts are stored and sorted by magnitude. The top and bottom 30 counts are discarded and the middle 40 counts are then averaged. At a 10 MHz clock, therefore, the frequency determination can be made relatively noise immune while still providing an output ten times per second. Figs. 5 through 7 illustrate the manner in which acoustic volume measurement systems may be used to pump and to control the flow of fluid in accordance with the present invention. In this connection, the fluid management system in accordance with the present invention utilizes valves A and B, chamber 52, and an air system to displace the variable volume of the chamber 52 in the manner disclosed in the Fluid Controller application referred to above and in its predecessor applications. Fluid from reservoir 51 may be permitted to enter the chamber 52 when valve A is open and may be permitted to leave the chamber 52 when valve B is open, the actual flow being a function of pressure in chamber 52 and area surrounding as determined by the air system. The air system includes positive and negative pressure sources 531 and 532 respectively, air pump and valve 541 and 542 respectively for charging the pressure sources, and valves C and D for determining the pressure from the air system output presented to the chamber 52. Transducer T monitors the pressure in the chamber 52. The pumping and controlling cycles that are described in the Fluid Controller application and its predecessor applications are fully applicable to the present fluid management system. Indeed, because the present invention permits monitoring of the volume chamber 52 on a substantially continuous basis, any desired pumping or control cycle may be implemented with even greater flexibility than in the case of the Fluid Controller application. In Fig. 5 an acoustic-pressure type measurement system of the general type described above in Background Art is here used in a fluid management system in accordance with the present invention. The air system delivers air of a desired pressure via the common volume 55 and volume A to the interface with the chamber 52. Volume B serves as a reference volume in relation to variable Volume A. Compressions caused by loudspeaker 571 are detected by microphones 561 and 562 in volumes A and B respectively, whose outputs are then compared to arrive at a value for Volume A. The conduits 581 and 582 are designed to minimize the possible effect of resonance and to isolate Volumes A and B respectively. In Fig. 6, fluid management is also achieved using an acoustic-pressure type measurement system; however, in this embodiment, there is provided an acoustic-pressure type measurement presenting important improvements over the prior art. In this embodiment, microphones 561 and 562 detect only pressure differentials between Volumes A and C on the one hand and B and D on the other, thus providing substantial noise cancellation. As in the case of conduits 581 and 582, the conduits 583 and 584 pass low frequency changes in pressure but otherwise preserve the isolation of the volumes to which they are coupled. Variations in sensitivity of microphones 561 and 562 can be compensated automatically by use of Volumes C and D in connection with loudspeaker 572. These two volumes are designed to be equal (or in any other predetermined ratio) , so that any variation in the output of the two microphones when loudspeaker 572 is driven is attributable to differences in sensitivity of the microphones, and can be compensated automatically. By driving loudspeakers 571 and 572 at substantially different frequencies, compensating signals (derived from filtering the microphone outputs for the signal frequency used in relation to Volumes C and D) can be utilized on a continuous basis for the equalization of the outputs of the microphones in connection with the volume measurement determinations made with respect to Volumes A and B. Fig. 7 illustrates the use of an acoustic resonance volume measurement system, of the type discussed above in connection with Fig. 3, in a fluid management system in accordance with the present invention. In this case chamber 52 corresponds to variable volume 35, and V,, V 2 , V 3 , and V^ correspond to Volumes A, B, D, and C respectively. Air pressure from the air system is delivered over conduits 73 and 731 to Volume B and chamber 52. Conduit 732, along with conduits 73 and 731, corresponds to the conduit 34 of Fig. 3 to equalize static pressure in the system. Measurement of Volume A is exactly as described above for measurement of volume V,. Although Fig. 7 illustrates the use of the Fig. 3 embodiment of an acoustic resonance volume measurement system, it will be apparent that any of a variety of acoustic resonance volume measurement systems may be employed. For example, a simpler system may employ only Volumes A and B, and dispense with Volumes C and D and microphone 712, or may, for example, use any other of the embodiments shown in Fig. 2. The use of an acoustic resonance volume measurement system in connection with a fluid management system offers some significant advantages over acoustic-pressure systems for volume measurement. First, pressure leaks that may inhere in the volumes have reduced impact on the measurement, and second, transducers may be more flexibly located. Fig. 8 shows the embodiment (3) of of Fig. 2 modified so as to control flow through a line 3, and with the microphone mounted in a different position. The back chamber 84 (V 2 ) is connected to an air supply line 103 that can be connected to positive and negative pressure sources, as shown in Figs. 5-7 above. The air supply line 103 is narrow and long enough, so that it presents a substantial acoustic impedance, thereby preventing a significant amount of acoustic energy from escaping the back chamber 84. Valves 6 and 7, when they are both closed, isolate the fluid 52 in the front chamber 82 from pressure effects in the rest of the line 3. The speaker 22 introduces acoustic energy to chambers 82 and 84 (V t and V 2 ) , which are connected by an orifice 87 (which contains the resonateable mass M.,) . The microphone 21 measures the reponse of the chamber-orifice-chamber system to the acoustic energy introduced by the speaker 22. By introducing a range of frequencies to the chamber- orifice-chamber system and analyzing the characteristics of the spectrum of frequencies detected by the microphone 21, the resonant frquency of the system may be determined. Such an analysis can also determine the presence of gas bubbles 81 in the liquid 52 in the the front chamber 82. Figs. 9 and 10 show electrical and mechanical models respectively of the acoustic chamber-orifice-chamber system of Fig. 8. In Fig. 9 the speaker is modeled by an A source and may have associated with it an inductance, L s , and a capacitance, C s . Variable capacitor C F represents the gas- filled portion of the front chamber (V,) , which has a varying volume. Capacitor C B represents the back chamber (V 2 ) , which has a constant volume. The inductance coil 1^ represents the orifice 87, which connects the front and back chambers. The op-amp measuring the voltage across the inductance coil I^ represents the microphone. This is a simplified model, and a more accurate model of the acoustic chamber-orifice-chamber system would include resistors and additional capacitors and inductance coils. One can determine the resonant frequencies of this electrical system by comparing for various frequencies the gain and the phase shift of the output of the op-amp with respect to the AC source. One would expect two resonant frequencies for this electrical model, one associated primarily with C F -I^-C B , the other being associated with the capacitance and inductance of the speaker. Fig. 10 shows a mechanical system having three resonant frequencies. This system includes an oscillating lever driven by a rotating wheel, and three masses, m,, m 2 and m 3 , suspended from the lever by three springs, having spring constants k,, k 2 and k 3 . There is a resonance associated with each mass-spring system, proportional to (k/m) % . Like the mechanical system shown in Fig. 10, the acoustic system depicted in Fig. 8 has three resonant frequencies, one is associated with the speaker 22, another is associated with the gas bubble 81 in the liquid 52, and the third is associated by the geometry of the chamber- orifice-chamber system. The resonant frequency associated with the speaker does not change significantly. The resonant frequecy associated with the bubble varies depending on the size of the bubble. The resonant frequency associated with the chamber-orifice-chamber geometry varies depending on the volume of gas in the front chamber (V t ) . As noted above, to determine the resonant frequencies of the system, a spectrum of frequencies may be introduced into the system through the speaker, and the system's response may be detected by the microphone. An example of such a response is shown in Fig. 11, which plots the phase shift and gain for each frequency of the response. The phase shift and gain for a given frequency are measured with respect to the phase and amplitude of the signal applied to the speaker at that frequency. If at a certain frequency, the gain has a gaussian pulse and the phase shift is 90°, that frequency is resonant. The plot shown in Fig. 11 shows two resonant frequencies and part of a third. The resonant frequency associated with the chamber-orifice-chamber geometry is at about 1 kHz, the resonant frequency associated with the air bubble is at about 2.4 kHz, and the resonant frequency associated with the speaker is at the far right of the plot, at about 3 kHz. The microphone also has a resonant frequency associated with it, but being about 10 kHz it is higher than even the speaker's resonant frequency. Between 1 kHz and 2.4 kHz the phase shift passes through 90° at several places; however, none of these points is associated with a peak in gain, and therefore none of these points represents a resonant frequency. The quality factor, or Q, of a resonance is a measure of the sharpness of the peak, and is the ratio of the center frequency to the bandwidth, which is the frequency difference between the two half-power points. The Q for the volume and bubble resonances is about 12, whereas the speaker's is very low, due to its broad bandwidth. If the bubble 81 is very small it may not be possible to locate its high-side half-power frequency. If the bubble 81 is very large, it may spread across the membrane 85 and communicate with the gas in the front chamber 82, so that the peaks representing the volume and bubble resonances merge. If a bubble is detected, it may be removed from the liquid 52 in the chamber. This may be done by means of a return line is connected to the line 3 downstream of the chamber 82. This return line may be connected to the fluid reservoir, so that fluid can be pumped out of the chamber back to the reservoir, carrying with it any bubbles. Once the bubbles have been removed from the chamber, acoustic energy having a spectrum of frequencies can again be introduced into the chambers and another spectral analysis performed. If the spectral analysis shows no bubbles, then the frequency of volume resonance may be determined. The resonance detection system scans a frequency spectrum through the speaker into the back chamber 84, and collects phase and gain information at each frequency. The collected information is stored in an array having three fields, for frequency, gain and phase. This array is then processed to identify the center frequency and Q for each resoance detected. The signal processing hardware that is used to determine the resonant frequencies includes a sine- ^ wave generator for injecting acoustic energy into the chamber, a peak detector for determining the gain, and a phase detector for measuring the phase angle between the input and output signals. Referring to Fig. 12, which shows elements of a preferred embodiment of the pump controller system, including elements of the resonance detection system. The resonance detection system uses sine-wave generator, which includes timer Tl that submits a 'request' to a direct memory access (DMA) controller. The DMA controller then reads a value from a stored sine table and forwards the value to a digital-to-analog converter (DAC) . The sine table has sixteen periods. When the DMA controller comes to the end of the sine-wave table, it receives an end-of-cycle signal and returns to the beginning of the table. The frequency of the generated sine-wave can be altered by changing how fast Tl ticks; the faster Tl ticks, the higher the frequency. The rate that Tl triggers is set by the microprocessor, which forwards a value, τ θ , depending on the desired frequency. Tl is clocked by a 8 MHz crystal, and thus, in the region where the volume resonance is expected (around 1 kHz) , the sine-wave frequency can be altered by increments of .125 Hz. Fig. 13 shows the signal processor (SP) of the resonance detection system in greater detail. The memory shown contains one sine-wave period, although as noted above in the preferred embodiment sixteen periods are stored. Timer Tl triggers the DMA, which in turn forwards a value from memory to the DAC. The output of the DAC is a sine wave that drives the speaker 22. The microphone 21 detects the response of the acoustic system, which is a sine wave that has a phase shift (Φ) and a gain (A) with respect to the signal driving the speaker 22. The response signal from the microphone 21 passes through a buffer and a gain stage, which removes any DC component from the microphone signal. This signal is then read by a zero-crossing detector (ZCD) and a peak detector (PD) . Since the acoustic system being examined is an under-damped system, the first four periods of the sixteen period signal is ignored, so as to allow the acoustic system approach steady state. After the first four periods are ignored, the peak detector determines the greatest amplitude in the remaining twelve periods of the acoustic system's response. Fig. 14 shows the peak-detector (PD) , which measures the amplitude or gain at each frequeny. The peak detector stores the magnitude in a capacitor C14, preferably a 0.1 μF polystyrene capacitor. A transistor switch Q14 allows the processor to ground the capacitor C14, thereby resetting the peak-detector after it has been read. The peak-detector is read by an 8-bit analog-to-digital converter (ADC) . The phase detector includes two zero-crossing detectors (ZCDs) , which turn sinusoidal waves into square waves having the same frequency. (See P. Horowitz and W. Hill, The Art of Electronics. 2nd Ed., Cambridge University Press, 1989, p. 242, for an example of a zero-crossing detector.) One ZCD converts the input signal into a square wave, the other ZCD converts the response signal. The outputs of the ZCDs are provided to an exclusive-or gate. The output from the exclusive-or gate is a square wave, the width of which indicates the phase difference between the input signal and the response. If the two signals are completely in phase, the square wave pulse would have zero width. A 90° shift would cause a pulse width equal to one-half of the period of the driving frequency. The gate's output is used to gate a timer, T2. The counter counts when the signal is high, and does not when it is low. The counter is reset at the beginning of the sine-wave cycle, and read at the end of the cycle (EOC) . The value read is the integrated phase angle. The buffer and gain stage elements in the signal processing circuit shown in Fig. 13 can vary the phase of the response signal by the time it reaches the ZCD and the X'OR gate. The microprocessor can take this additional phase shift into account in interpreting τ β . Fig. 12 shows other components of the pump controller. The pump used may be the pump described in the Membrane- Based Rotary Peristaltic Pump patent application, noted above, which may function as a control valve when turned off. The pump controller may receive error signals regarding signalling that the disposable cassette is mounted improperly (such as "door ajar" and "not vertical") . Also shown are communication lines leading to the user display and the power module. The power module includes an inductively coupled power supply, through which communications signals may be transmitted to other pump controllers being used for the same patient. Fig. 15 is a flow chart showing a process for measuring the flow through the line 3 of the device shown in Fig. 8. In the FILL step valve 7 (valve A) is closed and valve 6 (valve B) is closed. Fluid is allowed to flow into in the front chamber behind the membrane 85. The fluid may be pumped, or the head pressure may force it into the front chamber. Once the membrane is filled, valve 6 is closed. Then the SCAN mode is entered. In the SCAN mode the gain and phase data for each frequency is stored in an array, as discussed above. Fig. 16 shows a flow chart for developing this array. Acoustic energy at a spectrum of frequencies between about 500 Hz and 2800 Hz is introduced into the back chamber, i.e. the acoustic system is "bleeped" at a numerous frequencies, one frequency at a time. The signal processing circuit shown in Fig. 13 is used to determine the phase shift and amplitude (peak) at each frequency. In the PROCESS step the microprocessor parses the array to find resonances, by locating rising edges, peaks and falling edges. The peaks are found by looking for high amplitudes surrounded by lower amplitudes. The symmetry, the Q-value and the band width of the peak are also examined by the microprocessor to ensure that the peak is created by a resonance and not noise. Between the rising and falling edges, the phase data is considered valid, and is used to finely resolve the center frequency. The acoustic energy introduced into the back chamber, preferably does not have frequencies above 2800 Hz, and data above 2800 Hz is not collected. The speaker resonance is thereby avoided, and the detection of more than one resonance implies the existence of a bubble 81 in the liquid 52 in the front chamber 82. When a bubble is detected, it may be purged in the manner discussed above, and system returns to the FILL step of Fig. 15. Once it is determined that the liquid 52 does not contain air bubbles, and assuming that there is a sufficient amount of liquid present in the chamber, the depletion cycle is begun, wherein volume V, is determined using a phase- locked-loop (PLL) in the TRACK mode, instead of the spectral analysis (SCAN and PROCESS) described above. Before valve 7 is opened, and the fluid 52 starts flowing out of the front chamber, the PLL is used to precisely determine V r In the PLL mode a modified PLL is used to ascertain and track the volume, VI, of the gas-filled portion of the front chamber. PLLs typically consist of three basic elements: error detection, error integration (or low-pass filter) and feedback. Error detection is performed by the phase detector shown in Fig. 13. Integration is achieved by accumulating the phase error over twelve periods. (The integration functions as a low-pass filter, the time constant of which should preferably be a hundred times as large as that of the driving frequency for reasons of stability.) The phase shift information is read by the microprocessor, which performs the feedback function in the PLL mode. The microprocessor uses the phase shift information to determine a new input frequency, and a corresponding τ d , which is fed to timer Tl, which in turn triggers the DMA so as to create a sine wave of the desired frequency. Fig. 17 shows a flow chart of how the microprocessor closes the loop in the PLL mode. The acoustic system of Fig. 8 is bleeped at a frequency determined by the microprocessor. For the first iteration the resonant frequency determined in the PROCESS step of Fig. 15 is used. The signal processor shown in Fig. 13 is used to determine the phase shift (§) , and, based on this phase shift and the input frequency, the microprocessor calculates a more precise resoant frequency and from that the volume V 1f which is Vol. #1 in Fig. 15. Then valve 7 is opened, and the amount of fluid 52 in the front chamber depletes. The acoustic chamber is bleeped again at the more precise frequency just determined, or at a frequency that is very close. The signal processing circuit of Fig. 13 is used again to find the phase shift, and based on this phase shift the microprocessor determines whether to increase or decrease the input frequency. Another phase shift is determined for this new input frequency. This process continues, and the microprocessor tracks the resonant frequency, which is changing because volume V 1 is changing. The microprocessor can from time to time use the phase shift information to update V,. The microprocessor monitors the changing volume and phase shift. If the microprocessor determines that the membrane is depleting too quickly, it can partially close valve 7 so as to impede the flow. This is an important function, not only because one does not want to deliver medicine too quickly to the patient, but also because if the volume changes too quickly the microprocessor and the signal processing circuit of Fig. 13 may not be able to keep up. The amount of impedance valve 7 provides to the flow can be adjusted, so as to control the flow rate during depletion. When V., reaches a certain size, valve 7 is closed, and the acoustic system is bleeped one more time at the frequency suggested by the last iteration of the PLL. The phase shift from this bleep and the frequency of the bleep is used to determine V 1f which is used as Vol. #2 in Fig. 15. Vol. #1 is subtracted from Vol. #2 to determine how the volume of fluid that flowed to the patient during the just- completed depletion cycle. This volume is added to the volume of fluid that has already been supplied to the patient. The fluid controller then returns to the FILL step, and the process is repeated. In calculating the volume of the front chamber 82, corrections may be made for temperature and humidity, although such corrections are not thought to be necessary for most situations. Adapting equation (1) for the resonant angular frequency, Ω, we derive: 4) Ω 2 = S/p L • γ/Vol = γ/p • S/(L»Vol) Significantly, the square of speed of sound "c" is given by: 5) c- = γ/p in units length/time 2 . The units of the S/(L-Vol) are 1/length 2 , yielding the product units of 1/time 2 , which is frequency 2 . Volume "Vol" is a function of the front and back chamber volumes, recalling eq. 4, which implies: 6) 1/Vol = 1/V, + 1/V 2 Hence, we see that frequency is determined by the speed of sound and an effective length, the reciprocal square root of the term "A/(L»Vol)", a length determined by the overall geometry of the port and chambers. The sound-speed term comes entirely from the properties of air. Using an ideal gas approximation, which is quite accurate, the square of the speed of sound can be expressed as a function of air properties: 7) c 2 = γRT/M for R = gas constant = 8.31437*10 7 erg °K "1 mor 1 T = absolute temperature in °K M = average molecular weight of (air, + water vapor = 28.966 gm mol " , dry air = 18.015 gm mol *1 , water vapor Hence, we may rewrite the result of eq. 10 as follows: The heat capacity ratio "γ" is dependent on water vapor content, like "M". To compute "γ", one must compute C v , heat capacity at constant volume, as a weighted average of C v for air and C v for water vapor, proportioning the water vapor contribution to the saturation partial pressure of water vapor at temperature T, multiplied by the relative humidity fraction. With the weighted average C v , one uses the relation that 9) γ 2 = 1 + R/C v for C v = 20.6317* 10 7 erg °K "1 mol "1 , dry air = 25.4830* 10 7 erg °K "1 mol "1 , water vapor The effect of relative humidity rises steeply with temperature, since the absolute water content of air at a given relative humidity rises with temperature. Eq. 16 gives the partial pressure of water vapor, in atmospheres, at relative humidity .= RH and at absolute temperature T in 10) TM^o = RH» 10 A/T + B} for A = -2290. 6 B = 6. 17658 The A and B coefficients are adjusted for an exact fit at 20 β C and 40"C, yielding a worst-case fractional error of -.26% at 30 β C. For computations at one atmosphere, weighted averages of air and water vapor properties are formed by weighting the air figure by (l-ATM^) and the water vapor figure by ATM^ Q . At 40"C = 104 β F, the maximum perturbation on volume calibration attributable to humidity is at ±.9% variation for relative humidities of 10% and 90% and calibration at 50%. Neglecting the effect of humidity, resonant frequency depends on the ratio "Vol/T", so calibration to absolute temperature is essential. Pressure does not enter into the calibration, so altitude and barometer can be ignored. Rapidly changing pressure, as might be used for pumping of the fluids being measured, cannot be entirely ignored. The critical factor with time-varying pressure is that the variation be slow enough to allow chamber air to equilibrate thermally with the chamber and orifice walls, which act as "infinite" heat sinks. The time constants involved will be quantified below. The boundary layer is an acoustic orifice is driven by audio-frequency pressure variations. When the flow is being reversed rapidly, the maximum velocity achieved in a given direction is generally extremely small, which would imply a very low Reynolds number for pipe flow in a steady-flow analysis. This, in turn, would imply that orifice flow mechanics would be dominated by viscosity and the Q factor for the orifice would be much less than one. When the flow is being reversed rapidly, there are substantial pressure gradients in relation to the velocities achieved, and momentum effects tend to dominate over viscosity. It is as if high frequencies raise effective Reynolds numbers, emphasizing momentum forces over viscous forces. Fortunately, the equations for a one-dimensional boundary layer in oscillatory flow are relatively simple and yield a convenient algebraic solution, which will now be shown. To model the boundary layer near a static surface in a sinusoidally reversing flow, it is convenient to switch to a frame of reference in which the surface is oscillating tangentially and the fluid (e.g., air) at a distance from the surface is static. In this case, the sinusoidal tangential wall velocity "v" is described as a function of time "t" by a complex exponential times the amplitude A(0) , the amplitude of height = 0. In general, we have A = A(Z) , amplitude as a complex function of height Z above the oscillating surface, expressing both the amplitude and phase of the oscillating flow at Z: 11) v(Z) = A(Z)»EXP(jωt) The shear stress exerting a horizontal force across vertically adjacent layers of the oscillating fluid is proportional to the produce of the vertical gradient of horizontal velocity and the absolute viscosity, μ , of the fluid: 12) P = μ» dv/dZ Substituting the right side of eq. 11 and differentiating gives: 13) P = JI»dA/3Z»EXP(jωt) The net horizontal force per unit volume equals density "p" times acceleration, i.e. "p" times the derivative of velocity. This force/volume also equals the derivative of shear stress of P with respect to Z, i.e., the degree to which shear forces acting on the top and bottom surfaces of a layer of fluid are imbalanced: 14) p»v/θt = d/dZ = J-f8A/dZ 2 «EXP(j-.t) Substituting the right side of eq. 11 differentiated with respect to time, into the left side of eq. 14 yields: 15) jωp » A»EXP(jωt) » μ»8 2 A/3Z 2 »EXP(jωt) Dividing through the multipliers of d z h/dZ~ and swapping sides yields: The converging solution is readily seen to be the produce of wall velocity A(O) times a decaying complex exponential: 17) A(Z) = A(0)»EXP(-Z/SQRT(μ/jωp)) The square root expression is divided into equal real and imaginary parts: 18) SQRT(/J/jωp) = SQRT(μ/2ωp) - j *SQRT(μ/2ωp) A characteristic boundary layer depth can be defined as the real part of the square root expression in eq. 18: 19) Z 0 = SQRT (μ/2ωp) The flow field just described, decaying in amplitude and shifting in phase from a maximum velocity amplitude at a tangentially vibrating surface is toward zero amplitude at a large multiple of Z 0 above the surface, is now transformed into a uniformly vibrating flow field except in the vicinity of a surface, where the motion goes to zero. In this frame of reference, an oscillating horizontal pressure gradient must exist to maintain the flow oscillation, and this gradient is overcome progressively by a shear stress gradient on approach to the static surface. If the velocity field of the boundary layer is integrated from the surface upward to "infinity" or, in practice, a small multiple of Z 0 , it can be shown that two perturbations affect the net flow. The "real" perturbation is that the net flow in phase with the prevailing flow outside the boundary layer is reduced as if he flow area had been reduced by the thickness Z 0 . Hence, we may consider Z. to be a displacement thickness. The "imaginary" perturbation is a flow component 90° out of phase with the non-boundary flow field, moving in phase with the pressure gradient, as would occur if flow were limited by viscosity rather than inertia. For flow in a cylindrical orifice whose radius "R" is much greater than Z 0 , the effective flow cross-section is reduced as if "R" were reduced by the amount Z 0 . Simultaneously, a dissipative component of flow arises whose magnitude is the • same as the "real" phase flow reduction magnitude. From these relationships, we obtain an expression for the orifice-fi, Q 0 , in terms of radius R and thickness Z 0 : 20) Q 0 = (R-Z 0 ) 2 /(2.R*Z 0 ) This description is, of course, valid only if Z 0 is a small fraction of R, i.e., for high Q 0 . If Z 0 becomes too thick to satisfy this constraint, then one must solve the boundary layer equation in cylindrical coordinates. The solution for Z 0 » R approaches the description of steady laminar flow in a short pipe, with a velocity distribution changing in phase with the driving pressure gradient and Q 0 approaching zero. The ratio of absolute viscosity, μ , to density, p, designated pv =J_/p, is given in the vicinity of room temperature by the expression: 21) v = μ/p = (.1511 cmysec) (T/293.16) 1 1 .-8 a 6 t '3V. (P/latm) for T = °K = °C + 273.16, and P expressed in the same units as the value of 1 atmosphere in the denominator under P, e.g., (P/latm) = (mm.Hg/760) . Using this expression and eq. 19, we get v = .1511 cm 2 /sec at 20°C and Z 0 = .00347 cm. at 1 KHz and for orifice R = .15 cm. This leads to Q 0 = 20.6. In an acoustically vibrating cavity, the microfluctuations of acoustic pressure are accompanied by proportionate microfluctuations in temperature, due to the adiabatic nature of the compression and decompression. At the wall of the cavity, however, conditions are virtually isothermal, because solids have much greater thermal conductivity and thermal capacity than air. Very close to a wall, a thermal boundary layer occurs, representing a transition from adiabatic to isothermal compression and expansion. Significantly, the equations governing the thermal boundary layer have exactly the same form as the equations governing a vibrations flow boundary layer. The end equation of the analysis, analogous to flow eq. 16, for temperature variation T v , is: 22) a 2 T v /3z 2 = (jωC/K)»T v Here C is heat capacity per unit volume and K is thermal conductivity. From this expression one obtains a characteristic thermal boundary layer thickness, Z t , in an equation analogous to eq. 19: 23 ) Z t = SQRT (K/2ωCp) The ration K/Cp, called thermal diffusivity, bears a profound relationship to kinematic viscosity, v -μ/p . The square root of either quantity, with units of (e.g., cm/vsec) represents a diffusion distance that varies as the square root of time. Thermal diffusivity represents a diffusion of thermal energy, while kinematic viscosity represents a diffusion of kinetic energy, coupling adjacent layers of shearing air together. The ratio of the two quantities is not far from unity and changes little with temperature and negligibly with pressure: 24) K/Cp = (1.3955+.0005(T-20°C)) • μ/p The square root of this ratio relates thermal boundary layer thickness to flow boundary layer thickness, as expressed closely by a linear temperature fit: 25) Z t = (1.1813+0002(T-20°C)) • Zo The effect of the thermal boundary layer is to increases the compressibility of air over an effective thickness from 1/γP to 1/P. The fractional increment in compressibility is therefore (1/P - l/γP)/(l/γP) = γ-1. Hence, the volume displacement thickness of a thermal boundary layer is not Z 0 but Z t corrected for the fractional increase in volume. Designating this thermal displacement thickness as Z td , we have: 26) Z td = (γ-l)»Z t = (.4758+.00008(T-20°C)) • Z Q The volume of a resonant cavity is effectively increased by the wall area multiplied by the displacement thickness Z td . Accompanying this increase in acoustic compliance is an equal increment of compliance with a dissipative phase angle, representing the energy loss associated with heat flow across thermal resistance. Given these relationships, we can express an effective volume correction ratio and a chamber Q-factor, Q c , in terms of Area/Vol and Z td : 27) ΔVol/Vol = Z td «Area/Vol 28) Q c = (1+ΔVol/Vol)/(ΔVol/Vol) For a cube, Area/Vol = 61 2 /1 3 for a side of length 1 = Vol 1/3 . At a volume of 2 cm 3 and a frequency of 1 KHz, we obtain Z 0 = .00347 cm (from above), Z td = .00165 cm, Δ Vol/Vol = .00786, and Q c = 128. For comparison, we recall an orifice Q 0 = 20.6, giving Q c /Q 0 = 6.2. A practical front chamber is likely to have a higher surface/volume ratio than a cube, giving a smaller Q c . Furthermore, the surface area is likely to change little when a fluid-backed diaphragm pushes into the chamber reducing volume, so that Q c will decrease with decreasing volume. The Q of the larger back chamber will normally be higher than for the smaller front chamber. The overall chamber dissipation factor, 1/Q C , is a weighted average of the front and back chamber dissipation factors, l/Q cf and 1/Q cb , with the emphasis going to the smaller chamber, since energy of compression is higher there. The weighting should be: 29) 1/Q C = ((l/Q cf )/Vol f + (l/Q cb )/(Vol b ))/(l/Vol f + l/Vol b ) The dissipation factor for the entire resonant circuit is the sum of the dissipation factors of the inertia and spring components: 30) 1/Q = 1/Q C + 1/Q 0 The flow boundary layer reduces the effective orifice size, increasing the "inductive" or inertial impedance of the flow schematic, thus lowering resonant Ω, while the thermal boundary layer increases the effective chamber volume, lowering the "capacitative" or spring impedance, again lowering Ω. The fractional change in Ω 2 , which is used to determine Vol from eq. 8 is directly proportional to 1/Q at high Q, regardless of the relative chamber and orifice contributions to energy dissipation. This relationship might fail if Q is abnormally low due to a sharp flow obstruction or orifice edge, whose flow resistance might fail to obey the boundary layer equations described above. Similarly, dissipation in the speaker or microphone, or a leak from chamber to chamber to ambient, could lower the Q in a way that violates the stated relationship. For a clean leak-free acoustic resonator design with transducers that do not interfere significantly with resonant Q, however, the following resonant correction formula applies: - ~) Ω 2 ideat = fleas' d + VQ) In general, Q will be a relatively complicated function of frequency and the changing geometry of the front chamber. Eq. 31 implies a calibration correction function of frequency that can be based on the empirically measured Q of a resonant acoustic circuit. To determine the function Q(Ω) for computing front volumes, recall that the derivative of radian phase angle Φ with angular frequency ω in the vicinity of resonant frequency Ω is probably the best empirical measure of Q: 32) Q(Ω) = (Ω/2)«dΦ/dω for ω varying near resonant Ω. This function can be calibrated for a typical volume measurement unit, or it can be determined directly for the system, during operation in the field, if provision is made electronically for causing a phase angle perturbation in the oscillator loop and observing the resulting frequency perturbation. An advantage to providing for actual Q determination during normal operation in the field is that any acoustic or electronic malfunction is likely to cause Q to depart from, a normal range for the system. The orifice Q 0 needs to be known, separate from the overall Q of the acoustic circuit, in order to determine where the acoustic LC resonance lies in relation to the 90° phase resonance. Eqs. 19, 20, and 21 taken together give the orifice Q 0 as a function of geometry and frequency. The designer should reconcile the theory described above with actual circuit performance If the system is working properly, there should be a good correlation between theory and measurement, in which case an accurate calibration of front chamber volume from system frequency can be obtained using the equations described, plus a careful empirical calibration of the effective length for the given geometry. The representation given above, with boundary layer equations to determine component values around a specified frequency, is fair accurate from a few hundred hertz up to the vicinity of the piezo speaker resonance, around 3-4 KHz. At very low frequencies, where the computed Q factors for the circuit components fall below about 2, the boundary layer equations become invalid, being based on unlimited space above flat surfaces and not on confined space surrounded by enclosing surfaces. Going down in frequency, the orifice flow comes to resemble laminar flow in a short pipe, as mentioned above, with the impedance model coming to resemble a fixed resistance in series with a fixed inductance. At still lower frequencies, the thermal boundary layers reach to the centers of the chambers and compliance approaches a fixed isothermal compliance, or total capacitance of C = Vol/P, as opposed to the high- frequency adiabatic value of C = Vol/γP. A good low- frequency limit circuit representation of a chamber would be obtained by adding, in parallel with the capacitor at C = Vol/γP, a parallel R-series-C with the C = (Vol/P)• (1-1/γ) . The R of this R-series-C should be chosen so that the 3db frequency 1/RC equals the frequency S> at which the thermal boundary layer thickness Z t = Vol/Area of the chamber, using eqs. 25, 21, and 19. In the geometry being discussed by example, the thermal time constant RC is about .6 seconds for the front chamber, about 1.6 seconds for the hack chamber, and about .025 seconds across the orifice radius, setting Z t = radius/2, which equals Vol/area for a long cylinder. Thermal equilibration in the orifice is critical for accurate volume measurement. If a transient change in pumping pressure is a significant fraction of an atmosphere, the accompanying fractional change in absolute temperature will be of the same order of magnitude. Specifically, 33) T/T = (P/P ( 1)/Y for absolute temperature T relative to initial T 0 and total pressure P relative to initial P 0 . As mentioned above, it is the ratio Vol/T that determines resonant frequency, but the temperature T that counts is T in the orifice, which determines the air density in the orifice and therefore the effective moving mass. Although the .025 second equilibrium time constant for air in the orifice is fairly fast, the situation is changed if a chamber is not at thermal equilibrium and air is flowing from that chamber into the orifice, dynamically keeping the average air temperature in the orifice away from equilibrium. Air will flow as the front chamber moves toward thermal equilibrium and changes volume, and air will flow as a result of fluid flowing into or out of the front chamber. Where pumping is taking place faster than one stroke every three or four seconds, there will be a systematic tendency to overestimate net pumped volume. At slightly lower pumping rates, volume estimates might be off when volume is dynamically changing, but readings should settle rapidly to true values when fluid flow stops and the standing air in the orifice equilibrates with the orifice walls. By way of example, one can use measured frequency and temperature to compute volume. First, for thermodynamic properties of air. Assume that regardless of operating temperature in the chambers the moisture content of the air in the orifice is the same as room-temperature air, 72 β F, at 70% relative humidity. Then T c = (72-32)/1.8 = 22.22°C, which, adding 273.16°K at 0°C yields T = 295.38"K. 70% relative humidity as a fraction is .7, so setting RH = .7 and plugging into eq. 10 yields ATM^ Q = .0185, rounding to three figures. This figure is a reasonable estimate wherever air in the apparatus originates from a climate-controlled indoor environment. Even if the temperature chambers is significantly different due to local sources of heat or cold, the fraction .0185 is likely to be a good estimate of fractional water content of air. With this figure and the figures given following Eq. 7 for molecular weight, a weighted-average molecular weight of dry air and water vapor is obtained. M = (28.966) (1-.0185) + (18.015) (.0185) = 28.763 This figure differs from dry air by only .7%. Similarly computing heat capacity at constant volume, C v , as a weighted average of the dry air and water figures following Eq. 9, we obtain: C v =(20.6317 * 10 7 ) (l-.0185)+(25.4830*10 7 ) (.0185) =20.7214*10 7 This figure differs from dry air by only .4%. Using the figure for the gas constant R given following Eq. 7, we use Eq. 9 to solve for the ratio γ: γ = 1 + 8.31437*10 7 /20.7214*10 7 = 1.40125 All these figures can be taken as fixed constants for volume calculations based on a climate-controlled room temperature air. Now temperature and frequency are used to determine front-chamber volume. For calibration we shall use the figures: Vol front = 2.00 cm 3 = front chamber volume v ° _ ack = 12 ' 00 CItl3 = back chamber volume R oπf i ce = • 15 cm = orifice radius l 0Pifice = . 6 cm = orifice length T = 298.16"K = assumed chamber temperature of 25°C = 77 β F The chamber temperature is not the same figure as was used to compute moisture content or air, but is a local, measured chamber temperature. From these orifice area may be computed: A = rR 2 = .070686 cm 2 and an effective length of actual length + diameter is used: l eff = 1 + 2R = .6 + 2(.15) = .9 cm Combining A and 1 gives an orifice dimension: A/l eff = .070686/.9 = .0784540 cm Reduced volume Vol is given by Eq. 6, which for the nominal figures given works out to: 1/Vθl = 1/2 + 1/12 = .58333 cm "3 Computing theoretical resonant frequency for an infinite-Q system at 25 β C = 298.16°K (= 77°F), Eq. 8: Ω 2 = γRT/M • A/l eff • 1/Vol = 1.40125 • 8.31437*10 7 • 298.16 • (1/28.763) • .078540 • .58333 = 55,3331,000 f = 1183.9 HZ In a calibration measurement, resonance was: f = 948 Hz § maximum volume = 2 cm 3 Ω = 2πf = 5956.46 s" 1 The computed frequency is high by 25%. Calibrating to actual measured frequency response at maximum volume, ignore the geometric computation of A/l eff and use, instead, a value for A/1 from Eq. 8: A/1 = Ω 2 /(γRT/M • 1/Vol) = .05036 cm Given a measured frequency and temperature for an unknown volume, solve Eq. 8 for 1/Vol: 1/Vol = Ω 2 /(γRT/M • A/1) Then, applying Eq. 6, solve for Vol front : Vθl front - 1/d/Vol - To obtain a more exact solution, compute a theoretical value for the orifice quality factor, Q 0 , using Eqs. 19, 20, and 21. First, from Eq. 21, at T = 298.16, kinematic viscosity may be determined: v = μ/p = (.1511) (298.16/293.16) 1 - 863 /(latm/latm) = .1537 cm 2 /sec Substituting into Eq. 19, boundary layer thickness is determined: Z 0 = SQRT(.1537/2ω) = .003592 cm From Eq. 20 we obtain orifice Q: Q 0 = ( . 15- . 003592) 2 / (2» . 15* . 003592 = 19. 89 At the true "LC" resonance, the phase measured in the acoustic circuit should be: ANGLE(H(Ω)) = ATAN(19.89) = 87.122°, or 2.878° off 90°. The phase-lock loop circuit tracks a circuit phase angle of 90°, which gives a frequency slight above resonance. The phase-dither adds a capacitance of 680pf in parallel with a resistor of 100KΩ, giving a -3db frequency of 2340 Hz. The frequency of the circuit is observed to drop by 10 Hz to 938 Hz. At this frequency, the phase angle across the RC is: DITHER = ATAN(938/2340) = 21.84° phase shift = .3812 radians phase shift Eq. 32 gives overall circuit Q as a function of radian phase shift dΦ per fractional change in frequency, dω/Ω, with a factor of 1/2. The frequency in Hz can be used instead of radian frequency, since the 2π factor divides out: Q = (948/2)• .3812/10 = 18.07 This measured value correlates well with theory. The theoretical front chamber Q from above was 128, which dominates the overall chamber Q by 5 parts out of 6. The back chamber has a larger volume but a more irregular shape, so its surface/volume ratio is probably comparable, implying about the same Q. Adding 1/Q dissipation factors, one obtains Theoretical Q = 1/(1/19.89 + 1/128) = 17.215 This is low by 4.7% compared to the dither value. Using Q 0 = 19.89 and Q = 18.07 for orifice and overall Q-factors, we determine first the frequency at 90° phase, and then the corrected resonance frequency, taking boundary layer effects into account. We can substitute frequency "f" in Hz for frequency "ω" in radians/second into Eq. 32, since the ratio cancels the factor of 2π . Hence, an expression for dΦ/dθ is written and solved: d /df = 2Q/f = 2(18.07)/948 = .03812 radians/Hz Recalling from above: ANGLE(H(Ω) ) = ATAN(19.89) = 87.122°, or 2.878° = .05023 radians off quadrature The deficit angle from quadrature of .05023 radians implies a frequency correction from observed phase-look frequency to true resonance: f reso _ ant = f p + -* 2 " ATAN(Q 0 ) )/dΦ/df) = 948 + (.05023/.03812) = 949.32 The phase error between tracked quadrature phase and the resonance LC phase goes as 1/Q 0 , and the frequency correction per unit of phase error goes as f/(2»Q), so that an asymptotic expression for the resonance correction at high Q is expressed simply: f resona_t = f p H x - 1 + V (2 « Q 0 » Q) = 948 ( 1+1/ ( 2. 18 . 07. 19 . 89 ) = 949 . 32 This approximation matches the more exact solution to 5 place accuracy. Now compute Ω = 2π*949.32 = 5964.75 partially corrected Ω 2 = 35,578,000 partially corrected and from Eq. 31, using the overall Q determined by phase dither to correct to an ideal frequency for volume computation, one obtains: Ω 2 = 35,578,000* (1 + 1/18.07) = 37,547,000 fully corrected From this point, the computation proceeds exactly as in the no-boundary-layer case, , but using the corrected radian- frequency-squared rather than the electronically measured radian-frequency-squared to compute Vol front . In the boundary layer corrected context, the effective orifice dimension A/1 can be computed from the corrected value of Ω 2 , and the frequency measured at unknown volume can be corrected in like manner. This result is based on the temperature T measured at the time the frequency was sampled, and it is based on a measurement of frequency dither from a frequency close to the current frequency. It is not necessary to perform the dither measurement every time that volume is computed. The overall Q of the system is likely to be a fairly consistent function of frequency, so that the dither Q can be expressed in a table, applicable to all units sharing the software, with actual dither Q only checked occasionally, as assurance of system integrity.

Claims: What is claimed is: 1. A system for controlling the flow of liquid through a line, the system comprising: a chamber disposed in the line; isolation means for isolating in the chamber a volume of liquid from the pressure effects of liquid in the rest of the line and for dispensing liquid from the chamber; resonance means for associating with the chamber a resonatable mass of known acoustic characteristics, associated with the chamber, so as to form an acoustic resonant system; and detection means for determining a frequency of self- resonance of the system, and, based on the frequency of self-resonance, the volume of liquid in the chamber. 2. A system according to claim 1, wherein the chamber has an inlet from the line and an outlet to the line, and wherein the isolation means includes a first valve means, located at the inlet, for selectively permitting and preventing flow into the chamber, and a second valve means, located at the outlet, for selectively permitting and preventing flow out of the chamber, and further including control means for controlling the first and second valve means, and the detection means. 3. A system according to claim 2, wherein the control means causes (i) the second valve means to prevent flow out of the chamber, (ii) the first valve means to permit flow into the chamber, while the second valve means prevents flow, (iii) the first valve means to prevent flow, after fluid has flowed into the chamber, (iv) the detection means to determine the volume of liquid in the chamber, while both the first and second valve means are closed, (v) the second valve means to permit flow from the chamber after the volume has been determined, and (vi) the detection means to determine the volume of liquid in the chamber after the second valve means has permitted fluid to flow from the chamber. 4. A system for controlling the flow of liquid through a line, the system comprising: a chamber disposed in the line; isolation means for isolating in the chamber a volume of liquid from the pressure effects of liquid in the rest of the line and for dispensing liquid from the chamber; a resonatable mass of known acoustic characteristics, associated with the chamber, so as to form an acoustic resonant system; signal means for generating an electrical signal having a spectrum of frequencies; acoustic means for converting the electrical signal into an acoustic response in the chamber; and detection-means for determining whether a frequency in the spectrum causes the resonatable mass to resonate, and calculating, based on a determined resonant frequency, the volume of liquid in the chamber. 5. A system according to claim 4, further including measurement means for measuring, at a frequency in the spectrum, the gain of the acoustic response relative to the electrical signal; and wherein the detection means determines whether a frequency is resonant, based on the gain of the acoustic response at the frequency. 6. A system according to claim 5, wherein the measurement means further includes means for measuring the phase angle of the acoustic response relative to the electrical signal, and wherein the detection means determines whether a frequency causes the resonatable mass to resonate, based on the phase angle and the gain of the acoustic response at that frequency. 7. A system according to claim 4, wherein the detection means further includes means for determining, based on a determined resonant frequency, the presence of a gas-bubble in the liquid. 8. A system according to claim 5, wherein the detection means further includes means for determining, based on a determined resonant frequency, the presence of a gas-bubble in the liquid. 9. A system according to claim 6, wherein the detection means further includes means for determining, based on a determined resonant frequency, the presence of a gas-bubble in the liquid. 10. A method, for measuring the flow rate of liquid through a line, comprising the steps of: isolating in a chamber a section of the line from the pressure effects of liquid in the rest of the line; associating with the chamber a resonatable mass of known acoustic characteristics so as to form an acoustic resonant system; generating an electrical signal having a spectrum of frequencies; converting the electrical signal into an acoustic response in the chamber; determining, based on the amplitude and phase change of the acoustic response in relation to the electrical signal, whether a frequency in the spectrum causes the resonatble mass to resonate; determining, based on a resonant frequency, the volume of liquid in the chamber; and dispensing liquid from the chamber. 11. A system for controlling the flow of fluid through a line, comprising: (a) first and second valves in the line; (b) a first chamber of variable volume disposed in fluid communication between the first and second valves; (c) a second chamber of variable volume having a common boundary with the first chamber in such a way that the combined volume of the first and second chambers is constant; (d) pressure means for varying the pressure of a gas in the second chamber; (e) volume determination means for determining the volume of fluid in the irst chamber independently of subsonic pressure in the first chamber; (f) control means, in communication with the volume determination means, the first and second valves, and the pressure means, for directing the operation of the first and second valves and of the pressure means to produce the desired flow through the line. 12. A system according to claim 11, wherein the volume determination means includes an acoustic volume measurement system. 13. A system according to claim 12, wherein the acoustic volume measurement system is of the acoustic-pressure type. 14. A system according to claim 12, wherein the acoustic volume measurement system is of an acoustic resonance system. 15. A system, for determining the volume of a chamber, comprising: means for associating with the chamber a resonatable mass of known acoustic characteristics so as to form an acoustic resonant system; and means for generating electrical signals, each having one of a variety of frequencies; means for converting each of the electrical signals into an acoustic response in the chamber; means for determining the phase change of the acoustic response with respect to each of the electrical signals; means for determining the amplitude of the acoustic response with respect to each of the electrical signals; means for storing in an array the phase change and amplitude for each frequency; means determining, based on the array, whether a frequency is a resonant frequency of the acoustic resonant system; and means for determining, based on a resonant frequency, the volume of the chamber.

Inventors: ARNOLD FINN, BRIGGS JOSEPH, KAMEN DEAN L, SEALE JOSEPH B, ARNOLD, FINN, BRIGGS, JOSEPH, KAMEN, DEAN, L., SEALE, JOSEPH, B.
Applicants: DEKA PRODUCTS LP, DEKA PRODUCTS LIMITED PARTNERSHIP
Application year: 1991
Main classification: G01F1
IPC codes: F04B43, G01F1, G01F3, G01F11, G01F17