An improved measurement algorithm for increasing the accuracy of sing-around type ultrasonic flow meters

J.R. Gatabi*, I.R. Gatabi**, M. Soltani***, P. Mohammadi****, M. Dabbaghian Amiri*****, S. Ebrahimi****** *Electrical Engineering Department, Iran Univ. of Science and Tech. Tehran, Iran, E-mail: javad_rezanejad_gatabi@yahoo.com **Electrical Engineering Department, K. N. ToosiUniv. of Tech., Tehran, Iran, E-mail: irezanejad@yahoo.com ***Electrical Engineering Department, Iran Univ. of Science and Tech., Tehran, Iran, E-mail: mohammad_sds@yahoo.com ****Electrical Engineering Department, Iran Univ. of Science and Tech., Tehran, Iran, E-mail: pooria_moh@yahoo.com *****Industrial Engineering Department, Mazandaran University of Science and Technology, Babol, Iran, E-mail: maedeh_dabaghian@yahoo.com ******Electrical Engineering Department, Iran Univ. of Science and Tech., Tehran, Iran, E-mail: hebrahimi1985@gmail.com


Introduction
Nowadays measuring fluid flows accurately is an open research field.From simple steam materials flows to two-phase flows with solids [1][2][3][4], the search is ongoing for improving the accuracy and cost of flow meters [5][6][7][8][9][10].With today's environmental regulations requiring both more accurate flow measurements and high-energy costs making fuel consumption a primary problem, traditional measurement methods are not adequate yet [11].The rapid transmutation of ultrasonic technology is offering prospects for improved flow measurement systems.With its simple principle operation, and relative easy design, ultrasonic flow meters have become popular recently [12][13][14][15].This trend is likely to continue.Implementation of complex ultrasonic sensor became possible considering the current advances in computing capabilities [16].This paper presents an improved measurement algorithm for increasing the accuracy of the sing-around type ultrasonic flow measurement.The purpose of this work is to provide a new method to measure the frequency difference of the flowsensitive oscillators which are implemented in this type of flow meter.

Sing-around flow meter
For the following discussion, we need a brief review of the sing-around method from references [17][18][19].We will assume a configuration as shown in Fig. 1.  1) and upstream τ 2 in Eq. ( 2) A sing-around loop works as follow: the transceiver sends ultrasonic pulse along the flow and when receiver detects the signal, it sends the same pulse in the same direction, instantly.The frequency of repetition of pulses has been named as F 1 , at the same time when the pulses are sent by the other transceiver pair against the flow direction, their repetition frequency has been named as F 2 .We know when there is no flow F 1 = F 2 , and with increase of the flow, F 1 become greater than F 2 .Difference of the frequencies is proportional to the velocity flow [15] v cos From Eq. (3) we know that velocity of the flow does not depend on the ultrasound speed in the fluid and directly depends on F [15] FL v cos To determine the fluid velocity we need to know the distance L (i.e.D / sin α where D is the diameter of the pipe), the angle α and the downstream and upstream singaround periods, τ 1 and τ 2 , respectively.The most important problem of the sing-around systems is that they require very high resolution on the sing-around period measurement [18].Such an example: measurement of a fluid velocity of 0.05 m/sec with accuracy of 1% needs sing-around period measurement resolution on the order of 1:10 7 .For a sing-around period of 64 μs this implies an absolute time resolution of about 80 ps [18].
This high resolution obtains from a multiple period average measurement over the number of N sing-around loops.The multiple period average measurement system measures the total time for N periods [18].Considering the clock frequency and the sing-around frequency are uncorrelated, the multiple periods averaging method will increase the measurement resolution as [18] Time measurement resolution = t ref / N, when t ref is the resolution of the reference clock.
Unfortunately, the sing-around system needs a stable flow without any kind of nonstationeries like pulsation.The problem of fast changes of fluid temperature during the long sing-around measurement cycle has been solved [19].

Principle of operation
The proposed method is based on a new technique to measure the frequency difference of the flow-sensitive oscillators the upstream and downstream oscillators synchronously generate signals for each sampling cycle.Fig. 2 illustrates the output waveforms of these oscillators (F 1 &F 2 ) in a sampling duration of k seconds.If the number of rising edges of F 1 and F 2 during this cycle be N 1 and N 2 , and the final rising edges of F 1 and F 2 occur T 1 and T 2 seconds before t = k respectively, the frequency difference ΔF can be written as 12 12 12 Therefore measuring N 1 , N 2 , T 1 and T 2 allows ΔF to be calculated and finally the fluid velocity is evaluated via Eq.( 4).Fig. 3 shows the block diagram of the designed embedded system used for this purpose.
At the beginning of each sampling cycle, the processor activates its "Start" output.As a result, the upstream and downstream oscillators synchronously start generating signals and the Reference Clock is applied to Counter2 and Counter4.Counter1 and Counter3 are incremented, then Counter2 and Counter4 are reset at each rising edge of F 1 and F 2 , respectively.After k seconds, processor inactivates the "Start" signal.Therefore the upstream and downstream oscillators stop generating signals and the gate will be closed, preventing the Reference Clock to be applied to Counter2 and Counter4.
where ref t is the period of oscillation of the reference clock.
Finally the frequency difference ΔF is calculated through Eq. ( 5) which allows the fluid velocity to be evaluated from Eq. ( 4).

