Ultrasonic fluid flow measurement method and system based on flow prediction
By constructing a flow prediction method based on sliding window algorithm and LSTM model, dynamically adjusting the gain and signal processing, the measurement accuracy and range limitations of the ultrasonic flowmeter in a wide flow rate range are solved, and a wider flow measurement and high sampling rate are achieved.
Patent Information
- Application Number
- CN202310584471.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2043-05-23
AI Technical Summary
The existing ultrasonic gas flowmeters (UGFM) have low accuracy at low flow measurements and have limited measurement ranges within a wide flow rate range, making it difficult to expand the measurement range without replacing the pipeline while maintaining high accuracy and high sampling rates.
Using ultrasonic fluid flow measurement method based on flow prediction, the measurement range of the flow meter is expanded by constructing a sliding window algorithm and a long and short-term memory network (LSTM) model, the flow data at the next moment is predicted, the gain is dynamically adjusted and signal amplified, and then threshold detection and zero crossing comparison are performed to expand the measurement range of the flowmeter.
Without affecting the measurement accuracy, the measurement range of the ultrasonic flowmeter is significantly expanded, and is suitable for fluid flow measurements with large flow changes, improving the accuracy of measurement and sampling rate.
Smart Images

Figure CN116558587B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fluid flow measurement, and in particular to an ultrasonic fluid flow measurement method and system based on flow prediction. Background Art
[0002] Ultrasonic gas flow meters (UGFMs) have attracted significant attention in recent years. Compared to traditional flowmeters such as turbine flowmeters, vortex flowmeters, and differential pressure flowmeters, UGFMs offer high-precision measurements with high turndown ratios and no pressure loss. Furthermore, they can measure bidirectional flows. Due to their advantages, UGFMs have been widely used in many fields, such as gas delivery, chemical engineering, and pulmonary ventilation assessment. Today, the demands on flowmeters have increased significantly due to their measurement range, precision, and the accuracy of the collected gas flow data. Although UGFMs with large diameters offer a wide range, they can be less accurate at low flow rates. In such cases, it is necessary to replace the flow channel and ultrasonic transducer to achieve a wider measurement range. Furthermore, in spirometry, anemometers, and certain aerospace applications, small-diameter pipes are often used to measure the flow rate of rapidly changing gases over a relatively wide range of flow rates. However, current UGFMs have limited accuracy in reconstructing the gas information collected over a wide flow rate range and suffer from low accuracy in peak flow rate measurements. Therefore, expanding the measurement range of UGFMs without replacing the pipes while maintaining accuracy and a high sampling rate has become a current research hotspot.
[0003] There are two measurement methods for ultrasonic gas flowmeters: time difference method and Doppler method. The Doppler method is mostly suitable for measuring a variety of mixed fluid media (such as gas + liquid), etc., and has low measurement accuracy. Therefore, the time difference method is usually used to measure the fluid of a single medium. The working principle of the time difference ultrasonic gas flowmeter is to arrange a pair of transducers around the pipeline (the first transducer is transducer 1 and the second transducer is transducer 2), measure the flight time t1 of transducer 1 transmitting and transducer 2 receiving, and the flight time t2 of transducer 2 transmitting and transducer 1 receiving, and then calculate the flow rate of the fluid in the pipeline (unit: m / s) by the formula, such as Figure 1 As shown, the formula is as follows:
[0004] t1=L(c+vcosθ) (1)
[0005] t2=L(c-vcosθ) (2)
[0006] Where v represents the flow velocity; L is the effective length of the ultrasonic wave propagation path; D represents the inner diameter of the gas path; θ is the angle between the main propagation direction of the ultrasonic beam and the gas flow direction; t1 refers to the time it takes for the sound wave to propagate from transducer 1 to transducer 2; and t2 refers to the time it takes for the sound wave to propagate from transducer 2 to transducer 1. The fluid flow velocity v can be expressed as:
[0007]
[0008] The product of the flow velocity v and the cross-sectional area S of the pipe gives the instantaneous volume flow rate Q in the pipe (in L / s):
[0009] Q=S·v·α (4)
[0010] Time-of-flight ultrasonic gas flowmeters rely heavily on processing echo signals, with the most common methods being the envelope method, cross-correlation method, and threshold method. The envelope method and cross-correlation method require high-speed ADC sampling and cumbersome calculations, which can lead to system costs and slow speeds. Therefore, most ultrasonic gas flowmeters on the market use the threshold method as their echo processing method to obtain flight time (t1 and t2). The signal processing flow chart and time domain representation of the threshold method are shown below. Figure 2 .
[0011] like Figure 3 As shown at the bottom. Points A1, A2, ..., A n It is defined as the positive extreme point of the rising segment of the echo signal, point B1, B2, ..., B n It is defined as the negative extreme point of the rising segment of the echo signal. The echo signal usually contains a certain amount of noise. In order to reduce noise interference, the first observable maximum and minimum points are defined as A1 and B1, and A n and B n They refer to the maximum and minimum values in the echo signal respectively.
[0012] Time-of-flight measurement is the most widely used method in ultrasonic measurement because it is less affected by environmental and other factors. A key component of UGFM signal processing is the calculation of the ultrasonic time-of-flight (TOF), which depends on the processing of the echo signal. Typical methods that use the characteristic points of the echo signal include cross-correlation, envelope, and threshold methods. Cross-correlation and envelope methods require multiple mathematical operations and high-speed analog-to-digital converters (ADCs) for signal sampling, which can be significantly affected by noise, thereby reducing measurement accuracy. UGFM systems based on threshold methods are gaining increasing attention because they do not rely on high-speed ADCs for echo signal sampling and do not require complex data fitting and heavy computation. However, due to the acoustic impedance mismatch between the ultrasonic transducer and the gas medium, such systems often suffer from low echo signal reception efficiency and further signal attenuation during propagation in the gas medium. As a result, their flow measurement range is also extremely limited. Several studies have been conducted to expand the flow measurement range of threshold-based UGFM systems. For example, the dual threshold method and the dynamic threshold method use the echo signal characteristics of the previous sampling point to adjust the threshold for the next flow measurement, which exhibits considerable hysteresis. Therefore, an increase in the change in gas velocity may lead to adjustment delays or adjustment errors. In addition, as the flow rate increases, the echo signal attenuates significantly, and the difference between adjacent extreme points decreases, making the adjustment of the dynamic threshold increasingly difficult. Therefore, adaptive gain control is crucial to improving the flow measurement range of ultrasonic gas flowmeter systems. An automatic gain circuit (AGC) controller is used based on the change in the extreme points of the echo signal, but it still has limitations such as low sampling rate and distortion of the echo signal over a large flow range, making it unsuitable for larger flow measurements. Summary of the Invention
[0013] The present invention provides an ultrasonic fluid flow measurement method based on flow prediction, which solves the technical problem of how to increase the measurement range of UGFM to a certain extent without affecting the measurement accuracy, and is suitable for flow measurement of fluids with large flow variations (such as gas).
[0014] To solve the above technical problems, the present invention provides an ultrasonic fluid flow measurement method based on flow prediction, comprising the steps of:
[0015] S1. Build an ultrasonic fluid flowmeter signal acquisition system, the system comprising a circular tube and a first transducer and a second transducer with the same parameters placed on the outer wall of the circular tube;
[0016] S2. Using a flow volume simulator, simulate the fluid from the negative maximum flow rate to the positive maximum flow rate acting on the circular tube, and obtain the relationship between the different flow rates and gains at this time based on the echo signals of the first transducer and the second transducer;
[0017] S3. In the first measurement cycle, the current flow rate is calculated by threshold detection and zero-crossing comparison without adding gain;
[0018] S4. For each subsequent cycle, before threshold detection and zero-crossing comparison, the flow prediction model is used to predict the flow at the next sampling moment based on the flow collection values of n sampling moments in the previous cycle. Then according to The relationship between different flow rates and gains is obtained The corresponding gain amplifies the signal, and then threshold detection and zero-crossing comparison are performed on the amplified signal to obtain the fluid flow at the next moment.
[0019] Furthermore, the step S2 specifically includes the steps of:
[0020] S21. Use the second transducer as the excitation end and the first transducer as the receiving end, use a flow volume simulator to simulate the fluid from the negative maximum flow to the positive maximum flow acting on the circular tube, and plot the voltage amplitude V of the positive extreme value points A1, A2, A3, and A4 of the echo signal of the first transducer. A1 、V A2 、V A3 、V A4 In the curve of flow rate change, A1, A2, A3, and A4 refer to the first, second, third, and fourth positive maximum points of the signal during the transition from low to high, respectively;
[0021] S22, fitting the V of the change curve A1 、V A2 、V A3 、V A4 The mapping relationship between different traffic flows;
[0022] S23, V at 0 flow A1 As a benchmark, V A1 The signal is amplified to V when the flow is 0 A1 The voltage values of the extreme points A1, A2, A3, and A4 of the amplified echo signal are obtained by adjusting the level of The degree of amplification here is the gain of different flow rates, thus obtaining the relationship between different flow rates and gains;
[0023] S24: Use the first transducer as an excitation end and the second transducer as a receiving end, and adopt the same process as steps S21 to S23 to obtain the relationship between different flow rates and gains at this time.
[0024] Furthermore, in the process of not using flow prediction to dynamically adjust the gain, the threshold value is set to V threshold ∈(V A1 ,VA2 ).
[0025] Furthermore, in the process of dynamically adjusting the gain using flow prediction, the threshold value is set to
[0026] Furthermore, in step S4, the traffic prediction model includes an input layer, an LSTM layer, a Dense layer and an output layer, wherein the input layer uses a sliding window to obtain the traffic collection value of the previous n sampling moments and sends it to the LSTM layer. The LSTM layer uses a long short-term memory network to obtain features and outputs them to the Dense layer. The Dense layer extracts the correlation between features, and the output layer outputs the predicted traffic at the next sampling moment.
[0027] Furthermore, a differentiation layer and a normalization layer are successively provided between the input layer and the LSTM layer, for performing differentiation and normalization operations, respectively; an inverse normalization layer and an inverse differentiation layer are successively provided between the Dense layer and the output layer, for performing inverse normalization and inverse differentiation operations, respectively.
[0028] The present invention also provides an ultrasonic fluid flow measurement system based on flow prediction, the key of which is: comprising a fluid flow meter signal acquisition system, a flow volume simulator, a flow calculation module, a flow prediction module and a gain calculation module;
[0029] The fluid flow meter signal acquisition system includes a circular tube and a first transducer and a second transducer with the same parameters placed on the outer wall of the circular tube;
[0030] The flow volume simulator is used to simulate the fluid from the negative maximum flow rate to the positive maximum flow rate acting on the circular tube; the gain calculation module is used to obtain the relationship between different flow rates and gains at this time based on the echo signals of the first transducer and the second transducer;
[0031] The flow calculation module is used to calculate the current flow rate by threshold detection and zero-crossing comparison without adding gain in the first measurement cycle; the flow prediction module is used to use the flow prediction model to predict the flow rate at the next sampling time based on the flow collection values of n sampling times in the previous cycle before threshold detection and zero-crossing comparison in each subsequent cycle. The gain calculation module is used to calculate the gain according to The relationship between different flow rates and gains is obtained The corresponding gain amplifies the signal; the flow calculation module is also used to perform threshold detection and zero-crossing comparison on the amplified signal to obtain the fluid flow at the next moment.
[0032] Specifically, the gain calculation module obtains the relationship between different flow rates and gains at this time according to the echo signals of the first transducer and the second transducer, which specifically includes the steps of:
[0033] S21. Use the second transducer as the excitation end and the first transducer as the receiving end, use a flow volume simulator to simulate the fluid from the negative maximum flow to the positive maximum flow acting on the circular tube, and plot the voltage amplitude V of the positive extreme value points A1, A2, A3, and A4 of the echo signal of the first transducer. A1 、V A2 、V A3 、V A4 In the curve of flow rate change, A1, A2, A3, and A4 refer to the first, second, third, and fourth positive maximum points of the signal during the transition from low to high, respectively;
[0034] S22, fitting the V of the change curve A1 、V A2 、V A3 、V A4 The mapping relationship between different traffic flows;
[0035] S23, V at 0 flow A1 As a benchmark, V A1 The signal is amplified to V when the flow is 0 A1 The voltage values of the extreme points A1, A2, A3, and A4 of the amplified echo signal are obtained by adjusting the level of The degree of amplification here is the gain of different flow rates, thus obtaining the relationship between different flow rates and gains;
[0036] S24: Use the first transducer as an excitation end and the second transducer as a receiving end, and adopt the same process as steps S21 to S23 to obtain the relationship between different flow rates and gains at this time.
[0037] Specifically, when the flow prediction is not used to dynamically adjust the gain, the threshold value is set to V threshold ∈(V A1 ,V A2 ).
[0038] Specifically, in the process of dynamically adjusting the gain using traffic prediction, the threshold value is set to
[0039] The ultrasonic fluid flow measurement method and system based on flow prediction provided by the present invention construct a flow prediction model (based on a sliding window algorithm and a long short-term memory network), predict the flow at the next moment based on the first n sampled flow data, and dynamically calculate the gain based on the predicted flow to amplify the signal, and then perform threshold detection and zero-crossing comparison. In addition, by reasonably setting the threshold to perform threshold detection and zero-crossing comparison, the measurement range of UGFM can be increased to a certain extent, and it is suitable for measuring fluid flow with large flow changes without affecting the measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a schematic diagram of the principle of a mono UGFM system provided by the background technology of the present invention;
[0041] Figure 2 This is a flow chart of measuring TOF in UGFM using a threshold method provided by the background technology of the present invention;
[0042] Figure 3 This is the excitation and echo signal waveform diagram of the threshold method UGFM provided by the background technology of the present invention;
[0043] Figure 4 2 is a diagram of a UGFM echo signal sampling device provided by an embodiment of the present invention;
[0044] Figure 5 This is a graph showing changes in the echo signal of a negative flow rate provided by an embodiment of the present invention;
[0045] Figure 6 This is a graph showing changes in the echo signal of a positive flow rate provided by an embodiment of the present invention;
[0046] Figure 7 1 is a waveform diagram of echo signals of two transducers at different flow rates provided by an embodiment of the present invention;
[0047] Figure 8 This is a waveform diagram of an echo signal at different flow rates using a threshold method provided by an embodiment of the present invention;
[0048] Figure 9 is a normalized echo signal waveform diagram provided by an embodiment of the present invention;
[0049] Figure 10 is a graph showing the change of echo extreme value points with flow rate provided by an embodiment of the present invention;
[0050] Figure 11 1 is a schematic diagram of an ultrasonic fluid flow measurement method based on flow prediction provided by an embodiment of the present invention;
[0051] Figure 12is a curve diagram showing the change of the extreme value point of the amplified echo signal with the flow velocity provided by an embodiment of the present invention;
[0052] Figure 13 Schematic diagram of the SW-LSTM model for traffic prediction provided by an embodiment of the present invention;
[0053] Figure 14 is a schematic diagram of line A and curve B provided by an embodiment of the present invention;
[0054] Figure 15 This is a prediction diagram of the SW-LSTM model provided in an embodiment of the present invention;
[0055] Figure 16 Schematic diagram of the experimental device provided by an embodiment of the present invention;
[0056] Figure 17 1 is an echo signal diagram of the transducer 1 at zero flow rate provided by an embodiment of the present invention;
[0057] Figure 18 is a comparison diagram of echo signals under different positive flow rates provided by an embodiment of the present invention;
[0058] Figure 19 1 is an experimental data graph of curve A and curve B provided in an embodiment of the present invention;
[0059] Figure 20 1 is a comparison chart of experimental data of curve A provided by an embodiment of the present invention;
[0060] Figure 21 This is a curve diagram of volunteer experimental data verification under the LSTM model provided by an embodiment of the present invention;
[0061] Figure 22 This is a verification diagram of gas injector experimental data under the LSTM model provided by an embodiment of the present invention;
[0062] Figure 23 is a prediction diagram using a linear extrapolation model provided by an embodiment of the present invention;
[0063] Figure 24 This is a diagram showing the verification results of gas injector experimental data under the extrapolation model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following describes the embodiments of the present invention in detail with reference to the accompanying drawings. The embodiments are provided for illustrative purposes only and are not to be construed as limiting the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute a limitation on the scope of protection of the present invention. Many changes may be made to the present invention without departing from the spirit and scope of the present invention.
[0065] This embodiment takes gas as an example to illustrate an ultrasonic fluid flow measurement method and system based on flow prediction.
[0066] In a single-channel UGFM system, two time-of-flight (TOF) measurements (t1 and t2) are sampled sequentially to calculate the flow velocity at a given time. That is, after completing one TOF (t1) measurement, the system waits until the echo signal in the pipe decays to a certain level before starting the next TOF (t2) measurement. Typically, changes in flow velocity between two TOF measurements are ignored. However, for gases with rapidly changing flow rates or applications requiring high real-time flow measurement accuracy, it is necessary to minimize the time between two TOF measurements to improve the sampling rate and flow measurement accuracy. Reducing the number of pulses in the excitation signal effectively shortens the tail length of the echo signal, thereby reducing the measurement time of a single TOF. Therefore, in this example, a single pulse signal is used as the excitation signal for both the analysis of the echo signal in the UGFM system and the final experimental section.
[0067] Since the mathematical model of UGFM is difficult to construct, numerical fitting methods are usually used to analyze the system. Therefore, this embodiment first establishes a data acquisition system for UGFM echo signals, namely an ultrasonic gas flowmeter signal acquisition system. Figure 4 As shown. In order to collect the echo signal, a flow volume simulator (produced by Hans Rudolph) was used to simulate the forward and reverse constant flow. A circular tube made of polyetheretherketone with an inner diameter of 19 mm and a length of 140 mm was used. A pair of transducers (the first transducer, i.e., transducer 1, and the second transducer, i.e., transducer 2) was placed on the pipe wall, and the center frequency of the two transducers was 300 kHz. A 250 stainless steel woven wire mesh was placed at the intersection of the pipe and the transducer to promote the propagation of ultrasonic waves. A positive single pulse signal with a peak value of 60 V was used as the excitation signal with a pulse width of 100 μs. The echo signal was amplified 2000 times. The UGFM system was connected to the flow volume simulator, and a Tektronix TDS2024B oscilloscope was used to capture the echo signals of the two transducers.
[0068] like Figure 4 As shown, airflow from left to right is defined as positive flow, and the reverse direction is defined as negative flow. Figure 5 and Figure 6 The figure shows the changes in the echo signal of transducer 1 at negative flow rates [-12, 0] L / s and positive flow rates [0, 12] L / s. The x-axis, y-axis, and z-axis represent the sampling point (sampling period is 4ns), flow value, and amplitude of the sampled echo signal, respectively. As the flow rate increases, the attenuation of the echo signal becomes significant, and the extreme value point A1-An and B1-B n Decrease.
[0069] Figure 5 and Figure 6 The comparison shows that the attenuation of the echo signal in the positive direction is greater than that in the negative direction. This unbalanced attenuation of the transducers may be caused by differences in their structure, materials and other aspects. There is a certain mapping relationship between the echo signal of UGFM and the flow rate, which is expressed as
[0070] V A (Q,t)=f(Q,t) (5)
[0071] Where V A Represents the voltage of the echo signal, and f represents the mapping relationship between the flow rate and the echo signal. Similarly, the echo signal of transducer 2 is sampled according to the same procedure and compared with the echo signal of transducer 1, that is, V A(i) The comparison results are as follows: Figure 7 shown.
[0072] Figure 7 (a)-(c) show the echo signal V of transducer 1 at different flow rates (+4, +8, and +12 L / s) A(i) , and the echo signal V of transducer 2 at different flow rates (-4, -8 and -12 L / s) A . Figure 7 (d)-(f) show the V at flow rates of -4, -8, and -12 L / s A , and V at flow rates of +4, +8, and +12 L / s A(i) The x-axis and y-axis represent the sampling point and amplitude of the echo signal respectively.
[0073] It can be seen that when the ultrasonic wave propagates against the flow direction, the echo signals of the two transducers are almost the same at the same flow rate. This relationship can be expressed as:
[0074] V A(i) (Q,t)=f(-Q,t) (6)
[0075] Therefore, by finding the variation law of the echo signal of one transducer at the same flow rate in the system, the variation law of the echo signal of another transducer rate can be obtained.
[0076] During the propagation of ultrasonic signals in UGFM, as the flow rate increases, the extreme value point of the echo signal (A1-A n and B1-B n ) will experience varying degrees of attenuation. Figure 8 The echo signals at low, medium and high flow velocities in the same direction and from the same starting point are shown. Figure 8As shown, the threshold voltage is set between A1 and A2. In other words, characteristic points F1 and F2 are located on the rising edge of the echo cycle in which A2 occurs, and the TOF calculation ends at point E. As the flow rate increases, A2 decays below the threshold. Characteristic point F3 is obtained at the intersection of the threshold voltages. The echo signal falls within the cycle in which A3 occurs, and the TOF calculation ends at point E'. By comparing E and E', if the timing ends at E', an extra cycle is included in the calculation, resulting in an erroneous flow rate result. This is commonly known as the skip cycle phenomenon in flow measurement.
[0077] In the same UGFM system, as the flow velocity increases, the envelope of the echo signal will decrease proportionally, that is, the extreme point A1-A n The value of will decrease proportionally. Therefore, there is a solution to propose an AGC controller to improve the flow detection range. Normalize the echo signals collected at different flow rates and align their extreme points to obtain Figure 9 .
[0078] Figure 9 (a) shows the normalized echo signals when the negative flow rate is 0, -2, -4, and -6 L / s. Figure 9 (b) shows the normalized echo signals at negative flow rates of -8, -10, -12, and -14 L / s. Figure 9 (a) shows that the envelope of the echo signal with a flow rate of 0 to 6 L / s remains relatively consistent as the flow rate increases, and there are four visible extreme points in the rising part of the echo signal. Figure 9 (b) shows that as the flow rate continues to increase, the envelope of the echo signal undergoes some distortion and remains consistent within a certain flow range after the distortion. Within this flow range, there are five visible extreme points in the rising part of the echo signal.
[0079] Figure 9 (c) shows the normalized echo signals when the positive flow rate is 0, 2, 4, 6, 8, and 10 L / s. Figure 9 (d) shows the normalized echo signals for positive flow rates of 12 and 14 L / s. Similar phenomena were observed for positive flow rates as for negative flow rates: the echo signal envelope remained essentially consistent between 0 and 10 L / s, but distorted to some extent as the flow rate increased.
[0080] Therefore, while the AGC controller can expand the flow measurement range to a certain extent, it has limitations. When the flow rate is too high and causes the echo signal envelope to be distorted, the AGC controller will be unable to perform echo adaptive control of the UGFM. Furthermore, because the echo signal is an intermittent, spindle-shaped envelope signal, the AGC controller needs to intermittently excite the transducer twice to sample the flight time: the first excitation is used to modulate the echo signal gain, and the second excitation is used to sample the flight time. This significantly increases the sampling period, making it difficult to increase the sampling rate to accurately measure rapidly changing gas flow rates.
[0081] This embodiment extracts the value of the positive extreme point (i.e., A1-A4) of the echo signal of transducer 2 at a flow rate within the interval of [-16, +16] L / s. Each flow point is sampled 50 times at an interval of 1 L / s. Taking into account sampling noise, irregular airflow in the pipeline, and sampling accuracy, the peak value of the echo signal may be different at different flow rates. For the echo signal of each flow rate, the maximum and minimum extreme points are extracted. In addition, the adjacent points are linearized once to plot the change of the echo signal extreme point relative to the flow rate, as shown in FIG. Figure 10 shown.
[0082] V A1 -V A4 Represent the voltage values at points A1-A4 respectively. Figure 10 It shows that at zero flow, the difference between adjacent extreme points is (V A1 ,V A2 ) interval. The threshold voltage is set to a value in this interval, V threshold ∈(V A1 ,V A2 ), to maximize the flow measurement range in UGFM.
[0083] V A1 -V A4 There is a mapping relationship between and flow Q, which can be expressed as:
[0084]
[0085] Where Q represents the volume flow rate; V A1 -V A4 They refer to the voltage values at points A1-A4 at the same flow rate Q; f1-f4 represent the mapping relationship between A1-A4 and flow rate.
[0086] like Figure 10 As shown, the fixed threshold voltage V thresholdSet to 0.8V, the corresponding maximum measurement range of the flowmeter is [-10,7] L / s. Analysis of the echo signal at different flow rates shows that the ratio of the amplitude of each peak point to the amplitude of the maximum peak point is basically the same. Therefore, in this case, the characteristic point of the echo signal can be determined by adjusting the threshold based on the value at the peak of the echo signal. In this example, V is calculated. A1 -V A3 Value and V A4 The result is that, despite the change in flow rate, V A1 -V A3 With V A4 The ratio is generally stable within the range of [-4, 4] L / s. However, as the flow rate increases, a clear upward / downward trend is observed in the ratio, and the adjustment range of the threshold decreases. This phenomenon demonstrates the limitations of this dynamic thresholding method.
[0087] Figure 10 The results show that the difference between echo signal peaks is very small over a wider flow range. In this case, it is not easy to control the measurement range using a dynamic threshold voltage. In addition, the AGC method is not suitable for measuring a wider range of flow due to envelope distortion.
[0088] To expand the flow measurement range of ultrasonic gas flowmeters, adaptive control of the echo signal is necessary. While existing ultrasonic gas flowmeters can expand the flow measurement range under certain conditions, they often exhibit a certain degree of adjustment lag, making them unsuitable for measuring gases with rapidly fluctuating flow rates. Furthermore, the aforementioned tests revealed that when the flow rate exceeds a certain level, the echo signal becomes distorted to a certain degree.
[0089] Based on the above analysis, in order to maximize the range of flow rate testing, this embodiment proposes an ultrasonic fluid flow measurement method based on flow prediction, such as Figure 11 As shown, the steps include:
[0090] S1. Build an ultrasonic fluid flowmeter signal acquisition system, which includes a circular tube and a first transducer and a second transducer with the same parameters placed on the outer wall of the circular tube (see Figure 4 );
[0091] S2. Using a flow volume simulator, simulate the fluid acting on the circular tube from the negative maximum flow rate to the positive maximum flow rate, and obtain the relationship between the different flow rates and gains at this time based on the echo signals of the first transducer and the second transducer;
[0092] S3. In the first measurement cycle, the current flow rate is calculated by threshold detection and zero-crossing comparison without adding gain;
[0093] S4. For each subsequent cycle, before threshold detection and zero-crossing comparison, the flow prediction model is used to predict the flow at the next sampling moment based on the flow collection values of n sampling moments in the previous cycle. Then according to The relationship between different flow rates and gains is obtained The corresponding gain amplifies the signal, and then threshold detection and zero-crossing comparison are performed on the amplified signal to obtain the fluid flow at the next moment.
[0094] Wherein, step S2 specifically includes the steps of:
[0095] S21. Use the second transducer as the excitation end and the first transducer as the receiving end. Use a flow volume simulator to simulate the fluid from the negative maximum flow rate to the positive maximum flow rate acting on the circular tube. Plot the voltage amplitude V of the positive extreme value points A1, A2, A3, and A4 of the echo signal of the first transducer. A1 、V A2 、V A3 、V A4 In the curve of flow rate change, A1, A2, A3, and A4 refer to the first, second, third, and fourth positive maximum points of the signal during the transition from low to high, respectively;
[0096] S22, fitting the V of the change curve A1 、V A2 、V A3 、V A4 The mapping relationship between different traffic flows;
[0097] S23, V at 0 flow A1 As a benchmark, V A1 The signal is amplified to V when the flow is 0 A1 The voltage values of the extreme points A1, A2, A3, and A4 of the amplified echo signal are obtained by adjusting the level of The degree of amplification here is the gain of different flow rates, thus obtaining the relationship between different flow rates and gains;
[0098] S24: Use the first transducer as the excitation end and the second transducer as the receiving end, and adopt the same process as steps S21 to S23 to obtain the relationship between different flow rates and gains at this time.
[0099] like Figure 11 As shown, where V0 represents the input of the system. After the initial A0 times amplification and filtering, the signal V A The signal V is calculated by first amplifying the input signal A0 and then filtering it. AThe arrival times t1 and t2 of transducer 1 and transducer 2 are obtained by threshold detection and zero-crossing comparison, respectively. The average flow velocity v of the gas in the pipeline is calculated using formula (3). The flow rate Q is the volume flow rate of the product of v and the pipeline cross-sectional area S, which represents the average volume flow rate in the pipeline. The flow rate at the next sampling moment is predicted using the first n flow data before sampling, and the predicted flow rate is expressed as g represents the relationship between flow rate and gain k, which is obtained based on the predicted flow rate at the next sampling moment and the known relationship between different flow rates and gains.
[0100] Fluid flow is continuous, while fluid sampling is discrete. However, as flow increases, even small changes in flow over a larger flow range can lead to threshold detection errors. This system can predict flow changes and magnitudes before sampling, enabling more accurate flow measurement and precise control of echo signal gain within the measurement range, despite large flow fluctuations.
[0101] Because the V A1 The fluctuation of V varies little with the flow rate, so V A1 Determine the magnification k as the benchmark. In this example, Figure 10 Maximum V at zero flow A1 The curve (f1(0)) is used as the reference, and the V of the echo signal under all flow rates is calculated. A1 When all are amplified to 0 flow, V A1 The size of Q flow can be determined as:
[0102] k(Q)=V A1 (Q) / f1(0) (8)
[0103] Thus, the relationship between gain and flow is obtained.
[0104] At Q flow rate (e.g. ) under the magnified V A1 -V A4 It can be expressed as:
[0105]
[0106] in They represent the values of the extreme points A1-A4 of the echo signal after amplification with a gain of k(Q). Since the echo signal is time-varying, equation (9) can be rewritten as:
[0107]
[0108] in, It represents the echo signal after amplification with a gain of k(Q) at a flow rate Q.
[0109] use Figure 10 The maximum V A1 The curve is used as the benchmark and the amplification adjustment is performed according to formula (10), and the Figure 12 , which shows the amplified signal curve. In order to minimize the influence of interference on the measurement, the threshold voltage should be set within a relatively large interval. The threshold (black dashed line) should be adjusted as follows:
[0110]
[0111] They represent the voltage values at points A1 and A2 of the echo signal at the current flow rate, respectively. Points A1 and A2 are the first maximum point and the second maximum point of the echo signal during the transition from low to high.
[0112] This way through Figure 11 In the system shown, if the flow prediction error is very small, the echo signal amplification factor can be accurately controlled, thereby accurately measuring the flight times t1 and t2, and then accurately obtaining the flow value of the measured fluid.
[0113] To want Figure 11 In order to be able to work accurately and stably, the flow prediction link is also crucial. Large prediction errors will still lead to the occurrence of cycle skipping. In recent years, LSTM deep learning neural network models have been frequently used for time series prediction. The flow collection and prediction of the present invention is also a time series prediction problem. Therefore, the LSTM neural network is used here for prediction of this system. Since airflow is also an inertial fluid, it usually does not undergo large mutations. There is a certain correlation and coupling between the flow data. Therefore, the construction and workflow of the flow prediction model are as follows:
[0114] The prediction model uses n traffic data sliding windows to perform regular splitting, such as Figure 13 The "input layer" in the "LSTM layer" is connected to each other through loops; the "Dense layer" is added after the output of the LSTM to extract the association between features; and finally, the traffic prediction value for the next sampling time is output. After completing the i-th traffic sampling, the sampled real traffic data enters the data sliding window and the prediction before the i+1th traffic sampling is performed. It is worth noting that the prediction value ...only for Figure 11 The determination of the amplification factor k in the control system does not participate in the subsequent flow prediction.
[0115] A spirometer is a UGFM that measures the flow rate of air inhaled / expired from the lungs. During a pulmonary function test, the subject is required to inhale deeply and exhale rapidly in a forced breath. The flow rate varies greatly, and the direction of the flow changes continuously. Therefore, this embodiment uses a spirometer to train the proposed SW-LSTM model. In 1995, the American Thoracic Society (ATS) proposed 26 flow-time waveforms that represent the changes in airflow over time during forced breathing of participants. In addition, all spirometers must be validated according to these standard 26 waveforms before they can be considered suitable for provision to all participants. After 2000, the International Organization for Standardization issued and updated ISO 23747, as well as the domestically issued industry standard YY / T 1438-2016, which specify the requirements for spirometers. These two standards define curves A and B ( Figure 14 ) to verify flow meter accuracy. Curve A (RT between 100ms and 120ms, DT between 120ms and 140ms) verifies flow meter accuracy, repeatability, and linearity, while Curve B (RT between 12ms and 18ms, DT between 24ms and 36ms), which has a greater flow rate variation, verifies flow meter sampling rate and stability.
[0116] like Figure 14 The figure shows the key parameters of instantaneous flow in Curve A. Specifically, PEF and PIF refer to peak expiratory flow and peak inspiratory flow, respectively; FEF25 / 50 / 75% and FIF25 / 50 / 75% refer to the instantaneous forced expiratory and inspiratory flows at 25%, 50%, and 75% of lung capacity, respectively. The 26 flow-time waveforms are similar to these two profiles, but their RT, DT, and PF values differ.
[0117] 26 sinusoidal waveforms and 5 respiratory waveforms are included in the training dataset. The respiratory waveforms are generated using a flow-volume simulator with a respiratory rate between 12 and 60 bpm. In order to achieve more accurate predictions using the SW-LSTM model, the sliding window n size should be carefully determined. An n that is too large will slow down the system and make it unable to sample at the required sampling rate. If n is too small, the system cannot accurately identify the changing trend of the flow rate. Therefore, in order to achieve accurate flow prediction, the window size should be neither too large nor too small. In this embodiment, it is set to 10 (i.e., n=10).
[0118] In order to reduce the impact of strong data correlation on the prediction results, the data is preprocessed through the differentiation process before data processing. The preprocessed data is then normalized using the Minmax method to achieve faster convergence. Figure 13The following figure shows the SW-LSTM model for traffic prediction. Two steps should be added between the input layer and the LSTM layer: differentiation and normalization. This involves adding a differentiation layer and a normalization layer for differentiation and normalization, respectively. Before the output layer, two steps should be introduced: inverse differentiation and inverse normalization. This involves adding an inverse normalization layer and an inverse differentiation layer before the output layer, performing inverse normalization and inverse differentiation, respectively.
[0119] Using the SW (sliding window) algorithm, a window slides across the time series data stream, generating the model input. The LSTM model contains three hidden layers, and the number of iterations is set to 50. The output of each neuron in the model is calculated. The model is trained offline using the Adam optimization algorithm, and a loss function is defined. The neural network weights are updated via gradient descent. Furthermore, by introducing the Dropout technique in the output layer and randomly selecting neurons to be removed based on a certain probability during each training iteration, the model avoids overfitting of the training data, thereby improving its generalization and robustness. Furthermore, the model's noise tolerance is increased, enabling it to better handle noisy input data.
[0120] Curve A and Curve B are used as test data. The mean square error (MSE) is the average cost function that minimizes the sum of squares of the linear regression model fit, and is calculated as Equation (12). It can be used to see the number of outliers and large errors in the model and is used to evaluate the regression results of the proposed model.
[0121]
[0122] where Q (i) and Represents the input data set and prediction data set of the model respectively. The predicted flow rate is inevitably different from the actual value. N represents the flow data Q in a test set. (i) or Therefore, the actual amplification of the extreme value point of the echo signal and Expressed as:
[0123]
[0124] and Form the error band of the control system and LSTM model. During the operation of the model and control system, as long as Within the error band, the system can work stably. Therefore, we can determine whether the system works normally by calculating whether it meets the requirements of formula (14).
[0125]
[0126] The SW-LSTM model samples the data for Curve A at 5ms intervals. Tables 1 and 2 show the model error results for Curves A and B at different PF values. Max(E1) and Min(E2) (unit: V) represent the maximum and minimum errors within the error band. The threshold voltage is set to 1.10V to observe the threshold voltage margin at the point of maximum control system error.
[0127] Table 1 Prediction results of curve A
[0128]
[0129] Table 2 Prediction results of curve B
[0130]
[0131] The calculation results in Table 1 show that the model has very good performance in predicting Curve A. All points meet the requirements of Equation (14). In other words, all points are correctly estimated. The maximum E1 margin is -0.2802V (PF = -16L / s), and the minimum E2 margin is 0.2487V (PF = 14.5L / s). Figure 15 Comparison between original and predicted data is shown for curve A (PF = -16 L / s) and curve B (PF = 14.5 L / s).
[0132] In addition, the maximum value after the control system is magnified is plotted. and minimum It can be seen that the control system and SW-LSTM model achieved satisfactory results and ensured stable operation even for the B curve with fast flow changes.
[0133] Based on the above method, this embodiment also provides an ultrasonic fluid flow measurement system based on flow prediction, the key of which is: including a fluid flow meter signal acquisition system, a flow volume simulator, a flow calculation module, a flow prediction module and a gain calculation module;
[0134] The fluid flow meter signal acquisition system includes a circular tube and a first transducer and a second transducer with the same parameters placed on the outer wall of the circular tube;
[0135] The flow volume simulator is used to simulate the fluid acting on the circular tube from the negative maximum flow rate to the positive maximum flow rate; the gain calculation module is used to obtain the relationship between different flow rates and gains at this time based on the echo signals of the first transducer and the second transducer;
[0136] The flow calculation module is used to calculate the current flow rate through threshold detection and zero-crossing comparison without adding gain in the first measurement cycle; the flow prediction module is used to use the flow prediction model to predict the flow rate at the next sampling moment based on the flow collection values of n sampling moments in the previous cycle before threshold detection and zero-crossing comparison for each subsequent cycle. The gain calculation module is used to calculate the The relationship between different flow rates and gains is obtained The corresponding gain amplifies the signal; the flow calculation module is also used to perform threshold detection and zero-crossing comparison on the amplified signal to obtain the fluid flow at the next moment.
[0137] The functions implemented by each module in the system have been described in detail in the above method and will not be repeated here.
[0138] In summary, the ultrasonic fluid flow measurement method and system based on flow prediction provided by the embodiments of the present invention propose a flow prediction model (based on a sliding window algorithm and a long short-term memory network) to perform flow prediction on the first n flow data before sampling, to dynamically calculate the gain for dynamic amplification of the signal, and to perform threshold detection and zero-crossing comparison by reasonably setting the threshold, which can increase the measurement range of UGFM to a certain extent, and is suitable for fluid flow measurement with large flow changes without affecting the measurement accuracy.
[0139] The following is an experimental verification.
[0140] Based on the previous analysis, an experimental circuit system was established. The schematic diagram is as follows: Figure 16 The installation structure of the air flow pipe and the transducer is as shown. Figure 4 The transducer is the same as the original design. The output of the boost circuit is 60V with two 100kΩ matching resistors, denoted as R M1 and R M2 The CPU controls the excitation and reception of the ultrasonic transducer signal through five switches (i.e., S1 to S5). A single pulse signal with a pulse width of 100 μs is used as the excitation signal.
[0141] While the CPU controls the generation of the excitation signal, it also sends a "start" command to the TDC-GP22, a high-precision time-to-digital converter. After threshold and zero-crossing comparisons, a "stop" command is sent to the TDC. For signal amplification and filtering, this embodiment uses two AD8092AR devices and their peripheral circuitry. A MAX9202 comparator, an SN74HC74D SOIC, and peripheral circuitry are used for threshold and zero-crossing comparisons. A Texas Instruments VCA824 series amplifier is used for gain control by adjusting its gain control input voltage, and a MAX5541 series DAC converter is controlled by the CPU via an SPI interface. The processing unit of the experimental system is a Raspberry Pi 4B, equipped with a Broadcom BCM2711 quad-core Cortex-A72 ARMv8 64-bit SoC @ 1.5GHz and an integrated Broadcom VideoCore VI @ 500MHz GPU. The SW-LSTM model runs stably in Python on the Raspberry Pi 4B. The computing board has 4GB of LPDDR4 SDRAM, 15 GPIO pins, and an SPI interface, meeting all the requirements of the UGFM. The UGFM can communicate with a PC, which can store and display traffic data in real time.
[0142] For each sampled flow rate, t1 and t2 are calculated using the threshold method of the echo signal at two time points. SW starts from zero. t1 and t2 are calculated by amplifying the initial echo signal to obtain the first sample. For subsequent cycles, predictions are first made using the SW-LSTM model to adjust the gain before sampling t1 and t2. The parameters of the SW-LSTM model were trained in the previous chapter. The gain adjustment of transducer 2 can be obtained from equations (6) and (12) as:
[0143]
[0144] The SW-LSTM model has a total of N1 = 172 neurons and takes n = 10 time series flow data as input. The computational cost of the model is calculated as O(nN1) = O(1720). In order to achieve the same level of flow measurement accuracy in the UGFM system, the cross-correlation method and the envelope method need to ensure that the ADC sampling rate is not less than 25MHz and the echo signal is sampled twice within each flow acquisition cycle of approximately 250μs, which means that the minimum number of data samples per sampling is N2 = 6250. The computational cost of the cross-correlation and envelope methods can be expressed as approximately O(N2 2) = O(62500) and O(2N2) = O(12500), which is much higher than the LSTM method. Simulations using the LSTM model on a Raspberry Pi 4B show that it takes approximately 660-700 μs to predict a single flow rate value, meeting the system's design requirement of a 5 ms flow sampling period.
[0145] To calibrate the UGFM, a constant flow rate is first generated in the working mode of the flow volume simulator. The echo signal of the UGFM is collected by an oscilloscope, and a flow prediction and echo gain control method is proposed. Figure 17 The echo signal received by transducer 1 at zero flow rate is shown in FIG. Another collected echo signal is compared with the echo signal that is not amplified using this method. The comparison results are shown in FIG. Figure 18 shown.
[0146] Figure 18 (a), (e), (i), (m), (c), (g), (k), and (o) show the echo signals of transducer 1 at flow rates of +4, +8, +12, +16, -4, -8, -12, and -16 L / s, respectively. The echo signals were amplified 2000 times. After flow prediction and gain compensation, the echo signals of transducer 1 at flow rates of +4, +8, +12, +16, -4, -8, -12, and -16 L / s, respectively, are shown in Figure 1. Figure 18 (b), (f), (j), (n), (d), (h), (l), (p). Figure 18 As shown, V at eight flow rates A * 1 values are 0.76, 0.76, 0.76, 0.74, 0.76, 0.74, 0.76 and 0.76 V, V A * The values for 2 are 1.86, 1.94, 2.56, 1.82, 1.94, 1.48, 1.50, and 1.38 V. All V A * 1 and V A * 2 values all meet the requirements in formula (14).
[0147] To verify the obtained flow rate, the flow volume simulator (FVS) was set to "single exhalation / inhalation" mode for simulation. Different curves A and B were selected to generate flows in positive and negative directions. The data of specific flow points measured using the UGFM system were compared with the simulated data of the simulator. The comparison results are shown in Figure 2. Figure 19 shown. Figure 19 (a) and 19(b) illustrate the FVS readings and ultrasonic gas flow meter (UGFM) system measurement readings for curves A and B, respectively, in the flow range of [-16, 16] L / s. Figure 19 Each "measurement value" in represents the average of 50 measurements. Figure 19 It can be observed that the measurement range of UGFM can be expanded to [-16,16] L / s; no skipping cycles and data distortion were observed in the signal sampling. For the B curve used to verify the sampling rate and stability of the system, the UGFM system also showed good measurement performance. The error range of flow measurement is less than ±2.0%, and the maximum positive error and negative error are 1.92% and -1.96% respectively. In addition, the performance of the equipment fully meets the requirements of ISO 23747 and YY-1438 standards. Two groups of profiles A (PF = 14.5 L / s and PF = -14.5 L / s) were selected, and the simulator data and UGFM system sampling data were compared, as shown in the figure. Figure 20 (a) and Figure 20 (b) As shown. Figure 20 ,The output data of UGFM and FVS are highly consistent at all sampling points of flow measurement.
[0148] To verify the applicability and stability of the SW-LSTM model and UGFM system, 20 volunteers were recruited to measure respiratory airflow (PF) using an UGFM flowmeter. The data collected by the UGFM was input into the SW-LSTM model for validation. The volunteers achieved maximum expiratory and inspiratory flow rates of +11.8 L / s and -11.6 L / s, respectively, without any flow jumps or jump cycles. Figure 21 The test results of one of the volunteers are shown.
[0149] and Figure 15 similar, Figure 21 Error band curves for the maximum and minimum values are also included. Finally, to further test the stability and robustness of the system, experiments were conducted using a continuous randomized airflow. A 3L gas syringe was connected to the UGFM, and the plunger was manually pulled out of and pushed into the cylinder to generate a continuous, irregular airflow at various rates within the range of [-16, 16] L / s. No flow jumps or jump cycles were observed during multiple experiments. Figure 22 The waveforms captured during the test are shown in Figure 2. The flow rate is collected and the collected data is input into the SW-LSTM model for verification. The results are shown in Figure 2. Figure 22 As shown in Figure 2, the prediction results of the SW-LSTM model are accurate even for irregular traffic within the measurement range of [-16.3, 16.8] L / s. No skipped cycles or data distortion are observed in the signal sampling in UGFM.
[0150] This embodiment also attempts to apply linear extrapolation to the proposed system, i.e. Figure 11The "Flow Forecast" module in the . Different PFs for curves A and B, and Figure 15 The data shown in were validated using a linear extrapolation model, as Figure 23 As shown. In order to facilitate the observation of the threshold voltage V threshold and echo peak voltage and Figure 23 The amplitude scale range in is fixed to the interval [0.6,2.6]V. By comparing Figure 15 and Figure 24 , it can be observed that the linear extrapolation model also shows good prediction performance on curve A. However, when predicting the rapidly changing curve B, the linear extrapolation method may show significant prediction errors, resulting in a cycle skipping phenomenon, while the LSTM model still maintains good prediction performance. In addition, all PFs in the curves A and B in Tables 1 and 2 were verified using the linear extrapolation method. The results show that all the curves B of the linear extrapolation method fail to meet the requirements of formula (14), resulting in large flow prediction errors and the occurrence of cycle skipping. Similarly, this embodiment also verifies Figure 22 The airflow signal generated by the random push-pull air pump. Figure 22 Use linear extrapolation methods, such as Figure 24 As shown in Figure 2, it can be observed that the linear extrapolation method also exhibits significant prediction errors and skip cycle errors in this part of the flow rate with irregular changes. In this flow sampling section, it can be observed that about 20 or It was not correctly determined and a cycle skipping phenomenon occurred.
[0151] Therefore, the selection and construction of the prediction model is also crucial for the new system. Especially in the case of rapid changes in flow rate, the LSTM model shows faster and more accurate performance in flow rate prediction, thus being able to correctly determine the echo signal V during system operation. A1 and V A2 , and no periodic jump phenomenon occurs. The SW-LSTM model constructed in this embodiment performs well under the requirements of ISO23747 and YY-1438 standards.
[0152] In summary, this embodiment uses a 19mm inner diameter UGFM system as an example to study and analyze the echo signal characteristics of the UGFM system in positive and negative flow measurements. In addition, the changes in the echo signal within the range of [-16, 16] L / s are analyzed, and the relationship between the extreme points of the echo signal and the flow rate is given. The characteristics of the echo signal in the high-flow area demonstrate the limitations of AGC and other UGFM control methods. Based on the threshold method, this embodiment proposes a dynamic gain control method for echo signal processing based on flow prediction, which can solve the hysteresis adjustment problem of echo adaptive methods such as AGC controllers. In order to obtain an accurate TOF, a multi-input single-output flow prediction model is established using the SW algorithm and the LSTM model. This model can adjust the gain of the echo signal before sampling based on the flow prediction at the next sampling moment. Compared with other methods such as linear extrapolation, this method can maximize the range of flow measurement, has greater versatility, and is more conducive to measuring gases with rapidly changing flow rates.
[0153] The results show that this method effectively increases the range of flow measurement without changing the signal path and flow path. The initial range of the threshold method is expanded from [-10, 7] to [-16, 16] L / s. The range is expanded by approximately 2.3 times and 1.6 times in the positive and negative directions, respectively. The error range of flow measurement is less than ±2%. In addition, it meets all performance requirements specified in the ISO 23747 standard and YY-1438, including linearity, stability, and other requirements. Finally, both simulation and experimental results demonstrate the feasibility of this method. The results of the simulator and experiments show that this control method has wide applicability and can be used to achieve accurate flow measurement.
[0154] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.
Claims
1. An ultrasonic fluid flow measurement method based on flow prediction, characterized in that: Including steps: S1. Build an ultrasonic fluid flowmeter signal acquisition system, the system comprising a circular tube and a first transducer and a second transducer with the same parameters placed on the outer wall of the circular tube; S2. Using a flow volume simulator, simulate the fluid from the negative maximum flow rate to the positive maximum flow rate acting on the circular tube, and obtain the relationship between the different flow rates and gains at this time based on the echo signals of the first transducer and the second transducer; S3. In the first measurement cycle, the current flow rate is calculated by threshold detection and zero-crossing comparison without adding gain; S4. For each subsequent cycle, before threshold detection and zero-crossing comparison, the flow prediction model is used to predict the flow at the next sampling moment based on the flow collection values of n sampling moments in the previous cycle. Then according to The relationship between different flow rates and gains is obtained The corresponding gain amplifies the signal, and then the amplified signal is subjected to threshold detection and zero-crossing comparison to obtain the fluid flow rate at the next moment; In step S4, the traffic prediction model includes an input layer, an LSTM layer, a Dense layer and an output layer, wherein the input layer uses a sliding window to obtain the traffic collection value of the previous n sampling moments and sends it to the LSTM layer. The LSTM layer uses a long short-term memory network to obtain features and outputs them to the Dense layer. The Dense layer extracts the correlation between features, and the output layer outputs the predicted traffic at the next sampling moment.
2. The ultrasonic fluid flow measurement method based on flow prediction according to claim 1, characterized in that: The step S2 specifically includes the following steps: S21. Use the second transducer as the excitation end and the first transducer as the receiving end, use a flow volume simulator to simulate the fluid from the negative maximum flow to the positive maximum flow acting on the circular tube, and plot the voltage amplitude V of the positive extreme value points A1, A2, A3, and A4 of the echo signal of the first transducer. A1 、V A2 、V A3 、V A4 In the curve of flow rate change, A1, A2, A3, and A4 refer to the first, second, third, and fourth positive maximum points of the signal during the transition from low to high, respectively; S22, fitting the V of the change curve A1 、V A2 、V A3 、V A4 The mapping relationship between different traffic flows; S23, V at 0 flow A1 As a benchmark, V A1 The signal is amplified to V when the flow rate is 0 A1 The voltage values of the extreme points A1, A2, A3, and A4 of the amplified echo signal are obtained by adjusting the level of The degree of amplification here is the gain of different flow rates, thus obtaining the relationship between different flow rates and gains; S24: Use the first transducer as an excitation end and the second transducer as a receiving end, and adopt the same process as steps S21 to S23 to obtain the relationship between different flow rates and gains at this time.
3. The ultrasonic fluid flow measurement method based on flow prediction according to claim 2, characterized in that: In the process of not using flow prediction to dynamically adjust the gain, the threshold value is set to V threshold ∈(V A1 ,V A2 ).
4. The ultrasonic fluid flow measurement method based on flow prediction according to claim 3 is characterized in that: In the process of dynamically adjusting the gain using flow prediction, the threshold value is set to 5. The ultrasonic fluid flow measurement method based on flow prediction according to claim 1, characterized in that: A differentiation layer and a normalization layer are successively provided between the input layer and the LSTM layer, for performing differentiation and normalization operations respectively; an inverse normalization layer and an inverse differentiation layer are successively provided between the Dense layer and the output layer, for performing inverse normalization and inverse differentiation operations respectively.
6. Ultrasonic fluid flow measurement system based on flow prediction, characterized by: It includes a fluid flow meter signal acquisition system, a flow volume simulator, a flow calculation module, a flow prediction module and a gain calculation module; The fluid flow meter signal acquisition system includes a circular tube and a first transducer and a second transducer with the same parameters placed on the outer wall of the circular tube; The flow volume simulator is used to simulate the fluid from the negative maximum flow rate to the positive maximum flow rate acting on the circular tube; The gain calculation module is used to obtain the relationship between different flow rates and gains at this time according to the echo signals of the first transducer and the second transducer; The flow calculation module is used to calculate the current flow rate by threshold detection and zero-crossing comparison without adding gain in the first measurement cycle; the flow prediction module is used to use the flow prediction model to predict the flow rate at the next sampling time based on the flow collection values of n sampling times in the previous cycle before threshold detection and zero-crossing comparison in each subsequent cycle. The gain calculation module is used to calculate the The relationship between different flow rates and gains is obtained The corresponding gain amplifies the signal; the flow calculation module is also used to perform threshold detection and zero-crossing comparison on the amplified signal to obtain the fluid flow at the next moment.
7. The ultrasonic fluid flow measurement system based on flow prediction according to claim 6, characterized in that: The gain calculation module obtains the relationship between different flow rates and gains at this time according to the echo signals of the first transducer and the second transducer, specifically comprising the steps of: S21. Use the second transducer as the excitation end and the first transducer as the receiving end, use a flow volume simulator to simulate the fluid from the negative maximum flow to the positive maximum flow acting on the circular tube, and plot the voltage amplitude V of the positive extreme value points A1, A2, A3, and A4 of the echo signal of the first transducer. A1 、V A2 、V A3 、V A4 In the curve of flow rate change, A1, A2, A3, and A4 refer to the first, second, third, and fourth positive maximum points of the signal during the transition from low to high, respectively; S22, fitting the V of the change curve A1 、V A2 、V A3 、V A4 The mapping relationship between different traffic flows; S23, V at 0 flow A1 As a benchmark, V A1 The signal is amplified to V when the flow rate is 0 A1 The voltage values of the extreme points A1, A2, A3, and A4 of the amplified echo signal are obtained by adjusting the level of The degree of amplification here is the gain of different flow rates, thus obtaining the relationship between different flow rates and gains; S24: Use the first transducer as an excitation end and the second transducer as a receiving end, and adopt the same process as steps S21 to S23 to obtain the relationship between different flow rates and gains at this time.
8. The ultrasonic fluid flow measurement system based on flow prediction according to claim 7, characterized in that: In the process of not using flow prediction to dynamically adjust the gain, the threshold value is set to V threshold ∈(V A1 ,V A2 ).
9. The ultrasonic fluid flow measurement system based on flow prediction according to claim 7, characterized in that: In the process of dynamically adjusting the gain using flow prediction, the threshold value is set to
Citation Information
Patent Citations
KR20220041524A