Fast response method of low-power electromagnetic water meter, computer device and electromagnetic water meter
By combining intermittent excitation and Kalman filtering, the problems of high power consumption and slow response in electromagnetic water meters are solved, achieving low power consumption, fast response, and stable flow measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FOSHAN AKE ELECTRONICS ENG CO LTD
- Filing Date
- 2022-12-30
- Publication Date
- 2026-07-03
AI Technical Summary
The existing Kalman filtering technology of electromagnetic water meters cannot adapt to different flow data requirements, resulting in low measurement accuracy. In addition, the traditional constant current excitation technology consumes a lot of power, requires frequent battery replacements, and has poor real-time measurement performance.
By employing intermittent excitation combined with Kalman filtering, effective flow data is generated through the processing of positive and negative excitation data. The Q and R values are dynamically adjusted in the Kalman filter, and combined with order calculation and mean processing, power consumption is reduced and response speed is improved.
It effectively reduces the power consumption of electromagnetic water meters, improves flow response speed, reduces battery replacement frequency, and enhances the real-time performance and stability of flow measurement.
Smart Images

Figure CN116295675B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water meter technology, and in particular to a fast response method for a low-power electromagnetic water meter, a computer device, and an electromagnetic water meter. Background Technology
[0002] Kalman filtering is an algorithm that uses the state equations of a linear system to make an optimal estimate of the system state using the system's input and output observation data. Since the observation data includes the effects of noise and interference in the system, the optimal estimation can also be regarded as a filtering process.
[0003] Kalman filtering is frequently used in data processing. In traditional Kalman filters, parameters Q and R are calculated using fixed formulas, and the data is processed iteratively. While the filtering effect of the Kalman filter is significant before data amplification, after amplification, because the values of parameters Q and R are fixed, the filtered curve still exhibits slight fluctuations. Therefore, existing water meter filtering technologies based on Kalman filtering cannot adapt to the requirements of different flow rates, thus affecting the accuracy of water meter measurements.
[0004] In addition, current battery-powered electromagnetic water meters generally use constant current excitation technology, but they generally suffer from problems such as low excitation efficiency, long excitation time, and high power consumption. Therefore, in order to reduce the frequency of battery replacement and save power, they are generally used to excite once every few seconds or tens of seconds (i.e., measure once), and use the measurement of several seconds or tens of seconds to estimate the flow rate at each instant. However, this will result in poor real-time measurement and slow response speed.
[0005] In summary, as the water industry demands increasingly higher real-time measurement data and longer battery replacement cycles, the design of electromagnetic water meters that can both increase measurement frequency and reduce power consumption is becoming increasingly important. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a fast response method for a low-power electromagnetic water meter, a computer device and an electromagnetic water meter, which can effectively reduce power consumption and improve flow response speed.
[0007] To address the aforementioned technical problems, this invention provides a fast response method for a low-power electromagnetic water meter based on Kalman filtering, comprising: acquiring raw excitation data and extracting positive and negative excitation data from the raw excitation data; generating positive excitation effective data based on the positive excitation data and generating negative excitation effective data based on the negative excitation data; combining the positive and negative excitation effective data into effective flow data; inputting the effective flow data into a flow array; determining whether the effective flow data of the current period in the flow array is a preset multiple of the effective flow data of the previous period; if yes, filtering the effective flow data of the current period to fill the flow array and outputting initial flow data; if no, outputting initial flow data; and performing Kalman filtering on the initial flow data to generate target flow data.
[0008] As an improvement to the above scheme, the step of generating positive excitation effective data based on the positive excitation data includes: extracting initial effective data from the positive excitation data and performing filtering processing to generate reference effective data; determining whether the reference effective data is the first set of data after power-on; if yes, filling the effective array according to the reference effective data; if no, inputting the reference effective data into the effective array; performing order calculation on the reference effective data in the effective array; and extracting target effective data from the effective array and performing filtering processing to generate positive excitation effective data.
[0009] As an improvement to the above scheme, the step of generating negative excitation effective data based on the negative excitation data includes: extracting initial effective data from the negative excitation data and performing filtering processing to generate reference effective data; determining whether the reference effective data is the first set of data after startup; if yes, filling the effective array according to the reference effective data; if no, inputting the reference effective data into the effective array; performing order calculation on the reference effective data in the effective array; and extracting target effective data from the effective array and performing filtering processing to generate negative excitation effective data.
[0010] As an improvement to the above scheme, the order of the reference valid data in the valid array corresponding to the positive excitation data is calculated according to the formula {BufP[n]-(BufN[n]+BufN[n+1]) / 2} / 2; the order of the reference valid data in the valid array corresponding to the negative excitation data is calculated according to the formula {(BufP[n]+BufP[n+1]) / 2-BufN[n+1]} / 2; where BufP[n] is the reference valid data corresponding to the positive excitation array, and BufN[n] is the reference valid data corresponding to the negative excitation array.
[0011] As an improvement to the above scheme, the step of extracting target valid data from the valid array and performing filtering processing to generate positive excitation valid data includes: extracting a preset number of target valid data from the valid array, and performing mean processing on the target valid data to generate positive excitation valid data.
[0012] As an improvement to the above scheme, the step of extracting target valid data from the valid array and performing filtering processing to generate negative excitation valid data includes: extracting a preset number of target valid data from the valid array, and performing mean processing on the target valid data to generate negative excitation valid data.
[0013] As an improvement to the above scheme, the step of extracting initial valid data from the positive excitation data and performing filtering processing to generate benchmark valid data includes: performing bubble sort on the positive excitation data, extracting a preset number of initial valid data from the sorted positive excitation data, and performing mean processing on the initial valid data to generate benchmark valid data.
[0014] As an improvement to the above scheme, the step of extracting initial valid data from the negative excitation data and performing filtering processing to generate benchmark valid data includes: performing bubble sort on the negative excitation data, extracting a preset number of initial valid data from the sorted negative excitation data, and performing mean processing on the initial valid data to generate benchmark valid data.
[0015] As an improvement to the above scheme, the fast response method of the low-power electromagnetic water meter based on Kalman filtering also includes acquiring raw excitation data using an intermittent excitation method.
[0016] As an improvement to the above scheme, the preset multiple is 2 times and / or 0.5 times.
[0017] As an improvement to the above scheme, when performing Kalman filtering on the initial flow data, the Q value and R value are dynamically adjusted according to the initial flow data.
[0018] Accordingly, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described fast response method for a low-power electromagnetic water meter based on Kalman filtering.
[0019] Accordingly, the present invention also provides an electromagnetic water meter, characterized in that it includes a detection circuit and the aforementioned computer equipment, wherein the detection circuit is used to collect raw excitation data.
[0020] The beneficial effects of implementing this invention are as follows:
[0021] This invention employs an intermittent excitation method, which effectively reduces power consumption through rectangular wave excitation;
[0022] In order to make the electromagnetic water meter respond faster, when the effective flow data of the current period is found to be a preset multiple of the effective flow data of the previous period, the effective flow data of the current period is filtered and then filled into the flow array, so that the electromagnetic water meter responds faster and greatly improves the flow response speed.
[0023] In addition, this invention introduces a unique order calculation method to address the jitter of data curves, thereby achieving smooth processing of positive and negative excitation data.
[0024] Furthermore, the present invention can also dynamically adjust the Q value and R value according to different flow rates during Kalman filtering to ensure the stability of different flow rates. Attached Figure Description
[0025] Figure 1 This is a flowchart of an embodiment of the fast response method for a low-power electromagnetic water meter based on Kalman filtering according to the present invention;
[0026] Figure 2 This is a schematic diagram of the original excitation data in this invention;
[0027] Figure 3 This is a schematic diagram of the target traffic data in this invention;
[0028] Figure 4 This is a schematic diagram of the electrodes of the electromagnetic induction module in this invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. It is hereby declared that the directional terms such as up, down, left, right, front, back, inside, and outside used in this text are based solely on the accompanying drawings and are not intended to specifically limit the invention.
[0030] See Figure 1 , Figure 1 The flowchart illustrates an embodiment of the fast response method for a low-power electromagnetic water meter based on Kalman filtering according to the present invention, which includes:
[0031] S101, acquire the raw excitation data, and extract the positive excitation data and negative excitation data from the raw excitation data;
[0032] This invention uses intermittent excitation to acquire raw excitation data (see...). Figure 2 This includes 16 positive excitation data and 16 negative excitation data, and uses multi-task parallel processing to prevent data loss.
[0033] S102, Generate positive excitation effective data based on positive excitation data, and generate negative excitation effective data based on negative excitation data;
[0034] Specifically, the steps for generating effective positive excitation data based on the positive excitation data include:
[0035] (1) Extract initial valid data from the positive excitation data and perform filtering to generate reference valid data;
[0036] During filtering, the positive excitation data is first bubble sorted, and a preset number of initial valid data are extracted from the sorted positive excitation data. The initial valid data is then averaged to generate baseline valid data.
[0037] For example, by first performing bubble sort on the positive excitation data and then averaging the middle 8 initial valid data points, the baseline valid data can be generated.
[0038] (2) Determine whether the reference valid data is the first set of data after power-on. If it is, fill the valid array according to the reference valid data. If it is not, input the reference valid data into the valid array.
[0039] It should be noted that the valid array contains 12 data points. If the baseline valid data is determined to be the first set of data after power-on, then the 12 data points in the valid array are quickly filled with the baseline valid data.
[0040] (3) Perform order calculation on the baseline valid data in the valid array;
[0041] To prevent data curve jitter, the ranking of the baseline valid data in the valid array can be calculated. Specifically, the ranking of the baseline valid data in the valid array corresponding to the positive excitation data is calculated according to the formula {BufP[n]-(BufN[n]+BufN[n+1]) / 2} / 2, where BufP[n] is the baseline valid data corresponding to the positive excitation array, BufN[n] is the baseline valid data corresponding to the negative excitation array, and n is an integer.
[0042] For example:
[0043] {BufP[0]-(BufN[0]+BufN[1]) / 2} / 2, {BufP[1]-(BufN[1]+BufN[2]) / 2} / 2……
[0044] (4) Extract the target valid data from the valid array and perform filtering to generate positive excitation valid data.
[0045] Specifically, a preset number of target valid data can be extracted from the valid array, and the target valid data can be averaged to generate positive excitation valid data;
[0046] For example, by taking the middle 8 target valid data points from the valid array and averaging them, a positive excitation valid data point can be generated.
[0047] Similarly, the steps for generating effective negative excitation data based on negative excitation data include:
[0048] (1) Extract initial effective data from negative excitation data and perform filtering to generate reference effective data;
[0049] During filtering, the negative excitation data is first bubble sorted, and a preset number of initial valid data are extracted from the sorted negative excitation data. The initial valid data is then averaged to generate baseline valid data.
[0050] (2) Determine whether the reference valid data is the first set of data after power-on. If it is, fill the valid array according to the reference valid data. If it is not, input the reference valid data into the valid array.
[0051] It should be noted that the valid array contains 12 data points. If the baseline valid data is determined to be the first set of data after power-on, then the 12 data points in the valid array are quickly filled with the baseline valid data.
[0052] (3) Perform order calculation on the baseline valid data in the valid array;
[0053] To prevent data curve jitter, the ranking of the baseline valid data in the valid array can be calculated. Specifically, the ranking of the baseline valid data in the valid array corresponding to the negative excitation data is calculated according to the formula {(BufP[n]+BufP[n+1]) / 2-BufN[n+1]} / 2, where BufP[n] is the baseline valid data corresponding to the positive excitation array, BufN[n] is the baseline valid data corresponding to the negative excitation array, and n is an integer.
[0054] For example:
[0055] {(BufP[0]+BufP[1]) / 2-BufN[1]} / 2, {(BufP[1]+BufP[2]) / 2-BufN[2]} / 2……
[0056] (4) Extract the target valid data from the valid array and perform filtering to generate negative excitation valid data.
[0057] Specifically, a preset number of target valid data can be extracted from the valid array, and the target valid data can be averaged to generate negative excitation valid data.
[0058] It should be noted that after two cycles, the 12 data points in the two valid arrays can be filled respectively.
[0059] S103 combines the effective positive excitation data and the effective negative excitation data into effective flow data;
[0060] Therefore, by combining the effective data of positive excitation and the effective data of negative excitation, an effective flow rate can be obtained.
[0061] S104, Input the valid flow data into the flow array;
[0062] It should be noted that the traffic array contains 12 valid traffic data points.
[0063] S105, determine whether the effective flow data of the current period in the flow array is a preset multiple of the effective flow data of the previous period. If the determination is yes, filter the effective flow data of the current period, fill the flow array, and output the initial flow data. If the determination is no, output the initial flow data.
[0064] It should be noted that since six valid flow data points are generated per cycle, it takes at least two cycles for the flow rate to stabilize when changes occur, resulting in a slow response speed that is difficult to meet the requirements of on-site electromagnetic water meter applications. To make the electromagnetic water meter respond faster, when it is found that the valid flow data calculated in this cycle is a preset multiple of the valid flow data in the previous cycle, the average of these six valid flow data points is filled to the maximum of twelve valid flow data points, thus making the electromagnetic water meter respond faster. Preferably, the preset multiple is 2 times and / or 0.5 times, but this is not a limitation and can be set according to the actual situation.
[0065] Therefore, through the above processing, the response time from "water just starting to stabilize" or "water from stabilization to 0" can be shortened, greatly improving the flow response speed.
[0066] S106, perform Kalman filtering on the initial flow data to generate target flow data.
[0067] When performing Kalman filtering on the initial flow data, the Q and R values are dynamically adjusted based on the initial flow data to ensure stability under different flow rates (see [reference]). Figure 3 ).
[0068] Combination Figure 2 and Figure 3 As shown, the original excitation data contains a period of data fluctuation. Even after filtering, there will still be some jitter after the data stabilizes. The jitter is larger in the earlier data. However, after processing by the fast response method of the low-power electromagnetic water meter based on Kalman filtering of this invention, the response speed can be significantly improved, making the response to flow changes faster. After Kalman filtering, the final output is stable target flow data.
[0069] Accordingly, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described fast response method for a low-power electromagnetic water meter based on Kalman filtering.
[0070] Furthermore, this invention also discloses an electromagnetic water meter, which includes a detection circuit and a computer device. The detection circuit is used to collect raw excitation data and send the raw excitation data to the computer device for processing. Specifically, the detection circuit includes an electromagnetic induction module, a signal acquisition module, and an excitation drive module.
[0071] like Figure 4 As shown, the electromagnetic induction module is designed based on Faraday's principle of electromagnetic induction. By applying a changing current to the coil, the current generates a magnetic field. When water flows through the magnetic field, an electromotive force is induced on electrodes a and b.
[0072] The signal acquisition module consists of a low-pass filter and an analog-to-digital converter (ADC), used to extract the signal output by the electromagnetic induction module of the electromagnetic water meter. The ADC uses a 24-bit ADC, which has higher resolution and can identify weaker output signals to accurately measure extremely small flow rates. At the same time, the ADC can also amplify the low-pass filtered signal by 24 times using its own gain, giving full play to the high resolution advantage of the 24-bit ADC and avoiding interference from external preamplifier circuits.
[0073] The excitation drive module consists of an H-bridge circuit, a constant current circuit, and a resistor switching circuit, and is used to drive the excitation coil in the primary instrument of the electromagnetic water meter. In order to reduce power consumption, the excitation drive module adopts intermittent excitation and inputs a rectangular wave excitation to reduce power consumption.
[0074] Therefore, this invention combines intermittent excitation and Kalman filtering technologies to form a specific electromagnetic water meter.
[0075] The invention will now be described in detail with reference to specific experimental data:
[0076] Flow data were measured using both a Siemens water meter and a water meter employing the fast response method of a low-power electromagnetic water meter based on Kalman filtering, as per this invention. The Siemens water meter was used as the standard meter, and the water meter employing the fast response method of a low-power electromagnetic water meter based on Kalman filtering, as the test meter. The measured flow data are shown in Table 1 below:
[0077] Table 1
[0078]
[0079]
[0080] In Table 1, the water meter diameter is 50mm (DN50); the range ratio is 400 (R400); Q1 is the minimum flow rate, which requires the water meter reading to meet the minimum flow rate with the maximum permissible error; Q2 is the critical flow rate, which occurs between the normal flow rate Q3 and the minimum flow rate Q1, dividing the flow range into two zones, a "high zone" and a "low zone," each with a specific maximum permissible error; Q3 is the normal flow rate, which is the maximum flow rate under rated operating conditions. At this flow rate, the water meter should work normally and meet the maximum permissible error requirements.
[0081] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A fast response method of Kalman filter based low power consumption electromagnetic water meter, characterized in that, include: Acquire raw excitation data, and extract positive excitation data and negative excitation data from the raw excitation data; Generate positive excitation effective data based on the positive excitation data, and generate negative excitation effective data based on the negative excitation data; The effective positive excitation data and the effective negative excitation data are combined into effective flow data; Input the valid traffic data into the traffic array; Determine whether the effective flow data of the current period in the flow array is a preset multiple of the effective flow data of the previous period. If the determination is yes, filter the effective flow data of the current period, fill the flow array, and output the modified flow array as the initial flow data. If the determination is no, output the flow array as the initial flow data. The initial flow data is processed by Kalman filtering to generate target flow data.
2. The fast response method for low-power electromagnetic water meters based on Kalman filtering as described in claim 1, characterized in that, The step of generating positive excitation effective data based on the positive excitation data includes: extracting initial effective data from the positive excitation data and performing filtering processing to generate reference effective data; determining whether the reference effective data is the first set of data after power-on; if yes, filling the effective array according to the reference effective data; if no, inputting the reference effective data into the effective array; performing order calculation on the reference effective data in the effective array; and extracting target effective data from the effective array and performing filtering processing to generate positive excitation effective data. The step of generating negative excitation effective data based on the negative excitation data includes: extracting initial effective data from the negative excitation data and performing filtering processing to generate reference effective data; determining whether the reference effective data is the first set of data after power-on; if yes, filling the effective array according to the reference effective data; if no, inputting the reference effective data into the effective array; performing order calculation on the reference effective data in the effective array; and extracting target effective data from the effective array and performing filtering processing to generate negative excitation effective data.
3. The fast response method for low-power electromagnetic water meters based on Kalman filtering as described in claim 2, characterized in that, The order of the reference valid data in the valid array corresponding to the positive excitation data is calculated according to the formula {BufP[n]-(BufN[n]+BufN[n+1]) / 2} / 2; The order of the reference valid data in the valid array corresponding to the negative excitation data is calculated according to the formula {(BufP[n]+BufP[n+1]) / 2-BufN[n+1]} / 2; Where BufP[n] is the reference valid data corresponding to the positive excitation array, and BufN[n] is the reference valid data corresponding to the negative excitation array.
4. The fast response method for low-power electromagnetic water meters based on Kalman filtering as described in claim 2, characterized in that, The step of extracting target valid data from the valid array and performing filtering processing to generate positive excitation valid data includes: extracting a preset number of target valid data from the valid array, and performing mean processing on the target valid data to generate positive excitation valid data; The step of extracting target valid data from the valid array and performing filtering processing to generate negative excitation valid data includes: extracting a preset number of target valid data from the valid array, and performing mean processing on the target valid data to generate negative excitation valid data.
5. The fast response method for a low-power electromagnetic water meter based on Kalman filtering as described in claim 2, characterized in that, The step of extracting initial valid data from the positive excitation data and performing filtering processing to generate benchmark valid data includes: performing bubble sort on the positive excitation data, extracting a preset number of initial valid data from the sorted positive excitation data, and performing mean processing on the initial valid data to generate benchmark valid data. The step of extracting initial valid data from the negative excitation data and performing filtering processing to generate benchmark valid data includes: performing bubble sort on the negative excitation data, extracting a preset number of initial valid data from the sorted negative excitation data, and performing mean processing on the initial valid data to generate benchmark valid data.
6. The fast response method of Kalman filter based low power consumption electromagnetic water meter according to claim 1, wherein, It also includes acquiring raw excitation data using intermittent excitation.
7. The fast response method of Kalman filter based low power consumption electromagnetic water meter according to claim 1, wherein, The preset multiple is 2 times and / or 0.5 times.
8. The fast response method for a low-power electromagnetic water meter based on Kalman filtering as described in claim 1, characterized in that, When performing Kalman filtering on the initial flow data, the Q value and R value are dynamically adjusted based on the initial flow data.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
10. An electromagnetic water meter, characterized in that, It includes a detection circuit and the computer device as described in claim 9, wherein the detection circuit is used to acquire raw excitation data.