Multi-characteristic point ultrasonic transit time measurement method based on cross-correlation algorithm

By combining the hardware threshold method with zero crossing detection and cross-correlation algorithm, multi-feature point time is extracted and corrected, and the accuracy and robustness of cross-time measurement in the prior art are solved, and high-precision and real-time measurement of ultrasonic flowmeters under multi-channels are achieved.

CN116358652BActive Publication Date: 2025-08-22ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310344308.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2025-08-22
Estimated Expiration
2043-03-28

AI Technical Summary

Technical Problem

In the cross-time measurement of existing ultrasonic flowmeters, the threshold method is susceptible to noise and amplitude changes, and the cross-correlation method has a large calculation amount and limited resolution, so it is impossible to achieve accurate measurement in a multi-channel flowmeter.

Method used

The time of multiple feature points is extracted by combining the threshold method implemented by hardware and zero crossing detection, and the correction is assisted by cross-correlation algorithm, and AD sampling and cross-correlation calculation are used using the DSP chip, and combined with microcontroller timing, the accurate extraction and correction of feature points is achieved.

Benefits of technology

The resolution and resistance to waveform amplitude change of the transition time measurement are improved, ensuring high accuracy at low flow rates and robustness at high flow rates, and maintaining real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116358652B_ABST
    Figure CN116358652B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-feature point ultrasonic transit time measurement method assisted by a cross-correlation algorithm. The method first uses threshold comparison and zero-crossing detection technology to obtain three consecutive zero-crossing points after the amplitude of the received waveform exceeds the threshold as feature points, and calculates the average vibration period of the received signal based on the arrival time of these three feature points; secondly, the calculation results of the cross-correlation algorithm are combined to judge whether the three feature point times have a period jump phenomenon. If a period jump phenomenon is found, the calculated average vibration period is used for correction; finally, the corrected three feature point times are used to calculate the transit time of the ultrasonic signal. The flow rate verification experiment results show that compared with the traditional cross-correlation algorithm and threshold method, this method effectively improves the accuracy and repeatability of transit time measurement at low flow rates, and enhances the robustness of transit time measurement at high flow rates, thereby improving the measurement precision and accuracy of the gas ultrasonic flowmeter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of gas ultrasonic flow velocity measurement, and in particular relates to a transit time measurement method for correcting multi-characteristic point timing based on cross-correlation calculation results. Background Art

[0002] With China's steady economic growth and continued progress in energy transformation and development, natural gas, as a clean and efficient energy source, has steadily increased its share in the primary energy mix, and infrastructure development is accelerating. Compared to other flowmeters, ultrasonic flowmeters offer advantages such as no obstructions, no pressure drop, high reliability, and suitability for large-caliber measurement, making them a crucial measurement tool in the natural gas trade. The transit time method, with its simple measurement principle and high accuracy, has become the most commonly used method in gas ultrasonic flowmeters.

[0003] The time-of-flight method calculates the average flow velocity by measuring the difference in the transit time of ultrasonic signals in both the forward and reverse directions. Therefore, accurate transit time measurement is crucial for time-of-flight ultrasonic flowmeters. Currently, three common transit time measurement methods are the threshold method, the cross-correlation method, and the model fitting method. The cross-correlation method calculates the transit time difference by calculating the maximum position of the cross-correlation function of two signals. This method is insensitive to amplitude variations and offers greater robustness, but its measurement resolution is limited by the sampling frequency, resulting in low measurement accuracy at low flow rates. The model fitting method determines the onset moment by building a mathematical model of the ultrasonic wave and fitting it to the actual received signal. These methods can be broadly categorized into two types: directly fitting the signal envelope using a curve, and estimating the parameters of the received signal model using intelligent algorithms. However, these methods require significant computational effort, making them difficult to implement in embedded systems and typically require computation to be performed on a host computer. The threshold method sets an appropriate threshold voltage and selects the first significant peak in the received waveform for timing. This method is often combined with zero-crossing detection, offering simple implementation and high real-time performance. However, it is susceptible to noise and large amplitude variations, leading to significant feature point offsets and large errors.

