Patent Description:
A method is disclosed according to the claimed invention in claim <NUM>. A microcontroller unit to carry on the method is disclosed according to claim <NUM>. A computer-readable storage device storing machine instruction to carry on the method is disclosed according to claim <NUM>.

For at least some ultrasonic transducers used in flowmeters, the sensitivity of the transducer varies with frequency. For example, the maximum transducer sensitivity may be at a particular frequency. Further, the sensitivity of the transducer can vary with temperature. That is, the frequency corresponding to the maximum sensitivity of the transducer may vary with temperature of the fluid whose flow rate the flowmeter is monitoring.

The described examples pertain to a circuit (e.g., an integrated circuit (IC)) for a flowmeter that performs a temperature-based calibration process. The flowmeter comprises multiple ultrasonic transducers. The temperature-based calibration process includes sweeping one of the transducers through a range of frequencies from a lower frequency to a higher frequency (i.e., providing a range of excitation frequencies to the transducer), monitoring the amplitude of the signal from another transducer in the flowmeter, and determining the frequency corresponding to maximum sensitivity within the frequency range. The flowmeter is then configured to use as an excitation frequency the frequency determined from the calibration process going forward in measuring the flowrate of the fluid. The temperature-based calibration process can be repeated over time thereby dynamically adjusting its excitation frequency responsive to changes in temperature. The temperature-based calibration process is thus performed dynamically, that is, while the flowmeter is being used to make flow rate measurements of fluid flow in a pipe.

<FIG> shows an example of a flowmeter <NUM>. The example flowmeter <NUM> includes one or more central processing unit (CPU) cores <NUM>, an ultrasonic transducer (UST) circuit <NUM>, storage <NUM>, and a display <NUM>. The term "CPU core" (singular) is used herein to refer to either a single CPU core or multiple CPU cores. In one implementation, the flowmeter <NUM> comprises a microcontroller unit (MCU) fabricated as an integrated circuit on a common semiconductor substrate. The flowmeter <NUM> also includes or couples to ultrasonic transducers <NUM> and <NUM>, which are shown coupled to a pipe <NUM> in which a fluid flows in the direction of arrow <NUM>. A pair of ultrasonic signal reflectors <NUM> and <NUM> are included in the pipe <NUM> in this example. The UST circuit <NUM> can provide an electrical signal to either of transducers <NUM> or <NUM> and monitor the resulting signal from the other transducer. For example, transducer <NUM> can convert an electrical signal from the UST circuit <NUM> into an ultrasonic signal injected into the fluid flow in pipe <NUM>. The ultrasonic signal reflects off reflector <NUM> and then reflector <NUM> as indicated by arrow <NUM> (in the downstream direction). The ultrasonic signal then is received by transducer <NUM> and converted back into an electrical signal and provided to UST circuit <NUM>. Alternatively, the UST circuit <NUM> can use transducer <NUM> as the transmitting transducer and transducer <NUM> as the receiving transducer thereby causing an ultrasonic signal to pass through the fluid in the direction of arrow <NUM> (in the upstream direction). In some implementations, the pipe <NUM> does include reflectors <NUM> and <NUM>.

The UST circuit <NUM> measures the time it takes for the ultrasonic signal to pass through the fluid flow from one transducer to another. With no fluid flow relative to the transducers <NUM>, <NUM>, the speed of an ultrasonic signal in the fluid is a function of the type of fluid in pipe <NUM>. Time is distance/velocity and thus, the time required for an ultrasonic signal to pass in the downstream direction (i.e., from transducer <NUM>, through the fluid, and to transducer <NUM>) is L/(c+v) where L is the combined distance from transducer <NUM> to reflector <NUM> to reflector <NUM> and to transducer <NUM> and is a known value, c is the speed of ultrasound with respect to the fluid being monitored, and v is the speed of the fluid flow in direction <NUM>. In the upstream direction (i.e., from transducer <NUM> to transducer <NUM>), the time required for an ultrasonic signal to pass from transducer <NUM> to transducer <NUM> is L/(c-v). The difference in the time values is ΔT and the velocity of the fluid is: <MAT> where T1 is the measured time from transducer <NUM> to transducer <NUM>, and T2 is the measured time from transducer <NUM> to transducer <NUM>. Thus, by measuring T1 and T2 using the UST circuit <NUM>, the velocity of the fluid flow can be calculated. The cross sectional area of pipe <NUM> also is known and the volume of the interior of the pipe between transducers <NUM> and <NUM> can be calculated and known apriori. Assuming the pipe is full of fluid, the fluid flow rate can be determined based on the calculated velocity.

