Head wave threshold processing method, ultrasonic flow device and chip
By using the first wave threshold processing method in the ultrasonic flowmeter, the forward and reverse first wave thresholds are automatically determined, which solves the problems of low efficiency and high cost of manual determination of first wave thresholds in the prior art, and achieves more efficient and accurate flow measurement.
Patent Information
- Application Number
- CN202411866691.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-18
AI Technical Summary
In existing ultrasonic flowmeters, the determination of the first wave threshold depends on manual operation, resulting in high labor costs and low efficiency.
A first wave threshold processing method is adopted to identify the first wave signal based on the forward initial threshold and the reverse initial threshold, obtain the peak value of the echo signal, calculate the peak value difference, and determine the target peak value difference, thereby automatically determining the forward and reverse first wave threshold values.
The automatic determination of the first wave threshold is realized, which reduces labor costs, improves the determination efficiency of the first wave threshold, reduces errors, and improves the accuracy of the ultrasonic flowmeter.
Smart Images

Figure CN119845366A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of flow measurement, and in particular to a first wave threshold processing method, an ultrasonic flow device and a chip. Background Art
[0002] At present, ultrasonic flowmeter is a new type of flowmeter that detects the time difference between upstream and downstream caused by the change in the speed of ultrasonic signals when they propagate upstream and downstream in the fluid, analyzes and processes the flow rate of the fluid to be measured, and further determines the flow rate of the fluid. When measuring flow, in the process of determining the time difference between upstream and downstream, the first wave threshold needs to be used to identify the first echo signal.
[0003] In the related art, the first wave threshold value for the ultrasonic flow meter is often determined manually, which has high labor costs and low efficiency in determining the first wave threshold value. Summary of the invention
[0004] The embodiments of the present invention provide a first wave threshold processing method, an ultrasonic flow device and a chip, which can solve the problems of high labor cost and low efficiency in determining the first wave threshold.
[0005] In order to solve the above problem, an embodiment of the present invention discloses a first wave threshold processing method, the method comprising:
[0006] Identifying the first wave signal in the forward measurement process based on the forward initial threshold, and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold;
[0007] When the first wave signal in the forward measurement process is identified, the peak values of the multiple echo signals in the forward measurement process are obtained to obtain multiple forward peak values; and, when the first wave signal in the reverse measurement process is identified, the peak values of the multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peak values;
[0008] Determine a peak difference between adjacent peaks in the plurality of forward peaks to obtain a forward peak difference, and determine a peak difference between adjacent peaks in the plurality of reverse peaks to obtain a reverse peak difference;
[0009] Determine a target peak difference based on the peak difference in the forward peak difference and the peak difference in the reverse peak difference with the same corresponding signal sequence number;
[0010] A forward first wave threshold and a reverse first wave threshold are determined based on the target peak difference.
[0011] On the other hand, an embodiment of the present invention discloses an ultrasonic flow device, the device comprising:
[0012] Two ultrasonic transducers arranged at intervals in the direction of the fluid for sending and receiving ultrasonic information;
[0013] a time-to-digital converter, for measuring an ultrasonic time difference of the ultrasonic signal;
[0014] The controller is configured as:
[0015] Identifying the first wave signal in the forward measurement process based on the forward initial threshold, and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold;
[0016] When the first wave signal in the forward measurement process is identified, the peak values of the multiple echo signals in the forward measurement process are obtained to obtain multiple forward peak values; and, when the first wave signal in the reverse measurement process is identified, the peak values of the multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peak values;
[0017] Determine a peak difference between adjacent peaks in the plurality of forward peaks to obtain a forward peak difference, and determine a peak difference between adjacent peaks in the plurality of reverse peaks to obtain a reverse peak difference;
[0018] Determine a target peak difference based on the peak difference in the forward peak difference and the peak difference in the reverse peak difference with the same corresponding signal sequence number;
[0019] A forward first wave threshold and a reverse first wave threshold are determined based on the target peak value difference to obtain a first wave threshold, and the fluid flow is measured using the first wave threshold and the ultrasonic time difference measured by the time-to-digital converter.
[0020] On the other hand, an embodiment of the present invention discloses a chip, wherein the chip integrates the above ultrasonic flow device.
[0021] The embodiment of the present invention includes the following advantages: In the first wave threshold processing method provided by the embodiment of the present invention, the first wave signal in the forward measurement process is identified based on the forward initial threshold, and the first wave signal in the reverse measurement process is identified based on the reverse initial threshold. In the case of identifying the first wave signal in the forward measurement process, the peak values of multiple echo signals in the forward measurement process are obtained to obtain multiple forward peaks, and, in the case of identifying the first wave signal in the reverse measurement process, the peak values of multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peaks. The peak difference between adjacent peaks in the multiple forward peaks is determined to obtain the forward peak difference, and the peak difference between adjacent peaks in the multiple reverse peaks is determined to obtain the reverse peak difference. Based on the peak difference of the forward peak difference and the peak difference of the reverse peak difference with the same corresponding signal sequence number, the target peak difference is determined. The forward first wave threshold and the reverse first wave threshold are determined based on the target peak difference. In this way, the determination of the first wave threshold can be realized automatically, thereby reducing the labor cost and improving the efficiency of determining the first wave threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0023] Figure 1 It is a schematic diagram of the propagation of an ultrasonic signal;
[0024] Figure 2 It is a waveform diagram of an echo signal;
[0025] Figure 3 is a flowchart of the steps of a first wave threshold processing method provided by an embodiment of the present invention;
[0026] Figure 4 is a waveform diagram of another echo signal provided by an embodiment of the present invention;
[0027] Figure 5 1 is a schematic diagram of a process for setting a first wave threshold provided by an embodiment of the present invention;
[0028] Figure 6 It is a schematic diagram of a first wave threshold adjustment process provided by an embodiment of the present invention;
[0029] Figure 7 It is a block diagram of an ultrasonic flow device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The embodiment of the present invention can be applied to ultrasonic fluid flow measurement scenarios. First, the measurement principle of fluid flow measurement is described. Figure 1 It is a schematic diagram of the propagation of an ultrasonic signal, in which an ultrasonic transducer R2 and an ultrasonic transducer R1 are sequentially arranged along the flow direction of the fluid. Correspondingly, the ultrasonic transducer R2 and the ultrasonic transducer R1 are the upstream transducer and the downstream transducer, respectively. The two plane reflectors on the inner side of the pipe section: M1 and M2, are used to realize the reflection propagation of the ultrasonic signal. Specifically, the ultrasonic signal emitted by R2 can be reflected by M1 so that the ultrasonic signal is parallel to the direction of the fluid, and then reflected by M2, and finally received by R1, so that an upward flight time (i.e., the downstream propagation time) can be obtained. Similarly, the ultrasonic signal emitted by R1 is reflected by M2 and M1 in sequence, and finally received by R2, so that a downward flight time (i.e., the upstream propagation time) can be obtained.
[0032] Assume that the diameter of the pipe section is D, the distance between the two ultrasonic transducers is L, the fluid flow direction is consistent with the direction of the marked arrow (flowing from R2 to R1), and the fluid flow rate is V, that is, the fluid flows at a speed of V. The speed value of the ultrasonic signal in each distance segment can be determined first. Specifically, the speed of the ultrasonic signal flowing through L1 can be:
[0033] C L1 =C0 (1)
[0034] The speed of the ultrasonic signal flowing through L2 can be:
[0035] C L2 =C0 (2)
[0036] The downstream velocity of the ultrasonic signal flowing through L (i.e. Figure 1 The flow velocity in the t1 direction in the equation can be:
[0037] C L12 =C0+V (3)
[0038] The reverse flow velocity of the ultrasonic signal flowing through L (i.e. Figure 1 The flow velocity in the t2 direction in the equation can be:
[0039] C L21 =C0-V (4)
[0040] Accordingly, the time taken by the ultrasonic signal to flow through the pipeline fluid in the downstream and upstream conditions can be calculated respectively. Specifically, in the downstream condition, the time taken by the ultrasonic signal to flow through the pipeline can be:
[0041]
[0042] In the case of countercurrent flow, the time it takes for the ultrasonic signal to flow through the pipe can be:
[0043]
[0044] Furthermore, the forward and reverse flow time difference can be determined:
[0045]
[0046] In actual application scenarios, the propagation speed C0 of ultrasonic signals in liquids is usually above 1000 meters per second (m / s), while in most industrial systems, the fluid flow rate V is much smaller than the propagation speed C0 of ultrasonic signals in liquids, that is:
[0047]
[0048] Therefore, the forward and reverse flow time difference can be expressed as:
[0049]
[0050] Furthermore, the fluid flow velocity V in the pipeline can be obtained:
[0051]
[0052] The time difference can be obtained by measurement. The propagation speed of ultrasonic signals is different at different fluid temperatures. The propagation speed of ultrasonic signals at the current temperature can be obtained by looking up a table as C0, and then the fluid flow rate V can be calculated. The fluid flow rate V represents the average linear velocity. The average surface velocity V can be used to calculate the average linear velocity V. m The compensation coefficient of the average linear velocity and the average linear velocity obtained are used to determine the surface average velocity V of the fluid. m .
[0053] The average surface velocity V of the fluid in the pipe m Enter the following flow calculation formula to get the fluid flow Q:
[0054]
[0055] Based on the above measurement process, it can be known that in order to measure the fluid flow rate, a high-precision time-to-digital converter (TDC) is required to calculate the upstream and downstream time difference. When TDC calculates the upstream and downstream time difference, it needs to use the first wave threshold to identify the first echo signal. For ease of understanding, the process of TDC calculating the upstream and downstream time difference is further explained below.
[0056] In flow measurement, downstream measurement (forward measurement) and upstream measurement (reverse measurement) are performed. Specifically, during downstream measurement, the upstream transducer serves as the transmitting transducer and the downstream transducer serves as the receiving transducer. During reverse measurement, the downstream transducer serves as the transmitting transducer and the upstream transducer serves as the receiving transducer. The transmitting transducer transmits an ultrasonic signal, which propagates in the fluid and forms an echo signal after reflection and is received by the receiving transducer. The receiving transducer sends the received ultrasonic signal to the TDC so that the TDC can detect the time difference between the upstream and downstream flows. The number of pulses of the ultrasonic signal emitted during the forward measurement can be the same as the number of pulses of the ultrasonic signal emitted during the reverse measurement.
[0057] Figure 2 It is a waveform diagram of an echo signal, such as Figure 2 As shown, after the ultrasonic signal is reflected by the reflector, the receiving transducer can send the received spindle-shaped effective waveform signal to the TDC. However, since there will be random interference noise of different amplitudes in the signal receiving channel, the TDC needs to use the first wave threshold to identify the first echo signal to avoid noise signal interference. Among them, the amplitude of the noise signal varies depending on the system environment. The amplitude of the noise signal is often small and will not exceed the first wave threshold. Specifically, Figure 2 The first wave detection threshold level in is the first wave threshold, Vref represents the reference level, and the numbers 1 to 10 represent the peak numbers. If the amplitude of the signal peak is not greater than the first wave threshold, it is considered to be a noise signal. When the first peak greater than the first wave threshold is detected, it is considered to be the first echo signal.
[0058] In TDC, the first wave threshold is used to identify the starting point of the first echo signal. TDC detects the first echo signal mainly by the peak amplitude value measurement method, that is, reading the first wave threshold configured in advance in the hardware bottom register. Among them, the first wave threshold configured in the register can be in the form of a level quantity. Taking the first wave threshold as a reference, the peak of the waveform of the ultrasonic signal transmitted by the transducer is received. Specifically, within the detection cycle (for example, the first wave threshold detection window), if the first peak greater than the first wave threshold is detected, it is considered that the first echo signal has been received. If the peak greater than the first wave threshold has not been detected within the detection cycle, it is considered that the echo signal has not been received. Once TDC identifies the first echo signal based on the first wave threshold, it can be determined that the reflected wave signal is received. Accordingly, TDC will record the starting point of this signal as a time mark. Next, TDC will measure the time difference by detecting the zero crossing point.
[0059] Specifically, when an ultrasonic measurement event is triggered, the TDC is turned on, and the pulse generator (Pulse Generating) generates a certain number of ultrasonic signal pulses. After being transmitted through the transmitting transducer, the ultrasonic signal is received by the receiving transducer after a transmission time (DelayVal) in the pipe section, and then sent to the TDC.
[0060] Among them, the first wave threshold can be divided into a forward first wave threshold and a reverse first wave threshold. In the forward measurement, the TDC can read the forward first wave threshold. When the amplitude of the received ultrasonic signal exceeds the forward first wave threshold, it is considered that the first echo signal is received. After identifying the first echo signal, the TDC will continue to monitor the voltage changes of the subsequent ultrasonic signals received to determine the zero crossing point. Among them, the zero crossing point refers to the voltage transition point from positive to negative or from negative to positive. The TDC measures the time interval between each ultrasonic signal emitted by the transmitting transducer and the corresponding echo signal received by the receiving transducer, and obtains the arrival time of each ultrasonic signal pulse emitted during the forward measurement, and obtains the arrival time T(t1, t2,…) of the forward echo signal. Similarly, in the reverse measurement, the TDC unit can read the reverse first wave threshold, and detect the arrival time of each ultrasonic signal pulse emitted during the reverse measurement based on the reverse first wave threshold, and obtain the arrival time T'(t1, t2,…) of the reverse echo signal. Furthermore, by calculating the difference of the arrival time at the same time (i.e., the echo signal with the same signal number) in T(t1, t2, ...) and T'(t1, t2, ...), and then calculating the average of the difference of the pulse arrival time at the same time, the upstream and downstream time difference can be obtained. With the help of TDC, the upstream and downstream time difference can be accurately obtained.
[0061] It can be seen that the first wave threshold plays an important role in flow measurement, and determining the first wave threshold is the basis for realizing fluid measurement. To this end, an embodiment of the present invention provides a first wave threshold processing method to automatically determine the first wave threshold. The first wave threshold processing method is described below.
[0062] Figure 3 is a flowchart of a first wave threshold processing method provided by an embodiment of the present invention. Figure 3 As shown, the first wave threshold processing method may include the following steps:
[0063] Step 101: Identify the first wave signal in a forward measurement process based on a forward initial threshold value, and identify the first wave signal in a reverse measurement process based on a reverse initial threshold value.
[0064] Step 102: When the first wave signal in the forward measurement process is identified, the peak values of multiple echo signals in the forward measurement process are obtained to obtain multiple forward peak values; and, when the first wave signal in the reverse measurement process is identified, the peak values of multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peak values.
[0065] Step 103: determine the peak difference between adjacent peaks in the plurality of forward peaks to obtain a forward peak difference, and determine the peak difference between adjacent peaks in the plurality of reverse peaks to obtain a reverse peak difference.
[0066] Step 104: Determine a target peak difference based on the peak difference in the forward direction and the peak difference in the reverse direction that has the same corresponding signal number.
[0067] Step 105: Determine a forward first wave threshold and a reverse first wave threshold based on the target peak difference.
[0068] In an embodiment of the present invention, the first wave threshold may also be referred to as the first wave threshold, threshold value, first wave limit, first wave threshold value, etc. The executor of the first wave threshold processing method may be an ultrasonic flow meter. The forward initial threshold and the reverse initial threshold may be initial values pre-set in the ultrasonic flow meter, the forward initial threshold may represent the initial value of the forward first wave threshold, and the reverse initial threshold may represent the initial value of the reverse first wave threshold. Among them, the initial value of the forward first wave threshold may be the same as the initial value of the reverse first wave threshold. For example, the forward initial threshold and the reverse first wave threshold may both be Threshold_0, and Threshold_0 may be written into the forward and reverse first wave control (FWaveCtrl) register of the TDC. Among them, Threshold_0=Vref+30mv, Vref is the reference level, and the first echo signal is detected based on this reference level.
[0069] Among them, the first wave threshold mode can be divided into two modes: single threshold and double threshold. In the single threshold mode, the forward first wave threshold and the reverse first wave threshold can use the same value. In the double threshold mode, the forward first wave threshold and the reverse first wave threshold can use different values. In the embodiment of the present invention, the forward first wave threshold and the reverse first wave threshold are determined for the forward measurement and the reverse measurement respectively, which can ensure the accuracy of the first wave threshold to a certain extent.
[0070] Specifically, the first wave signal refers to the first echo signal. The execution order of identifying the first wave signal in the forward measurement process based on the forward initial threshold and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold is not unique. For example, the first wave signal in the forward measurement process can be first identified based on the forward initial threshold, and then the first wave signal in the reverse measurement process can be identified based on the reverse initial threshold. Alternatively, the first wave signal in the reverse measurement process can be first identified based on the reverse initial threshold, and then the first wave signal in the forward measurement process can be identified based on the forward initial threshold. Alternatively, the execution can be performed in parallel, and this is not limited in the embodiments of the present invention.
[0071] Exemplarily, the peak measurement function can be turned on, and the first wave signal in the forward measurement process is first identified based on the forward initial threshold. When the first wave signal in the forward measurement process is identified based on the forward initial threshold, the peak values of the m echo signals in the forward measurement process are captured using an analog-to-digital converter (ADC) to obtain m forward peak values. Then, the first wave signal in the reverse measurement process is identified based on the reverse initial threshold. When the first wave signal in the reverse measurement process is identified based on the reverse initial threshold, the peak values of the m echo signals in the reverse measurement process are captured using an analog-to-digital converter (ADC) to obtain m reverse peak values.
[0072] Wherein, m is a positive integer, and the specific value of m can be set as needed. For example, m can be 10, and the embodiment of the present invention does not limit this. Taking m as 10 as an example, for the forward measurement process, starting from the first echo signal, the m forward peaks can be recorded as Vcmp1, Vcmp2, ..., Vcmp10 in sequence, and the m forward peaks can be expressed as Vcmp (1, 2, ..., 10). For the reverse measurement process, starting from the first echo signal, the m reverse peaks can be recorded as Vcmp'1, Vcmp'2, ..., Vcmp'10 in sequence, and the m reverse peaks can be expressed as Vcmp' (1, 2, ..., 10).
[0073] The peak value can represent the amplitude of the echo signal, and correspondingly, the peak value can represent the amplitude difference. For any positive peak among multiple positive peaks, the difference between the next positive peak adjacent to the positive peak and the positive peak is calculated to obtain the positive peak difference. That is, the positive peaks are divided into a group in pairs, and a positive peak difference can be calculated based on a group of positive peaks. Among them, the positive peak, as the peak of the front signal in this group, can be used as the forward positive peak, and the adjacent next positive peak, as the peak of the rear signal in this group, can be used as the rear positive peak. The difference between the adjacent next positive peak and the positive peak can be calculated to obtain a positive peak difference. The adjacent next positive peak refers to a positive peak whose signal number is 1 greater than the signal number of the positive peak. Among them, the i in Vcmpi represents the signal number of the forward peak. The i in Vcmp'i represents the signal number of the reverse peak. The signal number of the forward peak indicates the transmission order of the echo signal corresponding to the forward peak, and the signal number of the reverse peak indicates the transmission order of the echo signal corresponding to the reverse peak. Taking Vcmp1 as an example, the next adjacent forward peak is Vcmp2. Accordingly, for the above example, the value of Vcmp2 minus Vcmp1 can be calculated to obtain a forward peak difference, and the value of Vcmp3 minus Vcmp2 can be calculated to obtain a forward peak difference, and so on, m-1 forward peak differences can be obtained. Among them, the forward peak difference can be recorded as ΔVcmp(px, py). Among them, px and py represent the signal number of the forward forward peak and the signal number of the backward forward peak, respectively.
[0074] For any reverse peak among multiple reverse peaks, the difference between the next reverse peak adjacent to the reverse peak and the reverse peak is calculated to obtain the reverse peak difference. That is, the reverse peaks are divided into a group in pairs, and a reverse peak difference can be calculated based on a group of reverse peaks. Among them, the reverse peak, as the peak of the front signal in this group, can be used as the forward reverse peak, and the adjacent next reverse peak, as the peak of the rear signal in this group, can be used as the rear reverse peak. The difference between the adjacent next reverse peak and the reverse peak can be calculated to obtain a reverse peak difference. The adjacent next reverse peak refers to a reverse peak whose signal number is 1 greater than the signal number of the reverse peak. Taking Vcmp'1 as an example, the adjacent next reverse peak is Vcmp'2. Accordingly, for the above example, the value of Vcmp'2 minus Vcmp'1 can be calculated to obtain a reverse peak difference, and the value of Vcmp'3 minus Vcmp'2 can be calculated to obtain a reverse peak difference, and so on, m-1 reverse peak differences can be obtained. Among them, the reverse peak difference can be recorded as ΔVcmp'(px, py). Among them, px and py represent the signal number of the forward reverse peak and the signal number of the backward reverse peak, respectively.
[0075] The signal number corresponding to the positive peak difference refers to the signal numbers of the two positive peaks used when calculating the positive peak difference. The signal number corresponding to the reverse peak difference refers to the signal numbers of the two reverse peaks used when calculating the reverse peak difference. Exemplarily, for the positive peak difference ΔVcmp1(1,2), the signal numbers corresponding to the positive peak difference are 1 and 2, that is, the positive peak difference ΔVcmp1(1,2) is calculated using Vcmp1 and Vcmp2. For the reverse peak difference ΔVcmp'1(1,2), the signal numbers corresponding to the reverse peak difference are 1 and 2, that is, the reverse peak difference ΔVcmp'1(1,2) is calculated using Vcmp'1 and Vcmp'2. Furthermore, in an embodiment of the present invention, the target peak difference can be determined based on the peak difference with the same corresponding signal number in the positive peak difference and the reverse peak difference, and the positive first wave threshold and the reverse first wave threshold can be determined based on the target peak difference. Since the target peak difference corresponds to the peak difference of the same signal sequence number, the forward first wave threshold and the reverse first wave threshold that are finally determined can, to a certain extent, take into account both the forward measurement process and the reverse measurement process, thereby improving the adaptability of the forward first wave threshold and the reverse first wave threshold. In an embodiment of the present invention, the determined forward first wave threshold and the reverse first wave threshold can be written into the forward first wave control register and the reverse first wave control register, respectively, for ease of use.
[0076] In summary, in the first wave threshold processing method provided by the embodiment of the present invention, the first wave signal in the forward measurement process is identified based on the forward initial threshold, and the first wave signal in the reverse measurement process is identified based on the reverse initial threshold. In the case of identifying the first wave signal in the forward measurement process, the peak values of multiple echo signals in the forward measurement process are obtained to obtain multiple forward peaks, and, in the case of identifying the first wave signal in the reverse measurement process, the peak values of multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peaks. The peak difference between adjacent peaks in the multiple forward peaks is determined to obtain the forward peak difference, and the peak difference between adjacent peaks in the multiple reverse peaks is determined to obtain the reverse peak difference. Based on the peak difference of the forward peak difference and the peak difference of the reverse peak difference with the same corresponding signal sequence number, the target peak difference is determined. The forward first wave threshold and the reverse first wave threshold are determined based on the target peak difference. In this way, the determination of the first wave threshold can be realized automatically, thereby reducing the labor cost and improving the efficiency of determining the first wave threshold.
[0077] In an embodiment of the present invention, the target peak difference may include a target forward peak difference and a target reverse peak difference. Optionally, the step of determining the target peak difference based on the peak difference corresponding to the same signal sequence number in the forward peak difference and the reverse peak difference may specifically include:
[0078] Step 1041: Select a maximum forward peak difference from the forward peak differences, and select a maximum reverse peak difference from the reverse peak differences.
[0079] Step 1042: If the signal number corresponding to the maximum forward peak difference is consistent with the signal number corresponding to the maximum reverse peak difference, the maximum forward peak difference is determined as the target forward peak difference, and the maximum reverse peak difference is determined as the target reverse peak difference.
[0080] Specifically, the forward peak differences can be sorted in order from large to small to obtain a forward peak difference sequence. The reverse peak differences can be sorted in order from large to small to obtain a reverse peak difference sequence. Then, the first peak difference in the forward peak difference sequence is read to obtain the maximum forward peak difference, and the first peak difference in the reverse peak difference sequence is read to obtain the maximum reverse peak difference. Next, analyze whether the signal number corresponding to this group of maximum forward peak differences is consistent with the signal number corresponding to the maximum reverse peak difference.
[0081] If the two are consistent, the maximum forward peak difference can be determined as the target forward peak difference, and the maximum reverse peak difference can be determined as the target reverse peak difference. That is to say, in the embodiment of the present invention, the corresponding signal numbers are consistent and the largest forward peak difference and reverse peak difference are selected as the target forward peak difference and the target reverse peak difference. Exemplarily, it is assumed that the maximum forward peak difference is ΔVcmp2(2,3) and the maximum reverse peak difference is ΔVcmp'2(2,3). Since the corresponding signal numbers of the two are 2 and 3, ΔVcmp2(2,3) can be determined as the target forward peak difference, and ΔVcmp'2(2,3) can be determined as the target reverse peak difference.
[0082] In the embodiment of the present invention, the maximum forward peak difference is selected from the forward peak difference, and the maximum reverse peak difference is selected from the reverse peak difference. If the signal number corresponding to the maximum forward peak difference is consistent with the signal number corresponding to the maximum reverse peak difference, the maximum forward peak difference is determined as the target forward peak difference, and the maximum reverse peak difference is determined as the target reverse peak difference. In this way, the peak difference with the same corresponding signal number and the largest value can be selected as the target peak difference, thereby to a certain extent avoiding the subsequent first wave threshold determined based on the target peak difference from being too small, thereby avoiding the first wave threshold from being too small, resulting in unnecessary signals being identified as first wave signals, and causing over-detection problems.
[0083] Optionally, the embodiment of the present invention may further include the following steps:
[0084] Step S21: If the signal number corresponding to the maximum positive peak difference is inconsistent with the signal number corresponding to the maximum reverse peak difference, the maximum positive peak difference and the maximum reverse peak difference are removed from the positive peak difference and the reverse peak difference respectively.
[0085] Step S22, execute again the step of selecting the maximum forward peak difference from the forward peak differences, and the step of selecting the maximum reverse peak difference from the reverse peak differences, until the number of executions is greater than the first number threshold, or the maximum forward peak difference and the maximum reverse peak difference with the same corresponding signal sequence number are found.
[0086] In an embodiment of the present invention, if the signal sequence number corresponding to the current maximum positive peak difference is inconsistent with the signal sequence number corresponding to the current maximum reverse peak difference, the target peak difference can be re-searched. Specifically, the maximum positive peak difference can be first removed from the forward peak difference sequence, that is, the current first peak difference in the forward peak difference sequence is removed. And the maximum reverse peak difference can be removed from the reverse peak difference sequence, that is, the current first peak difference in the reverse peak difference sequence is removed. Then, re-enter the above step 1041 and start execution, so as to determine the target positive peak difference and the target reverse peak difference based on the maximum positive peak difference in the remaining positive peak differences after removal and the maximum reverse peak difference in the remaining reverse peak differences after removal.
[0087] Specifically, after elimination, the first peak difference in the forward peak difference sequence can be re-read to obtain the maximum forward peak difference, and the first peak difference in the reverse peak difference sequence can be read to obtain the maximum reverse peak difference. Next, analyze whether the signal sequence number corresponding to this group of maximum forward peak differences is consistent with the signal sequence number corresponding to the maximum reverse peak difference. Correspondingly, if they are consistent, the maximum forward peak difference can be determined as the target forward peak difference, and the maximum reverse peak difference can be determined as the target reverse peak difference. At this time, since the corresponding maximum forward peak difference and maximum reverse peak difference with the same signal sequence number are found, the loop process of re-entering the above step 1041 can be ended. On the contrary, if they are inconsistent, and the current number of executions is not greater than the first number threshold, the above step 1041 can be re-entered to start execution again, and so on, until the number of executions is greater than the first number threshold. Among them, the number of executions refers to the number of times the above step 1041 is executed. The first number threshold can be pre-set according to actual conditions. For example, the first number threshold can be 3, 4 or 5, and the embodiment of the present invention does not limit this.
[0088] In an embodiment of the present invention, when the signal number corresponding to the maximum forward peak difference is inconsistent with the signal number corresponding to the maximum reverse peak difference, the maximum forward peak difference and the maximum reverse peak difference are eliminated from the forward peak difference and the reverse peak difference, respectively. Then, the operation of selecting the maximum forward peak difference from the forward peak difference and the operation of selecting the maximum reverse peak difference from the reverse peak difference are performed again until the step is executed more than the first number threshold, or the maximum forward peak difference and the maximum reverse peak difference with the same corresponding signal number are found. In this way, it is possible to search for the target peak difference based on the maximum forward peak difference and the maximum reverse peak difference for multiple times, thereby improving the probability of successfully finding the target peak difference to a certain extent.
[0089] Optionally, the embodiment of the present invention may also include: when the number of executions is greater than the first number threshold, adjusting the forward initial threshold and the reverse initial threshold based on a preset increment respectively; re-executing the steps of identifying the first wave signal in the forward measurement process based on the forward initial threshold, and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold. In the embodiment of the present invention, when it is found that the signal sequence number corresponding to the maximum forward peak difference is inconsistent with the signal sequence number corresponding to the maximum reverse peak difference, if it is detected that the current number of executions has exceeded the first number threshold, the forward initial threshold and the reverse initial threshold can be adjusted. Specifically, the preset increment can be added to the current value of the forward initial threshold and the reverse initial threshold, respectively, to obtain the adjusted forward initial threshold and the reverse initial threshold. Among them, the preset increment can be set as needed. For example, the preset increment can be 10 millivolts (mv).
[0090] Then, the steps of identifying the first wave signal in the forward measurement process based on the forward initial threshold and the first wave signal in the reverse measurement process based on the reverse initial threshold are re-executed, and the above step 101 is re-entered to re-determine the forward first wave threshold and the reverse first wave threshold according to the above steps 101 to 105. At this time, since the forward initial threshold and the reverse initial threshold have been adjusted, the forward peak value and the reverse peak value obtained can be different from the forward peak value and the reverse peak value obtained previously. In this way, the success rate of successfully determining the target peak difference this time can be improved, thereby improving the probability of successfully determining the forward first wave threshold and the reverse first wave threshold.
[0091] In one implementation, the first number threshold can be 3. Accordingly, if the number of executions reaches 4, after completing the analysis and comparison of the first 4 maximum peak differences, the corresponding maximum positive peak difference and maximum reverse peak difference with the same signal number are still not found. Then, after adjusting the forward initial threshold and the reverse initial threshold, the forward first wave threshold and the reverse first wave threshold can be determined again according to the above steps 101 to 105, and this cycle is repeated until the forward first wave threshold and the reverse first wave threshold are determined. Figure 2 In actual application scenarios, the peak difference between the first four echo signals is often the largest. Therefore, by setting the first count threshold to 3, it is possible to ensure that the peak difference between the first four echo signals is used in the process of determining the target peak difference, thereby ensuring the probability of successfully determining the target peak difference.
[0092] Optionally, the step of determining the forward first wave threshold and the reverse first wave threshold based on the target peak value difference may specifically include:
[0093] Step 1051, obtaining the forward forward peak value used when determining the target forward peak difference as a forward reference value, and obtaining the forward reverse peak value used when determining the target reverse peak difference as a reverse reference value.
[0094] Step 1052: Determine a forward reference increment based on the target forward peak difference, and determine a reverse reference increment based on the target reverse peak difference.
[0095] Step 1053: Determine the forward first wave threshold based on the forward reference value and the forward reference increment, and determine the reverse first wave threshold based on the reverse reference value and the reverse reference increment.
[0096] In an embodiment of the present invention, the forward forward peak value used when determining the target forward peak difference is the forward peak difference with a smaller signal number used when calculating the target forward peak difference. The forward reverse peak value used when determining the target reverse peak difference is the reverse peak difference with a smaller signal number used when calculating the target reverse peak difference. The target forward peak difference is represented by ΔVcmpmax(p1,p2), p1 is the signal number of the forward forward peak value used when determining the target forward peak difference, and accordingly, Vcmpp1 can be determined as the forward reference value. The target reverse peak difference is represented by ΔVcmp'max(p1,p2), p1 is the signal number of the forward reverse peak value used when determining the target reverse peak difference, and accordingly, Vcmp'p1 can be determined as the reverse reference value.
[0097] Further, the ratio of the target forward peak value difference to the first preset value can be calculated to obtain the forward reference increment. And, the ratio of the target reverse peak value difference to the first preset value can be calculated to obtain the reverse reference increment. The first preset value can be set as needed. For example, the first preset value can be 2. Accordingly, the forward reference increment can be expressed as ΔVcmpmax(p1,p2) / 2, and the reverse reference increment can be expressed as ΔVcmp'max(p1,p2) / 2.
[0098] The sum of the positive reference value and the positive reference increment may be used as the positive first wave threshold. Exemplarily, the positive first wave threshold may be Vcmpp1+ΔVcmpmax(p1, p2) / 2. Assuming ΔVcmpmax(p1, p2) is ΔVcmp(2, 3), the determined positive first wave threshold may be Vcmp2+ΔVcmp(2, 3) / 2. Figure 4 is a waveform diagram of another echo signal provided by an embodiment of the present invention, such as Figure 4 As shown, the first wave detection threshold level represents the positive initial threshold, d1 is greater than d2 and d0, and waveform 1 is not greater than the positive initial threshold, so waveform 2 is the first echo signal. Wherein, L = Vcmp2 + d1 / 2, d1 = ΔVcmp (2, 3), and Vcmp2 represents the peak corresponding to waveform 2. Further, the sum of the reverse reference value and the reverse reference increment can be used as the reverse first wave threshold, and the reverse first wave threshold can be Vcmp'p1 + ΔVcmp'max (p1, p2) / 2.
[0099] Since the target forward peak difference can represent the maximum difference in the forward peak, that is, the peak difference between the front and rear echo signals corresponding to the target forward peak difference is the largest. Therefore, determining the forward first wave threshold based on the forward reference value and the forward reference increment determined by the target forward peak difference can make the fault tolerance stronger and the fault tolerance better when detecting through the forward first wave threshold. Correspondingly, since the target reverse peak difference can represent the maximum difference in the reverse peak, that is, the peak difference between the front and rear echo signals corresponding to the target reverse peak difference is the largest. Therefore, determining the reverse first wave threshold based on the reverse reference value and the reverse reference increment determined by the target reverse peak difference can make the fault tolerance stronger and the fault tolerance better when detecting through the reverse first wave threshold.
[0100] In the embodiment of the present invention, by finding the first wave threshold with better fault tolerance as much as possible, the interference of external factors can be offset as much as possible, the peak shift problem in the calculation of the upstream and downstream time difference can be reduced, and the accuracy of the upstream and downstream time difference can be improved, thereby improving the accuracy of flow measurement.
[0101] In actual application scenarios, the fluid measurement environment in which the ultrasonic flowmeter is located may change. When the fluid measurement environment changes, it may be disturbed by external factors such as random noise, electromagnetic radiation, and flow field, which may cause changes in the positive and reverse first wave thresholds or peak amplitudes, and then cause the front and rear pulse edges to be out of sync, that is, the forward first wave signal and the reverse first wave signal produce a "peak-shifted" phenomenon. The "peak-shifted" phenomenon refers to the forward first wave signal being detected one ultrasonic emission cycle T earlier than the reverse first wave signal, or the forward first wave signal being detected one ultrasonic emission cycle T later than the reverse first wave signal. Among them, the ultrasonic emission cycle T is the interval period for sending ultrasonic signals, and the period T can be calculated in advance.
[0102] Regarding the peak shifting phenomenon, in the first case, the phenomenon is a slow permanent change. For example, under the influence of the fluid measurement environment, long-term use causes the internal resistor and capacitor to have a reduced life attenuation performance, resulting in a peak shifting phenomenon. In the second case, it may be caused by a temporary interference mutation. In the second case caused by the interference mutation, the echo signal can be data filtered to filter out the abnormal echo signal generated, and there is no need to adjust the threshold at this time. For the first case, the following steps S31 to S33 can be executed to adaptively adjust the first wave threshold according to environmental changes.
[0103] Optionally, in the embodiment of the present invention, after determining the forward first wave threshold and the reverse first wave threshold based on the target peak value difference, the following steps may be further performed:
[0104] Step S31, determine the difference between the arrival time of the forward echo signal and the arrival time of the reverse echo signal to obtain the target time difference.
[0105] Step S32: when the target time difference exceeds a preset time difference range, determine the forward first wave amplitude difference and the reverse first wave amplitude difference.
[0106] Step S33: Based on the forward first wave amplitude difference and the reverse first wave amplitude difference, a threshold adjustment operation is performed to adjust the forward first wave threshold or the reverse first wave threshold.
[0107] In an embodiment of the present invention, the arrival time t of the first forward echo signal among the arrival times of the forward echo signals may be obtained first, and the arrival time t' of the first reverse echo signal among the arrival times of the reverse echo signals may be obtained. Wherein, t and t' may be detected by a TDC, and the arrival time of the first forward echo signal detected by the TDC most recently may be obtained as t, and the arrival time of the first reverse echo signal detected most recently may be obtained as t'. Calculate t' - t to obtain the target time difference Δt. Alternatively, the arrival time of the nth reverse echo signal may also be subtracted from the arrival time of the nth forward echo signal as the target time difference Δt. Wherein, n may be set as required. Exemplarily, n may be 2, and the embodiment of the present invention does not limit this.
[0108] The preset time difference range can be preset, and the preset time difference range can represent the normal range of the target time difference. Exemplarily, the preset time difference range may be -T < Δt < 0. When the fluid measurement environment changes and is affected by the fluid flow velocity during forward and reverse measurements, if the forward first wave signal is detected one ultrasonic wave emission period T earlier than the reverse first wave signal, Δt < -T will occur, that is, the target time difference exceeds the preset time difference range. If the forward first wave signal is detected one ultrasonic wave emission period T later than the reverse first wave signal, 0 < Δt < T will occur, that is, the target time difference exceeds the preset time difference range. In an embodiment of the present invention, when the target time difference exceeds the preset time difference range, during the process of calculating the forward and reverse flow time differences by the TDC to measure the flow rate, the difference between the arrival times at the same moment calculated can also be corrected, thereby improving the accuracy of the finally calculated forward and reverse flow time differences and reducing the error of the flow rate finally measured at the current stage. Specifically, in the case of Δt < -T, the period T can be added to each difference. In the case of 0 < Δt < T, the period T is subtracted from each difference to achieve the correction process. Since there is still a large error after correcting the difference, the first wave threshold can be corrected to further reduce the measurement error. Assuming that the ultrasonic pulse emission period is T and the falling edge of the rectangular pulse is used as the detection moment. In an embodiment of the present invention, the first wave threshold can be dynamically adjusted to correct the problem of the forward and reverse first wave peak misalignment, thereby reducing the measurement error.
[0109] Specifically, the amplitude value of the peak of the forward first echo signal can be obtained to obtain the forward first wave peak value, and the amplitude value of the peak of the reverse first echo signal can be obtained to obtain the reverse first wave peak value. Then, subtract the forward first wave threshold from the forward first wave peak value to obtain the forward first wave amplitude difference ΔVf. Subtract the reverse first wave threshold from the reverse first wave peak value to obtain the reverse first wave amplitude difference ΔVf', thereby adjusting the threshold of the forward first wave threshold or the reverse first wave threshold. Wherein, the forward first wave peak value and the reverse first wave peak value detected by the TDC most recently can be obtained.
[0110] In an embodiment of the present invention, the target time difference is obtained by determining the difference between the arrival time of the forward echo signal and the arrival time of the reverse echo signal. When the target time difference exceeds the preset time difference range, the forward first wave amplitude difference and the reverse first wave amplitude difference are determined. Based on the forward first wave amplitude difference and the reverse first wave amplitude difference, a threshold adjustment operation is performed to adjust the forward first wave threshold or the reverse first wave threshold. In this way, by dynamically adjusting the size of the first wave threshold, the frequency of manual resetting of the first wave threshold can be reduced, thereby more effectively reducing the later maintenance cost of the meter. At the same time, it is beneficial to improve the adaptability of the measuring meter to the measuring environment, thereby reducing the error of the ultrasonic flow meter to a certain extent and improving the accuracy of the ultrasonic flow meter.
[0111] Optionally, in an embodiment of the present invention, the step of performing a threshold adjustment operation based on the forward first wave amplitude difference and the reverse first wave amplitude difference to adjust the forward first wave threshold or the reverse first wave threshold may specifically include:
[0112] Step S33a: when the positive first wave amplitude difference is smaller than the negative first wave amplitude difference, if the positive first wave amplitude difference is smaller than the positive adjustment increment, then increase the positive first wave threshold.
[0113] Step S33b: if the positive first wave amplitude difference is not less than the positive adjustment increment, lower the reverse first wave threshold.
[0114] Step S33c: when the forward first wave amplitude difference is not less than the reverse first wave amplitude difference, if the reverse first wave amplitude difference is less than the reverse adjustment increment, increase the reverse first wave threshold.
[0115] Step S33d: if the reverse first wave amplitude difference is not less than the reverse adjustment increment, lower the forward first wave threshold.
[0116] In an embodiment of the present invention, the positive adjustment increment is positively correlated with the target positive peak difference, and the reverse adjustment increment is positively correlated with the target reverse peak difference. The ratio of the target positive peak difference to the second preset value can be calculated to obtain the positive adjustment increment. And, the ratio of the target reverse peak difference to the second preset value is calculated to obtain the reverse adjustment increment. Among them, the second preset value can be set as needed, and illustratively, the second preset value can be 4. Accordingly, the positive adjustment increment can be expressed as ΔVcmpmax(p1,p2) / 4, and the reverse adjustment increment can be expressed as ΔVcmp'max(p1,p2) / 4.
[0117] When the amplitude difference of the positive first wave is less than the amplitude difference of the reverse first wave, that is, ΔVf<ΔVf', if the amplitude difference of the positive first wave is less than the positive adjustment increment, that is, ΔVf<ΔVcmpmax(p1,p2) / 4, it can be considered that the positive first wave threshold is too low, resulting in over-detection. Therefore, the positive first wave threshold can be increased. Specifically, the positive adjustment increment can be added to the positive first wave threshold. The positive first wave threshold is represented by Threshold, and Threshold=Threshold+ΔVcmpmax(p1,p2) / 4.
[0118] In the case where the forward first wave amplitude difference is smaller than the reverse first wave amplitude difference, if the forward first wave amplitude difference is not less than the forward adjustment increment, that is, ΔVf≥ΔVcmp_max(p1,p2) / 4, it can be considered that the reverse first wave threshold is too high, resulting in missed detection. Therefore, the reverse first wave threshold can be lowered. Specifically, it can be the reverse first wave threshold minus the reverse adjustment increment. Threshold' represents the reverse first wave threshold, and Threshold'=Threshold'-ΔVcmp'max(p1,p2) / 4.
[0119] Furthermore, when the amplitude difference of the forward first wave is not less than the amplitude difference of the reverse first wave, that is, ΔVf≥ΔVf', if the amplitude difference of the reverse first wave is less than the reverse adjustment increment, that is, ΔVf'<ΔVcmp'max(p1,p2) / 4, it can be considered that the reverse first wave threshold is too low, resulting in over-detection. Therefore, the reverse first wave threshold can be increased. Specifically, the reverse adjustment increment can be added to the reverse first wave threshold. Threshold' represents the forward first wave threshold, and Threshold'=Threshold'+ΔVcmp'max(p1,p2) / 4.
[0120] When the amplitude difference of the forward first wave is not less than the amplitude difference of the reverse first wave, if the amplitude difference of the reverse first wave is not less than the reverse adjustment increment, that is, ΔVf'≥ΔVcmp'max(p1,p2) / 4, it can be considered that the forward first wave threshold is too high, resulting in missed detection. Therefore, the forward first wave threshold can be lowered. Specifically, it can be the forward first wave threshold minus the positive adjustment increment. The forward first wave threshold is represented by Threshold, and Threshold=Threshold-ΔVcmpmax(p1,p2) / 4.
[0121] In the embodiments of the present invention, specifically, when Δt < -T or 0 < Δt < T, the forward first wave amplitude difference and the reverse first wave amplitude difference are determined. Based on the forward first wave amplitude difference and the reverse first wave amplitude difference, threshold adjustment is performed. Further, when Δt > T, the forward initial threshold and the reverse initial threshold can be directly adjusted based on a preset increment respectively; and the steps of identifying the first wave signal in the forward measurement process based on the forward initial threshold and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold are re-executed.
[0122] In the embodiments of the present invention, according to the magnitude relationship between the forward first wave amplitude difference and the reverse first wave amplitude difference, the magnitude relationship between the forward first wave amplitude difference and the forward adjustment increment, and the magnitude relationship between the reverse first wave amplitude difference and the reverse adjustment increment, in different cases, the forward first wave threshold is increased / decreased or the reverse first wave threshold is increased / decreased in a targeted manner, so as to achieve threshold adjustment, and the adjustment efficiency can be ensured to a certain extent.
[0123] Optionally, in the embodiments of the present invention, after performing the threshold adjustment operation based on the forward first wave amplitude difference and the reverse first wave amplitude difference, the following steps may further be performed:
[0124] Step S41: Re-determine the difference between the arrival time of the forward echo signal and the arrival time of the reverse echo signal to obtain a new target time difference.
[0125] Step S42: When the new target time difference exceeds the preset time difference range, re-execute the threshold adjustment operation.
[0126] Step S43: When the execution times of the threshold adjustment operation are greater than the second number threshold, adjust the forward initial threshold and the reverse initial threshold respectively based on a preset increment.
[0127] Step S44: Re-execute the steps of identifying the first wave signal in the forward measurement process based on the forward initial threshold and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold.
[0128] Specifically, the arrival time of the first forward echo signal detected by the TDC last time can be re-obtained as t, and the arrival time of the first reverse echo signal detected last time can be re-obtained as t'. Calculate the re-obtained t' - the re-obtained t to obtain a new target time difference Δt. If the new target time difference does not meet -T < Δt < 0, the threshold adjustment operation can be re-executed.
[0129] Among them, the second numerical threshold can be pre-set according to actual conditions. For example, the second numerical threshold can be 3, and the embodiment of the present invention does not limit this. By re-identifying the first wave signal in the forward measurement process based on the forward initial threshold, and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold, the above step 101 is re-entered, and the forward first wave threshold and the reverse first wave threshold are re-determined according to the above steps 101 to 105. At this time, since the forward initial threshold and the reverse initial threshold have been adjusted, the obtained forward peak value and reverse peak value can be different from the forward peak value and reverse peak value obtained before. In this way, the success rate of successfully determining the target peak difference this time can be improved, thereby improving the probability of successfully determining the forward first wave threshold and the reverse first wave threshold.
[0130] Accordingly, after raising the forward first wave threshold, if the problem that the new target time difference exceeds the preset time difference range occurs, when the threshold adjustment is performed again, the threshold adjustment operation can be directly implemented in the manner of the above steps S33a to S33d, or the forward first wave threshold can be directly raised to implement the threshold adjustment operation until the number of executions of the threshold adjustment operation exceeds the second preset number threshold. After lowering the reverse first wave threshold, if the problem that the new target time difference exceeds the preset time difference range occurs, when the threshold adjustment is performed again, the threshold adjustment operation can be directly implemented in the manner of the above steps S33a to S33d, or the reverse first wave threshold can be directly lowered to implement the threshold adjustment operation until the number of executions of the threshold adjustment operation exceeds the second preset number threshold.
[0131] After raising the reverse first wave threshold, if the problem occurs that the new target time difference exceeds the preset time difference range, when the threshold adjustment is performed again, the threshold adjustment operation can be directly implemented in the manner of steps S33a to S33d above, or the reverse first wave threshold can be directly raised to implement the threshold adjustment operation until the number of executions of the threshold adjustment operation is greater than the second preset number threshold.
[0132] After lowering the forward first wave threshold, if the problem occurs that the new target time difference exceeds the preset time difference range, when the threshold adjustment is performed again, the threshold adjustment operation can be directly implemented in the manner of steps S33a to S33d above, or the forward first wave threshold can be directly lowered to implement the threshold adjustment operation until the number of executions of the threshold adjustment operation is greater than the second preset number threshold.
[0133] Figure 5 FIG. 1 is a schematic diagram of a process for setting a first wave threshold provided by an embodiment of the present invention. Figure 5As shown, the first wave signal in the forward measurement process can be identified based on the forward initial threshold, and the first wave signal in the reverse measurement process can be identified based on the reverse initial threshold. When the first wave signal in the forward measurement process is identified, multiple forward peaks are obtained, and, when the first wave signal in the reverse measurement process is identified, multiple reverse peaks are obtained. Then, the forward peak difference and the reverse peak difference are determined based on the multiple forward peaks and the multiple reverse peaks, respectively. The maximum forward peak difference is selected from the forward peak differences, and the maximum reverse peak difference is selected from the reverse peak differences.
[0134] If the signal sequence number corresponding to the maximum forward peak difference is consistent with the signal sequence number corresponding to the maximum reverse peak difference, the maximum forward peak difference is determined as the target forward peak difference, and the maximum reverse peak difference is determined as the target reverse peak difference. The forward first wave threshold and the reverse first wave threshold are determined based on the target forward peak difference and the target reverse peak difference. If the signal sequence number corresponding to the maximum forward peak difference is inconsistent with the signal sequence number corresponding to the maximum reverse peak difference, the maximum forward peak difference and the maximum reverse peak difference are respectively removed from the forward peak difference and the reverse peak difference. Then, it is determined whether the current number of executions is greater than the first number threshold. If not, return to the step of selecting the maximum forward peak difference from the forward peak difference, and the step of selecting the maximum reverse peak difference from the reverse peak difference. If so, adjust the forward initial threshold and the reverse initial threshold respectively based on the preset increment. Then return to the step of identifying the first wave signal in the forward measurement process based on the forward initial threshold, and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold, so as to restart the determination of the forward first wave threshold and the reverse first wave threshold.
[0135] Figure 6 FIG. 1 is a schematic diagram of a first wave threshold adjustment process provided by an embodiment of the present invention. Figure 6As shown, the target time difference Δt can be determined first. If -T < Δt < 0 is satisfied, the target time difference Δt can be re-determined. If -T < Δt < 0 is not satisfied, when Δt < -T or 0 < Δt < T is satisfied, the forward first wave amplitude difference ΔVf and the reverse first wave amplitude difference ΔVf' are determined. Then the forward adjustment increment ΔVcmpmax(p1,p2) / 4 and the reverse adjustment increment ΔVcmp'max(p1,p2) / 4 are determined. Further, if ΔVf < ΔVf', when ΔVf < ΔVcmpmax(p1,p2) / 4, set Threshold_you = Threshold_you + ΔVcmpmax(p1,p2) / 4 to achieve threshold adjustment. When ΔVf ≥ ΔVcmp_max(p1,p2) / 4, set Threshold_you' = Threshold_you' - ΔVcmp'max(p1,p2) / 4 to achieve threshold adjustment. If ΔVf ≥ ΔVf', when ΔVf' < ΔVcmp'max(p1,p2) / 4, set Threshold_you' = Threshold_you' + ΔVcmp'max(p1,p2) / 4 to achieve threshold adjustment. When ΔVf' ≥ ΔVcmp'max(p1,p2) / 4, set Threshold_you = Threshold_you - ΔVcmpmax(p1,p2) / 4 to achieve threshold adjustment.
[0136] In a related technology, the first wave threshold of the ultrasonic flowmeter is determined manually. In this method, an oscilloscope is used manually to capture the transmitted and received signals, and then the received signals are analyzed manually. According to the first or second wave peak received, the level value is selected as the first wave threshold. However, in this manual determination method, using an oscilloscope will weaken the signal energy, and then the determined first wave threshold cannot adapt to the actual measurement environment. And affected by personal subjectivity, the determined first wave threshold often has errors, resulting in the accuracy of the ultrasonic flowmeter being affected. And in the related technology, for a batch of ultrasonic flowmeters, the same first wave threshold is determined for all ultrasonic flowmeters. However, due to the differences between ultrasonic flowmeters, for example, differences in the manufacturing processes of chips, sensors, and electronic components in the ultrasonic flowmeter, and the resistance-capacitance matching at the signal transmission front end, etc., the peak values of the echo signals of different ultrasonic flowmeters are different. Therefore, setting the same fixed first wave threshold for a batch of ultrasonic flowmeters has great limitations and will lead to large errors in the measurement system. For a single ultrasonic flowmeter, there will be a problem that the adaptability of the first wave threshold to this ultrasonic flowmeter is poor, which may further lead to the problem that the ultrasonic flowmeter has signal distortion, resulting in a jump phenomenon in the first wave detection, and thus the measurement error is too large and exceeds the range.
[0137] In the embodiment of the present invention, by presetting the forward initial threshold and the reverse initial threshold, the ultrasonic flowmeter can automatically determine the forward first wave threshold and the reverse first wave threshold by executing the above-mentioned first wave threshold processing method in the real environment before the equipment leaves the factory. In this way, the labor cost can be reduced and the determination efficiency can be improved. At the same time, the automatic calculation method is not affected by personal subjectivity, so the error of the first wave threshold can be reduced, the recognition rate of the first echo signal can be improved, and the accuracy of the ultrasonic flowmeter can be improved. Further, in the embodiment of the present invention, the ultrasonic flowmeter determines the first wave threshold through the echo signal in the real environment, so the determined first wave threshold can be made more suitable for the real measurement environment. For each ultrasonic flowmeter, the first wave threshold can be automatically determined for the ultrasonic flowmeter. In this way, when facing a batch of ultrasonic flowmeters, the above-mentioned first wave threshold processing method can be executed separately by each ultrasonic flowmeter, and the first wave threshold can be determined separately for each ultrasonic flowmeter without human intervention. Therefore, the first wave threshold processing method has the characteristics of strong versatility, high portability, simplicity and ease of use, which is conducive to the mass production of measuring meters, and is conducive to shortening the production cycle, and is highly practical. At the same time, the first wave threshold can be made more compatible with the ultrasonic flow meter, reducing the large error of the system and avoiding the jump phenomenon of the first wave detection due to signal distortion of the ultrasonic flow meter, thereby avoiding the problem of excessive measurement error and exceeding the measuring range, thereby reducing the subsequent maintenance cost and improving the product qualification rate of the ultrasonic flow meter.
[0138] The implementation logic of the first wave threshold processing method provided in the embodiment of the present invention can be implemented by software. For example, the software can be implemented using C language. The software can be executed by the processor of the ultrasonic flowmeter to implement the above-mentioned first wave threshold processing method. The processor can be a system-on-chip (SoC) dedicated to measurement on the ultrasonic flowmeter. Specifically, the chip can be a microcontroller unit (MCU). The chip can be integrated with a central processing unit (CPU), a flash memory (Flash Memory), a serial peripheral interface (SPI), a universal asynchronous receiver / transmitter (UART), an integrated circuit bus (I2C), a real-time clock controller module (RTC), TDC, an ultrasonic pulse generator, a temperature measurement module, a segment code display screen controller (LCD), a timer, an ADC and other functional modules. In this way, with the software and simulation debugging, it can be widely used in the design of ultrasonic flow measurement systems. For example, the processor may be a LS1D100 chip, and the TDC may be an ultrasonic time difference measurement module: a SONAR module. The ultrasonic flow meter may be an ultrasonic heat meter, an ultrasonic water meter, or an ultrasonic gas meter. For example, it may be a small-diameter ultrasonic water meter with different inner diameter specifications (e.g., an inner diameter of 15 mm, an inner diameter of 20 mm, and an inner diameter of 25 mm).
[0139] It should be noted that, in an embodiment of the present invention, identifying the first wave signal in the forward measurement process based on the forward initial threshold may specifically include: in the forward measurement process, after waiting for a specified time, starting to detect the first echo signal based on the forward initial threshold. Specifically, the forward first wave threshold detection window may be opened to detect the first wave signal using the forward initial threshold. Identifying the first wave signal in the reverse measurement process based on the reverse initial threshold may specifically include: in the reverse measurement process, after waiting for a specified time, starting to detect the first echo signal based on the reverse initial threshold. Specifically, the reverse first wave threshold detection window may be opened to detect the first wave signal using the reverse initial threshold. Among them, the specified time may be positively correlated with the transmission time of the ultrasonic signal. In this way, the interference of random noise in the channel inside the tube can be suppressed to a certain extent, preventing the noise signal from being detected as the first wave signal, and reducing the misjudgment of the first wave signal. The specified time may represent the opening time of the first wave threshold detection window, that is, after waiting for a specified time after receiving the signal, the first wave threshold detection window is opened to detect the first wave signal.
[0140] Taking a small-caliber ultrasonic water meter as an example, assuming that the ultrasonic emission period is T, the ultrasonic signal will not be received by the receiving transducer until it passes through DelayVal. Therefore, a value less than the DelayVal value can be set as the specified duration. Furthermore, the time difference change caused by the water flow rate of a small-caliber ultrasonic water meter is often less than s*T. Therefore, the DelayVal value -s*T can be set as the specified duration. Among them, the value range of s is 3 to 4. Time1 represents the specified duration. In an embodiment of the present invention, time1 can be set = DelayVal value -s*T. Among them, the DelayVal value can be used in advance to analyze the ultrasonic emission waveform and the reception waveform using an oscilloscope to measure the time interval between the starting moments of the two waveforms as the DelayVal value.
[0141] Reference Figure 7 , shows a block diagram of an ultrasonic flow device provided by an embodiment of the present invention, such as Figure 7 As shown, the ultrasonic flow device may specifically include:
[0142] Two ultrasonic transducers 201 spaced apart in the direction of the fluid, for sending and receiving ultrasonic information;
[0143] A time-to-digital converter 202, for measuring the ultrasonic time difference of the ultrasonic signal;
[0144] The controller 203 is configured to: identify the first wave signal in the forward measurement process based on the forward initial threshold, and identify the first wave signal in the reverse measurement process based on the reverse initial threshold; when the first wave signal in the forward measurement process is identified, obtain the peak values of multiple echo signals in the forward measurement process to obtain multiple forward peaks, and, when the first wave signal in the reverse measurement process is identified, obtain the peak values of multiple echo signals in the reverse measurement process to obtain multiple reverse peaks; determine the peak difference between adjacent peaks in the multiple forward peaks to obtain the forward peak difference, and determine the peak difference between adjacent peaks in the multiple reverse peaks to obtain the reverse peak difference; determine the target peak difference based on the forward peak difference and the peak difference with the same corresponding signal sequence number in the reverse peak difference; determine the forward first wave threshold and the reverse first wave threshold based on the target peak difference to obtain the first wave threshold; and measure the fluid flow rate using the first wave threshold and the ultrasonic time difference measured by the time-to-digital converter 202.
[0145] Specifically, the ultrasonic flow device can determine the first wave threshold through the first wave threshold processing method embodiment. The implementation method of each step of the controller 203 determining the forward first wave threshold and the reverse first wave threshold can refer to the above-mentioned related description, which will not be repeated here. The fluid direction refers to the flow direction of the fluid, and the two ultrasonic transducers 201 can be the above-mentioned ultrasonic transducer R2 and ultrasonic transducer R1, and the ultrasonic time difference is the above-mentioned forward and reverse flow time difference.
[0146] In summary, in the ultrasonic flow device provided by the embodiment of the present invention, the first wave signal in the forward measurement process is identified based on the forward initial threshold, and the first wave signal in the reverse measurement process is identified based on the reverse initial threshold. When the first wave signal in the forward measurement process is identified, the peak values of multiple echo signals in the forward measurement process are obtained to obtain multiple forward peaks, and, when the first wave signal in the reverse measurement process is identified, the peak values of multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peaks. The peak difference between adjacent peaks in the multiple forward peaks is determined to obtain the forward peak difference, and the peak difference between adjacent peaks in the multiple reverse peaks is determined to obtain the reverse peak difference. Based on the peak difference in the forward peak difference and the peak difference in the reverse peak difference with the same corresponding signal sequence number, the target peak difference is determined. The forward first wave threshold and the reverse first wave threshold are determined based on the target peak difference. In this way, the determination of the first wave threshold can be realized automatically, thereby reducing the labor cost and improving the efficiency of determining the first wave threshold.
[0147] The embodiment of the present invention further provides a chip, the chip is integrated with the ultrasonic flow device as described above. The embodiment of the present invention provides a machine-readable medium, on which instructions are stored, and when executed by one or more controllers, the controller is able to execute the first wave threshold processing method of the aforementioned embodiment. The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.
[0148] It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. It should be noted that all actions of acquiring signals, information or data in this application are carried out under the premise of complying with the corresponding data protection laws and policies of the country of residence and obtaining authorization from the owner of the corresponding device. The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal device to work in a predictable manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention. Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements. The first wave threshold processing method, an ultrasonic flow device, and a chip provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technicians in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A first wave threshold processing method, characterized in that: The method comprises: Identifying the first wave signal in the forward measurement process based on the forward initial threshold, and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold; When the first wave signal in the forward measurement process is identified, the peak values of the multiple echo signals in the forward measurement process are obtained to obtain multiple forward peak values; and, when the first wave signal in the reverse measurement process is identified, the peak values of the multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peak values; Determine a peak difference between adjacent peaks in the plurality of forward peaks to obtain a forward peak difference, and determine a peak difference between adjacent peaks in the plurality of reverse peaks to obtain a reverse peak difference; Determine a target peak difference based on the peak difference in the forward peak difference and the peak difference in the reverse peak difference with the same corresponding signal sequence number; A forward first wave threshold and a reverse first wave threshold are determined based on the target peak difference.
2. The method according to claim 1, characterized in that The determining of the target peak difference based on the peak difference corresponding to the same signal sequence number in the forward peak difference and the reverse peak difference comprises: selecting a maximum forward peak difference from the forward peak differences, and selecting a maximum reverse peak difference from the reverse peak differences; If the signal number corresponding to the maximum forward peak difference is consistent with the signal number corresponding to the maximum reverse peak difference, the maximum forward peak difference is determined as the target forward peak difference, and the maximum reverse peak difference is determined as the target reverse peak difference.
3. The method according to claim 2, characterized in that The method further comprises: If the signal number corresponding to the maximum positive peak difference is inconsistent with the signal number corresponding to the maximum reverse peak difference, the maximum positive peak difference and the maximum reverse peak difference are removed from the positive peak difference and the reverse peak difference respectively; The steps of selecting the maximum forward peak difference from the forward peak differences and selecting the maximum reverse peak difference from the reverse peak differences are performed again until the number of executions is greater than the first number threshold, or the maximum forward peak difference and the maximum reverse peak difference with the same corresponding signal sequence number are found.
4. The method according to claim 3, characterized in that The method further comprises: When the execution times are greater than the first times threshold, adjusting the forward initial threshold and the reverse initial threshold respectively based on a preset increment; The steps of identifying the first wave signal in the forward measurement process based on the forward initial threshold and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold are re-executed.
5. The method according to claim 2, characterized in that: The determining of a forward first wave threshold and a reverse first wave threshold based on the target peak value difference includes: Acquire a forward forward peak value used when determining the target forward peak difference as a forward reference value, and acquire a forward reverse peak value used when determining the target reverse peak difference as a reverse reference value; determining a forward reference increment based on the target forward peak difference, and determining a reverse reference increment based on the target reverse peak difference; The forward first wave threshold is determined based on the forward reference value and the forward reference increment, and the reverse first wave threshold is determined based on the reverse reference value and the reverse reference increment.
6. The method according to any one of claims 1 to 5, characterized in that: After determining the forward first wave threshold and the reverse first wave threshold based on the target peak difference, the method further includes: Determine the difference between the arrival time of the forward echo signal and the arrival time of the reverse echo signal to obtain the target time difference; When the target time difference exceeds the preset time difference range, determining the forward first wave amplitude difference and the reverse first wave amplitude difference; Based on the forward first wave amplitude difference and the reverse first wave amplitude difference, a threshold adjustment operation is performed to adjust the forward first wave threshold or the reverse first wave threshold.
7. The method according to claim 6, characterized in that The performing of a threshold adjustment operation based on the forward first wave amplitude difference and the reverse first wave amplitude difference comprises: In the case where the positive first wave amplitude difference is smaller than the reverse first wave amplitude difference, if the positive first wave amplitude difference is smaller than the positive adjustment increment, increasing the positive first wave threshold; If the positive first wave amplitude difference is not less than the positive adjustment increment, lowering the reverse first wave threshold; In the case where the forward first wave amplitude difference is not less than the reverse first wave amplitude difference, if the reverse first wave amplitude difference is less than the reverse adjustment increment, increasing the reverse first wave threshold; If the reverse first wave amplitude difference is not less than the reverse adjustment increment, the forward first wave threshold is reduced.
8. The method according to claim 6, characterized in that After performing the threshold adjustment operation based on the forward first wave amplitude difference and the reverse first wave amplitude difference, the method further includes: Re-determining the difference between the arrival time of the forward echo signal and the arrival time of the reverse echo signal to obtain a new target time difference; When the new target time difference exceeds the preset time difference range, re-performing the threshold adjustment operation; When the number of executions of the threshold adjustment operation is greater than a second number threshold, adjusting the forward initial threshold and the reverse initial threshold respectively based on a preset increment; The steps of identifying the first wave signal in the forward measurement process based on the forward initial threshold and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold are re-executed.
9. An ultrasonic flow device, characterized in that: The device comprises: Two ultrasonic transducers arranged at intervals in the direction of the fluid for sending and receiving ultrasonic information; a time-to-digital converter, for measuring an ultrasonic time difference of the ultrasonic signal; The controller is configured as: Identifying the first wave signal in the forward measurement process based on the forward initial threshold, and identifying the first wave signal in the reverse measurement process based on the reverse initial threshold; When the first wave signal in the forward measurement process is identified, the peak values of the multiple echo signals in the forward measurement process are obtained to obtain multiple forward peak values; and, when the first wave signal in the reverse measurement process is identified, the peak values of the multiple echo signals in the reverse measurement process are obtained to obtain multiple reverse peak values; Determine a peak difference between adjacent peaks in the plurality of forward peaks to obtain a forward peak difference, and determine a peak difference between adjacent peaks in the plurality of reverse peaks to obtain a reverse peak difference; Determine a target peak difference based on the peak difference in the forward peak difference and the peak difference in the reverse peak difference with the same corresponding signal sequence number; A forward first wave threshold and a reverse first wave threshold are determined based on the target peak value difference to obtain a first wave threshold, and the fluid flow is measured using the first wave threshold and the ultrasonic time difference measured by the time-to-digital converter.
10. A chip, characterized in that: The chip is integrated with the ultrasonic flow device as described in claim 9 above.
Citation Information
Cited By
Method and device for determining head wave in ultrasonic flow measurement
CN120760814A
A method and device for determining the first wave in ultrasonic flow measurement
CN120760814B