Gain value adjusting method of ultrasonic flowmeter, computer storage medium and ultrasonic flowmeter
Through software-controlled gain adjustment methods and mathematical model verification, the reliability and accuracy issues of gain values in existing ultrasonic flow meters have been resolved, achieving both reliability and accuracy, especially timely adjustment under abnormal conditions.
Patent Information
- Application Number
- CN202411139045.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-03
AI Technical Summary
Existing ultrasonic flow meters rely on hardware to obtain the signal voltage value and then control the gain value. The gain value has low reliability and low measurement accuracy, and it cannot be adjusted in time under abnormal conditions.
A software-controlled gain adjustment method is adopted, which is verified through a series of steps and mathematical models to ensure that the difference between the actual gain value and the ideal gain value is within 0.1V, and timely adjustment is made in case of abnormalities.
It improves the reliability of the gain value and the accuracy of the measurement, ensuring timely adjustment in abnormal situations, with the difference in gain value adjustment within 0.1V.
Smart Images

Figure CN121594982A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic flow meter technology, and more specifically, to a method for adjusting the gain value of an ultrasonic flow meter, a computer storage medium, and an ultrasonic flow meter. Background Technology
[0002] As one of the most advanced and accurate flow measurement instruments in the world, ultrasonic flow meters are widely used in process detection and trade transfer measurement in industries such as petroleum, petrochemical, chemical, pharmaceutical, papermaking, food and energy. They can easily determine the volumetric flow rate in pipelines.
[0003] The flow rate of an ultrasonic flow meter is adjusted by changing the angle of the ultrasonic probe, thereby adjusting the ultrasonic wave propagation path and measurement distance at the measurement point. Therefore, the method for adjusting the flow rate will vary depending on the different designs of the flow meter and the application scenarios.
[0004] A common AGC (Automatic Gain Control) method: First, the detection circuit converts the signal into a voltage signal, and the control circuit converts the detected signal strength into a control voltage to control the amplifier gain value. This process is repeated to keep the signal at a stable level.
[0005] Existing ultrasonic flow meters rely on hardware to obtain signal voltage values and then control the gain value. This results in low reliability of the gain value and low measurement accuracy. Furthermore, they cannot be adjusted in a timely manner when abnormalities occur.
[0006] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention
[0007] The purpose of this invention is to provide a gain adjustment method for an ultrasonic flow meter, a computer storage medium, and an ultrasonic flow meter. The gain adjustment method for the ultrasonic flow meter ensures that the difference between the actual gain value and the ideal gain value is within 0.1V, verifies the reliability of the gain value, and the accuracy of the measurement; and ensures timely adjustment in case of abnormalities.
[0008] This invention provides a method for adjusting the gain value of an ultrasonic flow meter, comprising the following steps:
[0009] S1: Gain adjustment. Adjust the comparison level to -831mV, and gradually increase the Vgain level until the GP22 interrupt returns.
[0010] S2: Read the measured time, read that the TimeoutTDC of GP22 is not 1, and record that the number of signals exceeding the comparison level is greater than 2, and automatically calculate 3 times;
[0011] S3: Determine if it is normal. The time difference between any two times is 5µs, and each time is greater than the measurement time of the ultrasonic flow meter; reduce the Vgain level by 1 level and set it as the amplification factor of this channel.
[0012] S4: Adjust the comparison level to -300mV and read the flight time T300 from GP22;
[0013] S5: Adjust the comparison level to -350mV and read the flight time T350 from GP22;
[0014] If these two times are consistent, the wave finding is correct, and the comparison level is configured to -300mV.
[0015] If T350 > T300, adjust the comparison level to -250mV and read the flight time T250 from GP22; then adjust the comparison level to -300mV and read the flight time T300 from GP22; if these two times are the same, the wave finding is correct; then configure the comparison level to -250mV.
[0016] If the wave is still not found, the wave finding is considered a failure, and the AGC adjustment is redone.
[0017] S6: Determine the reference sound velocity. After the AGC adjustment is completed and the wave is found, immediately calculate the reference sound velocity C0.
[0018] S7: For valid measurement, use -300mV or -250mV as the comparison level. After measurement, compare the ultrasonic signal with the reference sound velocity C0. If they are consistent, the measurement is valid; otherwise, the sound velocity is judged to be abnormal. Find the wave three times again. If the sound velocity is still abnormal, redo the AGC adjustment.
[0019] Furthermore, in step S1, the Vgain level is adjusted from small to large, starting from 0.1V and increasing by 0.1V each time.
[0020] Furthermore, the formula for calculating the reference sound speed C0 in step S6 is as follows:
[0021]
[0022] Where L represents the distance between probes, t up The time-of-flight time measured by the timing chip is represented by T0, the inherent delay caused by the circuit, and the zero drift caused by the probe itself. dn This represents the downlink flight time measured by the time chip; in the static state, Tzero = (t up -t dn ) / 2.
[0023] Furthermore, the formula for determining the validity of a normal measurement in step S7 is as follows:
[0024]
[0025] The present invention also provides a computer storage medium including a computer program, which, when executed, performs the above-described ultrasonic flow meter gain adjustment method to adjust the gain value of the ultrasonic flow meter.
[0026] The present invention also provides an ultrasonic flow meter, wherein the gain value of the ultrasonic flow meter is adjusted using the above-described ultrasonic flow meter gain value adjustment method.
[0027] Compared to methods that rely on hardware to obtain signal voltage values and then control the gain value, the ultrasonic gain adjustment method of this invention uses software control, ensuring that the difference between the actual gain value and the ideal gain value is within 0.1V. Furthermore, it uses a mathematical model to verify the reliability of the gain value and the accuracy of the measurement, ensuring timely adjustment in case of abnormalities. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating the gain adjustment method for an ultrasonic flowmeter provided in an embodiment of the present invention. Detailed Implementation
[0029] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0030] The terms "first," "second," "third," "fourth," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0031] Example 1
[0032] Figure 1 This is a schematic flowchart illustrating the gain adjustment method for an ultrasonic flowmeter provided in an embodiment of the present invention. Please refer to... Figure 1 The gain adjustment method for an ultrasonic flowmeter provided in this embodiment of the invention includes the following steps:
[0033] S1: Gain adjustment. Adjust the level of the comparator (CMP_VOLT) to -831mV (signals above -831mV are shielded). Adjust the Vgain level from small to large until GP22 interrupts and returns.
[0034] It should be noted that only signals whose actual voltage level absolute value exceeds CMP_VOLT can be detected by the TDC chip;
[0035] Specifically, in step S1, the Vgain level is adjusted from small to large, starting from 0.1V and increasing by 0.1V each time;
[0036] S2: Read the measured time, read that the TimeoutTDC of GP22 is not 1, and record that the number of signals exceeding the comparison level is greater than 2, and automatically calculate 3 times;
[0037] S3: To determine if it is normal, the time difference between every two times is 5us (200kHz), and each time is greater than the measurement time of the ultrasonic flow meter (the theoretical minimum value measured by the ultrasonic flow meter; if it is lower than this value, it must be caused by interference); reduce the Vgain level by 1 level and set it as the amplification factor of this channel (UP, DN);
[0038] S4: Adjust the CMP_VOLT level to -300mV and read the flight time T300 from GP22;
[0039] S5: Adjust the CMP_VOLT level to -350mV and read the flight time T350 from GP22;
[0040] If these two times are consistent, the wave finding is correct, and the comparison level is configured to -300mV.
[0041] If T350 > T300, adjust the CMP_VOLT level to -250mV and read the flight time T250 from GP22; then adjust the CMP_VOLT level to -300mV and read the flight time T300 from GP22; if these two times match, the wave finding is correct; then configure the comparison level (CMP_VOLT) to -250mV.
[0042] If the wave is still not found, the wave finding is considered a failure, and the AGC adjustment is redone.
[0043] S6: Determine the reference sound velocity. After the AGC adjustment is completed and the wave is found, immediately calculate the reference sound velocity C0 (only calculate once after the AGC adjustment).
[0044] Specifically, the formula for calculating the reference sound speed C0 in step S6 is as follows:
[0045]
[0046] Where L represents the distance between probes, t up The time-of-flight time measured by the timing chip is represented by T0, the inherent delay caused by the circuit, and the zero drift caused by the probe itself. dn This indicates the downlink flight time measured by the time chip;
[0047] In the static state, Tzero = (t up -t dn ) / 2;
[0048] S7: For valid measurement, use -300mV or -250mV as the comparison level. After measurement, compare the ultrasonic signal with the reference sound velocity C0. If they are consistent, the measurement is valid; otherwise, the sound velocity is judged to be abnormal. Find the wave three times again. If the sound velocity is still abnormal, redo the AGC adjustment.
[0049] Specifically, the formula for determining the validity of a normal measurement in step S7 is as follows:
[0050]
[0051] It should be noted that the common AGC gain method is as follows: First, the detection circuit converts the signal into a voltage signal, and the control circuit converts the detected signal strength into a control voltage to control the amplifier gain value. This process is repeated to keep the signal at a stable level.
[0052] Compared to methods that rely on hardware to obtain signal voltage values and then control the gain value, the ultrasonic flowmeter gain adjustment method of this invention uses software control to adjust the ultrasonic gain value, ensuring that the difference between the actual gain value and the ideal gain value is within 0.1V. Furthermore, a mathematical model is used to verify the reliability of the gain value and the accuracy of the measurement, ensuring timely adjustment in case of abnormalities.
[0053] The present invention also provides a computer storage medium including a computer program, which, when executed, performs the above-described ultrasonic flow meter gain adjustment method to adjust the gain value of the ultrasonic flow meter.
[0054] The present invention also provides an ultrasonic flow meter, wherein the gain value of the ultrasonic flow meter is adjusted by the above-described ultrasonic flow meter gain value adjustment method; for other technical features of the ultrasonic flow meter, please refer to the prior art, which will not be repeated here.
[0055] As can be seen from the above description, the advantages of this invention are:
[0056] Compared to methods that rely on hardware to obtain signal voltage values and then control the gain value, the ultrasonic gain adjustment method of this invention uses software control, ensuring that the difference between the actual gain value and the ideal gain value is within 0.1V. Furthermore, it uses a mathematical model to verify the reliability of the gain value and the accuracy of the measurement, ensuring timely adjustment in case of abnormalities.
[0057] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for adjusting the gain value of an ultrasonic flow meter, characterized in that, Includes the following steps: S1: Gain adjustment. Adjust the comparison level to -831mV, and gradually increase the Vgain level until the GP22 interrupt returns. S2: Read the measured time, read that the Timeout TDC of GP22 is not 1, and record that the number of signals exceeding the comparison level is greater than 2, and automatically calculate 3 times; S3: Determine if it is normal. The time difference between two times is 5us, and each time is greater than the measurement time of the ultrasonic flow meter; reduce the Vgain level by 1 level and set it as the amplification factor of this channel. S4: Adjust the comparison level to -300mV and read the flight time T300 from GP22; S5: Adjust the comparison level to -350mV and read the flight time T350 from GP22; If these two times are consistent, the wave finding is correct, and the comparison level is configured to -300mV. If T350 > T300, adjust the comparison level to -250mV and read the flight time T250 from GP22; then adjust the comparison level to -300mV and read the flight time T300 from GP22; if these two times are the same, the wave finding is correct; then configure the comparison level to -250mV. If the wave is still not found, the wave finding is considered a failure, and the AGC adjustment is redone. S6: Determine the reference sound velocity. After the AGC adjustment is completed and the wave is found, immediately calculate the reference sound velocity C0. S7: For valid measurement, use -300mV or -250mV as the comparison level. After measurement, compare the ultrasonic signal with the reference sound velocity C0. If they are consistent, the measurement is valid; otherwise, the sound velocity is judged to be abnormal. Find the wave three times again. If the sound velocity is still abnormal, redo the AGC adjustment.
2. The gain adjustment method for an ultrasonic flowmeter according to claim 1, characterized in that, In step S1, the Vgain level is adjusted from small to large, starting from 0.1V and increasing by 0.1V each time.
3. The gain adjustment method for an ultrasonic flowmeter according to claim 1, characterized in that, The formula for calculating the reference sound speed C0 in step S6 is as follows: Where L represents the distance between probes, t up The time-of-flight time measured by the timing chip is represented by T0, the inherent delay caused by the circuit, and the zero drift caused by the probe itself. dn This indicates the downlink flight time measured by the time chip; In the static state, Tzero = (t up -t dn ) / 2.
4. The gain adjustment method for an ultrasonic flowmeter according to claim 1, characterized in that, The formula used to determine the validity of a normal measurement in step S7 is as follows:
5. A computer storage medium, characterized in that, The device includes a computer program, which, when executed, performs the gain adjustment method for the ultrasonic flow meter according to any one of claims 1 to 4 to adjust the gain value of the ultrasonic flow meter.
6. An ultrasonic flow meter, characterized in that, The ultrasonic flow meter's gain value is adjusted using the gain value adjustment method for ultrasonic flow meters as described in any one of claims 1 to 4.