The storage <NUM> comprises volatile or non-volatile memory (non-transitory computer-readable storage device) and includes firmware (machine instructions) <NUM>. The firmware <NUM> is executable by one or more of the CPU cores <NUM>. Upon execution of the firmware <NUM>, the CPU core <NUM> interact with the UST circuit <NUM> to (a) determine the flowrate of fluid in pipe <NUM> and (b) to perform a temperature calibration process to determine the excitation frequency to use to measure flowrate given the current temperature of the fluid in pipe <NUM>. In some implementations, the temperature calibration process is performed periodically (e.g., every <NUM> minutes, every <NUM> minutes, etc.) and in between flowrate determinations (so as not to interfere with assessing flowrate). The display <NUM> can be used by the CPU core <NUM> to display flowrate, status, etc..

<FIG> illustrates two example frequency responsive curves <NUM> and <NUM> for an ultrasonic transducer. Each curve <NUM>, <NUM> represents the amplitude of an electrical signal generated by a transducer in response to receipt of an ultrasonic signal across a range of frequencies. The amplitude of the ultrasonic signal received by the transducer is the same at each frequency. The transducers generate an electrical output signal based on the received ultrasonic signal. Each curve <NUM>, <NUM> illustrates that the amplitude of the electrical output signal from the transducers varies with frequency. The amplitude response is maximum at frequency Fm1 for curve <NUM> and at frequency Fm2 for curve <NUM>, Frequency response curve <NUM> represents the frequency response of the ultrasonic transducer for one temperature at which the transducer operates and frequency response <NUM> represents the frequency response of the same transducer at a different temperature. As can be seen, the peak amplitude (maximum sensitivity) is a function of temperature. The temperature calibration process described herein determines the peak amplitude for a given fluid temperature and uses the corresponding frequency to make flowrate determinations.

Referring back to <FIG>, the UST circuit <NUM> includes a register set <NUM> which comprises one or more registers. At least some of the registers are configurable and/or readable by the CPU core <NUM>. In one implementation, the CPU core <NUM> programs the register set <NUM> with one or more values indicative of the frequency that the UST circuit <NUM> is to generate for one of the transducers <NUM>, <NUM>. During the temperature calibration process, the CPU core <NUM> sequences through a range of frequencies from a first frequency to a second frequency. The first frequency may be lower than the second frequency, or vice versa. That is, the frequency sweep may be from a lower frequency to a higher frequency or from a higher frequency down to a lower frequency. The range of frequencies should be wide enough to include the excitation frequency that will correspond to the maximum transducer sensitivity given the present temperature of the fluid in pipe <NUM>. In one example, the first frequency is <NUM> and the second frequency is <NUM>.

For each frequency, CPU core <NUM> configures a value into register set <NUM>. The UST circuit <NUM> uses that value to generate an electrical signal having a frequency corresponding to the value programed by the CPU core <NUM>. In one example, the UST circuit generates the electrical signal as a specified number of pulses of a pulse train and at a specific frequency. The CPU core <NUM> programs values into the register set <NUM> that encode the frequency and the number of pulses (e.g., <NUM> pulses) for the UST circuit <NUM> to generate.

The UST circuit <NUM> then generates the desired electrical signal to one of the transducers <NUM>, <NUM>-it does not matter which transducer is used as the excitation transducer-to thereby generate the ultrasonic signal. The UST circuit <NUM> receives the signal from the other transducer and determines a value proportional to that signal's amplitude. UST circuit <NUM> then stores the determined amplitude in, for example, storage <NUM>. The CPU core <NUM> then programs different values into register set <NUM> to cause the UST circuit <NUM> to generate an excitation electrical signal at a different frequency. The resulting transducer amplitude is stored in storage <NUM> along with values indicative of its excitation frequency. The process repeats until the second frequency is reached. The separation between adjacent frequency steps is application-specific. In one example, frequencies from <NUM> to <NUM> in <NUM> steps are used during the calibration process.

