Self-adaptive weighted recursive filtering algorithm of ultrasonic gas flowmeter

By employing an adaptive weighted recursive filtering algorithm and combining downstream and upstream transit times to construct an adaptive weighting function, the instability of transit time data in ultrasonic gas flow meters is resolved, thereby improving the stability and accuracy of the flow meters.

CN121740173APending Publication Date: 2026-03-27CHINA JILIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-26
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing ultrasonic gas flow meters are easily affected by flow field fluctuations, gas parameter changes and noise in transit time measurement, which leads to increased fluctuations in the measured value and zero drift. Traditional filtering methods are difficult to effectively identify and suppress abnormal data, affecting the repeatability and long-term stability of the flow meter.

Method used

An adaptive weighted recursive filtering algorithm is adopted. By obtaining the transit time of upstream and downstream, and combining it with the zero flow reference time, an adaptive weight function is constructed to dynamically weight the transit time data, identify and suppress abnormal data, and achieve data smoothing.

Benefits of technology

It improves the stability and reliability of transit time data, reduces zero-point drift, and enhances the repeatability and long-term stability of the flow meter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121740173A_ABST
    Figure CN121740173A_ABST
Patent Text Reader

Abstract

The invention relates to a self-adaptive weighted recursive filtering method of an ultrasonic gas flowmeter, in particular to a method for carrying out self-adaptive weighted and recursive filtering processing on transit time measurement data in the ultrasonic gas flowmeter, and belongs to the field of ultrasonic flow measurement. The method comprises the following steps: S1, taking downstream transit time and countercurrent transit time obtained in a current measurement period as input data of a filtering algorithm; s2, reference transit time under the zero-flow working condition is introduced, and down-flow transit time decrement and counter-flow transit time increment are calculated; and S3, according to a difference value between the downstream transit time decrement and the countercurrent transit time increment and a change relationship between a current measurement value and a previous filtering output value, constructing an adaptive weight of the measurement data, and carrying out weighted recursive average operation on the transit time data in a preset filtering window to obtain a stable transit time filtering result. According to the scheme, by combining the physical consistency characteristics of the forward and reverse flow transit time, abnormal or incredible measurement data are inhibited, and the influence of flow field fluctuation, gas parameter change and system noise on the transit time measurement result is effectively reduced. Compared with a traditional filtering method, the method has the advantages that no extra hardware circuit needs to be added, high-stability filtering processing can be achieved only by depending on transition time data, and the measurement reliability of the ultrasonic gas flowmeter is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an adaptive weighted recursive filtering algorithm for ultrasonic flow meters, belonging to the field of ultrasonic flow meters. Background Technology

[0002] Time-of-flight ultrasonic gas flow meters calculate gas velocity by measuring the transit time difference of ultrasonic waves propagating in a gas medium in the forward and reverse directions. Their metrological performance largely depends on the stability and reliability of the transit time measurement results. In practical applications, due to factors such as flow field fluctuations, gas parameter variations, transducer characteristic differences, and electronic system noise, the forward and reverse transit time measurements are prone to random fluctuations, and may even produce abnormal data that deviates significantly from the true value. Directly calculating from the raw transit time data can easily lead to increased fluctuations in instantaneous flow rate and exacerbated zero-point drift, thereby affecting the flow meter's repeatability and long-term stability.

[0003] In existing technologies, methods such as arithmetic mean filtering, moving average filtering, or Kalman filtering are commonly used to process transit time data. However, most of these methods only smooth the data statistically and do not fully consider the symmetry between downstream and upstream transit times in terms of physical mechanisms. When abnormal timing data exists during the measurement process, traditional filtering methods struggle to effectively identify and suppress erroneous measurements, resulting in the filtering results still being significantly affected by the abnormal data.

[0004] Therefore, it is necessary to propose a recursive filtering algorithm that can adaptively weight the measurement data by combining the physical characteristics of the transit time in both forward and reverse flow, so as to improve the stability and reliability of the transit time data of ultrasonic gas flow meters. Summary of the Invention

[0005] The purpose of this invention is to provide an adaptive weighted recursive filtering algorithm for ultrasonic flow, which obtains the transit time of ultrasonic waves in both the downstream and upstream directions, and introduces a reference transit time under zero flow conditions. By analyzing the mathematical consistency between the decrease in downstream transit time and the increase in upstream transit time, an adaptive weighting function is constructed, and combined with recursive average filtering to achieve dynamic weighting processing of the transit time data. The specific technical solution is as follows:

