Wide-range vortex flowmeter based on dynamic Fourier transform and flow calculation method
Through the design of a dynamic Fourier flowmeter, combined with multi-module signal processing and dynamic sampling rate, the problem of large error in high and low-frequency flow measurement in vortex flowmeters is solved, high-precision and wide-range flow measurement are achieved, and the production process is simplified.
Patent Information
- Application Number
- CN202211275200.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-18
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-10-18
AI Technical Summary
The existing vortex flowmeter has a large error in high-frequency flow measurement, and a larger error in low-frequency flow measurement, and the hardware filtering method is easily disturbed, the software Fourier calculation speed is slow, and the CNC filter is costly and cannot effectively handle complex interference.
A wide range vortex flowmeter based on dynamic Fourier is adopted, combined with DC signal processing, differential signal amplification, unipolar signal amplification, comparator module and MCU calculation module, and high-precision signal analysis of the signal is achieved by dynamically calculating the sampling rate, bandpass filtering, random interference filtering and Fourier transform.
It expands the range of the vortex flowmeter, improves signal accuracy, simplifies production processes, reduces hardware costs, and can effectively deal with complex interference.
Smart Images

Figure CN115435848B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vortex flowmeters, and in particular relates to a wide-range vortex flowmeter based on dynamic Fourier and a flow calculation method. Background Art
[0002] Existing vortex flowmeter design methods mainly include: hardware filtering-based method, software-based Fourier calculation method, and digital control filter method.
[0003] Among them: 1. Hardware filtering method: The hardware filtering circuit is controlled by a dip switch to filter out interference and shape the signal into a square wave signal, thereby generating a pulse signal corresponding to the flow rate. The instrument only needs to collect the number of pulses and calculate the flow rate by calculating the number of pulses per unit time and the set instrument coefficient. This method has a fast sampling speed, but is only suitable for situations where the signal-to-noise ratio of the effective signal to the noise is large. It is generally suitable for vortex flowmeters with a range ratio of less than or equal to 1:10. Moreover, because the hardware filtering method only has a pulse counting function and cannot further analyze and process the signal, it is extremely susceptible to interference when used on-site, and it is also impossible to determine the characteristics of the interference signal.
[0004] Second, software-based Fourier calculation method: To ensure calculation accuracy and reduce flow measurement errors, the software Fourier calculation method generally uses 2048 sampling points and a sampling rate of 2000 or more. This method is suitable for measuring high-frequency flow, but the measurement error is larger for large-diameter vortex flowmeters with lower frequencies. When the test frequency is 1000Hz, the error is ±1Hz, and the theoretical repeatability is 0.1%. For 10Hz flow, the error is ±1Hz, and the theoretical repeatability is 10%.
[0005] 3. Digital Control Filter Method: A digital control filter is constructed by replacing traditional DIP switches with controllable analog switches in hardware. Since software calculation of the final signal frequency is not required, fewer sampling points are used, typically 512. Theoretically, the maximum error in the Fourier transform frequency calculation is 11%. After determining the signal center frequency range, the analog switches are used to further control the center frequency and filter window of the digital control filter. The digital control filter filters out interference and converts the sine wave signal input from the vortex sensor into a pulse signal. The MCU only needs to calculate the signal frequency and further calculate the flow rate value based on the number of pulses per unit time. The disadvantage of this method is that the digital control filter significantly increases product cost. The Fourier transform only performs simple calculations and determines the center frequency of the window. It cannot analyze the amplitude-frequency characteristics of the signal, nor can it further judge and process the nature of the interference. It cannot display and analyze the original spectrum of the signal. However, industrial sites often have complex interference types and multiple interferences superimposed on the effective signal. This method still has certain limitations in field use. Summary of the Invention
[0006] The present invention addresses the shortcomings of existing technologies and provides a wide-range vortex flowmeter and flow calculation method based on dynamic Fourier transforms. This method addresses the slow speed and large errors associated with traditional software-based Fourier transforms for small flow rates, further expanding the usable range of vortex flowmeters.
[0007] To achieve the above objectives, the present invention adopts the following technical solutions.
[0008] A wide-range vortex flowmeter based on dynamic Fourier transform includes a DC signal processing module (i.e., a DC isolation module), a differential signal amplification module, a unipolar signal amplification module, a comparator module, and an MCU calculation module. The device is characterized in that the input of the DC signal processing module is connected to the differential signal of the vortex sensor; the output of the DC signal processing module is connected to the input of the differential signal amplification module; the output of the differential signal amplification module is connected to the input of the unipolar signal amplification module; the output of the unipolar signal amplification module is connected to the input of the comparator module; and the output of the comparator module is connected to the MCU calculation module. The MCU calculation module includes an MCU processor, also known as the MCU.
[0009] Furthermore, the DC signal processing module includes a DC isolation module, and the MCU calculation module is also connected to the temperature detection module, the pressure detection module, the display module, and the pulse output module respectively.
[0010] Furthermore, the differential signal input by the vortex sensor is converted into an AC signal after the DC component is removed by the DC isolation module. The AC signal is amplified by the differential signal amplification module and then enters the unipolar signal amplification module for secondary amplification. The comparator module then limits the maximum amplitude of the signal. The signal is collected by the ADC of the MCU calculation module, and the MCU calculates and outputs the result.
[0011] The temperature detection module is collected by the ADC of the MCU calculation module, and the pressure detection module is collected by the ADC of the MCU calculation module. The MCU calculation module calculates the vortex sensor input signal, the temperature detection module input signal, and the pressure sensor input signal. The calculation results are frequency and flow. The frequency is output from the frequency output module, and the flow is output from the display module. The display module displays the frequency data and spectrum analysis diagram.
[0012] A flow calculation method for a wide-range vortex flowmeter based on dynamic Fourier transform includes the following steps:
[0013] Step 1: Set the number of sampling points N of the signal in the MCU calculation module to 256 or 512; and calculate the sampling rate fs.
[0014] Calculate the gain PGA based on the average value of the ADC register (MCU calculation module) under the current working condition instantaneous flow, set the coefficient of the PGA inside the MCU; write the (new) sampling rate fs and gain PGA into the MCU register.
[0015] Sampling starts, and after sampling is completed, the input signal sequence X(n) is obtained.
[0016] Step 2: Perform bandpass filtering on the signal sequence X(n), and the signal sequence after filtering is Y(n).
[0017] Step 3: Perform random interference filtering calculation on the signal Y(n) to obtain the output sequence R(m).
[0018] Step 4: Perform Fourier transform on the output sequence R(m) to obtain the sequence Z(m); and obtain the signal amplitude sequence A(m) based on the sequence Z(m).
[0019] Step 5. Find the sequence point p corresponding to the maximum value of the A(m) sequence and calculate the flow value according to the following formula:
[0020]
[0021] Where qv is the instantaneous volume flow rate under working conditions, in m 3 / h, p is the sequence point corresponding to the maximum amplitude, fs is the sampling rate, and N is the number of sampling points.
[0022] Furthermore, in step 1, the sampling rate fs is calculated using the following formula:
[0023]
[0024] Where fs is the sampling rate, qv0 is the instantaneous volume flow rate of the current working condition, and if the flow result qv0 is invalid, qv0 is equal to the flow upper limit of the instrument, which is set by the user; k is the instrument coefficient.
[0025] Furthermore, in step 1, the gain PGA is calculated based on the average value of the ADC register under the instantaneous flow rate of the current working condition, and the coefficients of the PGA inside the MCU are set as follows:
[0026] When the average value of the ADC register of the MCU is less than 128, set the PGA equal to 16.
[0027] When the average value of the MCU's ADC register is greater than or equal to 128 and less than 256, set PGA to 8; when the average value of the MCU's ADC register is greater than or equal to 256 and less than 1024, set PGA to 4.
[0028] When the average value of the ADC register of the MCU is greater than 1024, set PGA equal to 1.
[0029] Furthermore, in step 2, performing bandpass filtering calculation on the signal sequence X(n) includes:
[0030] If the current qv0 is a valid value, the center frequency of the filter window f l Calculated using the following formula:
[0031]
[0032] Where, f l is the center frequency of the filter window, qv0 is the instantaneous volume flow rate of the current working condition, and k is the instrument coefficient.
[0033] If qv0 is greater than qv max ×0.2, the filter window is set to [f l ×0.85,f l ×1.15]; if qv0 is less than or equal to qv max ×0.2, the filter window is set to [f l ×0.6,f l ×1.5].
[0034] If the current qv0 result is invalid, the filter window is set to [f min ,f max ], f min and f max Calculate using the following formula.
[0035]
[0036] Where, f max is the maximum value of the filter window, f min is the minimum value of the filtering window, qv max is the flow upper limit of the instrument, qv min is the lower flow limit of the instrument, and k is the instrument coefficient.
[0037] Furthermore, the algorithm for bandpass filter calculation is any one of rectangular window, Tukey window, triangular window, Hanning window, Hamming window, Blackman window, and Kaiser window.
[0038] Furthermore, in step 3, performing random interference filtering calculation on the signal Y(n) includes:
[0039] Split the sequence Y(n) into two sequences Y1(m) and Y2(m), where m = 1, 2, ... 0.5n; the Y1(m) sequence is the first half of Y(n), and the Y2(m) sequence is the second half of Y(n). Calculate according to the following formula:
[0040]
[0041] Where R(m) is the output sequence after random interference filtering calculation.
[0042] Furthermore, in step 4, performing Fourier transform on the output sequence R(m) to obtain a sequence Z(m); and obtaining a signal amplitude sequence A(m) according to the sequence Z(m) includes:
[0043] The Fourier transform of the sequence R(m) is calculated according to the following formula:
[0044]
[0045] Where Z(m) is the sequence after Fourier calculation, Z real (m) is the real number of the sequence Z(m), Z imag (m) is the imaginary part of the sequence Z(m), and A(m) is the amplitude sequence of the signal.
[0046] Compared with the prior art, the present invention has beneficial effects.
[0047] The MCU calculation module described in this invention uses a small number of sampling points and a dynamic sampling rate to collect raw signals. It then uses a bandpass filter, randomized dry filtering, and Fourier transform algorithm to calculate the flow rate of the input signal. This dynamic sampling rate calculation method, which dynamically calculates the sampling rate for different instantaneous flow rates, improves signal accuracy while maintaining the same number of sampling points. Compared to traditional vortex flowmeters, this significantly increases the measuring range. Furthermore, the unified program and hardware circuitry allow for application to different pipe diameters, simplifying the production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The present invention is further described below with reference to the accompanying drawings and specific embodiments. The scope of protection of the present invention is not limited to the following description.
[0049] Figure 1 This is the structural block diagram of a wide-range vortex flowmeter based on dynamic Fourier.
[0050] Figure 2 This is a flow chart of the flow calculation method of a wide-range vortex flowmeter based on dynamic Fourier. DETAILED DESCRIPTION
[0051] like Figure 1-2 As shown, in Example 1, the specific steps of calculating the flow rate include:
[0052] Step 201, the flow calculation process starts, and checks whether the instantaneous flow value of the current working condition is valid. If the current flow value is valid, continue to step 202; if the current flow value is invalid, execute step 203.
[0053] Step 202: Calculate the sampling rate fs and the gain PGA.
[0054] Among them, the sampling rate fs adopts the following formula:
[0055]
[0056] Where fs is the sampling rate, qv0 is the instantaneous volume flow rate of the current working condition, and k is the instrument factor.
[0057] Among them, the gain PGA setting and calculation method are the same as before.
[0058] Step 203: Use the program to preset the sampling rate and gain coefficient. The program preset sampling rate is related to the pipe diameter. Different pipe diameters have different preset default sampling rates. If the pipe diameter is less than or equal to 40 cm, the program preset fs is 8000 and the preset PGA is 4; if the pipe diameter is greater than 40 cm and less than 200 cm, the program preset fs is 4000 and the preset PGA is 2; if the pipe diameter is greater than or equal to 200 cm, the program preset fs is 1000 and the preset PGA is 1.
[0059] Step 204: Initialize the ADC register inside the MCU using the new sampling rate fs and gain PGA, and start sampling.
[0060] Step 205: Query the sampling completion flag and wait for the sampling to be completed.
[0061] Step 206: Calculate the center frequency and width of the filter window of the software bandpass filter, and use the filtering algorithm set by the program to filter out interference. The filtering algorithm can be selected from: rectangular window, Tukey window, triangular window, Hanning window, Hamming window, Blackman window, and Kaiser window.
[0062] Step 207: Perform random dry filtering calculation on the filtered signal.
[0063] Step 208: Calculate the frequency, amplitude, and flow value of the signal.
[0064] Step 209: Use the frequency result calculated in step 208 to initialize the PWM register of the MCU and output a pulse signal; and display the instantaneous volume flow value and spectrum of the working condition on the LCD screen.
[0065] Example 2: Further explanation is given by combining a wide-range vortex flowmeter with a DN50 pipe diameter and a range ratio of 1:40.
[0066] Since the maximum sampling point is 512 and the random dry filtering method is used, the present invention uses an MCU with a maximum frequency of 32M. The MCU has a 23-bit ADC with a maximum 16-fold gain and a DMA function.
[0067] The flow range of the vortex flowmeter with a DN50 pipe diameter and a range ratio of 1:40 is about 10m 3 / h~400m 3 / h, corresponding to a frequency range of 30Hz to 1200Hz. When the meter is powered on, the MCU's instantaneous operating volume flow rate variable qv0 is invalid, and the input signal voltage average variable mV_average is invalid. The meter's sampling rate and gain PGA settings are used. For a DN50 pipe diameter, the sampling rate fs is 4000, the gain PGA is 2, and the filter window is 30Hz to 1200Hz. The MCU registers are initialized, and the DMA function is enabled. The ADC collects the input voltage value, which is automatically stored in the DMA input buffer via DMA. The interrupt flag is set after sampling is complete.
[0068] After the sampling is completed, all variable values stored in the DMA input buffer are copied to the calculation buffer, the interrupt flag is cleared, and the next AMC pre-sampling is performed.
[0069] Using the variables in the calculation buffer, the instantaneous flow rate qv of the current working condition is obtained through software filtering, random interference filtering, and Fourier calculation.
[0070] Calculate the parameters for the next sampling and compare qv with qv0. If qv0 is a valid value and qv is less than qv0*1.1 and greater than qv0*0.9, fs and PGA remain unchanged, ADC continues sampling, and DMA input buffer data is not cleared; otherwise, fs and PGA are recalculated, and the MCU registers are initialized, the DMA input buffer data is cleared, and ADC sampling is restarted.
[0071] DN50 pipe minimum flow rate 10m 3 / h. The MCU features a 23-bit ADC with a maximum gain of 16x, enabling accurate measurement of the voltage value of the vortex sensor's minimum flow signal input. According to the formula, fs is 100, the PGA setting is 8, and the theoretical error is 0.325%. The vortex input signal is a quasi-sine wave. The program uses a sine wave fitting algorithm to further improve measurement accuracy. The instrument's measured minimum flow repeatability is less than 0.2%, meeting the Class 1.0 meter's minimum flow repeatability of 0.3% and measurement error of 2.0%. Because the MCU has DMA functionality, signal acquisition requires no MCU intervention, directly storing the ADC data in the input buffer. Under relatively stable flow conditions, data acquisition and calculation are performed simultaneously, meeting flow response speed requirements.
[0072] DN50 pipe diameter maximum flow rate 400m 3 / h, PGA is set to 1, sampling rate fs is equal to 3600Hz, the theoretical error is 0.29%, and the measured error after fitting is less than 0.15%, meeting the requirements of 0.3% repeatability and 1% measurement error of level 1.0 meter.
[0073] It can be understood that the above specific description of the present invention is only used to illustrate the present invention and is not limited to the technical solutions described in the embodiments of the present invention. Those skilled in the art should understand that the present invention can still be modified or replaced by equivalents to achieve the same technical effects; as long as the use requirements are met, they are within the scope of protection of the present invention.
Claims
1. A flow calculation method for a wide-range vortex flowmeter based on dynamic Fourier, characterized by: The following steps are involved: Step 1: Set the number of sampling points N of the signal in the MCU calculation module to 256 or 512; And calculate the sampling rate fs; Calculate the gain PGA based on the average value of the ADC register in the MCU calculation module under the current working condition instantaneous flow, set the coefficient of the PGA inside the MCU; write the sampling rate fs and gain PGA into the MCU register; Start sampling, and after sampling is completed, the input signal sequence X(n) is obtained; Step 2: Perform bandpass filtering on the signal sequence X(n), and the filtered signal sequence is Y(n); Step 3: Perform random interference filtering calculation on the signal Y(n) to obtain the output sequence R(m); Step 4: Perform Fourier transform on the output sequence R(m) to obtain the sequence Z(m); and obtain the signal amplitude sequence A(m) based on the sequence Z(m); Step 5. Find the sequence point p corresponding to the maximum value of the A(m) sequence and calculate the flow value according to the following formula: Where qv is the instantaneous volume flow rate under working conditions, in m 3 / h, p is the sequence point corresponding to the maximum amplitude, fs is the sampling rate, and N is the number of sampling points; In step 1, the sampling rate fs is calculated using the following formula: Where fs is the sampling rate, qv0 is the instantaneous volume flow rate of the current working condition. If the flow result qv0 is invalid, qv0 is equal to the flow upper limit of the instrument, which is set by the user; k is the instrument coefficient; The wide-range vortex flowmeter based on dynamic Fourier includes a DC signal processing module, a differential signal amplification module, a unipolar signal amplification module, a comparator module, and an MCU calculation module; The input of the DC signal processing module is connected to the differential signal of the vortex sensor; the output of the DC signal processing module is connected to the input end of the differential signal amplification module, the output end of the differential signal amplification module is connected to the input end of the unipolar signal amplification module, and the output end of the unipolar signal amplification module is connected to the input end of the comparator module; the output end of the comparator module is connected to the MCU calculation module.
2. The flow calculation method of a wide-range vortex flowmeter based on dynamic Fourier according to claim 1, characterized in that: The DC signal processing module includes a DC isolation module, and the MCU calculation module is also connected to a temperature detection module, a pressure detection module, a display module, and a pulse output module respectively.
3. The flow calculation method of a wide-range vortex flowmeter based on dynamic Fourier according to claim 2, characterized in that: The differential signal input by the vortex sensor is converted into an AC signal after the DC component is removed by the DC isolation module. The AC signal is amplified by the differential signal amplifier module and then enters the unipolar signal amplifier module for secondary amplification. The comparator module then limits the maximum amplitude of the signal. The signal is collected by the ADC of the MCU calculation module, and the MCU calculates and outputs the result. The temperature detection module is collected by the ADC of the MCU calculation module, and the pressure detection module is collected by the ADC of the MCU calculation module. The MCU calculation module calculates the vortex sensor input signal, the temperature detection module input signal, and the pressure sensor input signal. The calculation results are frequency and flow. The frequency is output from the frequency output module, and the flow is output from the display module. The display module displays the frequency data and spectrum analysis diagram.
4. The flow calculation method of a wide-range vortex flowmeter based on dynamic Fourier according to claim 1, characterized in that: As described in step 1, the gain PGA is calculated based on the average value of the ADC register under the current working condition instantaneous flow. The coefficients of setting the PGA inside the MCU include: When the average value of the ADC register of the MCU is less than 128, set the PGA to 16; When the average value of the ADC register of the MCU is greater than or equal to 128 and less than 256, set the PGA to 8; when the average value of the ADC register of the MCU is greater than or equal to 256 and less than 1024, set the PGA to 4; When the average value of the ADC register of the MCU is greater than 1024, set PGA equal to 1.
5. The flow calculation method of a wide-range vortex flowmeter based on dynamic Fourier according to claim 1, characterized in that: In step 2, performing bandpass filtering calculation on the signal sequence X(n) includes: If the current qv0 is a valid value, the center frequency of the filter window f l Calculated using the following formula: Where, f l is the center frequency of the filter window, qv0 is the instantaneous volume flow rate of the current working condition, and k is the instrument coefficient; If qv0 is greater than qv max ×0.2, the filter window is set to [f l ×0.85,f l ×1.15]; if qv0 is less than or equal to qv max ×0.2, the filter window is set to [f l ×0.6,f l ×1.5]; If the current qv0 result is invalid, the filter window is set to [f min ,f max ], f min and f max Calculated using the following formula: Where, f max is the maximum value of the filter window, f min is the minimum value of the filtering window, qv max is the flow upper limit of the instrument, qv min is the lower flow limit of the instrument, and k is the instrument coefficient.
6. The flow calculation method of a wide-range vortex flowmeter based on dynamic Fourier according to claim 5, characterized in that: The algorithm for bandpass filter calculation is any one of rectangular window, Tukey window, triangular window, Hanning window, Hamming window, Blackman window, and Kaiser window.
Citation Information
Patent Citations
Improved low power consumption two-wire system vortex shedding flowmeter
CN101451864A
Cited By
Vortex street flow measuring system and method resistant to vibration interference
CN121323732A