[0004] In the existing technology, the current improvement of the threshold method is mainly to achieve adaptive thresholds. However, once the ratio of the proportional threshold method implemented by hardware is set, it cannot be easily changed, and the impact of amplitude changes cannot be avoided. At the same time, for multi-channel gas ultrasonic flowmeters with higher measurement accuracy, when the lengths of the chord channel and the path channel are different, the amplitude of the received waveform is also different, and the proportional threshold method cannot achieve accurate measurement of the transit time; the variable proportional threshold implemented by software still measures the transit time based on the sampled signal, and the measurement resolution is limited by the sampling frequency. It is usually necessary to use interpolation to achieve zero-crossing detection to improve accuracy, increase the calculation burden, affect real-time performance, and cannot retain its original advantages. It is not much different from the cross-correlation method. Summary of the Invention

[0005] In view of the shortcomings of the background technology, the present invention aims to propose a multi-feature point ultrasonic transit time measurement method assisted by a cross-correlation algorithm.

[0006] In order to achieve the above object, the technical solution adopted by the present invention is:

[0007] The present invention provides a multi-characteristic point ultrasonic transit time measurement method based on the assistance of a cross-correlation algorithm, the method comprising the following steps:

[0008] S1: For the received waveform received during the measurement process of the gas ultrasonic flowmeter, the received waveform is processed using a received signal processing circuit. Then, a signal shaping circuit is used to extract multiple consecutive zero-crossing points after the positive peak value of the received waveform exceeds a fixed threshold voltage by combining a threshold method with zero-crossing detection and use them as feature points.

[0009] S2: Use the time detection circuit to time the extracted feature points and obtain the time t of three consecutive feature points. i , i = 1 to 3; with three characteristic points at time t i The average value of the ultrasonic signal is taken as the average transit time t TOF , take half of the difference between the third characteristic point time t3 and the first characteristic point time t1 as the average vibration period T ave ;

[0010] S3: Use the DSP chip to perform AD sampling on the received waveform, perform cross-correlation calculation with the reference waveform, and obtain the time delay Δt of the received waveform relative to the reference waveform cor , and then further calculate the transit time measurement result t of the cross-correlation method cor ;

[0011] S4: The average transit time t obtained in step S2 is TOF The cross-correlation algorithm result t obtained in step S3 cor Compare and find out if the two are close to or exceed an average vibration period T ave If there is a gap between the two, it is considered that the extraction of feature points has a cycle skipping problem, and the average flight time t TOF With t cor Compare and estimate the number of cycles of error in the wave jumping problem and make corrections to obtain the final feature point time Otherwise, it is considered that there is no cycle skipping problem, and the measured feature point time t is directly used. i As the final feature point time

[0012] S5: Time for the final feature points The average value is taken as the final flight time measurement result.

[0013] Preferably, in step S1, the receiving signal processing circuit includes a multi-stage filtering and amplifying circuit for improving the signal-to-noise ratio of the received signal; it also includes a voltage boosting circuit for boosting the voltage of the signal processed by the multi-stage filtering and amplifying circuit to facilitate subsequent AD sampling and feature point extraction.

[0014] Preferably, in step S1, the signal shaping circuit includes a hysteresis comparator circuit and a three-way inverter, and the upper and lower limit voltages of the hysteresis comparator circuit are set to a predetermined fixed threshold voltage and a reference voltage, respectively; the received waveform is compared by the hysteresis comparator, and its output is then inverted by the three-way inverter to finally obtain a shaped square wave, wherein the rising edge of the square wave corresponds to the point where the received waveform reaches the threshold, and the falling edge corresponds to the zero crossing point.

