Ultrasonic flow detection method and device, electronic equipment and storage medium
By combining the zero-crossing comparison method and the analog-to-digital conversion sampling method, the flight time interval in ultrasonic flow detection is calculated, which solves the problem of signal amplitude jitter-induced wave errors and achieves more accurate flow detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GOLDEN CARD WATER TECH CO LTD
- Filing Date
- 2021-12-29
- Publication Date
- 2026-08-04
AI Technical Summary
In existing ultrasonic flow detection methods, the signal amplitude changes rapidly due to factors such as flow field, noise, and temperature. This causes the fixed threshold to be unable to keep up with the jitter of the echo signal amplitude, resulting in a false echo phenomenon and poor flow detection accuracy.
A method combining zero-crossing comparison and analog-to-digital conversion sampling is adopted. By acquiring the echoes received by the first and second transducers on the fluid channel, the distance between the characteristic wave and the wave after the delayed phase is calculated, and flight time compensation is performed to obtain the compensated flight time. Then, the flow rate is analyzed based on the time difference method.
It improves the accuracy of flow detection, reduces the error in flow calculation caused by false waveforms, and enhances the reliability of detection results.
Smart Images

Figure CN116412864B_ABST
Abstract
Description
Technical Field
[0001] This application relates to detection technology, and more particularly to an ultrasonic flow detection method, apparatus, electronic device, and storage medium. Background Technology
[0002] There are various ultrasonic flow measurement methods, mainly including the time-of-flight method (TOF) and the correlation method. Among them, the TOF method is more widely used due to its simple principle, stable performance, and good adaptability to various application scenarios. The TOF method utilizes the time difference between the propagation of ultrasonic waves in the forward and reverse directions within a flow tube to analyze the fluid velocity information and then calculate the flow volume. The TOF method typically obtains the time of flight by receiving characteristic waves of the signal separately to determine the propagation time of the ultrasonic wave. A common method is the zero-crossing comparison method, which works by setting a fixed threshold and taking the moment when the received echo signal first exceeds the threshold as the propagation time of the sound wave.
[0003] During the propagation of ultrasound in fluids, the signal amplitude changes rapidly due to factors such as flow field, noise, and temperature. The set fixed threshold cannot keep up with the jitter of the echo signal amplitude, which will result in a false echo, manifested as an error in the acquired sound wave propagation time, leading to poor flow detection accuracy. Summary of the Invention
[0004] This application provides an ultrasonic flow detection method, apparatus, electronic device, and storage medium to improve the accuracy of flow detection.
[0005] In a first aspect, this application provides an ultrasonic flow detection method, comprising:
[0006] The first echo received by the first transducer and the second echo received by the second transducer in the fluid channel are acquired. The ultrasonic waves corresponding to the first and second echoes are emitted by the second transducer and the first transducer respectively under the excitation of an excitation signal, wherein the excitation signal includes a delayed phase.
[0007] The first echo and the second echo are respectively used as target echoes, and compensation processing is performed to obtain the compensated flight time. The compensation processing includes: using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively to calculate the first gap and the second gap between the characteristic wave and the wave after the delayed phase in the target echo; and compensating the flight time calculated by the zero-crossing comparison method according to the difference between the first gap and the second gap to obtain the compensated flight time.
[0008] The flow rate of the fluid is obtained based on the compensated flight time and the time difference method.
[0009] Optionally, the step of calculating the first and second spacings between the characteristic wave and the subsequent wave corresponding to the delayed phase in the target echo using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively includes:
[0010] The first spacing is obtained by using the zero-crossing comparison method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the wave after the delayed phase.
[0011] The second spacing is obtained by using the analog-to-digital conversion sampling method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the wave after the delayed phase.
[0012] Optionally, the step of compensating the flight time calculated by the zero-crossing comparison method based on the difference between the first spacing and the second spacing to obtain the compensated flight time includes:
[0013] Using the second spacing as a reference, the difference between the first spacing and the second spacing is obtained; wherein, the difference is the result of subtracting the second spacing from the first spacing;
[0014] If the difference is zero, the flight time calculated by the zero-crossing comparison method shall be used as the compensated flight time.
[0015] If the difference is a positive integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is added to the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0016] If the difference is a negative integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0017] Optionally, the difference being zero includes: the absolute value of the difference not exceeding a preset error range;
[0018] The difference is a positive integer number of excitation signal cycles, including: the difference is positive, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error;
[0019] The difference is a negative integer number of excitation signal cycles, including: the difference is negative, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error.
[0020] Optionally, obtaining the flow rate of the fluid based on the compensated flight time using the time difference method includes:
[0021] Based on the compensated flight time, the downstream flight time and the upstream flight time of the ultrasonic wave in the fluid are calculated.
[0022] The flow velocity of the fluid is calculated based on the downstream flight time and the upstream flight time, as well as the distance between the first transducer and the second transducer.
[0023] The instantaneous flow rate of the fluid is calculated based on the fluid velocity and the effective cross-sectional area of the fluid channel.
[0024] Secondly, this application provides an ultrasonic flow detection device, comprising:
[0025] The waveform acquisition module is used to acquire the first echo received by the first transducer and the second echo received by the second transducer on the fluid channel. The ultrasonic waves corresponding to the first echo and the second echo are emitted by the second transducer and the first transducer respectively under the excitation of an excitation signal, wherein the excitation signal includes a delayed phase.
[0026] The compensation module is used to take the first echo and the second echo as target echoes respectively, perform compensation processing, and obtain the compensated flight time; the compensation processing includes: using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively to calculate the first gap and the second gap between the characteristic wave and the wave after the delayed phase in the target echo; and compensating the flight time calculated by the zero-crossing comparison method according to the difference between the first gap and the second gap to obtain the compensated flight time;
[0027] The flow calculation module is used to obtain the flow rate of the fluid based on the compensated flight time and the time difference method.
[0028] Optionally, the compensation module is specifically used for:
[0029] The first spacing is obtained by using the zero-crossing comparison method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the wave after the delayed phase.
[0030] The second spacing is obtained by using the analog-to-digital conversion sampling method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the wave after the delayed phase.
[0031] Optionally, the compensation module is further configured to:
[0032] Using the second spacing as a reference, the difference between the first spacing and the second spacing is obtained; wherein, the difference is the result of subtracting the second spacing from the first spacing;
[0033] If the difference is zero, the flight time calculated by the zero-crossing comparison method shall be used as the compensated flight time.
[0034] If the difference is a positive integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is added to the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0035] If the difference is a negative integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0036] Optionally, the difference being zero includes: the absolute value of the difference not exceeding a preset error range;
[0037] The difference is a positive integer number of excitation signal cycles, including: the difference is positive, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error;
[0038] The difference is a negative integer number of excitation signal cycles, including: the difference is negative, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error.
[0039] Optionally, the flow calculation module is specifically used for:
[0040] Based on the compensated flight time, the downstream flight time and the upstream flight time of the ultrasonic wave in the fluid are calculated.
[0041] The flow velocity of the fluid is calculated based on the downstream flight time and the upstream flight time, as well as the distance between the first transducer and the second transducer.
[0042] The instantaneous flow rate of the fluid is calculated based on the fluid velocity and the effective cross-sectional area of the fluid channel.
[0043] Thirdly, this application provides an electronic device, comprising:
[0044] At least one processor; and
[0045] A memory communicatively connected to the at least one processor; wherein,
[0046] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0047] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect.
[0048] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0049] This application provides an ultrasonic flow detection method, apparatus, electronic device, and storage medium. The method acquires a first echo received by a first transducer and a second echo received by a second transducer in a fluid channel. The ultrasonic waves corresponding to the first and second echoes are emitted by the second transducer and the first transducer, respectively, under the excitation of an excitation signal containing a delayed phase. The first and second echoes are used as target echoes, and compensation processing is performed to obtain the compensated flight time. Based on the compensated flight time, the flow rate of the fluid is obtained using a time-of-flight method. By adding a delayed phase to the ultrasonic excitation signal and obtaining two characteristic waves based on a threshold level and the delayed phase, the accuracy of flow detection can be improved by comparing and analyzing the time intervals obtained from the two characteristic waves according to different principles using the zero-crossing comparison method and the analog-to-digital conversion sampling method. Attached Figure Description
[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0051] Figure 1 This application provides an example of an application scenario diagram;
[0052] Figure 2 A schematic diagram illustrating the ultrasonic flow detection error phenomenon provided as an example in this application;
[0053] Figure 3 This is a schematic flowchart of an ultrasonic flow detection method provided in Embodiment 1 of this application;
[0054] Figure 4 This is a schematic flowchart of an ultrasonic flow detection method provided in Embodiment 2 of this application;
[0055] Figure 5 This is a schematic flowchart of an ultrasonic flow detection method provided in Embodiment 3 of this application;
[0056] Figure 6 This is a schematic diagram of the structure of an ultrasonic flow detection device provided in Embodiment 4 of this application;
[0057] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application.
[0058] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0059] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0060] Figure 1 The application scenario diagram provided in this application is as follows: Figure 1 As shown, Figure 1 This paper presents the principle of a time-of-flight ultrasonic flow detection method. By setting up transducers A and B, the flight time is measured, and the flow rate is obtained. During normal operation of the ultrasonic flow meter, transducer A emits excitation signals such as square waves. These excitation signals generate sound waves through the piezoelectric effect, which propagate in the fluid, carrying flow velocity information. This sound wave is received by transducer B and then converted into an electrical signal by the inverse piezoelectric effect; this received sound wave signal is the echo signal. By analyzing the propagation time of the sound wave signal and the echo signal in the fluid, the corresponding downstream and upstream times can be obtained. Furthermore, using parameters such as the downstream and upstream times, transducer spacing, and effective cross-sectional area, the instantaneous flow rate can be calculated.
[0061] The time-of-flight method for obtaining time of flight typically determines the propagation time of ultrasound waves by receiving characteristic waves of the signal separately. A common method is the zero-crossing comparison method. Its principle is to use a preset fixed threshold, and the moment when the received echo signal first exceeds the threshold is taken as the propagation time of the sound wave. However, during the propagation of ultrasound in fluids, due to the influence of factors such as flow field, noise, and temperature, the signal amplitude changes rapidly. The preset fixed threshold cannot keep up with the fluctuations in the echo signal amplitude, resulting in misaligned waves. This manifests as an error in the obtained sound wave propagation time, leading to significant errors in water flow measurement. Figure 2 This application provides a schematic diagram illustrating the ultrasonic flow detection error phenomenon, as shown below. Figure 2As shown, the preset threshold level is represented by the solid horizontal line in the figure. The solid line waveform represents the theoretical waveform of the echo signal, while the dashed line waveform represents the waveform where the echo signal jitters. Ideally, the third wave should be used as the reference for calculating the echo time. However, in reality, due to signal amplitude jitter, the second wave becomes the reference for calculating the echo time, resulting in a forward shift in the echo signal waveform. The resulting echo time is one cycle shorter and should be compensated by adding one cycle. Conversely, if the dashed line waveform is used as the theoretical waveform, a backward shift occurs, requiring a subtraction of one cycle for compensation. Therefore, an accurate and simple method for detecting waveform errors is needed to ensure the accuracy of flow calculation. It should be noted that in most cases, ultrasonic water meters will only experience one waveform error, but in some operating conditions, multiple waveform errors may occur. Furthermore, multiple waveform errors may also occur in applications such as ultrasonic gas meters. The single-wave error shown in the figure is merely a representative example and should not be considered limiting. The waveform errors described in this application should encompass all types of waveform errors.
[0062] The technical solutions of this application will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. In the description of this application, unless otherwise expressly specified and limited, the terms should be broadly understood within the art. The embodiments of this application will now be described with reference to the accompanying drawings.
[0063] Example 1
[0064] Figure 3 This is a schematic flowchart of an ultrasonic flow detection method provided in Embodiment 1 of this application, as shown below. Figure 3 As shown, the method includes:
[0065] S101: Acquire the first echo received by the first transducer and the second echo received by the second transducer on the fluid channel;
[0066] S102: Take the first echo and the second echo as target echoes respectively, perform compensation processing, and obtain the compensated flight time;
[0067] S103: Based on the compensated flight time, the flow rate of the fluid is obtained by time difference analysis.
[0068] This embodiment is illustrated with an example in a specific application scenario: First, the first echo received by the first transducer and the second echo received by the second transducer on the fluid channel are acquired. Error detection and time-of-flight compensation tasks are performed based on the echo signals received by the transducers. The ultrasonic waves corresponding to the first and second echoes are emitted by the second transducer and the first transducer, respectively, under the excitation of an excitation signal. The excitation signal is typically a square wave and includes a delayed phase. The delayed phase, as information, can be completely preserved in the acoustic signal and echo signal, and therefore can be used as a characteristic wave for error detection and time-of-flight detection. After acquiring the echo signals, the first echo and the second echo are used as target echoes, respectively, and compensation processing is performed to obtain the compensated time of flight. The compensation process includes: calculating the first and second gaps between the characteristic wave and the delayed phase wave in the target echo using the zero-crossing comparison method and the analog-to-digital conversion sampling method, respectively; compensating the flight time calculated by the zero-crossing comparison method based on the difference between the first and second gaps to obtain the compensated flight time; and finally, analyzing the flow rate of the fluid based on the time difference method according to the compensated flight time.
[0069] For example, the calculation of the first and second gaps between the characteristic wave and the subsequent wave corresponding to the delayed phase in the target echo using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively includes: using the zero-crossing comparison method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the subsequent wave of the delayed phase, to obtain the first gap; and using the analog-to-digital conversion sampling method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the subsequent wave of the delayed phase, to obtain the second gap. Specifically, after the transducer receives the acoustic wave signal, it converts it into an echo signal through the inverse piezoelectric effect. This echo signal is processed simultaneously in the back-end of the circuit by a time-to-digital converter (TDC) and an analog-to-digital converter (ADC). Taking the subsequent wave at the threshold level and the subsequent wave of the delayed phase as two characteristic waves, the first and second gaps can be obtained by detecting the duration between these two characteristic waves using the TDC and ADC respectively. Typically, the characteristic wave can be the subsequent wave at the threshold level. It should be noted that there are other ways to select characteristic waves, such as the two waves following the threshold level and the two waves following the delayed phase. Alternatively, characteristic waves corresponding to other characteristic signals can be selected besides those corresponding to the threshold level and delayed phase, as long as they have certain physical meaning and invariance. There are no restrictions on this, and selection can be made according to the actual situation. By using two different time interval acquisition methods, the time interval between the characteristic wave and the wave following the delayed phase can be acquired, obtaining the first and second intervals, providing raw data for error wave detection.
[0070] This embodiment provides an ultrasonic flow detection method. It acquires a first echo received by a first transducer and a second echo received by a second transducer in a fluid channel. The ultrasonic waves corresponding to the first and second echoes are emitted by the second transducer and the first transducer, respectively, under the excitation of an excitation signal containing a delayed phase. The first and second echoes are used as target echoes, and compensation processing is performed to obtain the compensated flight time. Based on the compensated flight time, the flow rate of the fluid is obtained using a time-of-flight method. By adding a delayed phase to the ultrasonic excitation signal and obtaining two characteristic waves based on a threshold level and the delayed phase, the accuracy of flow detection can be improved by comparing and analyzing the time intervals obtained from the two characteristic waves according to different principles using the zero-crossing comparison method and the analog-to-digital conversion sampling method.
[0071] Example 2
[0072] Figure 4 This is a schematic flowchart of an ultrasonic flow detection method provided in Embodiment 2 of this application, as shown below. Figure 4As shown, based on any other embodiment, S102 specifically includes:
[0073] S201: Using the second spacing as a reference, obtain the difference between the first spacing and the second spacing;
[0074] S211: If the difference is zero, the flight time calculated by the zero-crossing comparison method shall be used as the compensated flight time.
[0075] S212: If the difference is a positive integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is added to the positive integer number of excitation signal cycles as the compensated flight time;
[0076] S213: If the difference is a negative integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0077] This embodiment is illustrated with an example in a specific application scenario: The wave following the threshold level and the wave following the delayed phase are used as two characteristic waves. The duration between these two characteristic waves is detected by TDC and ADC, respectively, to obtain the first spacing and the second spacing. The TDC is also used to detect the time of flight; in principle, if the wave error phenomenon occurs, it will appear on the TDC side. Meanwhile, as long as the ADC device has sufficient accuracy, the obtained duration is usually quite accurate. Therefore, the second spacing measured by the ADC can be used as a benchmark to compare the difference between the first spacing and the second spacing, thereby obtaining the wave error phenomenon reflected by the first spacing obtained by the TDC. The difference is the result of subtracting the second spacing from the first spacing.
[0078] Specifically, if the difference is zero, meaning the first spacing between the characteristic waves obtained by the TDC method is consistent with the second spacing obtained by the ADC, then it is considered that there is no erroneous wave, and the flight time calculated by the zero-crossing comparison method is used as the compensated flight time, i.e., no compensation operation is performed; if the difference is a positive integer number of excitation signal cycles, i.e. Figure 2 For the forward misalignment phenomenon shown, the flight time calculated by the zero-crossing comparison method is added to the positive integer number of excitation signal cycles to obtain the compensated flight time; if the difference is a negative integer number of excitation signal cycles, i.e., the backward misalignment phenomenon as described above, the flight time calculated by the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0079] For example, the difference being zero includes: the absolute value of the difference not exceeding a preset error range; the difference being a positive integer number of excitation signal cycles includes: the difference being positive, and the absolute value of the difference exceeding the difference between a positive integer number of excitation signal cycles and a preset error; the difference being a negative integer number of excitation signal cycles includes: the difference being negative, and the absolute value of the difference exceeding the difference between a positive integer number of excitation signal cycles and a preset error. Due to the influence of calculation errors and sampling accuracy, the obtained flight time and the first and second spacings will deviate slightly from the theory. Therefore, it is necessary to design the compensation strategy to account for the error and reserve a certain error range. Generally speaking, the error range should be much smaller than one theoretical cycle of the sound wave or echo; a feasible value is 0.1 cycles. When the obtained difference falls within the error range of the three expected scenarios mentioned above, it can be considered to conform to the corresponding theoretical situation. That is, when the absolute value of the difference does not exceed the preset error range, the difference is regarded as zero; when the difference is positive and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and the preset error, the difference is regarded as a positive integer number of excitation signal cycles; when the difference is negative and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and the preset error, the difference is regarded as a negative integer number of excitation signal cycles. By designing the preset error range, the different situations in application and in theory are fully considered, improving the feasibility and practicality of the method in the actual application of flow measurement.
[0080] This embodiment provides an ultrasonic flow detection method. Using a second spacing as a reference, the difference between the first spacing and the second spacing is obtained. The difference is the result of subtracting the second spacing from the first spacing. If the difference is zero, the flight time calculated using the zero-crossing comparison method is used as the compensated flight time. If the difference is a positive integer number of excitation signal cycles, the flight time calculated using the zero-crossing comparison method is added to the positive integer number of excitation signal cycles to obtain the compensated flight time. If the difference is a negative integer number of excitation signal cycles, the flight time calculated using the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time. By using the second spacing obtained by the ADC as a reference, the error situation of the first spacing obtained by the TDC can be determined, improving the accuracy of error detection. This, in turn, compensates for the flight time obtained by the zero-crossing comparison method, achieving flight time correction and improving the accuracy of flow detection.
[0081] Example 3
[0082] Figure 5 This is a schematic flowchart of an ultrasonic flow detection method provided in Embodiment 3 of this application, as shown below. Figure 5As shown, based on any other embodiment, S103 specifically includes:
[0083] S301: Based on the compensated flight time, calculate the downstream flight time and the upstream flight time of the ultrasonic wave in the fluid.
[0084] S302: Calculate the flow velocity of the fluid based on the downstream flight time and the upstream flight time, as well as the distance between the first transducer and the second transducer;
[0085] S303: Calculate the instantaneous flow rate of the fluid based on the fluid velocity and the effective cross-sectional area of the fluid channel.
[0086] This embodiment is illustrated with an example in a specific application scenario: The purpose of the aforementioned fault detection is to compensate for the flight time obtained by the zero-crossing comparison method, thereby obtaining accurate downstream and upstream flight times, and calculating the flow rate based on other parameters. Specifically, based on the compensated flight time, the downstream and upstream flight times of the ultrasonic wave propagating in the fluid are calculated. It should be noted that the definitions of downstream and upstream directions should be based on actual application. For example, when the first transducer is upstream of the second transducer in the fluid direction, the first echo received should be an upstream echo, and the corresponding time is the upstream flight time; conversely, the same applies. Based on the downstream and upstream flight times, and the distance between the first and second transducers, the flow velocity of the fluid can be calculated, and the instantaneous flow rate of the fluid can be calculated based on the flow velocity and the effective cross-sectional area of the fluid channel.
[0087] This embodiment provides an ultrasonic flow rate detection method. Based on the compensated flight time, the method calculates the downstream and upstream flight times of the ultrasonic wave propagating in the fluid. Then, based on the downstream and upstream flight times, and the distance between the first and second transducers, the method calculates the fluid velocity. Finally, based on the fluid velocity and the effective cross-sectional area of the fluid channel, the method calculates the instantaneous flow rate of the fluid. By using the compensated flight time and other relevant parameters to calculate the flow rate, the method significantly reduces the errors that may arise from the time-of-flight error method, thereby improving the accuracy of flow rate detection.
[0088] Example 4
[0089] Embodiment 4 of this application also provides an ultrasonic flow detection device to implement the aforementioned method. Figure 6 This is a schematic diagram of the ultrasonic flow detection device provided in Embodiment 5 of this application, as shown below. Figure 6As shown, based on any other embodiment, the apparatus includes:
[0090] The waveform acquisition module 41 is used to acquire the first echo received by the first transducer and the second echo received by the second transducer on the fluid channel. The ultrasonic waves corresponding to the first echo and the second echo are emitted by the second transducer and the first transducer respectively under the excitation of an excitation signal, wherein the excitation signal includes a delayed phase.
[0091] Compensation module 42 is used to take the first echo and the second echo as target echoes respectively, perform compensation processing, and obtain the compensated flight time; the compensation processing includes: using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively to calculate the first gap and the second gap between the characteristic wave and the delayed phase wave in the target echo; and compensating the flight time calculated by the zero-crossing comparison method according to the difference between the first gap and the second gap to obtain the compensated flight time.
[0092] The flow calculation module 43 is used to obtain the flow rate of the fluid based on the time difference method according to the compensated flight time.
[0093] It should be noted that the various implementation methods provided in this embodiment can be combined and implemented.
[0094] For example, compensation module 42 is specifically used for:
[0095] The first spacing is obtained by using the zero-crossing comparison method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the wave after the delayed phase.
[0096] The second spacing is obtained by using the analog-to-digital conversion sampling method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the wave after the delay phase.
[0097] When the transducer receives the acoustic signal, it converts it into an echo signal through the inverse piezoelectric effect. This echo signal is routed to the compensation module 42 in two separate circuits, specifically processed by the TDC and ADC simultaneously at the back end of the circuit. Using the wave following the threshold level and the wave following the delayed phase as two characteristic waves, the duration between these two characteristic waves is detected by the TDC and ADC respectively, yielding the first and second intervals. By employing two time interval acquisition methods based on different principles, the time interval between the characteristic wave and the wave following the delayed phase can be acquired, providing the first and second intervals and raw data for error wave detection.
[0098] As an example, compensation module 42 is also used for:
[0099] Using the second spacing as a reference, the difference between the first spacing and the second spacing is obtained; wherein, the difference is the result of subtracting the second spacing from the first spacing;
[0100] If the difference is zero, the flight time calculated by the zero-crossing comparison method shall be used as the compensated flight time.
[0101] If the difference is a positive integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is added to the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0102] If the difference is a negative integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time.
[0103] Using the wave following the threshold level and the wave following the delayed phase as two characteristic waves, the duration between these two characteristic waves is detected by TDC and ADC, respectively, to obtain the first gap and the second gap. The second gap measured by the ADC can be used as a reference to compare the difference between the first gap and the second gap, thereby obtaining the wave error phenomenon reflected by the first gap obtained by TDC.
[0104] Using the second gap obtained by the ADC as a reference, the error situation of the first gap obtained by the TDC can be determined, which improves the accuracy of error detection. In addition, the flight time obtained by the zero-crossing comparison method can be compensated, and the flight time can be corrected, thus improving the accuracy of flow detection.
[0105] As an example, the difference being zero includes: the absolute value of the difference not exceeding a preset error range;
[0106] The difference is a positive integer number of excitation signal cycles, including: the difference is positive, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error;
[0107] The difference is a negative integer number of excitation signal cycles, including: the difference is negative, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error.
[0108] Due to calculation errors and sampling accuracy, the obtained flight time, as well as the first and second spacings, will deviate slightly from the theoretical values. Therefore, it is necessary to design the compensation strategy to account for these errors and reserve a certain error range. By designing a preset error range, the differences between the actual application and the theoretical conditions are fully considered, thus improving the feasibility and practicality of the method in actual flow detection applications.
[0109] One example, the flow calculation module 43, is specifically used for:
[0110] Based on the compensated flight time, the downstream flight time and the upstream flight time of the ultrasonic wave in the fluid are calculated.
[0111] The flow velocity of the fluid is calculated based on the downstream flight time and the upstream flight time, as well as the distance between the first transducer and the second transducer.
[0112] The instantaneous flow rate of the fluid is calculated based on the fluid velocity and the effective cross-sectional area of the fluid channel.
[0113] By calculating the flow rate using compensated flight time and other relevant parameters, the errors that may be caused by the time difference method for calculating flow rate can be significantly reduced, thereby improving the accuracy of flow rate detection.
[0114] This embodiment provides an ultrasonic flow detection device, comprising a waveform acquisition module for acquiring a first echo received by a first transducer and a second echo received by a second transducer on a fluid channel. The ultrasonic waves corresponding to the first and second echoes are emitted by the second transducer and the first transducer, respectively, under the excitation of an excitation signal, which includes a delayed phase. A compensation module is used to take the first and second echoes as target echoes and perform compensation processing to obtain a compensated flight time. The compensation processing includes: calculating a first gap and a second gap between the characteristic wave and the wave following the delayed phase in the target echo using a zero-crossing comparison method and an analog-to-digital conversion sampling method, respectively; compensating the flight time calculated by the zero-crossing comparison method based on the difference between the first and second gaps to obtain the compensated flight time; and a flow calculation module for analyzing the flow rate of the fluid based on the compensated flight time using a time-difference method. By adding a delayed phase to the ultrasonic excitation signal and obtaining two characteristic waves based on a threshold level and the delayed phase, and comparing and analyzing the time intervals obtained by the two characteristic waves according to different principles using the zero-crossing comparison method and the analog-to-digital conversion sampling method, the accuracy of flow detection can be improved.
[0115] Example 5
[0116] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application, as shown below. Figure 7 As shown, the electronic device includes:
[0117] The electronic device includes a processor 291 and a memory 292; it may also include a communication interface 293 and a bus 294. The processor 291, memory 292, and communication interface 293 can communicate with each other via the bus 294. The communication interface 293 can be used for information transmission. The processor 291 can invoke logical instructions stored in the memory 294 to execute the methods of the above embodiments.
[0118] Furthermore, the logic instructions in the aforementioned memory 292 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0119] The memory 292, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, thereby implementing the methods in the above-described method embodiments.
[0120] The memory 292 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 292 may include high-speed random access memory and may also include non-volatile memory.
[0121] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods described in any of the embodiments.
[0122] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in the above embodiments.
[0123] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0124] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. An ultrasonic flow rate detection method, characterized in that, include: The first echo received by the first transducer and the second echo received by the second transducer in the fluid channel are acquired. The ultrasonic waves corresponding to the first and second echoes are emitted by the second transducer and the first transducer respectively under the excitation of an excitation signal, wherein the excitation signal includes a delayed phase. The first echo and the second echo are respectively used as target echoes, and compensation processing is performed to obtain the compensated flight time. The compensation processing includes: using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively to calculate the first gap and the second gap between the characteristic wave and the subsequent wave corresponding to the delayed phase in the target echo; and compensating the flight time calculated by the zero-crossing comparison method according to the difference between the first gap and the second gap to obtain the compensated flight time. The flow rate of the fluid is obtained based on the compensated flight time and the time difference method. The calculation of the first and second gaps between the characteristic wave and the subsequent wave corresponding to the delayed phase in the target echo, using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively, includes: The first spacing is obtained by using the zero-crossing comparison method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the subsequent wave corresponding to the delayed phase. The second spacing is obtained by using the analog-to-digital conversion sampling method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the subsequent wave corresponding to the delayed phase. The step of compensating the flight time calculated by the zero-crossing comparison method based on the difference between the first spacing and the second spacing to obtain the compensated flight time includes: Using the second spacing as a reference, the difference between the first spacing and the second spacing is obtained; wherein, the difference is the result of subtracting the second spacing from the first spacing; If the difference is zero, the flight time calculated by the zero-crossing comparison method shall be used as the compensated flight time. If the difference is a positive integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is added to the positive integer number of excitation signal cycles to obtain the compensated flight time. If the difference is a negative integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time.
2. The method according to claim 1, characterized in that, The difference being zero includes: the absolute value of the difference not exceeding a preset error range; The difference is a positive integer number of excitation signal cycles, including: the difference is positive, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error; The difference is a negative integer number of excitation signal cycles, including: the difference is negative, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error.
3. The method according to claim 1 or 2, characterized in that, The step of obtaining the flow rate of the fluid based on the compensated flight time and using the time difference method includes: Based on the compensated flight time, the downstream flight time and the upstream flight time of the ultrasonic wave in the fluid are calculated. The flow velocity of the fluid is calculated based on the downstream flight time and the upstream flight time, as well as the distance between the first transducer and the second transducer. The instantaneous flow rate of the fluid is calculated based on the fluid velocity and the effective cross-sectional area of the fluid channel.
4. An ultrasonic flow detection device, characterized in that, include: The waveform acquisition module is used to acquire the first echo received by the first transducer and the second echo received by the second transducer on the fluid channel. The ultrasonic waves corresponding to the first echo and the second echo are emitted by the second transducer and the first transducer respectively under the excitation of an excitation signal, wherein the excitation signal includes a delayed phase. The compensation module is used to take the first echo and the second echo as target echoes respectively, perform compensation processing, and obtain the compensated flight time; the compensation processing includes: using the zero-crossing comparison method and the analog-to-digital conversion sampling method respectively to calculate the first gap and the second gap between the characteristic wave and the subsequent wave corresponding to the delayed phase in the target echo; and compensating the flight time calculated by the zero-crossing comparison method according to the difference between the first gap and the second gap to obtain the compensated flight time; The flow calculation module is used to obtain the flow rate of the fluid based on the compensated flight time and the time difference method. The compensation module is specifically used for: The first spacing is obtained by using the zero-crossing comparison method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the subsequent wave corresponding to the delayed phase. The second spacing is obtained by using the analog-to-digital conversion sampling method to calculate the difference between the time of the zero-crossing point of the characteristic wave in the target echo and the time of the zero-crossing point of the subsequent wave corresponding to the delayed phase. Using the second spacing as a reference, the difference between the first spacing and the second spacing is obtained; wherein, the difference is the result of subtracting the second spacing from the first spacing; If the difference is zero, the flight time calculated by the zero-crossing comparison method shall be used as the compensated flight time. If the difference is a positive integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is added to the positive integer number of excitation signal cycles to obtain the compensated flight time. If the difference is a negative integer number of excitation signal cycles, then the flight time calculated by the zero-crossing comparison method is subtracted from the positive integer number of excitation signal cycles to obtain the compensated flight time.
5. The apparatus according to claim 4, characterized in that, The difference being zero includes: the absolute value of the difference not exceeding a preset error range; The difference is a positive integer number of excitation signal cycles, including: the difference is positive, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error; The difference is a negative integer number of excitation signal cycles, including: the difference is negative, and the absolute value of the difference exceeds the difference between a positive integer number of excitation signal cycles and a preset error.
6. The apparatus according to claim 4 or 5, characterized in that, The flow calculation module is specifically used for: Based on the compensated flight time, the downstream flight time and the upstream flight time of the ultrasonic wave in the fluid are calculated. The flow velocity of the fluid is calculated based on the downstream flight time and the upstream flight time, as well as the distance between the first transducer and the second transducer. The instantaneous flow rate of the fluid is calculated based on the fluid velocity and the effective cross-sectional area of the fluid channel.
7. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-3.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-3.
9. A computer program product comprising a computer program that, when executed by a processor, implements the method as described in any one of claims 1-3.