A method for synchronously measuring ultrasonic transit time

By using the main and auxiliary synchronous measurement method of microcontroller and time chip in ultrasonic transit time measurement, combined with variable threshold algorithm, the problem of measurement accuracy and cost in the prior art is solved, and efficient and low-cost ultrasonic transit time is achieved Measurement.

CN115014453BActive Publication Date: 2025-02-18CHINA COAL TECH & ENG GRP CHONGQING RES INST CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210869750.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-02-18
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The existing ultrasonic transit time measurement methods have shortcomings in terms of accuracy and cost, with high hardware costs, large power consumption or complex circuit design.

Method used

A method of ultrasonic crossing time main and auxiliary synchronous measurement is adopted, sampling is performed through the microcontroller's own ADC, and the zero-crossing time interval is predicted in combination with a variable threshold algorithm, supplemented by the time chip to obtain the exact zero-crossing time, and finally according to the ultrasonic signal period and hardware delay calculation of the transit time.

Benefits of technology

It achieves high time measurement resolution, low cost and power consumption, high integration, few circuit components and low power consumption, and is suitable for a wide range of applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115014453B_ABST
    Figure CN115014453B_ABST
Patent Text Reader

Abstract

The invention relates to a main-auxiliary synchronous measurement method for ultrasonic transit time, which belongs to the field of flow measurement and comprises a main process and an auxiliary process; the main process is: S1: filtering, amplifying and conditioning an ultrasonic signal; S2: adopting an ADC provided by a single-chip microcomputer to sample the processed ultrasonic signal; S3: searching for the local peak value and peak time of the rising edge of an envelope signal for the sampled signal, adopting a variable threshold algorithm, and pre-judging a relatively rough zero-crossing time interval; the auxiliary process is: adopting a time chip to calculate the zero-crossing time of an ultrasonic signal, and obtaining three precise zero-crossing time moments; the main process and the auxiliary process are carried out synchronously, and finally the ultrasonic transit time tof is calculated according to the ultrasonic signal period T and the hardware delay τ.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of flow measurement and relates to a main-auxiliary synchronous measurement method of ultrasonic transit time. Background Art

[0002] The time from sending the excitation signal to receiving the first ultrasonic signal is called the ultrasonic transit time tof. The ultrasonic transit time tof of the downstream and upstream processes is s and tof n It is a key factor affecting the measurement accuracy. Taking DN50 pipe diameter and ultrasonic signal frequency of 200kHz as an example, when the ideal wind speed is 5m / s, if the reverse flow tof n A detection deviation of 1us will result in a flow velocity deviation of about 115%, so the wave transit time tof needs to be increased as much as possible. s and tof n Measurement accuracy.

[0003] The first existing measurement method is to build a parallel acquisition system of intermediate frequency digitalization of FPGA combined with high-speed ADC. The FPGA operating frequency can reach 200MHz, and the high-speed ADC sampling frequency can reach 100MHz. According to the discretized sampling data, a higher time resolution can be obtained, and its resolution can reach ten nanoseconds. The disadvantages of this solution are high hardware cost and high power consumption. The second existing measurement method is to use a peak holding circuit composed of an operational amplifier, a zero-crossing comparison circuit, and a single-chip timer time capture unit for peak extraction and zero-crossing point detection. This solution has low hardware cost and low power consumption, but it has many discrete electronic components and a relatively complex circuit design. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a method for primary-auxiliary synchronous measurement of ultrasonic transit time.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A method for main-auxiliary synchronous measurement of ultrasonic transit time, comprising a main process and an auxiliary process;

[0007] The main process is:

[0008] S1: Filter, amplify and condition the ultrasonic signal;

[0009] S2: Use the ADC built into the microcontroller to sample the processed ultrasonic signal;

[0010] S3: for the sampled signal, search for the local peak value and peak time of the rising edge of the envelope signal, and use a variable threshold algorithm to predict a relatively rough zero-crossing time interval;

[0011] The auxiliary process is: using a time chip to calculate the zero-crossing point of the ultrasonic signal to obtain three precise zero-crossing point moments;