[0015] Preferably, in step S1, the signal shaping circuit includes a shaping circuit resistor R12, an output resistor R13, an adjustable resistor R14, an input resistor R15, a feedback resistor R16, a high-speed comparator U5, an operational amplifier U6 and a three-way inverter U7; one end of the shaping circuit resistor R12 is connected to a +5v power supply, and the other end is connected to a fixed point of the adjustable resistor R14, and the other fixed point of the adjustable resistor R14 is grounded, the movable head is connected to the positive input terminal of the operational amplifier U6, the output terminal of the operational amplifier U6 is connected to the negative input terminal, and the input voltage is 0. One end of resistor R15 is connected to the output of operational amplifier U6, and the other end is connected to the positive input of high-speed comparator U5. The negative input of high-speed comparator U5 is connected to the received signal. One end of feedback resistor R16 is connected to the positive input of high-speed comparator U5, and the other end is connected to the output of high-speed comparator U5. One end of output resistor R13 is connected to the output of high-speed comparator U5, and the other end is connected to the input of the first path of three-way inverter U7. The shaped square wave signal is output from the output of the first path of the three-way inverter U7.

[0016] Preferably, in step S1, the method for determining the fixed threshold voltage in the threshold method includes the following steps:

[0017] S11: selecting multiple flow velocity points covering the entire flow state, and collecting multiple sets of received waveforms at each flow velocity point;

[0018] S12: extracting the positive peak points of the received waveform at all flow rate points, and drawing a distribution diagram of the positive peak points of the received waveform at different flow rates;

[0019] S13: According to the positive peak point distribution diagram of the received waveform at each flow rate, a voltage range with the largest interval between the front and rear peak voltages is selected as the threshold voltage.

[0020] Preferably, in step S2, the time detection circuit includes a single-chip microcomputer and a timing chip. The timing chip is set to be falling edge sensitive. The characteristic points corresponding to the falling edges of the first three shaped square waves extracted in step S1 are timed, and each timing result is uploaded to the single-chip microcomputer to obtain the time t of the three consecutive characteristic points. i .

[0021] As a preference, in step S3, it is necessary to collect N groups of static waveforms in advance under static conditions and take the average as the reference waveform, and at the same time use step S2 to measure the time t of three consecutive characteristic points under N groups of static waveforms. ki To calculate the average transit time t0 of the reference waveform, the expression is:

[0022]

[0023] where t ki represents the time of the i-th characteristic point of the k-th group of static waveforms;

[0024] Then use the cross-correlation algorithm to calculate the time delay Δt between the received waveform and the reference waveform cor , calculate the transit time measurement result t of the cross-correlation algorithm cor , whose expression is:

[0025] t cor =Δt cor +t0.

[0026] Preferably, step S2 and step S3 are controlled by the MSP430 chip and the DSP chip respectively and performed simultaneously, and finally the data are uploaded to the host computer for fusion and calculation of the average surface flow velocity.

[0027] As a preference, in step S4, the average transit time t TOF The time-of-flight measurement result t cor If the difference between them is not less than the time difference threshold T*, it is considered that the feature point extraction has a cycle skipping problem; the time difference threshold is the average vibration period T ave 0.9 times of .

[0028] As a preference, in step S4, when the extraction of feature points has a cycle skipping problem, the average flight time t TOF The time-of-flight measurement result t cor The difference between the two is combined with the average vibration period to estimate the number of jump wave cycles n, the expression of n is:

[0029] If t TOF -t cor ≥T*

[0030] If tTOF -t cor ≤-T*

[0031] Where: [] represents the rounding down operation;

[0032] Then make corrections based on the specific value of the cycle number n and calculate the corrected characteristic time in:

[0033] If n = -1, the corrected characteristic time The expression is:

[0034]

[0035]

[0036]

[0037] If n≤-2, the corrected characteristic time The expression is:

[0038]

[0039] If n=1, the corrected characteristic time The expression is:

[0040]

[0041]

[0042]

[0043] If n≥2, the corrected characteristic time The expression is:

[0044]

[0045] Compared with the existing technology, the present invention uses hardware to implement a threshold method combined with zero-crossing detection to extract multiple feature point times for transit time measurement, which has a simple circuit and high measurement resolution, and has high measurement accuracy even at low flow rates; at the same time, the cross-correlation method is used to assist in correcting the multiple extracted feature points, which improves the ability to resist waveform amplitude changes, has good robustness even at high flow rates, and ensures good real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a flow chart of the present invention;

[0047] Figure 2 It is the schematic diagram of the shaping circuit;

