Automatic adjustment method for head wave detection voltage threshold value of ultrasonic flowmeter
By dynamically monitoring the peak value of the ultrasonic received signal and adjusting the first wave trigger voltage threshold, combined with the fine-tuning mechanism of front and rear wave jump phenomenon, the measurement accuracy problems of ultrasonic flowmeter under complex operating conditions are solved, and the measurement accuracy of the ultrasonic flowmeter under signal amplitude changes and noise interference are achieved. High precision and stable flow rate measurement.
Patent Information
- Application Number
- CN202411358482.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In the case of signal amplitude changes and noise interference under complex operating conditions, the fixed voltage threshold method causes false triggering and leakage triggering, which affects measurement accuracy, especially in the face of disturbed flow, pipeline noise and electromagnetic radiation. , it is difficult to maintain stable performance.
By dynamically monitoring the peak value of ultrasonic received signals and adjusting the first wave trigger voltage threshold, a fine-tuning mechanism based on the front and rear wave jump phenomenon is introduced to ensure that the system accurately recognizes the first wave signal in a complex environment, reduces measurement errors, and enhances anti-interference ability.
It significantly improves the accuracy of flow velocity measurement and the anti-interference ability of the system, ensures stable performance in complex environments, meets the needs of high-precision metering and real-time response, and reduces disputes caused by inaccurate metering.
Smart Images