<FIG> shows an example of the amplitudes <NUM> determined for the excitation frequencies between a first frequency, F1, and a second frequency, F2, for the temperature of the fluid in pipe <NUM> when the calibration process is performed. Frequency Fm generally designates the frequency corresponding to the maximum amplitude <NUM>. F1 should be set to be lower than the lowest predicted value for the frequency at the maximum amplitude and F2 should be set to be greater than the highest predicted value for the frequency at the maximum amplitude so that the frequency sweep will be sure to include the frequency at the maximum amplitude for any fluid temperature that may be present in pipe <NUM>.

The CPU core <NUM> in <FIG> reads the amplitude values back from storage <NUM> (either after all amplitude values have been acquired and stored or after each amplitude value is stored) and determines the excitation frequency that corresponds to the peak amplitude (i.e., maximum sensitivity). In one implementation, CPU core <NUM> determines the maximum amplitude value from among the amplitude values stored in storage <NUM> and then selects the frequency associated with that value as the excitation frequency to use in determining flowrates going forward.

In other implementation, CPU core <NUM> identifies the maximum amplitude from among the amplitudes <NUM> determined during the frequency sweep. CPU core <NUM> converts each amplitude to a decibel (dB), for example <NUM> * log(amplitude) and subtracts X dB from the largest dB value. In one example X dB is <NUM> dB. CPU core <NUM> then determines the two frequencies corresponding to the dB values that are X less than the largest dB value. <FIG> illustrates these frequencies as F_lower and F_upper. CPU core <NUM> determines the excitation frequency to use for flowrate measurements based on F_lower and F_upper. For example, CPU core <NUM> can average together F_lower and F_upper. In another example, CPU core <NUM> computes the median of F_lower and F_upper as the excitation frequency.

As noted above, the UST circuit <NUM> generates the electrical signal to be provided to a transducer <NUM>, <NUM> as a number of pulses of a pulse train at a specific frequency. <FIG> shows an example of a pulse train <NUM>. Pulse train <NUM> include N pulses <NUM>, where N is one or more. In one example, N is <NUM>. Each cycle of the pulse train is characterized by time values TU and TL, where TU is the time during which the pulse is at a higher voltage level and TL is the time during which the pulse is at a lower voltage value. The period of each cycle is TU + TL and is the inverse of the frequency. As such, a desired frequency dictates the sum of TU and TL. TU and TL can be equal, but need not be equal. If TU and TL are equal, the resulting pulse train has a <NUM>% duty cycle, but the duty cycle can be greater than <NUM>% if TU is greater than TL or smaller than <NUM>% if TU is less than TL. In one example, the CPU core <NUM> programs UST circuit <NUM> with three values to defining the target pulse train. The three values include TU, TL and the number of pulses <NUM> of the pulse train.

<FIG> shows an example implementation of the UST <NUM> coupled to the CPU core <NUM>, storage <NUM> and ultrasonic transducers <NUM> and <NUM>. The UST circuit <NUM> in the example of <FIG> includes a programmable pulse generator (PPG) <NUM>, a driver <NUM>, multiplexers <NUM> and <NUM>, a programmable gain amplifier (PGA) <NUM>, an analog-to-digital converter (ADC) <NUM>, an oscillator (OSC) <NUM>, and a phase-locked loop (PLL) <NUM>. The CPU core <NUM> programs the values defining the desired pulse train into register set <NUM>, which is included in, or is accessible to, the PPG <NUM>. An oscillator <NUM> generates a clock <NUM> based on a signal received from an external resonator <NUM>. The external resonator may comprise a crystal resonator or a ceramic resonator. The clock <NUM> from oscillator <NUM> is provided as a reference clock to PLL <NUM> which, in turn, generates a clock <NUM> to the PPG <NUM>. In some examples, the clock <NUM> generated by the PLL <NUM> is phase-locked to clock <NUM>, but has a higher frequency than clock <NUM>. For example, the frequency of clock <NUM> may be <NUM> and the frequency of clock <NUM> may be in the range of <NUM> to <NUM>.