[0048] Figure 3 It is the distribution diagram of the positive peak point clusters of the six-channel forward and reverse flow waveforms at each flow rate point;

[0049] Figure 4 It is a comparison diagram between the received waveform and the shaped square wave;

[0050] Figure 5 This is the transit time distribution diagram obtained by measuring 45 sets of received waveforms using the method of the present invention at a flow rate of 0.22 m / s;

[0051] Figure 6 The transit time distribution diagram obtained by calculating the 45 sets of received waveforms using the cross-correlation algorithm in step 3 at a flow rate of 0.22 m / s is shown in FIG.

[0052] Figure 7 The transit time distribution diagram is obtained by measuring 45 sets of received waveforms using the threshold method and zero-crossing detection technology in step 2 at a flow rate of 22.03 m / s;

[0053] Figure 8 This is the transit time distribution diagram obtained by measuring 45 sets of received waveforms using the method of the present invention at a flow rate of 22.03 m / s; DETAILED DESCRIPTION

[0054] The present invention will be further described and illustrated below with reference to the accompanying drawings.

[0055] In one embodiment of the present invention, a multi-feature point ultrasonic transit time measurement method assisted by a cross-correlation algorithm is applied to a six-channel gas ultrasonic flowmeter. 14 velocity points are set within a velocity range encompassing the entire flow regime: 0 m / s, 0.22 m / s, 0.29 m / s, 0.35 m / s, 0.68 m / s, 0.78 m / s, 1.19 m / s, 1.59 m / s, 2.97 m / s, 3.91 m / s, 7.31 m / s, 12.47 m / s, 15.38 m / s, and 22.03 m / s. The flow rate range is divided into a low velocity range and a high velocity range using 2 m / s as the dividing point. Forty-five sets of forward and reverse flow data are continuously collected at each velocity point, with the data at a velocity of 0 m / s being primarily used to obtain a reference waveform and the average transit time t0 of the reference waveform.

[0056] like Figure 1 As shown, in this embodiment, the measurement using the multi-feature point ultrasonic transit time measurement method assisted by the cross-correlation algorithm includes the following steps:

[0057] Step 1) Process the received waveform during the measurement process of the gas ultrasonic flowmeter using a received signal processing circuit. In this embodiment, the received signal processing circuit includes a multi-stage filtering and amplification circuit for improving the signal-to-noise ratio of the received signal. It also includes a voltage boost circuit for boosting the voltage of the signal processed by the multi-stage filtering and amplification circuit to facilitate subsequent AD sampling and feature point extraction. A signal shaping circuit including a hysteresis comparator circuit and three inverter signals is then used to extract multiple consecutive zero-crossing points after the positive peak of the received waveform exceeds a fixed threshold voltage, using a combination of a threshold method and zero-crossing detection, and these are used as feature points.

[0058] In an embodiment of the present invention, the signal shaping circuit is implemented as follows Figure 2 As shown, the signal shaping circuit includes a hysteresis comparator circuit and a three-way inverter. The hysteresis comparator has two unequal threshold voltages. Usually, the difference between these two voltages is small, about a few microvolts, to avoid self-oscillation. However, the present invention sets two threshold voltages with a larger difference, namely a fixed threshold selected by pre-analysis (which can be used to implement the threshold method) and a reference voltage raised in the voltage raising circuit (which can be used to implement zero-crossing detection), thereby combining the threshold method with the zero-crossing detection technology. Considering that the output waveform of the inverted input is more stable and the calculation of the threshold voltage is more convenient, the present invention adopts an inverted input circuit design, using the threshold voltage as the positive input of the comparator and the received signal as the negative input. In this case, the peak and valley positions of the square wave output by the hysteresis comparator are opposite to those of the received waveform, so it is also necessary to invert it through the three-way inverter. At this point, the rising edge of the square wave obtained after passing through the entire signal shaping circuit is the moment when the received waveform reaches the threshold, and the falling edge is the zero-crossing moment after reaching the threshold.