[0006] S1. Obtain the downstream transit time within the current sampling period. t up (n) Crossing Time Against the Current t down (n) .

[0007] S2, Referencing transit time based on zero flow t zeroCalculate the decrease in downstream transit time and the increase in upstream transit time:

[0008] S3. Calculate the deviation index between the forward and reverse flow time characteristic quantities:

[0009] Furthermore, the change between the current measured value and the previous filtered output value is calculated simultaneously:

[0010] in, y(n-1) This is the filtered output value from the previous moment.

[0011] Furthermore, adaptive weight calculation is performed based on a pre-set deviation threshold. λ m With change threshold Construct measurement data weighting factors:

[0012] when λ(n) or When the data exceeds the set range, the corresponding weight factor is set to zero, thereby preventing abnormal data from participating in the filtering operation.

[0013] The weighting factors are further normalized to obtain the final filter weights:

[0014] Further, a recursive weighted filtering process is performed on the output. The length is... N Within the filtering window, the filtered output value is calculated as follows:

[0015] The algorithm described above can effectively identify erroneous transit time data by combining the characteristics of the transit time of the echo signal, and assign it a low or zero weight to achieve the effect of filtering and smoothing the transit time data. Furthermore, the current threshold voltage can be corrected by using this filtered value. Attached Figure Description

[0016] The advantages of the invention can be better understood when considered in conjunction with the accompanying drawings and the following detailed description. However, the accompanying drawings, which are included to provide a further understanding of the invention and constitute a part of this invention, are illustrative embodiments and descriptions used to explain the invention and do not constitute an undue limitation thereof.

[0017] Figure 1 This is a schematic diagram of the algorithm flow of the present invention.

[0018] Figure 2 This is a hardware framework diagram of a prototype according to an embodiment of the present invention.

[0019] Figure 3 This is a schematic diagram of the transit time measurement of the prototype in an embodiment of the present invention.

[0020] Figure 4 Comparison chart of different algorithm effects in embodiments of the present invention.

[0021] Figure 5 Zero-drift data diagram of the algorithm in this embodiment of the invention. Detailed Implementation

[0022] The present invention will be further illustrated below with reference to the accompanying drawings and embodiments. However, these embodiments are merely illustrative, and the scope of protection of the present invention is not limited to these embodiments.

[0023] This embodiment selects a prototype of a gas ultrasonic flow meter. The transducer excitation voltage is 18V, the frequency is 200kHz, and the period is 5µs. Its overall hardware framework diagram is as follows. Figure 2 As shown in the figure, the main control units introduced in the figure include the STM32F103 main control circuit and the TDC-GP22 timing circuit, followed by the excitation signal amplification circuit, switching circuit, receiving conditioning circuit, and finally the display module and storage module.

[0024] The ultrasonic flowmeter transit time measurement method in this embodiment is as follows: Figure 3 As shown, the threshold method for time-of-flight measurement starts the timing process by using the excitation signal generation time of the transducer. When the echo signal first exceeds a set threshold, the threshold comparison circuit sends a stop timing signal to the timing chip; this moment is the arrival time of the echo signal. The arrival time of the echo signal serves as the end of the timing process. The arrival time of the echo signal is confirmed by using a timing device to obtain the time it takes for the echo to travel from transmission to reception. T a Arrival time T a With flight time T f difference n Transducer cycle time T n , n The positional difference between the target characteristic wavenumber and the first wave.

[0025] In this embodiment, the zero-flow reference transit time is obtained during the system startup phase using a zero-flow operating condition. t zero Based on the experimental data, the following filtering parameters were set: upper limit parameter for consistency deviation. λ m =3.5, upper limit parameter for recursive change =4.5, filter window length M =100.

[0026] In this embodiment, the ultrasonic flow meter controls the ultrasonic transducer to complete ultrasonic excitation and reception in both the downstream and upstream directions during each measurement cycle, and obtains: the downstream transit time of the current cycle. t up (n) and the current cycle reverse flow time t down (n) The acquired transit time data is transmitted to the data processing unit as input to the filtering algorithm.