[0012] The main process and the auxiliary process are performed synchronously, and finally the ultrasonic transit time tof is calculated according to the ultrasonic signal period T and the hardware delay τ.

[0013] Furthermore, in the main process, the sampling frequency of the ADC built into the single-chip microcomputer is configured to be 1 MHz to 8 MHz.

[0014] Furthermore, the variable threshold algorithm specifically includes:

[0015] S11: Searching for waveform peaks p1-pm and corresponding times, which are recorded as Vp(i) and Tp(i), respectively, where i is 1-m;

[0016] S12: Set the relative threshold K, and calculate the amplitude comparison threshold K*Vp(m) in combination with the maximum peak value Vp(m);

[0017] S13: Search for the characteristic time interval [Tp(x), Tp(y)] where the received waveform intersects the comparison threshold for the first time, recorded as [T_L, T_H].

[0018] Furthermore, the auxiliary process specifically includes the following steps:

[0019] S4: The ultrasonic signal after filtering, amplification and conditioning is connected to the time detection circuit and the threshold comparison circuit respectively;

[0020] S5: The sampling signal is compared and output through the threshold comparison circuit and connected to the microcontroller. When the amplitude of the ultrasonic signal is higher than the threshold K2, a rising edge trigger signal is generated to enter the external interrupt of the microcontroller.

[0021] S6: A high-level signal is generated in the interrupt function and connected to the time chip through the IO pin output, which serves as a window enable signal to start the time detection circuit;

[0022] S7: The MCU reads the data register of the time chip through the SPI instruction and obtains three precise zero-crossing time data t1, t2, and t3.

[0023] Furthermore, the comparison output of the threshold comparison circuit is connected to an external interrupt pin of the single chip microcomputer, and the threshold setting range is 200mV to 1000mV.

[0024] Furthermore, the threshold comparison circuit is composed of a comparator.

[0025] Furthermore, the threshold comparison circuit is composed of an analog watchdog built into the single chip microcomputer.

[0026] Furthermore, the ultrasonic transit time Tof is obtained by combining the characteristic time interval [T_L, T_H] obtained by the main process measurement and the zero-crossing time t1, t2, t3 obtained by the auxiliary process measurement, and according to the ultrasonic signal period T and the hardware delay τ. The specific steps are as follows:

[0027] S8: Calculate the average value of t1, t2, and t3, recorded as t_aver;

[0028] S9: According to T_L≤(t_aver-n*T)≤T_H, determine the number of compensation cycles n;

[0029] S10: Determine the ultrasonic transit time tof=t_aver-n*T-τ;

[0030] S11: measure the downstream transit time tof respectively s and the upstream transit time tof n , and then realize the flow velocity and flow measurement according to the following formula:

[0031]

[0032]

[0033] Where: L is the length of the sound channel; v is the fluid velocity; θ is the angle between the sound channel and the pipeline axis; q is the instantaneous flow rate; and D is the inner diameter of the pipeline.

[0034] The beneficial effects of the present invention are: the present invention can achieve high time measurement resolution by prejudging the zero-crossing time interval and obtaining accurate zero-crossing time, and the cost and power consumption are low. The present invention directly adopts ADC to measure the peak value, adopts zero-crossing comparison circuit and time chip to measure the zero-crossing point, and adopts relative threshold algorithm to calculate the zero-crossing point lock, and has high measurement accuracy, high integration, few circuit elements, low power consumption, and can be widely promoted and applied.

[0035] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0037] Figure 1 It is the ultrasonic receiving waveform diagram;

[0038] Figure 2This is the schematic diagram of ultrasonic flow measurement;

[0039] Figure 3 It is the overall flow chart of the present invention;

[0040] Figure 4 The main process measurement circuit structure diagram;

[0041] Figure 5 It is the ultrasonic sampling waveform diagram;

[0042] Figure 6 It is the main process algorithm flow chart;

[0043] Figure 7 It is the auxiliary process measurement circuit;

[0044] Figure 8 This is a schematic diagram of zero-crossing detection. DETAILED DESCRIPTION