[0059] Specifically, the signal shaping circuit includes a shaping circuit resistor R12, an output resistor R13, an adjustable resistor R14, an input resistor R15, a feedback resistor R16, a high-speed comparator U5, an operational amplifier U6 and a three-way inverter U7; one end of the shaping circuit resistor R12 is connected to a +5V power supply, and the other end is connected to a fixed point of the adjustable resistor R14, and the other fixed point of the adjustable resistor R14 is grounded, the movable head is connected to the positive input terminal of the operational amplifier U6, the output terminal of the operational amplifier U6 is connected to the negative input terminal, and the input resistor R15 is connected to the negative input terminal. One end is connected to the output of operational amplifier U6, and the other end is connected to the positive input of high-speed comparator U5. The negative input of high-speed comparator U5 is connected to the received signal. Feedback resistor R16 is connected to the positive input of high-speed comparator U5 and the other end is connected to the output of high-speed comparator U5. Output resistor R13 is connected to the output of high-speed comparator U5 and the other end is connected to the input of the first path of three-way inverter U7. The shaped square wave signal is output from the output of the first path of three-way inverter U7. The upper and lower limit voltages of the hysteresis comparator circuit in this signal shaping circuit are respectively predetermined fixed threshold voltage and reference voltage. The received waveform is compared by the hysteresis comparator, and its output is then inverted by the three-way inverter to finally obtain the shaped square wave. The rising edge of the square wave corresponds to the point where the received waveform reaches the threshold, and the falling edge corresponds to the zero crossing point.

[0060] The threshold used in the threshold method should be able to accurately screen out the peaks in all ranges. Therefore, the threshold voltage should be located at the location where the positive peak distribution points are the sparsest at each flow rate. Therefore, in an embodiment of the present invention, the specific steps of selecting the above-mentioned fixed threshold voltage include:

[0061] (1) Select multiple flow rate points covering the entire flow state and collect multiple sets of received waveforms at each flow rate point;

[0062] (2) Extract the positive peak points of the received waveform at all flow rate points and draw a distribution diagram of the positive peak points of the received waveform at different flow rates;

[0063] (3) According to the distribution diagram of the positive peak points of the received waveform at each flow rate, the voltage range with the largest interval between the front and rear peak voltages is selected as the threshold voltage;

[0064] Figure 3The figure shows the distribution of the clusters of positive peak points of the six-channel forward and reverse flow waveforms at each flow rate point. The sampling waveform at this time does not take into account the voltage raising effect in the hardware circuit, which is convenient for extracting the positive peak. It can be seen from the figure that the intervals between the front and rear peak points of the forward and reverse flow waveforms of each channel at most flow rates in the range of about 0.53v to 0.58v are relatively large. Selecting the threshold within this range can better achieve stable distinction of characteristic periods. Therefore, the fixed threshold used in the threshold method in the actual circuit is set to increase 0.55v on the basis of the reference voltage. Finally, the comparison diagram of the received waveform and the square wave obtained after shaping in the embodiment is shown as follows. Figure 4 shown.

[0065] Step 2) Design a time detection circuit using a single-chip microcomputer and a timing chip. Set the timing chip to be falling-edge sensitive. Use the square wave obtained by shaping in step 1) for timing. Measure the characteristic points corresponding to the falling edges of the first three shaped square waves extracted in step 1) to obtain the time t of three consecutive characteristic points. i (i=1~3), upload each timing result to the microcontroller and calculate the average transit time t of the ultrasonic signal TOF and the average vibration period T ave Among them, the average transit time of the ultrasonic signal t TOF The time t of three characteristic points i The average value is calculated as follows:

[0066]

[0067] Average vibration period T ave It is half of the difference between the time of the third feature point t3 and the time of the first feature point t1. Its calculation formula is:

[0068]

[0069] Step 3) Use the DSP chip to perform AD sampling on the received waveform and perform cross-correlation calculation with the reference waveform to obtain the time delay Δt of the received waveform relative to the reference waveform. cor , and further use Δt cor Calculate the transit time measurement result t of the cross-correlation method cor .