Figure CN119124319A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of flow velocity measurement, and in particular to a method for automatically adjusting a first wave detection voltage threshold of an ultrasonic flowmeter. Background Art
[0002] Ultrasonic flowmeters are widely used in the measurement of gases and liquids, especially in the fields of gas meters and water services. Due to their unique advantages, such as wide range ratio, extremely low starting flow, no mechanical rotating parts, and low maintenance requirements, they have received more and more attention. With the development of low-power electronic technology, most modern ultrasonic flowmeters are powered by batteries to meet the needs of urban gas and water metering. Ultrasonic flowmeters mainly measure flow rate by the difference in the time it takes for ultrasonic waves to propagate in the forward and reverse directions in the fluid medium. This measurement method is often called the time difference method and is the basic principle of most ultrasonic flowmeters on the market. The working principle of ultrasonic flowmeters is: an ultrasonic signal is emitted through a transmitting transducer, which passes through the medium (gas or liquid) and is received by a receiving transducer. When ultrasonic waves are transmitted in the forward and reverse directions, their propagation time is affected by the flow velocity of the fluid, and the time difference is the basis for measuring the flow velocity. In actual use, the zero-crossing detection method is used to identify the first wave of the received signal, that is, a fixed voltage threshold trigger circuit is used to determine the first wave. This trigger signal starts the subsequent zero-crossing detection circuit to calculate the duration of the ultrasonic wave in the forward and reverse directions, thereby measuring the flow rate of the fluid.
[0003] The prior art has the following deficiencies:
[0004] At present, most ultrasonic flow meters use the first wave detection method with a fixed voltage threshold, that is, when the amplitude of the received signal exceeds or falls below the set voltage threshold, a comparator generates a trigger signal to identify the first wave. However, as environmental conditions change and the amplitude of the signal after amplification becomes unstable, the fixed voltage threshold method will cause two problems:
[0005] The received signal amplitude is too large or too small: When the signal amplitude is too large and the voltage threshold is too low, it may be falsely triggered before the first wave is detected, resulting in wave skipping. Conversely, when the signal amplitude is too small and the voltage threshold is too high, the first wave may not be effectively identified, resulting in detection failure.
[0006] Difference in signal-to-noise ratio: When the signal-to-noise ratio is poor, the interference of noise signals will increase the error of first wave recognition, directly leading to inaccurate measurement or even failure to work properly. This is particularly evident under complex working conditions, especially in the face of various disturbed flows, pipeline noise and surrounding electromagnetic radiation. The signal quality is poor, and the fixed voltage threshold trigger method is difficult to cope with signal fluctuations and noise interference.
[0007] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0008] The purpose of the present invention is to provide an automatic adjustment method for the voltage threshold of the first wave detection of an ultrasonic flowmeter, which significantly improves the accuracy of flow velocity measurement by dynamically monitoring the peak value of the ultrasonic receiving signal and adjusting the first wave trigger voltage threshold. The mechanism can adapt to the changes in signal amplitude under different working conditions, reduce false triggering and leak triggering caused by fixed thresholds, thereby reducing measurement errors, improving measurement accuracy, and reducing disputes caused by inaccurate measurement. In addition, the system has enhanced anti-interference capabilities, can effectively filter out external noise influences, and still accurately identify the first wave signal under low signal-to-noise ratio conditions, ensuring stable performance in complex environments. At the same time, the present invention introduces a fine-tuning mechanism based on the front and back wave jumping phenomenon, which further improves the adaptability to changes in signal waveforms. By detecting the wave jumping situation and adjusting the trigger voltage in time, the mechanism ensures the reliable identification of the first wave signal, prevents measurement failure, and enables the ultrasonic flowmeter to continue to work stably in a dynamically changing industrial environment, meeting the needs of high-precision measurement and real-time response, so as to solve the problems in the above-mentioned background technology.
[0009] In order to achieve the above-mentioned purpose, the present invention provides the following technical solutions: a method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter, which ensures that the ultrasonic flowmeter can accurately identify the first wave and measure the flow rate under complex working conditions by dynamically detecting and adjusting the peak value and wave jumping phenomenon of the received signal. The method includes the following steps:
[0010] S101, initializing the peak value acquisition circuit, adjustable potentiometer, logic control circuit, first wave trigger and zero-crossing control circuit of the system, and adjusting the amplifier gain;
[0011] S102, amplifying the received signal through an amplifier and collecting its highest peak value, determining whether the peak value is within a preset range, and calculating the first wave trigger voltage threshold according to the peak value;
[0012] S103, adjusting the resistance value of the adjustable potentiometer to obtain a trigger voltage corresponding to the voltage threshold;
[0013] S104, detecting the waveform of the received signal through a comparator to identify whether a pre-wave jump or a post-wave jump phenomenon occurs;
[0014] S105 , further fine-tuning the voltage threshold according to the detected front wave jump or back wave jump situation to ensure minimization of the wave jump phenomenon and obtain an accurate first wave detection voltage threshold.
[0015] Preferably, the amplifier gain is adjusted, specifically:
[0016] The amplifier is an amplifier with automatic gain control function. The gain of the amplifier is adjusted by the microprocessor during initialization. When the amplifier gain is G1, the measured amplified signal amplitude is V1, and the required target amplitude is V0. The gain is required to be adjusted to: G = G1*V0 / V1. Based on the calculated gain G, the microprocessor adjusts the amplifier with AGC function to amplify the signal according to the gain G.
[0017] Preferably, the received signal is amplified by an amplifier and its highest peak value is collected to determine whether the peak value is within a preset range. The specific steps are as follows:
[0018] The microprocessor compares the highest peak value collected with the preset signal amplitude range. If the peak value is within the range, the signal amplitude meets the requirements and the system enters the subsequent first-wave trigger voltage calculation and adjustment steps. If it is not within the signal amplitude range, the system will readjust the amplifier gain to ensure that the signal amplitude is within the set range, thereby ensuring the stability and reliability of the received signal.
[0019] Preferably, the first wave trigger voltage threshold is calculated according to the wave peak value, and the specific steps are as follows:
[0020] The first wave trigger voltage threshold Vth is calculated according to the peak value of the received signal by the formula: Vth=C*Vpp, where C is the proportional coefficient, which is a constant between 0.11-0.15, and Vpp is the peak value. The proportional coefficient is set according to the system hardware characteristics and the number of excitation waves to ensure that the trigger voltage is adjusted proportionally to the amplitude of the received signal, so that the trigger voltage can adapt to complex working conditions and reduce the influence of wave jumping on the measurement results.
[0021] Preferably, the resistance value of the adjustable potentiometer is adjusted to obtain a trigger voltage corresponding to the voltage threshold, and the specific steps are as follows:
[0022] The microprocessor adjusts the resistance value R2 of the adjustable potentiometer through the voltage divider circuit according to the calculated trigger voltage Vth. The voltage divider circuit is composed of a reference voltage source Vref, a resistor R1 and an adjustable potentiometer R2. The calculation formula of the resistor R2 is: R2 = R1*Vth / (Vref-Vth). According to the formula, the microprocessor adjusts the resistance value of the adjustable potentiometer so that the voltage output by the voltage divider circuit matches the calculated trigger voltage Vth, ensuring that the trigger voltage threshold corresponds accurately to the amplitude of the received signal, thereby achieving accurate triggering of the first wave;
[0023] The positive and negative input terminals of the comparator are respectively connected to the received signal and the first wave trigger voltage threshold Vth. When the amplitude of the received signal exceeds the first wave trigger voltage threshold, the comparator outputs a trigger signal and starts the first wave trigger and zero-crossing detection circuit. Then the system detects the zero point position of the received signal and outputs several square wave signals. The square wave signal is used to calculate the forward and reverse duration of the ultrasonic wave. By calculating the difference between the forward and reverse durations, the accurate fluid flow rate is obtained.
[0024] Preferably, the specific steps of detecting the waveform of the received signal by a comparator and identifying the pre-wave jump or post-wave jump phenomenon are:
[0025] The received signal is amplified by the amplifier and then enters the comparator. The two input terminals of the comparator receive the amplified signal and the first wave trigger voltage threshold Vth respectively. When the instantaneous value of the received signal exceeds the threshold Vth for the first time, the comparator outputs a trigger signal, which starts the zero-crossing comparator (which can be a forward or reverse zero-crossing comparison) with this trigger signal, and marks the moment of the first zero-crossing point as t0, which is the first wave zero-crossing trigger point.
[0026] The system continuously monitors the waveform of the received signal. After recording the trigger point t0, the system continues to track the first zero-crossing time after the highest peak of the received signal, and calculates the time difference Δt between the highest waveform peak and the first wave zero-crossing trigger point. The time difference is the time required for the received signal to pass from the first wave zero-crossing trigger to the first zero-crossing time after the received wave reaches its maximum value. It is used to determine the wave-hopping phenomenon. The calculation expression of the time difference is: Δt = t p -t0, where t p It is the time point when the first zero crossing occurs after the highest peak, and t0 is the trigger point time of the first zero crossing;
[0027] The time difference Δt is within the predetermined reference threshold range Δt min ~Δt max For comparison (where Δt min , Δt max It is related to the number of excitation waves and the hardware circuit) to determine whether the signal waveform has a wave jump phenomenon. If the time difference Δt is too small, it means that the signal is triggered too early, that is, the pre-wave jump phenomenon occurs; if the time difference Δt is too large, it means that the signal is triggered too late, and the post-wave jump phenomenon occurs, which is specifically expressed as: Among them, Δt min and Δt max It is the minimum and maximum value of the predetermined reference threshold range, which is used to determine whether there is a wave jumping phenomenon.
[0028] Preferably, based on the detected pre-wave phenomenon, when a parasitic wave appears before the first wave of the received signal and the amplitude of the parasitic wave is close to or exceeds the first wave trigger voltage threshold Vth, the microprocessor increases the first wave trigger voltage threshold Vth by ΔVth each time according to the number of wave jumps. The adjustment range of ΔVth is 20mV to 30mV. The fine-tuning mechanism eliminates the pre-wave phenomenon by gradually increasing the voltage threshold, thereby ensuring the accuracy of the measurement signal and the stability of the system.
[0029] Preferably, based on the detected post-wave jump phenomenon, when the first wave amplitude of the received signal is lower than the first wave trigger voltage threshold Vth and the first wave cannot be effectively triggered, the microprocessor reduces the first wave trigger voltage threshold Vth by ΔVth each time according to the number of wave jumps. The adjustment range of ΔVth is 20mV to 30mV. By lowering the first wave trigger voltage threshold, the stable operation of the system under low amplitude signals is ensured.
[0030] Preferably, the adjustment process of the first-wave trigger voltage threshold Vth allows up to two fine adjustments to reduce the consumption of system resources and improve efficiency. After two fine adjustments, if the wave jumping phenomenon still exists, the system will restart the signal amplifier gain adjustment process and re-adjust the amplitude of the received signal to ensure the reliability of subsequent measurements and low-power operation of the system.
[0031] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0032] The present invention significantly improves the accuracy of flow rate measurement by real-time monitoring of the peak value of the ultrasonic receiving signal and dynamically adjusting the first wave trigger voltage threshold. Under different working conditions, the amplitude of the ultrasonic signal will vary due to changes in the medium, flow rate, temperature and pressure. Dynamic adjustment of the trigger voltage can ensure that the system responds in a timely manner when the signal amplitude is greater than or less than the set range. This adaptive mechanism effectively reduces the false triggering and missed triggering caused by the fixed threshold, thereby reducing the measurement error, improving the overall measurement accuracy, and further reducing trade disputes caused by inaccurate measurement. The present invention enhances the anti-interference ability of the system, especially in complex working environments, where external noise (such as electromagnetic interference and pipeline noise) often affects the signal quality. Through dynamic adjustment based on the signal peak, the system can effectively filter the influence of noise and ensure that the first wave signal can still be accurately identified under low signal-to-noise ratio conditions. This feature enables the ultrasonic flowmeter to maintain stable performance and reliable measurement results in an unstable environment, meeting the needs of modern industry for high-precision measurement.
[0033] The present invention introduces a fine-tuning mechanism based on the front and back wave jump phenomenon, which significantly enhances the system's adaptability to changes in signal waveforms. By detecting the front and back wave jumps in the steps, the system can determine whether the currently set trigger voltage is reasonable, and make timely fine-tuning according to the wave jump situation. The flexible adjustment mechanism ensures that the trigger voltage can adapt quickly under a variety of complex signal conditions, thereby ensuring reliable identification of the first wave signal. Even when the amplitude of the received signal fluctuates greatly, the system can still maintain accuracy and ensure measurement stability. At the same time, this fine-tuning mechanism improves the overall stability and reliability of the ultrasonic flowmeter. By effectively eliminating the negative impact of the wave jump phenomenon, the system can ensure the accuracy of the first wave detection and prevent measurement failures caused by wave jumps. This feature makes the ultrasonic flowmeter more reliable in practical applications, and can work continuously and stably in a changing industrial environment, meeting the high requirements for measurement accuracy and real-time response. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0035] Figure 1 The present invention is a method flow chart of the method for automatically adjusting the voltage threshold value of the first wave detection of the ultrasonic flow meter.
[0036] Figure 2 This is a block diagram of the signal processing principle of the ultrasonic flowmeter of the present invention.
[0037] Figure 3 Schematic diagram of the waveform of the ultrasonic flowmeter of the present invention.
[0038] Figure 4 Schematic diagram of the pre-hop wave of the present invention.
[0039] Figure 5 It is a schematic diagram of the post-wave jump of the present invention. DETAILED DESCRIPTION
[0040] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.
[0041] The present invention provides Figures 1 to 5The method for automatically adjusting the voltage threshold value of the first wave detection of the ultrasonic flowmeter as shown in the figure ensures that the ultrasonic flowmeter can accurately identify the first wave and measure the flow rate under complex working conditions by dynamically detecting and adjusting the peak value and wave jumping phenomenon of the received signal. The method includes the following steps:
[0042] S101, initializing the peak value acquisition circuit, adjustable potentiometer, logic control circuit, first wave trigger and zero-crossing control circuit of the system, and adjusting the amplifier gain;
[0043] The amplifier is an amplifier with automatic gain control function. The gain of the amplifier is adjusted by the microprocessor during initialization. When the amplifier gain is G1, the measured amplified signal amplitude is V1, and the target amplitude is required to be V0, then the gain is required to be adjusted to: H = G1*V0 / V1. According to the calculated gain G, the microprocessor adjusts the amplifier with AGC function to amplify the signal according to the gain G. Due to the influence of various factors, the amplified signal amplitude will generally deviate from the target value V0, but it will generally be within the peak range; if it exceeds, it needs to be adjusted again. In order to reduce power consumption, the number of adjustments is generally limited to 3 times.
[0044] S102, amplifying the received signal through an amplifier and collecting its highest peak value, determining whether the peak value is within a preset range, and calculating the first wave trigger voltage threshold according to the peak value;
[0045] The microprocessor compares the highest peak value collected with the preset signal amplitude range (usually set to 900mV to 1100mV). If the peak value is within the range, the signal amplitude meets the requirements, and the system enters the subsequent first-wave trigger voltage calculation and adjustment steps; if it is not within the signal amplitude range, the system will readjust the amplifier gain to ensure that the signal amplitude meets the set range, thereby ensuring the stability and reliability of the received signal.
[0046] The first wave trigger voltage threshold Vth is calculated according to the peak value of the received signal by the formula: Vth=C*Vpp, where C is the proportional coefficient, which is a constant between 0.11-0.15, and Vpp is the peak value. The proportional coefficient is set according to the system hardware characteristics and the number of excitation waves to ensure that the trigger voltage is adjusted proportionally to the amplitude of the received signal, so that the trigger voltage can adapt to complex working conditions and reduce the influence of wave jumping on the measurement results.
[0047] S103, adjusting the resistance value of the adjustable potentiometer to obtain a trigger voltage corresponding to the voltage threshold;
[0048] The microprocessor adjusts the resistance value R2 of the adjustable potentiometer through the voltage divider circuit according to the calculated trigger voltage Vth. The voltage divider circuit is composed of a reference voltage source Vref, a resistor R1 and an adjustable potentiometer R2. The calculation formula of the resistor R2 is: R2 = R1*Vth / (Vref-Vth). According to this formula, the microprocessor adjusts the resistance value of the adjustable potentiometer so that the voltage output by the voltage divider circuit matches the calculated trigger voltage Vth, ensuring that the trigger voltage threshold corresponds accurately to the amplitude of the received signal, thereby achieving accurate triggering of the first wave.
[0049] The positive and negative input terminals of the comparator are connected to the received signal and the first wave trigger voltage threshold Vth respectively. When the amplitude of the received signal exceeds the first wave trigger voltage threshold, the comparator outputs a trigger signal and starts the first wave trigger and zero-crossing detection circuit. Then the system detects the zero point position of the received signal and outputs several square wave signals. These square wave signals are used to calculate the forward and reverse duration of the ultrasonic wave. By calculating the difference between the forward and reverse durations, the accurate fluid flow rate is obtained.
[0050] S104, detecting the waveform of the received signal through a comparator to identify whether a pre-wave jump or a post-wave jump phenomenon occurs;
[0051] The received signal is amplified by the amplifier and then enters the comparator. The two input terminals of the comparator receive the amplified signal and the first wave trigger voltage threshold Vth respectively. When the instantaneous value of the received signal exceeds the threshold Vth for the first time, the comparator outputs a trigger signal, which starts the zero-crossing comparator (which can be a forward or reverse zero-crossing comparison) with this trigger signal, and marks the moment of the first zero-crossing point as t0, which is the first wave zero-crossing trigger point.
[0052] The system continuously monitors the waveform of the received signal. After recording the trigger point t0, the system continues to track the first zero-crossing time after the highest peak of the received signal, and calculates the time difference Δt between the highest waveform peak and the first wave zero-crossing trigger point. The time difference is the time required for the received signal to pass from the first wave zero-crossing trigger to the first zero-crossing time after the received wave reaches its maximum value. It is used to determine the wave-hopping phenomenon. The calculation expression of the time difference is: Δt = t p -t0, where t p It is the time point when the first zero crossing occurs after the highest peak, and t0 is the trigger point time of the first zero crossing;
[0053] The time difference Δt is within the predetermined reference threshold range Δt min ~Δt max For comparison (where Δt min , Δt maxIt is related to the number of excitation waves and the hardware circuit) to determine whether the signal waveform has a wave jump phenomenon. If the time difference Δt is too small, it means that the signal is triggered too early, that is, the pre-wave jump phenomenon occurs; if the time difference Δt is too large, it means that the signal is triggered too late, and the post-wave jump phenomenon occurs, which is specifically expressed as: Among them, Δt min and Δt max It is the minimum and maximum value of the predetermined reference threshold range, which is used to determine whether there is a wave jumping phenomenon.
[0054] S105, further fine-tuning the voltage threshold according to the detected front wave jump or back wave jump situation to ensure minimization of the wave jump phenomenon and obtain an accurate first wave detection voltage threshold;
[0055] Based on the detected pre-jump wave phenomenon, when a parasitic wave appears before the first wave of the received signal, and the amplitude of the parasitic wave is close to or exceeds the first wave trigger voltage threshold Vth, the microprocessor increases the first wave trigger voltage threshold Vth by ΔVth each time according to the number of wave jumps, and the adjustment range of ΔVth is 20mV to 30mV. This fine-tuning mechanism eliminates the pre-jump wave phenomenon by gradually increasing the voltage threshold, ensuring the accuracy of the measurement signal and the stability of the system.
[0056] A parasitic wave refers to an unexpected waveform or noise that accompanies the main signal in the signal waveform, and usually occurs before the expected first wave signal. It is usually caused by external interference, equipment noise, or oscillation of the system itself, and the amplitude may be close to or even exceed the first wave trigger voltage threshold Vth set by the system. If not distinguished, the parasitic wave can easily be mistaken by the system as the first wave signal, resulting in a pre-jump wave phenomenon, that is, the first wave is triggered too early. This erroneous triggering will affect the accuracy of the ultrasonic flowmeter and cause measurement errors. Therefore, when a parasitic wave is detected, it is necessary to avoid false triggering by fine-tuning the trigger voltage threshold Vth to ensure that the system can correctly identify the first wave and make accurate measurements.
[0057] Based on the detected post-wave jump phenomenon, when the first wave amplitude of the received signal is lower than the first wave trigger voltage threshold Vth and the first wave cannot be effectively triggered, the microprocessor reduces the first wave trigger voltage threshold Vth by ΔVth each time according to the number of wave jumps, and the adjustment range of ΔVth is 20mV to 30mV. By reducing the first wave trigger voltage threshold, this method can effectively deal with the detection difficulties when the signal amplitude is small, ensuring the stable operation of the system under low amplitude signals.
[0058] The adjustment process of the first wave trigger voltage threshold Vth allows for up to two fine adjustments to reduce the consumption of system resources and improve efficiency. After two fine adjustments, if the wave hopping phenomenon still exists, the system will restart the signal amplifier gain adjustment process and re-adjust the amplitude of the received signal to ensure the reliability of subsequent measurements and low power consumption of the system.
[0059] The specific implementation of the present invention is:
[0060] Before each detection, the microprocessor initializes the peak acquisition circuit, adjustable potentiometer (digital or voltage control), logic control circuit, first wave trigger and zero-crossing control circuit, and enables the amplifier (PGA) and adjusts its gain; at the same time, after an appropriate delay, the microprocessor and logic control circuit control the enable comparator.
[0061] The receiving signal from the receiving transducer of the measurement channel is amplified by an amplifier (PGA) with a preset gain to obtain the receiving signal. The receiving signal is sampled by the peak acquisition circuit to obtain its highest signal peak value. The microprocessor performs AD conversion to read the peak value. If the peak value meets the required range, subsequent processing is performed; if it does not meet the requirements, the gain value is recalculated and the amplifier gain is adjusted until the amplitude of the received signal meets the required range; the upper and lower limits of the peak range of the received signal are set by the software. The general signal amplitude range is 900mV~1100mV, and the target value is V0=1000mV. The specific adjustment steps are as follows:
[0062] Assuming that the measured amplified signal amplitude is V1 when the amplifier gain is G1, and the required target amplitude is V0, the gain is required to be adjusted to: G=G1*V0 / V1. According to the calculated gain G, the microprocessor adjusts the amplifier with AGC function to amplify the signal according to the gain G. Due to the influence of various factors, the amplified signal amplitude will generally deviate from the target value V0, but it will generally be within the peak range; if it exceeds, it needs to be adjusted again. In order to reduce power consumption, the number of adjustments is generally limited to 3 times.
[0063] After the peak value of the received signal meets the required range or is adjusted for the maximum number of times, the microprocessor obtains the first-wave trigger voltage threshold Vth according to the designed adjustment coefficient based on the size of the highest wave peak voltage obtained by AD sampling, and calculates the resistance value of the adjustable potentiometer and its corresponding control data or control voltage through the voltage divider network composed of the voltage source Vref (to ensure the stability of the trigger voltage, the voltage source Vref of the voltage divider circuit is provided by a voltage regulator chip LDO or a reference voltage chip with a smaller temperature coefficient), the resistor R1 and the resistor R2 of the adjustable potentiometer, and controls the adjustable potentiometer to obtain the first-wave trigger voltage threshold Vth.
[0064] The positive and negative input terminals of the comparator are respectively input with the received signal and the first wave trigger voltage threshold Vth. When the peak value of the leftmost signal (first wave) of the received signal is higher than the first wave trigger voltage threshold Vth, the output signal level of the comparator changes (from high to low or from low to high). Thereafter, the first wave trigger and zero-crossing control circuit quickly cuts the comparison potential of the reverse input terminal of the comparator to the AC zero potential. In this way, when the first waveform of the received signal is lower than the middle axis of the received signal (AC zero potential), the output level of the comparator is restored to the state before the first wave trigger, that is, the comparator outputs a square wave signal under the control of the first wave trigger and zero-crossing control circuit and the logic control circuit. The square wave is used to control the first wave trigger and zero-crossing control circuit to enable the comparator.
[0065] The positive and negative input terminals of the comparator are respectively connected to the received signal and the AC zero point. The first wave trigger and zero-crossing control circuit enables the comparator to perform zero-crossing comparison and output several square wave signals (see square wave signal) under the control of a square wave output by the comparator until the first wave trigger and zero-crossing control circuit shuts down the comparator.
[0066] The timing circuit can obtain the forward and reverse duration of the ultrasonic wave and calculate the time difference by timing the time from the moment the excitation wave is emitted to the moment when several rising edges or falling edges of the square wave signal are received, thereby realizing flow velocity measurement.
[0067] The processing method for adjusting the first wave trigger voltage threshold Vth based on the received signal amplitude is:
[0068] The peak value acquisition circuit collects the received signal to obtain the highest wave peak voltage of the received signal (i.e. the highest signal amplitude, generally the 4th to 7th wave, which is related to the number of excitation waves). The highest wave peak voltage collected by the microprocessor AD is set as Vpp;
[0069] For the same circuit, since the first wave amplitude Vp1 of the received signal is basically proportional to the peak value Vpp, the first wave trigger voltage threshold Vth is calculated according to the following formula: Vth=C*Vpp, where C is the proportional coefficient, generally 0.11~0.15, which is related to the circuit and the number of excitation waves.
[0070] The first wave trigger voltage is generated by a voltage divider circuit consisting of a voltage source Vref, a resistor R1 and a potentiometer R2. The microprocessor calculates the resistance value R2 of the adjustable potentiometer according to the voltage divider circuit and the first wave trigger voltage threshold Vth as follows: R2 = R1*Vth / (Vref-Vth).
[0071] The microprocessor controls the resistance value of the adjustable potentiometer to R2 according to the resistance value R2 and the characteristics of the adjustable potentiometer (which can be a digital potentiometer or a voltage-controlled potentiometer), so that the first wave trigger voltage threshold Vth of the reverse input terminal of the comparator can be obtained.
[0072] When the signal changes to a large amplitude and a small amplitude, the first wave trigger voltage thresholds Vth1 and Vth2 are generated according to the above method, respectively, Vth1>Vth2 to meet the first wave triggering needs of received signals with different amplitudes. Figure 2 and Figure 3 .
[0073] Analysis of the possible results if a fixed first wave trigger voltage threshold Vth is used:
[0074] When the amplitude of the received signal is large, there may be a parasitic wave with an amplitude slightly lower than the amplitude of the first wave before the first wave of the received signal. If the first wave trigger voltage threshold Vth is fixed and lower than the parasitic wave amplitude, a pre-jump wave will be generated. Figure 4 As shown;
[0075] When the amplitude of the received signal is too small, the amplitude of the first wave of the received signal is low. If the first wave trigger voltage threshold Vth is fixed and higher than the first wave amplitude, a post-jump wave will be generated. Figure 5 As shown;
[0076] The above wave jumps will lead to mismeasurement, and cause huge measurement errors, or even failure to work normally.
[0077] The processing method of adjusting the first wave trigger voltage threshold Vth based on the number of previous and next jump waves:
[0078] Although the "processing method of adjusting the first wave trigger voltage threshold Vth based on the received signal amplitude" can greatly reduce the probability of wave jumping, there is still the possibility of front and back wave jumping. In order to further improve the reliability of the measurement, the "processing method of fine-tuning the first wave trigger voltage threshold Vth based on front and back wave jumping" is further adopted. The specific steps are as follows:
[0079] If the medium conditions and working environment conditions are basically the same, the total forward and reverse transmission time of the same channel ultrasound at different flow rates is basically unchanged, but the medium conditions and working environment generally change slowly. This feature can be used to basically correctly judge whether the detection process has a front jump wave or a back jump wave.
[0080] When it happens Figure 4 When a pre-jump wave is shown, it means that the amplitude of the received signal is still too high or the first wave trigger voltage threshold Vth is too low. The microprocessor increases Vth by ΔVth according to the number of wave jumps, then Vth′=Vth+ΔVth, where ΔVth=20mV~30mV, Vth' is the adjusted voltage threshold, which is specifically related to the set signal peak range; if a pre-jump wave still exists after adjustment, ΔVth is increased again.
[0081] When it happens Figure 5When the post-jump wave is shown, it means that the received signal amplitude is still too low or the first wave trigger voltage threshold Vth is too high. The microprocessor adjusts Vth down by ΔVth according to the number of wave jumps, then Vth′=Vth-ΔVth; if the post-jump wave still exists after adjustment, ΔVth is further fine-tuned.
[0082] The above fine-tuning can be performed twice at most. If wave skipping still exists, the amplitude is readjusted according to the processing method of adjusting the first wave trigger voltage threshold Vth based on the amplitude of the received signal.
[0083] The present invention significantly improves the accuracy of flow rate measurement by real-time monitoring of the peak value of the ultrasonic receiving signal and dynamically adjusting the first wave trigger voltage threshold. Under different working conditions, the amplitude of the ultrasonic signal will vary due to changes in the medium, flow rate, temperature and pressure. Dynamic adjustment of the trigger voltage can ensure that the system responds in a timely manner when the signal amplitude is greater than or less than the set range. This adaptive mechanism effectively reduces the false triggering and missed triggering caused by the fixed threshold, thereby reducing the measurement error, improving the overall measurement accuracy, and further reducing trade disputes caused by inaccurate measurement. The present invention enhances the anti-interference ability of the system, especially in complex working environments, where external noise (such as electromagnetic interference and pipeline noise) often affects the signal quality. Through dynamic adjustment based on the signal peak, the system can effectively filter the influence of noise and ensure that the first wave signal can still be accurately identified under low signal-to-noise ratio conditions. This feature enables the ultrasonic flowmeter to maintain stable performance and reliable measurement results in an unstable environment, meeting the needs of modern industry for high-precision measurement.
[0084] The present invention introduces a fine-tuning mechanism based on the front and back wave jump phenomenon, which significantly enhances the system's adaptability to changes in signal waveforms. By detecting the front and back wave jumps in the steps, the system can determine whether the currently set trigger voltage is reasonable, and make timely fine-tuning according to the wave jump situation. The flexible adjustment mechanism ensures that the trigger voltage can adapt quickly under a variety of complex signal conditions, thereby ensuring reliable identification of the first wave signal. Even when the amplitude of the received signal fluctuates greatly, the system can still maintain accuracy and ensure measurement stability. At the same time, this fine-tuning mechanism improves the overall stability and reliability of the ultrasonic flowmeter. By effectively eliminating the negative impact of the wave jump phenomenon, the system can ensure the accuracy of the first wave detection and prevent measurement failures caused by wave jumps. This feature makes the ultrasonic flowmeter more reliable in practical applications, and can work continuously and stably in a changing industrial environment, meeting the high requirements for measurement accuracy and real-time response.
[0085] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
[0086] It should be noted that, in this article, if there are relational terms such as first and second, etc., they are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0087] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0088] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0089] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0090] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0091] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0092] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0093] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0094] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter, characterized in that: By dynamically detecting and adjusting the peak value and wave-hopping phenomenon of the received signal, it is ensured that the ultrasonic flowmeter can accurately identify the first wave and measure the flow velocity under complex working conditions. The method includes the following steps: S101, initializing the peak value acquisition circuit, adjustable potentiometer, logic control circuit, first wave trigger and zero-crossing control circuit of the system, and adjusting the amplifier gain; S102, amplifying the received signal through an amplifier and collecting its highest peak value, determining whether the peak value is within a preset range, and calculating the first wave trigger voltage threshold according to the peak value; S103, adjusting the resistance value of the adjustable potentiometer to obtain a trigger voltage corresponding to the voltage threshold; S104, detecting the waveform of the received signal through a comparator to identify whether a pre-wave jump or a post-wave jump phenomenon occurs; S105 , further fine-tuning the voltage threshold according to the detected front wave jump or back wave jump situation to ensure minimization of the wave jump phenomenon and obtain an accurate first wave detection voltage threshold.
2. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: Adjust the amplifier gain as follows: The amplifier is an amplifier with automatic gain control function. The gain of the amplifier is adjusted by the microprocessor during initialization. When the amplifier gain is G1, the measured amplified signal amplitude is V1, and the required target amplitude is V0. The gain is required to be adjusted to: G = G1*V0 / V1. Based on the calculated gain G, the microprocessor adjusts the amplifier with AGC function to amplify the signal according to the gain G.
3. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: The received signal is amplified by an amplifier and its highest peak value is collected to determine whether the peak value is within a preset range. The specific steps are as follows: The microprocessor compares the collected highest wave peak value with the preset signal amplitude range. If the peak value is within the range, the signal amplitude meets the requirements, and the system enters the subsequent first wave trigger voltage calculation and adjustment steps; If the signal amplitude is not within the range, the system will readjust the amplifier gain to ensure that the signal amplitude is within the set range, thereby ensuring the stability and reliability of the received signal.
4. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: Calculate the first wave trigger voltage threshold according to the wave peak value. The specific steps are as follows: The first wave trigger voltage threshold Vth is calculated according to the peak value of the received signal by the formula: Vth=C*Vpp, where C is the proportional coefficient, which is a constant between 0.11-0.15, and Vpp is the peak value. The proportional coefficient is set according to the system hardware characteristics and the number of excitation waves to ensure that the trigger voltage is adjusted proportionally to the amplitude of the received signal, so that the trigger voltage can adapt to complex working conditions and reduce the influence of wave jumping on the measurement results.
5. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: Adjust the resistance value of the adjustable potentiometer to obtain the trigger voltage corresponding to the voltage threshold. The specific steps are: The microprocessor adjusts the resistance value R2 of the adjustable potentiometer through the voltage divider circuit according to the calculated trigger voltage Vth. The voltage divider circuit is composed of a reference voltage source Vref, a resistor R1 and an adjustable potentiometer R2. The calculation formula of the resistor R2 is: R2 = R1*Vth / (Vref-Vth). According to the formula, the microprocessor adjusts the resistance value of the adjustable potentiometer so that the voltage output by the voltage divider circuit matches the calculated trigger voltage Vth, ensuring that the trigger voltage threshold corresponds accurately to the amplitude of the received signal, thereby achieving accurate triggering of the first wave; The positive and negative input terminals of the comparator are respectively connected to the received signal and the first wave trigger voltage threshold Vth. When the amplitude of the received signal exceeds the first wave trigger voltage threshold, the comparator outputs a trigger signal and starts the first wave trigger and zero-crossing detection circuit. Then the system detects the zero point position of the received signal and outputs several square wave signals. The square wave signal is used to calculate the forward and reverse duration of the ultrasonic wave. By calculating the difference between the forward and reverse durations, the accurate fluid flow rate is obtained.
6. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: The specific steps of detecting the waveform of the received signal by a comparator and identifying the pre-jump wave or post-jump wave phenomenon are as follows: The received signal is amplified by the amplifier and then enters the comparator. The two input terminals of the comparator receive the amplified signal and the first wave trigger voltage threshold Vth respectively. When the instantaneous value of the received signal exceeds the threshold Vth for the first time, the comparator outputs a trigger signal, which starts the zero-crossing comparator and marks the moment of the first zero-crossing point as t0, which is the first wave zero-crossing trigger point. The system continuously monitors the waveform of the received signal. After recording the trigger point t0, the system continues to track the first zero-crossing time after the highest peak of the received signal, and calculates the time difference Δt between the highest waveform peak and the first wave zero-crossing trigger point. The time difference is the time required for the received signal to pass from the first wave zero-crossing trigger to the first zero-crossing time after the received wave reaches its maximum value. It is used to determine the wave-hopping phenomenon. The calculation expression of the time difference is: Δt = t p -t0, where t p It is the time point when the first zero crossing occurs after the highest peak, and t0 is the trigger point time of the first zero crossing; The time difference Δt is within the predetermined reference threshold range Δt min ~Δt max Compare and judge whether the signal waveform has wave jumping phenomenon. If the time difference Δt is too small, it means that the signal is triggered too early, that is, the pre-wave jumping phenomenon occurs; if the time difference Δt is too large, it means that the signal is triggered too late, and the post-wave jumping phenomenon occurs, which is specifically expressed as: Among them, Δt min and Δt max It is the minimum and maximum value of the predetermined reference threshold range, which is used to determine whether there is a wave jumping phenomenon.
7. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: Based on the detected pre-wave phenomenon, when a parasitic wave appears before the first wave of the received signal and the amplitude of the parasitic wave is close to or exceeds the first-wave trigger voltage threshold Vth, the microprocessor increases the first-wave trigger voltage threshold Vth by ΔVth each time according to the number of wave jumps. The adjustment range of ΔVth is 20mV to 30mV. The fine-tuning mechanism eliminates the pre-wave phenomenon by gradually increasing the voltage threshold to ensure the accuracy of the measurement signal and the stability of the system.
8. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: Based on the detected post-wave jump phenomenon, when the first wave amplitude of the received signal is lower than the first wave trigger voltage threshold Vth and the first wave cannot be effectively triggered, the microprocessor reduces the first wave trigger voltage threshold Vth by ΔVth each time according to the number of wave jumps. The adjustment range of ΔVth is 20mV to 30mV. By lowering the first wave trigger voltage threshold, the system is ensured to operate stably under low-amplitude signals.
9. The method for automatically adjusting the voltage threshold of the first wave detection of an ultrasonic flowmeter according to claim 1, characterized in that: The adjustment process of the first-wave trigger voltage threshold Vth allows up to two fine adjustments to reduce the consumption of system resources and improve efficiency. After two fine adjustments, if the wave jumping phenomenon still exists, the system will restart the signal amplifier gain adjustment process and re-adjust the amplitude of the received signal to ensure the reliability of subsequent measurements and low-power operation of the system.
Citation Information
Patent Citations
Thickness measuring method based on electro-magnetic ultrasonic wave
CN105841645A
Low-frequency network voltage fluctuation detection and protection method of traction power supply system
CN107528292A
Anti-fault wave detection device for gas ultrasonic flowmeter
CN109579950A
Gas ultrasonic flowmeter signal processing method based on similarity analysis
CN111044110A
Ultrasonic flowmeter time difference stable measurement method based on envelope threshold-peak value method
CN113758543A
Cited By
Automatic gain control method and circuit for ultrasonic flow metering device
CN119642912A
An automatic gain control method and circuit for ultrasonic flow metering devices
CN119642912B
Receiving waveform position discrimination method for ultrasonic flow metering device
CN119642913A
Head wave threshold voltage setting method for ultrasonic flow metering device
CN119714482A
A method for setting the first wave threshold voltage of an ultrasonic flow measurement device
CN119714482B