[0045] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0046] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0047] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0048] The time from sending the excitation signal to receiving the first ultrasonic signal is called the ultrasonic transit time tof. Figure 1 As shown, by alternately measuring the ultrasonic transit time tof in the downstream and upstream processes in the fluid s and tof n , the velocity and flow rate of the fluid in the pipeline can be calculated. The ultrasonic flow measurement principle is as follows Figure 2 shown.

[0049]

[0050]

[0051] Where: L is the length of the sound channel; v is the fluid velocity; θ is the angle between the sound channel and the pipeline axis; q is the instantaneous flow rate; and D is the inner diameter of the pipeline.

[0052] like Figure 3 As shown, the present invention provides a main-auxiliary synchronous measurement method for ultrasonic transit time, which adopts the low-speed ADC of the single-chip microcomputer to sample the ultrasonic signal after filtering, amplification and conditioning, searches the local peak value and peak time of the rising edge of the envelope for the sampling signal software, adopts the variable threshold algorithm, and predicts to obtain a relatively rough zero-crossing time interval Time_L~Time_H, which is the main process; at the same time, adopts the TDC-GP22 time chip to calculate the zero-crossing point of the ultrasonic signal, and obtains 3 precise zero-crossing time points t1, t2, t3, which is the auxiliary process; the main and auxiliary processes work synchronously in parallel, and finally according to the ultrasonic signal period T and the hardware delay τ, the ultrasonic transit time tof can be accurately locked.

[0053] The main process measurement circuit structure is as follows Figure 4 As shown, first, the ultrasonic signal sampling after filtering, amplification and conditioning is directly connected to the ADC of the microcontroller STM32F103, and the ADC sampling frequency is configured to 2MHz (it can be configured in the range of 1MHz to 8MHz). The ADC samples the ultrasonic signal in real time and stores it for subsequent signal processing.

[0054] Secondly, the software searches for the local peak value and peak time of the rising edge of the envelope signal for the stored sampling signal, and uses a variable threshold algorithm to predict a relatively rough zero-crossing time interval. This process is the main process.

[0055] The ultrasonic receiving waveform after sampling and storage is as follows Figure 5 shown.

[0056] The specific steps of the main process are as follows:

[0057] a. Search for waveform peaks P1 to P7 and the corresponding times, denoted as Vp(i) and Tp(i), where i is 1 to 7;

[0058] b. Set the relative threshold K, and calculate the amplitude comparison threshold K*Vp(7) in combination with the maximum peak value Vp(7);

[0059] c. Search for the characteristic time interval [Tp(3), Tp(4)] where the received waveform intersects the comparison threshold for the first time, recorded as [T_L, T_H].

[0060] The main process algorithm flow is as follows Figure 6 As shown, after searching and obtaining the characteristic time interval [T_L, T_H], wait for the transit time measurement auxiliary process to perform accurate zero-crossing point detection.

[0061] The auxiliary process measurement circuit structure is as follows Figure 7 As shown. First, the ultrasonic signal sampling after filtering, amplification and conditioning is directly connected to the time chip TDC-GP22. The threshold comparison circuit is composed of a comparator (to further reduce the peripheral circuit, it can also be composed of an analog watchdog built into the microcontroller), and its comparison output is connected to the external interrupt pin of the STM32 microcontroller. Secondly, the threshold is set to 500mV (200~1000mV). The threshold here is different from the software threshold of the previous main process. The threshold here can be a hardware threshold, which is used as a noise shielding threshold. When the ultrasonic signal amplitude is higher than the threshold K2, a rising edge trigger signal is generated to enter the external interrupt of the microcontroller. A 50us wide high-level signal is generated in the interrupt function, and is connected to the en_stop pin of the TDC time chip through the IO pin output. It is used as a window enable signal to start the TDC time detection circuit, and then the data register of TDC-GP22 is read through the SPI instruction to obtain 3 accurate zero-crossing time data t1, t2, and t3.

[0062] according to Figure 8 , combined with the characteristic time interval [T_L, T_H] obtained by the main process measurement and the zero-crossing time t1, t2, t3 obtained by the auxiliary process measurement, as well as the ultrasonic signal period T and the hardware delay τ, the ultrasonic transit time Tof can be accurately locked. The specific steps are as follows:

[0063] a. Calculate the average value of t1, t2, and t3, recorded as t_aver;

[0064] b. According to T_L≤(t_aver-n*T)≤T_H, determine the number of compensation cycles n;

[0065] c. Determine the ultrasonic transit time tof = t_aver-n*T–τ.

[0066] According to the above rules, the transit time tof of downstream and upstream is measured respectively. s and tof n, and then according to formula (1-2), flow velocity and flow measurement can be achieved.

[0067] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A method for synchronously measuring ultrasonic transit time, characterized in that: Includes main process and auxiliary process; The main process is: S1: Filter, amplify and condition the ultrasonic signal; S2: Use the ADC built into the microcontroller to sample the processed ultrasonic signal; S3: for the sampled signal, search for the local peak value and peak time of the rising edge of the envelope signal, and use a variable threshold algorithm to predict a relatively rough zero-crossing time interval; The variable threshold algorithm specifically includes: S1-1: Search for the waveform peak value p1~pm and the corresponding time, which are recorded as Vp(i) and Tp(i), respectively, where i is 1~m; S1-2: Set the relative threshold K, and calculate the amplitude comparison threshold K×Vp(m) in combination with the maximum peak value Vp(m); S1-3: Search for the characteristic time interval [Tp(x), Tp(y)] where the received waveform intersects the comparison threshold for the first time, recorded as [T_L, T_H]; The auxiliary process is: using a time chip to calculate the zero-crossing point of the ultrasonic signal to obtain three precise zero-crossing point moments; the auxiliary process specifically includes the following steps: S4: The ultrasonic signal after filtering, amplification and conditioning is connected to the time detection circuit and the threshold comparison circuit respectively; S5: The sampling signal is compared and output through the threshold comparison circuit and connected to the microcontroller. When the amplitude of the ultrasonic signal is higher than the threshold K2, a rising edge trigger signal is generated to enter the external interrupt of the microcontroller. S6: A high-level signal is generated in the interrupt function and connected to the time chip through the IO pin output, which serves as a window enable signal to start the time detection circuit; S7: The MCU reads the data register of the time chip through the SPI instruction to obtain three accurate zero-crossing time data t1, t2, t3; The main process and the auxiliary process are carried out synchronously, and finally the ultrasonic transit time is calculated according to the ultrasonic signal period T and the hardware delay τ. ; Combine the characteristic time interval [T_L, T_H] obtained by the main process measurement and the zero-crossing time t1, t2, t3 obtained by the auxiliary process measurement, and the ultrasonic signal period T and hardware delay τ to obtain the ultrasonic transit time tof. The specific steps are as follows: S8: Calculate the average value of t1, t2, and t3, recorded as t_aver; S9: According to T_L≤(t_aver-n×T)≤T_H, determine the number of compensation cycles n; S10: Determine the ultrasonic transit time tof = t_aver-n×T-τ; S11: Measure downstream transit time separately and upstream transit time , and then realize the flow velocity and flow measurement according to the following formula: Where: is the vocal tract length; is the fluid velocity; is the angle between the sound channel and the pipe axis, is the instantaneous flow rate; is the inside diameter of the pipe.

2. The ultrasonic transit time master-slave synchronous measurement method according to claim 1, characterized in that: In the main process, the sampling frequency of the ADC built into the single-chip microcomputer is configured to be 1 MHz to 8 MHz.

3. The ultrasonic transit time master-slave synchronous measurement method according to claim 1, characterized in that: The comparison output of the threshold comparison circuit is connected to the external interrupt pin of the single chip microcomputer, and the threshold setting range is 200mV~1000mV.

4. The ultrasonic transit time master-slave synchronous measurement method according to claim 3 is characterized in that: The threshold comparison circuit is composed of a comparator.

5. The method for synchronously measuring the ultrasonic transit time according to claim 3, characterized in that: The threshold comparison circuit is composed of an analog watchdog built into the single chip microcomputer.

Citation Information

Patent Citations

  • Coal mine underground double-card-reader accurate personnel positioning method

    CN115278534A