[0070] In an embodiment of the present invention, N (N is 45 here) sets of static waveforms can be collected in advance under static conditions and averaged as a reference waveform. At the same time, step 2) is used to measure the time of multiple characteristic points (i.e., the aforementioned three consecutive characteristic points) under the N sets of static waveforms to calculate the average transit time t0 of the reference waveform, which is expressed as:

[0071]

[0072] where tki Indicates the time of the i-th feature point of the k-th group of static waveforms.

[0073] Then, based on the average transit time t0 of the reference waveform, the time delay Δt of the received signal relative to the reference waveform is obtained by adding the cross-correlation cor , calculate the transit time measurement result t of the cross-correlation algorithm cor , whose expression is:

[0074] t cor =Δt cor +t0

[0075] Among them, in this step, t cor The calculation of step 1) and step 2) are controlled by the DSP chip and the MSP430 chip respectively and are performed simultaneously. Finally, the data are uploaded to the host computer for fusion and calculation of the average surface flow velocity.

[0076] Step 4) The average transit time t obtained in step 2) is TOF The cross-correlation algorithm result t obtained in step 3) cor If the two are close to or exceed an average vibration period T ave If the difference is less than 0.05, it is considered that the extraction of feature points has a cycle skipping phenomenon, and step 5) is performed first and then step 6); otherwise, it is considered that no cycle skipping phenomenon occurs, and the measured feature point arrival time is used as the final feature point moment Skip step 5) and go directly to step 6);

[0077] It should be noted that the above-mentioned average transit time t TOF The result of cross-correlation algorithm t cor When the so-called "close to an average vibration period T ave " means the gap between the two can be slightly smaller than T ave But the difference cannot be too large. In this embodiment, it is determined whether the two are close to or exceed an average vibration period T ave The gap can be achieved by setting a time difference threshold T*, which can be set to the average vibration period T ave Therefore, if the average transit time t TOF The time-of-flight measurement result t cor If the difference between them (the absolute value of the difference can be taken for later judgment) is not less than the time difference threshold T*, it is considered that the feature point extraction has a cycle skipping problem.

[0078] In this embodiment, the result obtained in step 2) at a flow rate of 0.22 m / s is as follows Figure 5 As shown, the result obtained in step 3) is as follows Figure 6As shown. It can be seen that at a flow rate of 0.22m / s, the result of step 2) does not have a cycle skipping problem, so it can be directly used as the final result of the transit time measurement. However, the result obtained in step 3) shows obvious stratification. This is because the sampling frequency of the received waveform is 6MHz, and the resolution of the cross-correlation algorithm can only reach the sampling cycle time, that is, 0.16us. At this time, using the transit time obtained by the cross-correlation algorithm for flow velocity calculation will produce a large error; while the method of the present invention will not be affected by the sampling frequency, and the transit time result distribution is precise, which effectively improves the measurement accuracy and measurement repeatability.

[0079] Step 5) After the cycle jump phenomenon occurs, the average transit time t TOF The result of cross-correlation algorithm t cor By comparison, the number of cycles n where errors occur in the cycle skipping phenomenon is estimated and corrected. The specific correction process is as follows:

[0080] Using t TOF With t cor The difference between the two periods is compared with the average vibration period to estimate the number of wave skipping periods n. Usually, the period skipping problem is caused by the increase of flow velocity, the aggravation of ultrasonic energy attenuation, and the decrease of echo signal amplitude. Therefore, the period skipping phenomenon often occurs backwards. At this time, n>0, and the expression is:

[0081] If t TOF -t cor ≥T*

[0082] Where: [] represents the rounding down operation, the same below.

[0083] Considering that in some cases during the flow velocity measurement process, the increase in the amplitude of the echo signal may cause a forward cycle jump problem. In this case, n < 0, the expression is:

[0084] If t TOF -t cor ≤-T*

[0085] Then make corrections based on the specific value of the cycle number n and calculate the corrected characteristic time in:

[0086] If n = -1, the corrected characteristic time The expression is:

[0087]

[0088]

[0089]

[0090] If n≤-2, the corrected characteristic time The expression is:

[0091]

[0092] If n=1, the corrected characteristic time The expression is:

[0093]

