Introduction
The ultrasonic flowmeter has the advantages of high measurement accuracy, wide measurement range, no pressure loss, etc. It can be used for liquid and gas flow measurements. In recent years, ultrasonic gas flowmeter has developed rapidly and has been widely used in natural gas metering.
The accuracy of an ultrasonic gas flowmeter mainly depends on the measurement accuracy of transit time. However, different from the ultrasonic liquid flowmeter, because of the large attenuation of ultrasonic wave propagation in the gas medium and the interference of airborne noise, the signal-to-noise ratio of ultrasonic wave reception is low, and the measurement of transit time becomes complex. The commonly used transit time detection methods mainly include the cross-correlation method, threshold method, Doppler method, etc. Because the Doppler method relies on a reflective medium and is mainly used for liquid flow measurement, the cross-correlation method and threshold method are more widely used in the ultrasonic gas flowmeter.
The measurement principle of the threshold method is to compare the ultrasonic received signal with the threshold level. When the amplitude of the received signal reaches the threshold, the ultrasonic echo signal is considered to have arrived. The threshold method can be divided into fixed threshold method, double threshold method, and proportional threshold method. The fixed threshold method depends on the high signal-to-noise ratio of the received signal, but the ultrasonic attenuation in the gas medium is serious and the signal-to-noise ratio is low, leading to the "cycle skipping" phenomenon and large measurement error when using the fixed threshold method.
The double threshold method uses the first threshold to identify the noise signal and the second threshold to detect the ultrasonic transit time, which can avoid the peak interference of noise from affecting the measurement accuracy. However, in practical application, it is difficult to ensure the coordination of the two thresholds. Mu Libin et al. proposed a variable threshold method. This method completes the measurement of transit time by judging the interval where the difference between local peak values of the received waveform is the largest and setting a proportional threshold here. In this method, the determination of the threshold lacks robustness, and the stability of the flowmeter in long-term operation is difficult to guarantee.
In order to improve the accuracy and stability of transit time detection, a multi-stage filter amplifier circuit is designed to improve the signal-to-noise ratio and stabilize the amplitude of the received ultrasonic signal; At the same time, a transit time detection method based on the adaptive threshold is proposed and applied to flow detection. Real flow calibration tests are carried out on the sonic nozzle gas flow standard device.
1 Measurement principle
The ultrasonic transducer is an important part of the ultrasonic gas flowmeter. Two ultrasonic transducers integrated with the transmitter and receiver are installed in the meter body, which can alternately send and receive ultrasonic signals within a few milliseconds. The flow velocity and flow rate of gas in the pipeline can be calculated by detecting the ultrasonic transit time in the forward and reverse flow processes.
2 Receiving signal processing
The working frequency of the transducer applicable to the ultrasonic gas flowmeter is between 40 and 200 kHz. Acoustic noise interference is obvious in this frequency band. Due to the mismatch of acoustic impedance, the absorption attenuation and diffusion attenuation of ultrasonic wave are serious when it travels in the gas medium. If no corresponding measures are taken, the amplitude of the ultrasonic received signal is only a few millivolts and extremely unstable. The working frequency of the ultrasonic transducer selected in this study is 200 kHz, and the multi-stage filter amplifier circuit is used to realize the gain adjustment of ultrasonic receiving signal and interference filtering; On this basis, the ultrasonic transit time is accurately measured by using an adaptive threshold.
2.1 Filter and amplifier circuit
The first stage adopts a low-pass filter circuit. The circuit gain is 20 dB and the cut-off frequency is 295 kHz.The second stage uses a second-order band-pass filter amplifier circuit, with a passband center frequency of 200 kHz, bandwidth of 30 kHz, and gain of 26 dB.
The third stage adopts an automatic gain control circuit, which is mainly realized by voltage controlled gain amplifier (AD603), digital-analog converter (DAC), and field programmable gate array (FPGA) processor. The AD603 has an adjustment range of - 10 ~+30 dB, and the gain adjustment accuracy is ± 0.5 dB. The FPGA processor adjusts the DAC voltage output through the serial peripheral interface (SPI) bus, and the difference with the 1.24 V reference voltage is used as the gain control signal of the AD603 to amplify and attenuate the previous stage signal.
2.2 Transit time detection
The multistage filter amplifier circuit has initially achieved the stability of the amplitude of the ultrasonic received signal. However, in the case of large flow or turbulence, although the peak and peak values of the ultrasonic received signal are adjusted to a fixed range, the local amplitude will still appear jitter, and the adoption of a fixed threshold method will lead to the "cycle skipping" phenomenon in the transit time measurement results, resulting in large flow velocity errors. In order to improve the anti-interference performance of the threshold method, the adaptive threshold method is used to detect the transit time. The processing steps are as follows.
① The maximum peak value (P7) of the discrete ultrasonic signal sampled by high-speed AD is searched, and the maximum value and corresponding time are recorded. ② Search 6 local peaks (P1 ~ P6) before the maximum peak and record the amplitude and corresponding time of these 6 local peaks. ③ Compare the six local peaks with the preset threshold K one by one (the preset threshold is between the third and fourth local peaks, and is 100 mV greater than P3 amplitude). When a local peak value is less than the threshold value and a subsequent local peak value is greater than the threshold value, the characteristic time is considered to be found. Finally, the first zero crossing time before the characteristic time is searched, and the ultrasonic transit time can be obtained by subtracting the fixed delay from the zero crossing time.
In order to improve the anti-interference performance of the threshold method, the effectiveness of local peak P3 needs to be strictly judged and selected. If P3 amplitude fluctuation is greater than 50 mV, it is determined that the received waveform is not suitable for threshold measurement, and it will be discarded and the next signal reception acquisition and discrimination will be restarted. On the contrary, if P3 amplitude fluctuation is not greater than 50 mV, it is considered that the threshold measurement requirements are met. At this time, the amplitude of P3 is recorded, and it is averaged with the previous 8 historical values of P3. The average result plus the value of 100 mV is used as the new threshold value to detect the ultrasonic transit time in the next cycle, thus completing the dynamic adjustment and update of the threshold value.
The whole transit time detection algorithm is implemented in high-speed FPGA. By the same method, the ultrasonic transit time in both the forward and reverse directions can be calculated, and the real-time calculation of the gas flow in the pipeline can be completed.
3 Test verification
In order to verify the accuracy of the adaptive threshold algorithm, the real flow calibration method is adopted for verification. The test was carried out on the sonic nozzle gas flow standard device (with an uncertainty of 0.27%) in the testing center. Air was used as the measured medium, and the test object was the self-developed DN100 mono-channel ultrasonic gas flowmeter. The flowmeter consists of a meter body, two ultrasonic transducers, and a signal processing unit. The sound channel angle is 45 °. The length of the upstream straight pipe section of the meter body is more than 10 times the pipe diameter, and the downstream straight pipe section is more than 5 times the pipe diameter. The ambient temperature is 24 ℃, and the atmospheric pressure is 97.6 kPa.
First, calibrate the zero point of the ultrasonic gas flowmeter at zero flow. Then, start the sonic nozzle gas flow standard device, adjust the sonic nozzle to the given flow value, and record the cumulative flow of the two instruments in the same time period when the sonic nozzle flow and the ultrasonic flowmeter flow are stable. Finally, the process is repeated three times to convert the accumulated flow into the instantaneous flow, and the average flow, relative error, and repeatability of each flow point are calculated.The ultrasonic gas flowmeter using the adaptive threshold method has good measurement accuracy in the flow range of 10~651 m3/h, with a measurement error of less than 1% and measurement repeatability of less than 0.2%, which meets the measurement index requirements of accuracy class 1.0 in the national Verification Regulation of Ultrasonic Flowmeters (JJG 1030-2007).
4 Conclusion
This paper analyzes and discusses the characteristics of the cross-correlation algorithm and threshold method in the ultrasonic gas flowmeter. In order to improve the stability and accuracy of ultrasonic transit time measurement, a multi-stage filter amplifier circuit and an automatic gain control circuit are designed to improve the signal-to-noise ratio of the ultrasonic signal received; At the same time, the adaptive threshold method is used to detect the ultrasonic transit time, and a new threshold value is obtained by recursion of the historical average value of the key local peak value, which can avoid large errors in the transit time measurement caused by amplitude jitter.
The real flow calibration test was carried out on the sonic nozzle gas flow standard device. The test results show that the design scheme has high measurement accuracy and repeatability. This research method can make up for the shortcomings of the cross-correlation algorithm and conventional threshold method in ultrasonic flow measurement and plays an important role in improving the stability and accuracy of the ultrasonic gas flowmeter.