The PPG <NUM> generates a pulse train using clock <NUM>. The number of pulses of the pulse train and the frequency of the pulse train are dictated by the values written to register set <NUM> by the CPU core <NUM> (e.g., TU, TL, and the number of pulses). The resulting pulse train is provided to driver <NUM> which conditions the pulse train for driving one of the transducers <NUM>, <NUM>. The condition implemented by the driver <NUM> may include voltage level shifting, amplification, etc..

For the temperature calibration process described herein, one of the transducers is used to generate the ultrasonic signal with the other transducer functioning as the ultrasonic signal receiving transducer. Multiplexer <NUM> is configured by control signal CTL1 to select one of the transducers <NUM>, <NUM> to receive the pulse train from driver <NUM>. The PPG <NUM> in this example generates CTL1. The PPG <NUM> also asserts control signal CTL2 to configure multiplexer <NUM> to provide the electrical signal generated by the receiving transducer to the PGA <NUM>. To perform the temperature calibration process, for example, PPG <NUM> asserts CTL1 to electrically couple driver <NUM> to transducer <NUM> to thereby generate the ultrasonic signal <NUM>, and asserts CTL2 to electrically couple transducer <NUM> to PGA <NUM>.

The signal from the sensing transducer is provided through multiplexer <NUM> to PGA <NUM> where the signal is amplified. The amplified analog signal is then provided to ADC <NUM> which converts the amplified analog signal to a digital representation. In one implementation, ADC <NUM> includes a sigma-delta modulator (e.g., third order sigma-delta modulator). The resulting digital value is indicative of the amplitude of the signal received by the ultrasonic transducer and is stored in, for example, in storage <NUM>. The CPU core <NUM> can then read the digital value from storage <NUM>. Multiple excitation frequencies are used as described above and the resulting digital values are stored in storage <NUM>. The CPU core <NUM> determines the excitation frequency to use based on the resulting digital values.

To determine flowrate using the excitation frequency produced by a previous execution of the temperate calibration process, the CPU core <NUM> configures the PPG <NUM> to generate a pulse train to be provided first to one transducer with the other transducer's signal to be provided to PGA <NUM>. The CPU core <NUM> can write a value to register set <NUM> to specify which transducer to use to generate the ultrasonic signal and which to use as the ultrasonic signal receiving transducer (e.g., transducer <NUM> used to generate the ultrasonic signal and the electrical signal from transducer <NUM> to be provided to PGA <NUM>). The resulting digital value from ADC <NUM> is stored in storage <NUM>. The CPU <NUM> can then write values to the register set <NUM> to reverse the roles of transducers <NUM> and <NUM> (e.g., transducer <NUM> used to generate the ultrasonic signal and the electrical signal from transducer <NUM> to be provided to PGA <NUM>). A timer derived from the PLL output can be used to drive a sequencer which controls the start time of the PPG <NUM> and the start of ADC sampling. The difference between these two events represents a static offset for both the upstream and downstream time-of-flight. Using the signal digitized by the ADC <NUM>, any of multiple different methods can be used to compute TOF. In one example, the envelope of the signal is calculated and the time when the envelope crosses a predefined threshold is determined. The threshold can be calculated based on the maximum amplitude of the signal. The amplitude of the signal crossing the threshold is used to determine the presence of the signal.

<FIG> shows a method describing an example of the temperature calibration process. The temperature calibration process is controlled by the CPU <NUM> executing firmware <NUM> and interacting with the USC circuit <NUM>. The temperature calibration process comprises operations <NUM>-<NUM> as indicated by reference number <NUM>. Operation <NUM> comprises making a flow measurement using a current value of an excitation frequency. The current excitation frequency may have been determined in accordance with a prior performance of the temperature calibration process. Use of the UST circuit <NUM> to determine flow velocity (and thus flow rate) is explained above.