[0094]

[0095]

[0096] If n≥2, the corrected characteristic time The expression is:

[0097]

[0098] Step 6) Time the three feature points finally obtained Take the average value as the final flight time measurement result.

[0099] In this embodiment, Figure 7 The measurement result obtained in step 2) at a flow rate of 22.03 m / s is: Figure 8 This is the result obtained in step 5) at this flow rate. As can be seen from the figure, at a flow rate of 22.03 m / s, the result of step 2) has a large-scale "jump cycle" problem due to the drastic change in the received waveform amplitude. At this time, step 4) is followed by step 5), and the cross-correlation algorithm in step 3) is used to improve the waveform amplitude capability to correct the result of step 2). Finally, the result obtained in step 6) shows that the present invention effectively overcomes the "jump cycle" problem, more accurately measures the transit time, and effectively expands the instrument range.

[0100] The above description is only a preferred embodiment of the present invention. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Any person skilled in the art can use the above disclosed methods and technical contents to make many possible changes and modifications to the technical solution of the present invention without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.

Claims

1. A multi-feature point ultrasonic transit time measurement method based on a cross-correlation algorithm, characterized in that: The method comprises the following steps: S1: For the received waveform received during the measurement process of the gas ultrasonic flowmeter, the received waveform is processed using a received signal processing circuit. Then, a signal shaping circuit is used to extract multiple consecutive zero-crossing points after the positive peak value of the received waveform exceeds a fixed threshold voltage by combining a threshold method with zero-crossing detection and use them as feature points. S2: Use the time detection circuit to time the extracted feature points and obtain the time t of three consecutive feature points. i , i = 1 to 3; with three characteristic points at time t i The average value of the ultrasonic signal is taken as the average transit time t TOF , take half of the difference between the third characteristic point time t3 and the first characteristic point time t1 as the average vibration period T ave ; S3: Use the DSP chip to perform AD sampling on the received waveform, perform cross-correlation calculation with the reference waveform, and obtain the time delay Δt of the received waveform relative to the reference waveform cor , and then further calculate the transit time measurement result t of the cross-correlation method cor ; S4: The average transit time t obtained in step S2 is TOF The cross-correlation algorithm result t obtained in step S3 cor Compare and find out if the two are close to or exceed an average vibration period T ave If there is a gap between the two, it is considered that the extraction of feature points has a cycle skipping problem, and the average flight time t TOF With t cor Compare and estimate the number of cycles of error in the wave jumping problem and make corrections to obtain the final feature point time i=1~3; otherwise, it is considered that there is no cycle skipping problem, and the measured characteristic point time t i As the final feature point time i = 1 to 3; S5: Time for the final feature points The average value is taken as the final transit time measurement result; In step S4, the average transit time t TOF The time-of-flight measurement result t cor If the difference between them is not less than the time difference threshold T*, it is considered that the feature point extraction has a cycle skipping problem; the time difference threshold is the average vibration period T ave 0.9 times; In step S4, when the extraction of feature points has a cycle skipping problem, the average flight time t TOF The time-of-flight measurement result t cor The difference between the two is combined with the average vibration period to estimate the number of jump wave cycles n, the expression of n is: If t TOF -t cor ≥T* If t TOF -t cor ≤-T* Where: [] represents the rounding down operation; Then make corrections based on the specific value of the cycle number n and calculate the corrected characteristic time in: If n = -1, the corrected characteristic time The expression is: If n≤-2, the corrected characteristic time The expression is: If n=1, the corrected characteristic time The expression is: If n≥2, the corrected characteristic time The expression is:

2. The method for measuring the ultrasonic transit time of multiple characteristic points based on the cross-correlation algorithm according to claim 1 is characterized in that In step S1, the received signal processing circuit includes a multi-stage filtering and amplifying circuit for improving the signal-to-noise ratio of the received signal; it also includes a voltage boosting circuit for boosting the voltage of the signal processed by the multi-stage filtering and amplifying circuit to facilitate subsequent AD sampling and feature point extraction.