[0027] The data processing unit is based on zero-flow reference transit time. t zero The feature quantity is calculated on the collected transit time data. The increase or decrease of the transit time in the upstream and downstream directions is calculated by formula (1). The feature quantity is used to reflect the change characteristics of the transit time in the upstream and downstream directions relative to the zero flow state under the current flow state.

[0028] After completing the calculation of the transit time characteristics, a criterion for evaluating the reliability of the current measurement data is further constructed. First, the consistency deviation between the upstream and downstream transit time characteristics is calculated according to equation (2). Second, the recursive change between the current measurement value and the previous filtered output value is calculated according to equation (3).

[0029] The consistency deviation calculated in step four λ(n) and recursive change Compare with a preset threshold parameter: when λ(n)<λm and < When, the current measurement data is considered reliable; when λ(n)≥λm or ≥ At that time, it was determined that the current measurement data was abnormal.

[0030] Based on this, the weight factor of the current measurement data is calculated according to equation (4). For data that is judged to be abnormal, its weight factor is zero and it does not participate in the subsequent filtering calculation.

[0031] Further normalization of the filter weights is performed within a filter window of length [missing information]. N In the data sequence, according to All effective weight factors are normalized to obtain the corresponding filter weights. The normalization process ensures the stability and consistency of weight allocation during the filtering calculation.

[0032] Based on this, after completing the weight calculation, a weighted recursive average operation is performed on the transit time data within the filtering window, and the current cycle's filtered output value is obtained according to equation (6). The filtered output value serves as a stable transit time result and is used for subsequent flow velocity and volumetric flow rate calculations.

[0033] like Figure 4 As shown, the adaptive weighted recursive filtering algorithm can better filter out erroneous data obtained due to incorrect threshold voltage setting compared to other conventional filtering algorithms, and has better data performance and data response capability.

[0034] Secondly, to compare the effects of the adaptive weighted recursive filtering algorithm before and after filtering, 500 sets of sample values ​​were collected for both the original zero-drift time difference data and the zero-drift time difference data after data filtering. The black solid line represents the original zero-drift data of the ultrasonic gas flow meter, and the red solid line represents the zero-drift data after adaptive weighted recursive filtering. Figure 5 The original zero drift fluctuation range is within 40ns, while the zero drift fluctuation range after weighted recursive filtering is within 6ns. By comparing these two sets of data, it can be concluded that the zero drift data after using the filtering algorithm in this study is reduced to 1 / 4 of the original system state, and the system stability is significantly improved.

[0035] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. An adaptive weighted recursive filtering method for an ultrasonic gas flow meter, characterized in that... Includes the following steps: S1. Obtain the downstream transit time and upstream transit time within the current measurement cycle, and use the downstream transit time and upstream transit time as input data for the filtering algorithm; S2. Based on the reference transit time obtained under zero flow conditions, calculate the downstream transit time reduction and upstream transit time increment respectively; S3. Based on the difference between the decrease in downstream transit time and the increase in upstream transit time, calculate the consistency deviation index of downstream and upstream transit times, and compare the transit time of the current measurement cycle with the previous filtered output value to calculate the recursive change index; S4. Based on the consistency deviation index and the recursive change index, construct an adaptive weighting factor for the measurement data, assign lower weights or zero weights to abnormal measurement data, and perform a weighted recursive average calculation on the transit time data within a preset filtering window to output the filtered transit time result of the current measurement cycle.

2. An adaptive weighted recursive filtering method for an ultrasonic gas flow meter, characterized in that, In step S2, the decrease in downstream transit time is the difference between the downstream transit time and the zero-flow reference transit time, and the increase in upstream transit time is the difference between the upstream transit time and the zero-flow reference transit time.

3. An adaptive weighted recursive filtering method for an ultrasonic gas flow meter, characterized in that, In step S3, the consistency deviation index is used to characterize the degree of symmetry deviation between the downstream transit time reduction and the upstream transit time increment in terms of physical mechanism.

4. An adaptive weighted recursive filtering method for an ultrasonic gas flow meter, characterized in that, In step S4, after normalizing the adaptive weighting factor, a weighted recursive average operation is performed within the sliding filter window. The transit time result of the filter output is used for gas flow rate or volumetric flow rate calculation.