At <NUM>, the temperature calibration process includes selecting an initial frequency, as part of the frequency sweep. In some implementations, the initial frequency has a value that is lower than the lowest frequency expected for the maximum transducer amplitude. In other implementations, the initial frequency has a value that is higher than the highest frequency expected for the maximum transducer amplitude. The initial frequency is selected or otherwise programmed into the CPU core <NUM> via firmware <NUM>.

At <NUM>, the temperature calibration process includes generating an electrical signal at the selected frequency for one of the ultrasonic transducers <NUM>, <NUM>. In some cases, this operation includes the CPU core <NUM> determining the values of T1 and T2 for the selected frequency and the number of pulses and writing corresponding values to register set <NUM> in the UST circuit <NUM>. The PPG <NUM> then generates the programmable pulse train, which is provided through multiplexer <NUM> (controlled by CTL1 from PPG <NUM>) to one of the transducers (e.g., transducer <NUM>).

At <NUM>, the amplitude of the electrical signal generated by the other transducer (e.g., transducer <NUM>) is measured. This operation may be performed by amplifying the detected signal by PGA <NUM> and converting the amplified signal to a digital representation by ADC <NUM>. The resulting digital value is then stored in storage <NUM> (<NUM>).

The temperature calibration process implements a frequency sweep and thus, at <NUM>, the CPU <NUM> determines whether another frequency remains to be used for the frequency sweep. In one example, the frequency sweep includes frequencies in <NUM> increments between <NUM> and <NUM>. The frequencies are used in ascending or descending order in some examples, but can be used in an order other than ascending or descending in other examples. If another frequency remains to be used, then the next frequency in the sweep is selected at <NUM> and the process repeats at operation <NUM>. Once all of the frequencies within the range of the frequency sweep are used to generate amplitude values, then at <NUM> the temperature calibration process determines the new frequency to use for future flowrate measurements based on the digital value representations of the amplitudes. Examples of how to determine the excitation frequency to use are provided above. The newly determined excitation frequency is then used at <NUM> the next time the CPU <NUM> uses the UST circuit <NUM> to determine flow velocity (rate).

In some cases, the temperature calibration process <NUM> is performed between every pair of consecutive flowrate measurements. In other cases, the temperature calibration process <NUM> is performed between pairs of consecutive flowrate measurements, but not necessarily between every pair of consecutive flowrate measurements. For example, flowrate measurements may be performed at one-minute intervals, but the temperature calibration process is performed at <NUM>-minute or <NUM>-minute (or other) intervals. In some cases, the temperature calibration process is performed at an interval that is at least a <NUM> minute interval.

In this description, the term "couple" or "couples" means either an indirect or direct wired or wireless connection. Thus, if a first device couples to a second device, that connection may be through a direct connection or through an indirect connection via other devices and connections. The recitation "based on" means "based at least in part on. " Therefore, if X is based on Y, X may be a function of Y and any number of other factors.

Claim 1:
A method, comprising:
using a first ultrasonic transducer and a second ultrasonic transducer to measure fluid flow using a present excitation frequency;
performing a temperature calibration process that includes:
sequentially generating a plurality of electrical signals for the first ultrasonic transducer, each generated electrical signals having a different respective frequency;
for each respective frequency, measuring an amplitude of a signal from the second ultrasonic transducer;
based on the measured amplitudes of the signals from the second ultrasonic transducer, determining a new excitation frequency; and
using the first and second ultrasonic transducers to measure fluid flow using the new excitation frequency; and
wherein determining the new excitation frequency comprises:
determining a first frequency corresponding to a peak amplitude from among the measured amplitudes;
determining a second frequency based on the peak amplitude, the second frequency being smaller than the first frequency,
determining a third frequency based on the peak amplitude, the third frequency larger than the first frequency; and
determining the new excitation frequency based on the second and third frequencies; and
generating each of the plurality of electrical signals through configuration of one or more registers to include:
a first value indicative of a number of pulses to generate of the electrical signal;
a second value indicative of a first time period during for which each pulse is to be at a first voltage level; and
a third value indicative of a second time period during for which each pulse is to be at a second voltage level.