3. The method for measuring ultrasonic transit time at multiple feature points based on cross-correlation algorithm according to claim 1, characterized in that In step S1, the signal shaping circuit includes a hysteresis comparator circuit and a three-way inverter. The upper and lower limit voltages of the hysteresis comparator circuit are set to a predetermined fixed threshold voltage and a reference voltage, respectively. The received waveform is compared by the hysteresis comparator, and its output is then inverted by the three-way inverter to finally obtain a shaped square wave. The rising edge of the square wave corresponds to the point where the received waveform reaches the threshold, and the falling edge corresponds to the zero crossing point.

4. The method for measuring ultrasonic transit time at multiple feature points based on cross-correlation algorithm according to claim 3 is characterized in that In step S1, the signal shaping circuit includes a shaping circuit resistor R12, an output resistor R13, an adjustable resistor R14, an input resistor R15, a feedback resistor R16, a high-speed comparator U5, an operational amplifier U6 and a three-way inverter U7; one end of the shaping circuit resistor R12 is connected to a +5V power supply, and the other end is connected to a fixed point of the adjustable resistor R14, and the other fixed point of the adjustable resistor R14 is grounded, the movable head is connected to the positive input terminal of the operational amplifier U6, the output terminal of the operational amplifier U6 is connected to the negative input terminal, and the input resistor R1 5 is connected to the output of the operational amplifier U6, and the other end is connected to the positive input of the high-speed comparator U5. The negative input of the high-speed comparator U5 is connected to the received signal. One end of the feedback resistor R16 is connected to the positive input of the high-speed comparator U5, and the other end is connected to the output of the high-speed comparator U5. One end of the output resistor R13 is connected to the output of the high-speed comparator U5, and the other end is connected to the input of the first path of the three-way inverter U7. The shaped square wave signal is output from the output of the first path of the three-way inverter U7.

5. The method for measuring ultrasonic transit time at multiple feature points based on cross-correlation algorithm according to claim 3, characterized in that: In step S1, the method for determining the fixed threshold voltage in the threshold method includes the following steps: S11: selecting multiple flow velocity points covering the entire flow state, and collecting multiple sets of received waveforms at each flow velocity point; S12: extracting the positive peak points of the received waveform at all flow rate points, and drawing a distribution diagram of the positive peak points of the received waveform at different flow rates; S13: According to the positive peak point distribution diagram of the received waveform at each flow rate, a voltage range with the largest interval between the front and rear peak voltages is selected as the threshold voltage.

6. The method for measuring ultrasonic transit time at multiple feature points based on cross-correlation algorithm according to claim 1, characterized in that In step S2, the time detection circuit includes a single-chip microcomputer and a timing chip. The timing chip is set to be falling edge sensitive. The characteristic points corresponding to the falling edges of the first three shaped square waves extracted in step S1 are timed. Each timing result is uploaded to the single-chip microcomputer to obtain the time t of the three consecutive characteristic points. i .

7. The method for measuring ultrasonic transit time at multiple feature points based on cross-correlation algorithm according to claim 1, characterized in that In step S3, it is necessary to collect N groups of static waveforms in static conditions in advance and take the average as the reference waveform. At the same time, the time t of three consecutive characteristic points under N groups of static waveforms is measured by step S2. ki To calculate the average transit time t0 of the reference waveform, the expression is: where t ki represents the time of the i-th characteristic point of the k-th group of static waveforms; Then use the cross-correlation algorithm to calculate the time delay Δt between the received waveform and the reference waveform cor , calculate the transit time measurement result t of the cross-correlation algorithm cor , whose expression is: t cor =Δt cor +t0。 8. The method for measuring ultrasonic transit time at multiple feature points based on cross-correlation algorithm according to claim 1, characterized in that Step S2 and step S3 are controlled and performed simultaneously by the MSP430 chip and the DSP chip respectively. Finally, the data is uploaded to the host computer for fusion and calculation of the average surface flow velocity.

Citation Information

Patent Citations

  • Ultrasonic transit time flowmeter signal processing system

    CN107084763A

  • Gas ultrasonic acoustic flowmeter and hopping wave recognition and correction method thereof

    CN114623890A