Comparing the accuracy of the proposed method with existing methods
In the existing method, in order to measure the frequency difference ΔF, the total time of N sing-around loops of F 1 and F 2 (say t 1 and t 2 respectively) are measured as 12 12 If dt is the resolution of the Reference Clock, the resolution of t 1 and t 2 would be dt 1 and dt 2 where 12 dt dt dt .Then the resolution of ΔF is achieved by differentiating Eq. ( 7) with respect to t     Since N t  , the previous equa- tion can be written as This equation represents the relationship between the minimum measurable time by the Reference Clock, dt, and the minimum measurable frequency difference, d(ΔF).
On the other hand, in the proposed method, dt = dT 1 = dT 2 , where dT 1 , dT 2 and dt are the resolutions of T 1 , T 2 and the Reference Clock, respectively.The function ΔF represented by Eq. ( 5) is differentiable except at the points where N 1 and N 2 have suddenly changed.The resolution of ΔF is achieved by differentiating Eq. ( 5) with respect to t  9) and ( 11), it can be found that how more accurate is the proposed method than the existing method.
Accuracy improvement factor (AIF) can be expressed by the following equation The function AIF was sketched versus the sam- pling duration k for several amounts of F 1 and F 2 .Figs. 4-6 illustrate AIF versus k for F 1 = 12000 Hz and F 2 = 11994 Hz.
From the numerical analysis of AIF as a function of F 1 , F 2 and the sampling duration k, the following results are inferred: 1. AIF may have some peaks as illustrated in Fig. 4. The amount of the sampling duration at which AIF takes its maximum value, is depended on F 1 and F 2 .(i.e. it is depended on the fluid velocity.)Thus, there is not a fixed sampling duration for which AIF is maximum for different fluid velocities.Therefore, these points are not helpful for our purpose.Regardless of the amount of F 1 and F 2 , for 1/(4ΔF) < k < 1/ΔF, AIF is greater than 0.999 and its aver-age is greater than 1 (Fig. 5).Therefore the average accuracy of the proposed method is greater than the existing method in this interval.3.For k > 1/ΔF (Fig. 6), AIF is greater than 1 regardless of the amount of F 1 and F 2 , and the proposed method would be more accurate.As a result, the proposed method can be replaced with the existing method when the sampling duration is greater than 1/(4ΔF).
The average value of AIF was calculated for 1/(4ΔF) < k < 1 and 1 Hz <ΔF < 6 Hz, and it was repeated for different zero-flow frequencies (that is the oscillating frequency of the flow-sensitive oscillators when there is no flow).Compared to existing technique, the average accuracy improvement factor was equal to 2.04 regardless of the amount of the zero-flow frequency.

Experimental results
Consider the ultrasonic flowmeter system as illustrated in Fig. 3.This circuit contains two oscillators, one in the upstream and the other in downstream direction.Two accurate crystal oscillators with the frequencies of F 1 = 10788.460513Hz and F 2 = 10787.214737Hz are used as downstream and upstream oscillators.
The simulation results around 1/(4ΔF) are shown in Fig. 7.All the simulations are done with MATLAB.The average of the blue curve is illustrated with continuous cross line in Fig. 7.The best fitting line of experimental results is expected to be similar to the best fitting line of the simulation results which is this red line.
Experiments are done at a sampling time of 24 microseconds and for each point, AIF is calculated by the processor.Results are plotted in Fig. 8.The best fitting line for experimental results is plotted in Fig. 8.This line varies from the values smaller than 1 to the values greater than 1 which is similar to the best fitting line achieved from simulation.This demonstrates the validity of the simulation results.
The simulation results for k > 1/ΔF are shown in Fig. 9. Best fitting lines for simulation result and experiment result are plotted in continuous line in Fig. 9 and Fig. 10.The best fitting line for experimental results is always above 1 which is similar with simulation results best fitting line.

Conclusion
We have proposed and demonstrated a novel singaround type ultrasonic flow meter which was approximately two times more accurate than current ultrasonic singaround type flow measurements.
The accuracy of the proposed method was compared with the existing method numerically.The results indicate that if the sampling duration be greater than 1/(4ΔF), the proposed method would be more accurate.
Compared to the existing technique, the average accuracy improvement factor was calculated for 1/(4ΔF) < k and 1 Hz < ΔF < 6 Hz for different zero-flow frequencies.It was equal to 2.04 regardless of the amount of the zero-flow frequency.

Fig. 1
Fig. 1 The ultrasonic flow meter based on conventional dual-sensor transit time Each transmitter emits coded sound pulses received by the receiver.The fluid flow decreases the ultra-

Fig. 2
Fig. 2 The output waveforms of the flow-sensitive oscillators during a sampling duration of k seconds

Fig. 3
Fig. 3 Block diagram of the implemented circuitry for measuring the frequency difference of flow-sensitive oscillators In this manner, at the end of the sampling cycle, the quantities of Counter1 and Counter3 are N 1 and N 2 respectively, and T 1 , T 2 can be calculated through the following equation Counter and Counter ref ref absolute values of right sides of Eqs. (

Fig. 6
Fig. 6 AIF versus the sampling duration for F 1 = 12000 Hz and F 2 = 11994 Hz and the sampling duration k > 1/ΔF