Method of metering suitable for ultrasonic gas meters
Patent Information
- Application Number
- CN202611186419.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-23
AI Technical Summary
然而,实际使用环境温度波动较大,在固定发送频率不变的前提下,当环境温度偏离标定温度时,发送频率与换能器当前的中心工作频率之间的频差将随之增大
[0017]发明实施例的技术方案,通过设置根据上游绝对飞行时间和下游绝对飞行时间得到第一上游信号和第一下游信号的截取特征点,并且以截取特征点为起点,按预设宽度分别对第一上游信号和第一下游信号进行截取,得到第一上游信号和第二下游信号,再将第二上游信号和第二上游信号作互相关,得到时间差,以及设置预设宽度与第一信号斜率相关,能够提升时间差的计算速度,并保证时间差计算的准确性和可靠性,从而保证瞬时流量计量的可靠性和准确性。通过建立温漂补偿模型,可以实时评估温漂情况,调整超声燃气表的工作模式,能够降低温漂影响,且不增加硬件成本,最终有效保证计量精度。进一步地,通过设置根据计量准确度模型计算准确度指数,并设置准确度指数所处为范围不同时,对预设宽度进行相应的调整,可实现负反馈调节,以提高计量可靠性。
Smart Images

Figure CN122961514A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic flow measurement technology, and in particular to a metering method applicable to ultrasonic gas meters. Background Technology
[0002] Ultrasonic gas meters have been widely used in residential and industrial gas metering applications due to their significant advantages such as high metering accuracy, wide range, and low pressure loss. Their core metering principle is as follows: the metering module uses ultrasonic transducers positioned upstream and downstream of the flow channel to transmit and receive ultrasonic signals. Based on the time difference in ultrasonic wave propagation in the downstream and upstream directions, the flow velocity of the gas being measured is calculated.
[0003] In traditional solutions, ultrasonic transducers are typically excited using pulse signals of a fixed frequency. However, in actual use, ambient temperatures fluctuate significantly. With a fixed transmission frequency, when the ambient temperature deviates from the calibration temperature, the frequency difference between the transmission frequency and the transducer's current center operating frequency increases. This increased frequency difference directly leads to a decrease in the transducer's electroacoustic conversion efficiency and attenuation of transmitted energy. Simultaneously, the received ultrasonic waves are prone to distortion and amplitude instability, causing errors in determining the arrival time of the echo signal. Ultimately, this manifests as a significant drift in the metering results with temperature changes (i.e., temperature drift). In severe cases, the temperature drift can cause instantaneous flow rate measurement to exceed the allowable error range, affecting the reliability of gas metering.
[0004] Improving the properties of ultrasonic transducers to reduce temperature-induced frequency drift would increase transducer costs and make it difficult to control consistency. Furthermore, as the transducer ages over time, frequency drift can also occur, further reducing metrological reliability.
[0005] In other words, the existing ultrasonic gas meters have low metering reliability. Summary of the Invention
[0006] This invention provides a metering method suitable for ultrasonic gas meters to improve the metering reliability of ultrasonic gas meters.
[0007] This invention provides a metering method suitable for ultrasonic gas meters, comprising: An excitation signal with a preset transmission frequency is sent to one of the first transducer and the second transducer respectively, and the received signal of the other of the first transducer and the second transducer is collected to obtain a first upstream signal and a first downstream signal. Based on the first upstream signal and the first downstream signal, the upstream absolute flight time, the downstream absolute flight time, the upstream signal slope, and the downstream signal slope are obtained. Calculate the first signal slope based on the upstream signal slope and the downstream signal slope; Based on the upstream absolute flight time and the downstream absolute flight time, the interception feature points of the first upstream signal and the first downstream signal are obtained. Starting from the interception feature points, the first upstream signal and the first downstream signal are intercepted by a preset width to obtain the second upstream signal and the second downstream signal. The preset width is related to the value of the slope of the first signal. Calculate the time difference based on the second upstream signal and the second downstream signal; The instantaneous flow rate is calculated based on the upstream absolute flight time, the downstream absolute flight time, and the time difference. Obtain the ambient temperature of the environment where the first transducer and the second transducer are located; Based on the ambient temperature, the upstream absolute flight time, the downstream absolute flight time, and the design parameters of the ultrasonic gas meter, a temperature drift compensation model is established, and the temperature drift coefficient is calculated based on the temperature drift compensation model. The working mode of the ultrasonic gas meter is then controlled based on the temperature drift coefficient. A measurement accuracy model is established based on the instantaneous flow rate within a preset time period, the first upstream signal, and the first downstream signal. An accuracy index is calculated based on the measurement accuracy model, and the preset width is adjusted using the accuracy index.
[0008] Optionally, based on the first upstream signal and the first downstream signal, the upstream absolute flight time, the downstream absolute flight time, the upstream signal slope, and the downstream signal slope are obtained, including: The first upstream signal is controlled to pass through a bandpass filter, and the filtered first upstream signal is processed. The processed first upstream signal is cross-correlated with the reference signal waveform to obtain a first time interval. Then, the upstream absolute time of flight is obtained based on the first time interval and the absolute time of flight of the reference signal waveform. The first downstream signal is controlled to pass through a bandpass filter, and the filtered first downstream signal is processed. The processed first downstream signal is cross-correlated with a reference signal waveform to obtain a second time interval. Then, the absolute time of flight of the downstream signal is obtained based on the second time interval and the absolute time of flight of the reference signal waveform. The slope of the upstream signal is calculated based on the maximum value point of the first upstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value. The slope of the downstream signal is calculated based on the maximum value point of the first downstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value. Calculating the first signal slope based on the upstream signal slope and the downstream signal slope includes: The average of the upstream signal slope and the downstream signal slope is taken as the first signal slope.
[0009] Optionally, the preset width is the width formed by the m points before the extracted feature point and the n points after the extracted feature point; where n is an integer greater than or equal to 1, and m is an integer greater than or equal to 1. The preset width is related to the value of the slope of the first signal, including: When the slope of the first signal is greater than or equal to 0 and the slope of the first signal is less than 1, adjust m to 1 / 2 of the default value and n to 3 / 2 of the default value. When the slope of the first signal is greater than or equal to 1 and the slope of the first signal is less than 2, m remains at its default value and n remains at its default value. When the slope of the first signal is greater than or equal to 2 and less than 4, m remains at the default value and n is adjusted to 1 / 2 of the default value. When the slope of the first signal is greater than or equal to 4, or when the slope of the first signal is less than 0, adjust m to twice the default value and n to twice the default value. Optionally, the default value for m is 16, and the default value for n is 80.
[0010] Optionally, calculating the time difference based on the second upstream signal and the second downstream signal includes: The time difference is obtained by cross-correlating the second upstream signal and the second downstream signal.
[0011] Optionally, the calculation formula for the measurement accuracy model is: ; Where SNR is the signal-to-noise ratio. The average instantaneous flow rate within the preset time period. The maximum instantaneous flow rate within the preset time period. Let P be the standard deviation of the instantaneous flow rate within the preset time period, and let P be the slope of the first signal. max β represents the maximum of the upstream signal slope and the downstream signal slope, and γ are adjustable parameters. Adjusting the preset width using the accuracy index includes: When the accuracy index is greater than or equal to the first preset value, the preset width is adjusted to twice the default preset width; When the accuracy index is less than or equal to half of the first preset value, the preset width is adjusted to half of the default preset width; When the accuracy index is less than the first preset value but greater than half of the first preset value, the current preset width remains unchanged.
[0012] Optionally, based on the ambient temperature, the upstream absolute flight time, the downstream absolute flight time, and the design parameters of the ultrasonic gas meter, a temperature drift compensation model is established, and the temperature drift coefficient is calculated based on the temperature drift compensation model, including: Calculate the first speed of sound based on the upstream absolute flight time and the downstream absolute flight time; Calculate the second speed of sound based on the ambient temperature; Based on the ambient temperature, the first sound velocity, the second sound velocity, and the design parameters of the ultrasonic gas meter measured in two adjacent cycles, a temperature drift compensation model is established, and the temperature drift coefficient is calculated based on the temperature drift compensation model.
[0013] Optionally, controlling the operating mode of the ultrasonic gas meter according to the temperature drift coefficient includes: When the temperature drift coefficient meets the preset conditions, and the environment in which the first transducer and the second transducer are located is a static gas environment, the ultrasonic gas meter enters the frequency modulation mode; wherein, the static gas environment is a flow rate qmin in which the instantaneous flow rate measured and calculated in two adjacent cycles is less than 5%, and the deviation of the instantaneous flow rate calculated in two adjacent cycles is less than 10%, the deviation of the first sound velocity is less than 10%, and the duration is the preset time. After the ultrasonic gas meter enters frequency modulation mode, it also includes: In the frequency modulation mode, the optimal transmission frequency is obtained.
[0014] Optionally, in the frequency modulation mode, obtaining the optimal transmission frequency includes: In the frequency modulation mode, the frequency range of the preset transmission frequency is traversed, the first upstream signal is collected, and the peak-to-peak value of the first upstream signal at each preset transmission frequency is calculated. The peak-to-peak value and the preset transmission frequency corresponding to the peak-to-peak value are saved to the frequency modulation table. After the traversal is completed, the optimal transmission frequency is calculated based on the peak-to-peak values of each peak. After calculating the optimal transmission frequency based on each of the aforementioned peak-to-peak values, the method further includes: Based on the optimal transmission frequency, adjust the bandwidth and center frequency of the bandpass filter through which the first upstream signal and the first downstream signal pass.
[0015] Optionally, the calculation formula for the temperature drift compensation model is: ; Where ΔTemp is the temperature difference measured in two adjacent cycles. To represent the maximum permissible temperature difference, ΔSOS is the difference between the measured first speed of sound calculated from the upstream and downstream absolute flight times in two adjacent cycles. This is the difference between the second speed of sound in air, calculated based on the temperature values measured in two adjacent cycles. The third speed of sound in an air environment at an ambient temperature of 20℃ is α, which is an adjustable parameter related to the design parameters of the ultrasonic gas meter.
[0016] Optionally, after adjusting the preset width using the accuracy index, the process includes: The accuracy index is used to determine whether to enter frequency modulation mode; Determining whether to enter frequency modulation mode based on the accuracy index includes: When the accuracy index is greater than or equal to the second preset value, the ultrasonic gas meter is controlled to re-enter the frequency modulation mode.
[0017] The technical solution of this invention embodiment, by setting interception feature points for the first upstream signal and the first downstream signal based on the absolute flight time of the upstream and downstream signals, and using these interception feature points as starting points, intercepting the first upstream signal and the first downstream signal by a preset width to obtain the first upstream signal and the second downstream signal, then cross-correlating the second upstream signal and the second downstream signal to obtain the time difference, and setting the preset width to be correlated with the slope of the first signal, can improve the calculation speed of the time difference and ensure the accuracy and reliability of the time difference calculation, thereby ensuring the reliability and accuracy of instantaneous flow measurement. By establishing a temperature drift compensation model, the temperature drift situation can be evaluated in real time, and the working mode of the ultrasonic gas meter can be adjusted to reduce the impact of temperature drift without increasing hardware costs, ultimately effectively ensuring measurement accuracy. Furthermore, by setting an accuracy index calculated based on the measurement accuracy model, and setting the preset width to be adjusted accordingly when the accuracy index is in different ranges, negative feedback regulation can be achieved to improve measurement reliability.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a metering method for ultrasonic gas meters, provided as an embodiment of the present invention; Figure 2 A flowchart illustrating another metering method applicable to ultrasonic gas meters provided in an embodiment of the present invention; Figure 3 A flowchart illustrating another metering method applicable to ultrasonic gas meters provided in an embodiment of the present invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and their variations, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] This invention provides a metering method suitable for ultrasonic gas meters. Figure 1 A flowchart illustrating a metering method for ultrasonic gas meters provided in this embodiment of the invention is shown below. Figure 1 The metering methods applicable to ultrasonic gas meters include: S100: Send an excitation signal with a preset transmission frequency to one of the first transducer and the second transducer respectively, and collect the received signal of the other of the first transducer and the second transducer to obtain the first upstream signal and the first downstream signal.
[0024] In this configuration, along the airflow direction, the part closer to the air inlet is considered upstream, and the part closer to the air outlet is considered downstream. For example, the first transducer can be the upstream transducer, and the second transducer can be the downstream transducer. The excitation signal can be a square wave excitation signal, and the received signal can include an ultrasonic signal.
[0025] The preset transmission frequency range is related to the specific metering scheme of the ultrasonic gas meter and the frequencies of the first and second transducers. For example, in this embodiment, the ultrasonic transducers (first and second transducers) can have a frequency of 200kHz, so the preset transmission frequency range can be defined as 160kHz~250kHz.
[0026] Specifically, the process of acquiring the first upstream signal and the first downstream signal can be as follows: First, the second transducer responds to the excitation signal of a preset frequency and sends a first ultrasonic detection signal. The first transducer receives the first ultrasonic detection signal and converts it into a first ultrasonic signal, which is the first upstream signal. Then, the first transducer responds to the excitation signal of the preset frequency and sends a second ultrasonic detection signal. The second transducer receives the second ultrasonic detection signal and converts it into a second ultrasonic signal, which is the first downstream signal.
[0027] S200. Based on the first upstream signal and the first downstream signal, obtain the upstream absolute flight time, the downstream absolute flight time, the upstream signal slope, and the downstream signal slope.
[0028] The ultrasonic gas meter pre-stores a reference signal waveform and a reference absolute time of flight associated with that waveform. The reference signal waveform is the waveform at room temperature (20°C), and the time of flight calculated based on the reference waveform is the reference absolute time of flight. The process of obtaining the reference signal waveform and the reference absolute time of flight can be carried out using methods provided in the prior art, and this embodiment does not limit this process.
[0029] Specifically, the first upstream signal and the first downstream signal undergo preprocessing, including at least filtering and data conversion. The preprocessed signals are then cross-correlated with a reference signal waveform to obtain a first time interval related to the first upstream signal and a second time interval related to the first downstream signal. The first time interval is then added to a reference absolute time of flight to obtain the upstream absolute time of flight; the second time interval is added to the reference absolute time of flight to obtain the downstream absolute time of flight.
[0030] The first upstream signal envelope corresponding to the first upstream signal and the first downstream signal envelope corresponding to the first downstream signal are obtained respectively. Then, based on the preset feature points in the first upstream signal envelope and the first downstream signal envelope and their corresponding abscissas, the upstream signal slope and the downstream signal slope are obtained. The preset feature points can be the maximum value point of the envelope and half of the maximum value of the envelope.
[0031] S300. Calculate the first signal slope based on the upstream signal slope and the downstream signal slope.
[0032] Specifically, the slope of the first signal can be calculated based on the average or weighted average of the upstream and downstream signal slopes.
[0033] S400. Based on the upstream absolute flight time and the downstream absolute flight time, obtain the interception feature points of the first upstream signal and the first downstream signal, and using the interception feature points as the starting point, intercept the first upstream signal and the first downstream signal according to the preset width to obtain the second upstream signal and the second downstream signal.
[0034] The preset width is related to the value of the slope of the first signal.
[0035] Specifically, firstly, the upstream and downstream absolute flight times are sampled according to a preset frequency to obtain the number of first sampling points corresponding to the upstream absolute flight time and the number of second sampling points corresponding to the downstream absolute flight time. The first and second sampling point numbers are rounded down, and then the average of the rounded values is taken as the intercepted feature points. For example, the upstream absolute flight time can be 402 seconds, the downstream absolute flight time can be 604 seconds, and the preset frequency can be 2Hz. The number of first sampling points is 201, which is rounded down to 200; the number of second sampling points is 302, which is rounded down to 300; then the intercepted feature points are (200+300) / 2=250.
[0036] The preset width can be the width formed by m points in the opposite direction of the horizontal coordinate and n points in the positive direction of the horizontal coordinate, starting from the extracted feature point; that is, the preset width is (m+n). Then, the first upstream signal and the first downstream signal are extracted according to the width of (m+n) to obtain the second upstream signal and the second downstream signal.
[0037] Furthermore, by setting the preset width to be related to the slope of the first signal, the value of the preset width can be adjusted according to the slope of the first signal, thereby ensuring the reliability of the preset width setting.
[0038] It is understandable that the second upstream signal is related to the first upstream signal, and the second downstream signal is related to the first downstream signal. For example, the abscissa range of the first upstream signal is 0-402, and the abscissa range of the second upstream signal is 250-m to 250+n; the abscissa range of the first downstream signal is 0-604, and the abscissa range of the second downstream signal is 250-m to 250+n. That is, the second upstream signal is a part of the first upstream signal, only with a different starting position on the abscissa, and the second downstream signal is a part of the first downstream signal, only with a different starting position on the abscissa.
[0039] S500: Calculate the time difference based on the second upstream signal and the second downstream signal.
[0040] Specifically, the time difference is obtained by cross-correlating the second upstream signal and the second downstream signal. By setting the time difference to be calculated from the second upstream signal and the second downstream signal, compared with the traditional metering method that calculates the time difference from the first upstream signal and the first downstream signal, less data is required, thus improving the calculation speed.
[0041] S600: Calculate the instantaneous flow rate based on the upstream absolute flight time, the downstream absolute flight time, and the time difference.
[0042] Specifically, the formula for calculating instantaneous flow rate vfr is: ; Where L is the acoustic path length, S is the cross-sectional area, and T is the cross-sectional area. 12 T represents the absolute flight time upstream. 21 ΔT represents the absolute flight time downstream, and ΔT represents the time difference.
[0043] S700: Obtain the ambient temperature of the environment where the first transducer and the second transducer are located.
[0044] Specifically, the ultrasonic gas meter is equipped with a temperature sensor that monitors the ambient temperature in real time.
[0045] S800: Based on ambient temperature, upstream absolute flight time, downstream absolute flight time, and the design parameters of the ultrasonic gas meter, a temperature drift compensation model is established, and the temperature drift coefficient is calculated based on the temperature drift compensation model. The working mode of the ultrasonic gas meter is then controlled based on the temperature drift coefficient.
[0046] The working modes of an ultrasonic gas meter can include frequency modulation mode and normal working mode.
[0047] Specifically, ultrasonic gas meters experience significant temperature drift in measurement results under high and low temperature environments, leading to lower measurement accuracy. By establishing a temperature drift compensation model and calculating the temperature drift coefficient, the ultrasonic gas meter can assess the temperature drift in real time, thereby adjusting its operating mode to reduce the impact of temperature drift and ensure measurement accuracy.
[0048] S900. Based on the instantaneous flow rate, the first upstream signal, and the first downstream signal within a preset time period, establish a measurement accuracy model, calculate the accuracy index based on the measurement accuracy model, and adjust the preset width using the accuracy index.
[0049] Specifically, the accuracy index can be understood as a measurement accuracy index, and the measurement period of the accuracy index can be a third preset value. For example, the calculation period of the accuracy index can be set to 24 hours, and the environmental parameters for each calculation must meet preset environmental parameters and be maintained in this calm environment for a preset time. For example, the preset time can be 2 minutes.
[0050] Since the measurement of instantaneous flow rate is related to the time difference, and the calculated time difference is related to the preset width of the intercepted first upstream signal and first downstream signal, this embodiment establishes a measurement accuracy model, calculates an accuracy index based on the model, and adjusts the preset width accordingly when the accuracy index falls within different ranges. This achieves the purpose of adjusting the time difference. In other words, this embodiment achieves negative feedback regulation by establishing a measurement accuracy model to improve measurement reliability.
[0051] The technical solution of this invention, by setting interception feature points for the first upstream and first downstream signals based on the absolute flight time of the upstream and downstream signals, and by intercepting the first upstream and first downstream signals with a preset width starting from the interception feature points, obtains the second upstream and second downstream signals. The second upstream and second downstream signals are then cross-correlated to obtain the time difference. Furthermore, by setting the preset width to be correlated with the slope of the first signal, the calculation speed of the time difference can be improved, and the accuracy and reliability of the time difference calculation can be guaranteed, thereby ensuring the reliability and accuracy of instantaneous flow measurement. By establishing a temperature drift compensation model, the temperature drift situation can be evaluated in real time, and the working mode of the ultrasonic gas meter can be adjusted, reducing the impact of temperature drift without increasing hardware costs, ultimately effectively guaranteeing measurement accuracy. Further, by setting an accuracy index calculated based on the measurement accuracy model, and by setting the preset width to be adjusted accordingly when the accuracy index falls within different ranges, negative feedback regulation can be achieved to improve measurement reliability.
[0052] Based on the above embodiments, optionally, the preset width is the width formed by the m points before the feature point and the n points after the feature point; where n is an integer greater than or equal to 1, and m is an integer greater than or equal to 1; where the m points before the feature point can be understood as m points along the opposite direction of the horizontal coordinate, and the n points after the feature point can be understood as n points along the positive direction of the horizontal coordinate.
[0053] The preset width is related to the value of the slope of the first signal, including: When the slope of the first signal is greater than or equal to 0 and less than 1, m is adjusted to half of the default value, and n is adjusted to half of the default value. When the slope of the first signal is greater than or equal to 1 and less than 2, m and n remain at their default values. When the slope of the first signal is greater than or equal to 2 and less than 4, m remains at its default value, and n is adjusted to half of the default value. When the slope of the first signal is greater than or equal to 4, or less than 0, m and n are adjusted to twice the default value. For example, the default value of m can be 16, and the default value of n can be 80. It is understood that the values of m and n can be set according to actual conditions, and this embodiment does not limit this.
[0054] The following sections explain the process of obtaining the upstream absolute flight time, downstream absolute flight time, upstream signal slope, and downstream signal slope.
[0055] The process of obtaining the upstream absolute time of flight is as follows: the first upstream signal is controlled to pass through a bandpass filter, and the filtered first upstream signal is processed. The processed first upstream signal is then cross-correlated with a reference signal waveform to obtain a first time interval. The upstream absolute time of flight is then obtained based on the first time interval and the absolute time of flight of the reference signal waveform (reference absolute time of flight). The data processing can involve analog-to-digital conversion of the filtered first upstream signal. Specifically, an analog-to-digital converter can be used to acquire the filtered first upstream signal for analog-to-digital conversion.
[0056] The process of obtaining the downstream absolute time of flight is as follows: the first downstream signal is controlled to pass through a bandpass filter, and the filtered first downstream signal is processed. The processed first downstream signal is then cross-correlated with a reference signal waveform to obtain a second time interval. The downstream absolute time of flight is then obtained based on the second time interval and the absolute time of flight of the reference signal waveform (reference absolute time of flight). The data processing can involve analog-to-digital conversion of the filtered first downstream signal. Specifically, an analog-to-digital converter can be used to acquire the filtered first downstream signal for analog-to-digital conversion.
[0057] The data processing procedures for upstream absolute flight time and downstream absolute flight time are the same. Taking the data processing procedure for upstream absolute flight time as an example, the calculation formula for the first upstream signal is as follows: ; in, The first upstream signal after filtering. is the mean of the first upstream signal after filtering, and N is the number of bits in the analog-to-digital converter.
[0058] The process of obtaining the upstream signal slope is as follows: the upstream signal slope is calculated based on the maximum value point of the first upstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value.
[0059] The process of obtaining the downstream signal slope is as follows: the downstream signal slope is calculated based on the maximum value point of the first downstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value.
[0060] The formulas for calculating the upstream signal slope and the downstream signal slope are the same.
[0061] For example, taking the upstream signal slope as an example, the formula for calculating the upstream signal slope P1 is: ; in, This is the point where the first upstream signal envelope has its maximum value. Let x be the x-coordinate of the point corresponding to the maximum value of the first upstream signal envelope. It is 50% of the maximum value of the first upstream signal envelope. The x-coordinate is the horizontal axis corresponding to 50% of the maximum value of the first upstream signal envelope.
[0062] Based on the above embodiments, optionally, the calculation formula for the measurement accuracy model is as follows: ; Where SNR is the signal-to-noise ratio. The average instantaneous flow rate over a preset time period. The maximum instantaneous flow rate within a preset time period. Let P be the standard deviation of the instantaneous flow rate within a preset time period, and let P be the slope of the first signal. max β and γ represent the maximum of the upstream and downstream signal slopes, respectively, and are adjustable parameters. For example, β is typically set to 0.25 and γ to 0.15. The preset time can be 2 minutes.
[0063] Figure 2 A flowchart of another metering method applicable to ultrasonic gas meters provided in this embodiment of the invention is shown below. Figure 2 The metering methods applicable to ultrasonic gas meters include: S201. Send an excitation signal with a preset transmission frequency to one of the first transducer and the second transducer respectively, and collect the received signal of the other of the first transducer and the second transducer to obtain the first upstream signal and the first downstream signal.
[0064] S202. Control the first upstream signal to pass through a bandpass filter, process the filtered first upstream signal, cross-correlate the processed first upstream signal with the reference signal waveform to obtain the first time interval, and then obtain the upstream absolute time of flight based on the first time interval and the absolute time of flight of the reference signal waveform.
[0065] S203. Control the first downstream signal to pass through a bandpass filter, process the filtered first downstream signal, and cross-correlate the processed first downstream signal with the reference signal waveform to obtain the second time interval. Then, based on the second time interval and the absolute flight time of the reference signal waveform, obtain the downstream absolute flight time.
[0066] S204. Calculate the slope of the upstream signal based on the maximum value point of the first upstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value.
[0067] S205. Calculate the slope of the downstream signal based on the maximum value point of the first downstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value.
[0068] S206. The average value of the upstream signal slope and the downstream signal slope is taken as the first signal slope.
[0069] S207. Based on the upstream absolute flight time and the downstream absolute flight time, obtain the interception feature points of the first upstream signal and the first downstream signal, and use the interception feature points as the starting point to intercept the first upstream signal and the first downstream signal according to the preset width to obtain the second upstream signal and the second downstream signal.
[0070] S208. Cross-correlate the second upstream signal and the second downstream signal to obtain the time difference.
[0071] S209. Calculate the instantaneous flow rate based on the upstream absolute flight time, the downstream absolute flight time, and the time difference.
[0072] S210. Obtain the ambient temperature of the environment where the first transducer and the second transducer are located.
[0073] S211. Based on the ambient temperature, the upstream absolute flight time, the downstream absolute flight time, and the design parameters of the ultrasonic gas meter, establish a temperature drift compensation model, calculate the temperature drift coefficient based on the temperature drift compensation model, and control the working mode of the ultrasonic gas meter based on the temperature drift coefficient.
[0074] S212. Based on the instantaneous flow rate, the first upstream signal, and the first downstream signal within a preset time period, establish a measurement accuracy model and calculate the accuracy index based on the measurement accuracy model.
[0075] S213. Determine whether the accuracy index is less than or equal to half of the first preset value; if yes, execute S215; if no, execute S214.
[0076] S214. Determine whether the accuracy index is less than the first preset value; if yes, execute S216; if no, execute S217.
[0077] S215. Adjust the preset width to half of the default preset width.
[0078] Specifically, adjust the default preset width to half of its original value.
[0079] S216. Keep the current preset width unchanged.
[0080] S217. Adjust the preset width to twice the default preset width.
[0081] Specifically, the default preset width is adjusted to twice its original value.
[0082] In this embodiment, steps S201-S208 illustrate an absolute flight time and time difference calculation scheme, which can improve the calculation speed and accuracy of the time difference. Steps S210-S211 in this embodiment, by establishing a temperature drift compensation model, can assess the temperature drift situation in real time, and reduce the impact of temperature drift by adjusting the transmission frequency online, without increasing hardware costs, effectively ensuring measurement accuracy. Steps S212-S217 in this embodiment illustrate a scheme for achieving negative feedback adjustment by establishing a measurement accuracy model, which can improve measurement reliability.
[0083] This invention also provides another high-precision metering method suitable for ultrasonic gas meters. Figure 3 A flowchart of another high-precision metering method for ultrasonic gas meters provided in this embodiment of the invention is shown below. Figure 3 Based on the above embodiments, a high-precision metering method applicable to ultrasonic gas meters includes: S301. Send an excitation signal with a preset transmission frequency to one of the first transducer and the second transducer respectively, and collect the received signal of the other of the first transducer and the second transducer to obtain the first upstream signal and the first downstream signal.
[0084] S302. Based on the first upstream signal and the first downstream signal, obtain the upstream absolute flight time, the downstream absolute flight time, the upstream signal slope, and the downstream signal slope.
[0085] S303. Calculate the first signal slope based on the upstream signal slope and the downstream signal slope.
[0086] S304. Based on the upstream absolute flight time and the downstream absolute flight time, obtain the interception feature points of the first upstream signal and the first downstream signal, and use the interception feature points as the starting point to intercept the first upstream signal and the first downstream signal according to the preset width to obtain the second upstream signal and the second downstream signal.
[0087] S305. Calculate the time difference based on the second upstream signal and the second downstream signal.
[0088] S306. Calculate the instantaneous flow rate based on the upstream absolute flight time, the downstream absolute flight time, and the time difference.
[0089] S307. Obtain the ambient temperature of the environment where the first transducer and the second transducer are located.
[0090] Specifically, the ultrasonic gas meter is equipped with a temperature sensor that monitors the ambient temperature in real time.
[0091] S308. Calculate the first speed of sound based on the upstream absolute flight time and the downstream absolute flight time.
[0092] Specifically, the formula for calculating the first speed of sound, c, is: ; Where L is the acoustic path length, T 12 T represents the absolute flight time upstream. 21 This refers to the absolute flight time downstream.
[0093] S309. Calculate the second speed of sound based on the ambient temperature.
[0094] Specifically, calculating the second speed of sound based on ambient temperature is existing technology and will not be elaborated here.
[0095] S310. Based on the ambient temperature, first sound velocity, second sound velocity, and design parameters of the ultrasonic gas meter measured in two adjacent cycles, establish a temperature drift compensation model and calculate the temperature drift coefficient based on the temperature drift compensation model.
[0096] Specifically, the calculation formula for the temperature drift compensation model is as follows: ; Where TD is the temperature drift coefficient, and ΔTemp is the temperature difference between two adjacent measurements. To represent the maximum permissible temperature difference, ΔSOS is the difference between the measured first velocity of sound calculated from the upstream and downstream absolute flight times in two adjacent cycles. This is the difference between the second speed of sound in air, calculated based on the temperature values measured in two adjacent cycles. The velocity of sound is the third speed of sound in air at an ambient temperature of 20°C. α is an adjustable parameter related to the design parameters of the ultrasonic gas meter. For example, α can be 0.7. The value can be 10℃.
[0097] S311. When the temperature drift coefficient meets the preset conditions and the environment in which the first transducer and the second transducer are located is a static gas environment, the ultrasonic gas meter enters the frequency modulation mode; wherein, the static gas environment is defined as the instantaneous flow rate calculated in two adjacent cycles being less than 5% of the qmin flow rate, and the deviation of the instantaneous flow rate calculated in two adjacent cycles being less than 10%, the deviation of the first sound velocity being less than 10%, and the duration being a preset time.
[0098] For example, the preset condition can be a condition where the temperature drift coefficient is greater than or equal to a fourth preset value, where the fourth preset value can be 25%.
[0099] Specifically, when the temperature drift coefficient is ≥25%, it is determined that the temperature drift coefficient meets the preset conditions. In this case, it is determined whether the current environment is a calm gas environment. If both conditions are met, the ultrasonic gas meter automatically enters the frequency modulation mode. Otherwise, the ultrasonic gas meter enters the normal operating mode.
[0100] S312. In frequency modulation mode, obtain the optimal transmission frequency.
[0101] Specifically, in frequency modulation mode, the ultrasonic gas meter traverses the frequency range of preset transmission frequencies, collects the first upstream signal corresponding to each preset transmission frequency, and calculates the peak-to-peak value of the first upstream signal at each preset transmission frequency. The peak-to-peak values and their corresponding preset transmission frequencies are then saved to the frequency modulation table. After the traversal is complete, the optimal transmission frequency is calculated based on each peak-to-peak value. For example, after the traversal, the maximum value of the peak-to-peak value is found in the frequency modulation table, and a polynomial fit is performed using the maximum value and several preceding and following points to obtain the optimal transmission frequency, which is then updated in the ultrasonic gas meter.
[0102] S313. Adjust the bandwidth and center frequency of the bandpass filter through which the first upstream signal and the first downstream signal pass, according to the optimal transmission frequency.
[0103] Specifically, the update strategy can be to adjust the center frequency of the bandpass filter to the optimal transmission frequency and adjust the bandwidth of the bandpass filter to ±10% of the center frequency.
[0104] S314. Based on the instantaneous flow rate, the first upstream signal, and the first downstream signal within a preset time period, establish a measurement accuracy model, calculate the accuracy index based on the measurement accuracy model, and adjust the preset width using the accuracy index.
[0105] S315. Determine whether to enter frequency modulation mode by using the accuracy index.
[0106] Specifically, when the accuracy index is greater than or equal to the second preset value, the ultrasonic gas meter is controlled to re-enter the frequency modulation mode. For example, if the accuracy index AP ≥ the second preset value, the default value of the preset width is adjusted to twice the original value, and the frequency modulation mode is re-entered to obtain the optimal transmission frequency and update the bandpass filter parameters; if the accuracy index AP ≤ half of the second preset value, the default value of the preset width is adjusted to half of the original value; otherwise, it remains unchanged.
[0107] The technical solution of this invention provides a metering method suitable for ultrasonic gas meters through steps S301-S315. This embodiment establishes a temperature drift compensation model to evaluate the temperature drift in real time, and reduces the impact of temperature drift by adjusting the transmission frequency online without increasing hardware costs, thus effectively ensuring metering accuracy.
[0108] Optionally, after adjusting the bandwidth and center frequency of the bandpass filter through which the first upstream signal and the first downstream signal pass, the method further includes: Store the current temperature, first sound velocity, optimal transmission frequency, and bandpass filter parameters, then exit FM mode.
[0109] It is understandable that when an ultrasonic gas meter first starts working, it defaults to normal working mode.
[0110] In summary, the technical solution of this invention provides a high-precision metering method suitable for ultrasonic gas meters. Specifically, it first proposes an absolute flight time and time difference calculation scheme, improving calculation accuracy. Second, by establishing a temperature drift compensation model, temperature drift can be assessed in real time, and its impact can be reduced by adjusting the transmission frequency online, without increasing hardware costs, effectively ensuring metering accuracy. Finally, by establishing a metering accuracy model, negative feedback adjustment can be achieved, further improving metering reliability. In other words, this invention, without increasing any hardware costs, can improve the metering accuracy of ultrasonic gas metering modules under high and low temperatures, thus improving metering reliability.
[0111] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and no limitation is imposed herein.
[0112] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A metering method suitable for ultrasonic gas meters, characterized in that, include: An excitation signal with a preset transmission frequency is sent to one of the first transducer and the second transducer respectively, and the received signal of the other of the first transducer and the second transducer is collected to obtain a first upstream signal and a first downstream signal. Based on the first upstream signal and the first downstream signal, the upstream absolute flight time, the downstream absolute flight time, the upstream signal slope, and the downstream signal slope are obtained. Calculate the first signal slope based on the upstream signal slope and the downstream signal slope; Based on the upstream absolute flight time and the downstream absolute flight time, the interception feature points of the first upstream signal and the first downstream signal are obtained. Starting from the interception feature points, the first upstream signal and the first downstream signal are intercepted by a preset width to obtain the second upstream signal and the second downstream signal. The preset width is related to the value of the slope of the first signal. Calculate the time difference based on the second upstream signal and the second downstream signal; The instantaneous flow rate is calculated based on the upstream absolute flight time, the downstream absolute flight time, and the time difference. Obtain the ambient temperature of the environment where the first transducer and the second transducer are located; Based on the ambient temperature, the upstream absolute flight time, the downstream absolute flight time, and the design parameters of the ultrasonic gas meter, a temperature drift compensation model is established, and the temperature drift coefficient is calculated based on the temperature drift compensation model. The working mode of the ultrasonic gas meter is then controlled based on the temperature drift coefficient. A measurement accuracy model is established based on the instantaneous flow rate within a preset time period, the first upstream signal, and the first downstream signal. An accuracy index is calculated based on the measurement accuracy model, and the preset width is adjusted using the accuracy index.
2. The metering method for ultrasonic gas meters according to claim 1, characterized in that, Based on the first upstream signal and the first downstream signal, the upstream absolute flight time, downstream absolute flight time, upstream signal slope, and downstream signal slope are obtained, including: The first upstream signal is controlled to pass through a bandpass filter, and the filtered first upstream signal is processed. The processed first upstream signal is cross-correlated with the reference signal waveform to obtain a first time interval. Then, the upstream absolute time of flight is obtained based on the first time interval and the absolute time of flight of the reference signal waveform. The first downstream signal is controlled to pass through a bandpass filter, and the filtered first downstream signal is processed. The processed first downstream signal is cross-correlated with a reference signal waveform to obtain a second time interval. Then, the absolute time of flight of the downstream signal is obtained based on the second time interval and the absolute time of flight of the reference signal waveform. The slope of the upstream signal is calculated based on the maximum value point of the first upstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value. The slope of the downstream signal is calculated based on the maximum value point of the first downstream signal envelope, the x-coordinate corresponding to the maximum value point, half of the maximum value, and the x-coordinate corresponding to half of the maximum value. Calculating the first signal slope based on the upstream signal slope and the downstream signal slope includes: The average of the upstream signal slope and the downstream signal slope is taken as the first signal slope.
3. The metering method for ultrasonic gas meters according to claim 1, characterized in that, The preset width is the width formed by the m points before the extracted feature point and the n points after the extracted feature point; where n is an integer greater than or equal to 1, and m is an integer greater than or equal to 1. The preset width is related to the value of the slope of the first signal, including: When the slope of the first signal is greater than or equal to 0 and the slope of the first signal is less than 1, adjust m to 1 / 2 of the default value and n to 3 / 2 of the default value. When the slope of the first signal is greater than or equal to 1 and the slope of the first signal is less than 2, m remains at its default value and n remains at its default value. When the slope of the first signal is greater than or equal to 2 and less than 4, m remains at the default value and n is adjusted to 1 / 2 of the default value. When the slope of the first signal is greater than or equal to 4, or when the slope of the first signal is less than 0, adjust m to twice the default value and n to twice the default value. Preferably, the default value of m is 16, and the default value of n is 80.
4. The metering method for ultrasonic gas meters according to claim 1, characterized in that, Calculate the time difference based on the second upstream signal and the second downstream signal, including: The time difference is obtained by cross-correlating the second upstream signal and the second downstream signal.
5. The metering method for ultrasonic gas meters according to claim 1, characterized in that, The calculation formula for the measurement accuracy model is as follows: ; Where SNR is the signal-to-noise ratio. The average instantaneous flow rate within the preset time period. The maximum instantaneous flow rate within the preset time period. Let P be the standard deviation of the instantaneous flow rate within the preset time period, and let P be the slope of the first signal. max β represents the maximum of the upstream signal slope and the downstream signal slope, and γ are adjustable parameters. Adjusting the preset width using the accuracy index includes: When the accuracy index is greater than or equal to the first preset value, the preset width is adjusted to twice the default preset width; When the accuracy index is less than or equal to half of the first preset value, the preset width is adjusted to half of the default preset width; When the accuracy index is less than the first preset value but greater than half of the first preset value, the current preset width remains unchanged.
6. The metering method for ultrasonic gas meters according to claim 1, characterized in that, Based on the ambient temperature, the upstream absolute flight time, the downstream absolute flight time, and the design parameters of the ultrasonic gas meter, a temperature drift compensation model is established, and the temperature drift coefficient is calculated based on the temperature drift compensation model, including: Calculate the first speed of sound based on the upstream absolute flight time and the downstream absolute flight time; Calculate the second speed of sound based on the ambient temperature; Based on the ambient temperature, the first sound velocity, the second sound velocity, and the design parameters of the ultrasonic gas meter measured in two adjacent cycles, a temperature drift compensation model is established, and the temperature drift coefficient is calculated based on the temperature drift compensation model.
7. The metering method for ultrasonic gas meters according to claim 6, characterized in that, The operating mode of the ultrasonic gas meter is controlled according to the temperature drift coefficient, including: When the temperature drift coefficient meets the preset conditions, and the environment in which the first transducer and the second transducer are located is a static gas environment, the ultrasonic gas meter enters the frequency modulation mode; wherein, the static gas environment is a flow rate qmin in which the instantaneous flow rate measured and calculated in two adjacent cycles is less than 5%, and the deviation of the instantaneous flow rate calculated in two adjacent cycles is less than 10%, the deviation of the first sound velocity is less than 10%, and the duration is the preset time. After the ultrasonic gas meter enters frequency modulation mode, it also includes: In the frequency modulation mode, the optimal transmission frequency is obtained.
8. The metering method for ultrasonic gas meters according to claim 7, characterized in that, In the frequency modulation mode, obtaining the optimal transmission frequency includes: In the frequency modulation mode, the frequency range of the preset transmission frequency is traversed, the first upstream signal is collected, and the peak-to-peak value of the first upstream signal at each preset transmission frequency is calculated. The peak-to-peak value and the preset transmission frequency corresponding to the peak-to-peak value are saved to the frequency modulation table. After the traversal is completed, the optimal transmission frequency is calculated based on the peak-to-peak values of each peak. After calculating the optimal transmission frequency based on each of the aforementioned peak-to-peak values, the method further includes: Based on the optimal transmission frequency, adjust the bandwidth and center frequency of the bandpass filter through which the first upstream signal and the first downstream signal pass.
9. The metering method for ultrasonic gas meters according to claim 6, characterized in that, The calculation formula for the temperature drift compensation model is as follows: ; Where ΔTemp is the temperature difference measured in two adjacent cycles. To represent the maximum permissible temperature difference, ΔSOS is the difference between the measured first speed of sound calculated from the upstream and downstream absolute flight times in two adjacent cycles. The difference between the second speed of sound in air, calculated based on the temperature values measured in two adjacent cycles. The third speed of sound in an air environment at an ambient temperature of 20℃ is α, which is an adjustable parameter related to the design parameters of the ultrasonic gas meter.
10. The metering method for ultrasonic gas meters according to claim 7, characterized in that, After adjusting the preset width using the accuracy index, the following steps are included: The accuracy index is used to determine whether to enter frequency modulation mode; Determining whether to enter frequency modulation mode based on the accuracy index includes: When the accuracy index is greater than or equal to the second preset value, the ultrasonic gas meter is controlled to re-enter the frequency modulation mode.