Online real-time liquid level height measuring method and system for liquid level sensor
By filtering and local linear fitting of the liquid level sensor signal, and using the inflection point determination algorithm, the liquid level height is calculated in real time, solving the problem of liquid level height measurement error accumulation in the existing technology, and achieving high-precision and real-time liquid level Height measurement.
Patent Information
- Application Number
- CN202510000506.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2045-01-02
AI Technical Summary
Existing liquid level sensors cannot accurately measure liquid level height when the ambient temperature changes, resulting in accumulated measurement errors, and errors accumulate throughout the entire process when calculating liquid level height by linear wave voltage signals.
The liquid level height measurement method of online real-time liquid level sensor is adopted. By filtering the triangular wave voltage signal and linear wave voltage signal, combined with local linear fitting and inflection point determination algorithm, the liquid level height is calculated in real time to reduce the impact of ambient temperature changes on measurements. .
Real-time and accurate liquid level height measurement is achieved, which reduces measurement errors caused by temperature changes, and avoids error accumulation during linear wave voltage signal calculation, improving measurement accuracy.
Smart Images

Figure CN119394405A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sensor signal processing technology, specifically, to an online real-time liquid level sensor liquid level height measurement method and system, and more specifically, to a method and system for calculating the liquid level height by comprehensively utilizing a segmented capacitive sensor triangular wave voltage signal and a linear wave voltage signal. Background Art
[0002] At present, segmented capacitive sensors are generally used to measure the liquid level height of the tank on the arrow. During the filling process of the tank, the change in ambient temperature will cause the dielectric constant of the filling liquid to change, which will further affect the liquid level height of the tank. The existing method predicts the dielectric constant of the filling liquid before filling according to the filling environment, and uses a unified dielectric constant to calculate the liquid level height throughout the filling process. The ambient temperature changes during the filling process, and the traditional method cannot accurately measure the liquid level height, which will cause a relatively large liquid level measurement error.
[0003] At present, in the method of processing the liquid level height of the liquid level sensor, a linear wave voltage signal is used to calculate the liquid level height during the entire filling process. The error of the liquid level height calculated by the linear wave voltage signal will accumulate in the entire process, resulting in that after the segmented capacitive sensor is segmented, the error of the liquid level height will become larger and larger.
[0004] At present, in the method of processing the liquid level height of the liquid level sensor, the average filtering method is used for the triangular wave voltage value and the linear wave voltage value. When more values are selected for average filtering in order to obtain a better filtering effect, the value after filtering is smoother, but there will be a delay.
[0005] The existing method is relatively simple and reliable to implement. There will be no measurement errors caused by misjudging the number of liquid level sensor nodes. The error mainly exists in the change of the dielectric constant of the medium caused by the change of ambient temperature. The measurement accuracy is low, and the error will accumulate throughout the process. The impact of the change of the triangular wave voltage signal on the liquid level height is not considered. Summary of the invention
[0006] In view of the defects in the prior art, an object of the present invention is to provide an online real-time liquid level sensor liquid level height measurement method and system.
[0007] According to the present invention, an online real-time liquid level sensor liquid level height measurement method is provided, comprising: Step S1: filtering the liquid level signal of the liquid level sensor including the triangular wave voltage signal and the linear wave voltage signal to obtain the triangular wave voltage signal and the linear wave voltage signal after filtering; Step S2: After filtering, the linear wave voltage signal is used to determine whether the current tank mode is a filling mode or a consumption mode according to the slope of the local linear fitting; Step S3: using an inflection point determination algorithm to obtain a maximum voltage value and a minimum voltage value of the triangular wave voltage value from the triangular wave voltage signal after filtering; Step S4: Determine the number of sections of the current liquid level sensor according to the current mode of the storage tank, and calculate the liquid level height using the filtered triangular wave voltage signal, the number of sections of the liquid level sensor, and the maximum and minimum voltage values of the triangular wave voltage.
[0008] Preferably, the step S1 comprises: Step S1.1: filtering the liquid level signal of the liquid level sensor including the triangular wave voltage signal and the linear wave voltage signal by using a weighted sliding filtering method; Step S1.2: Perform local linear fitting on the filtered triangular wave and linear wave voltage signals using the least square method to obtain filtered triangular wave voltage signals and linear wave voltage signals.
[0009] Preferably, the step S1.1 comprises: The sliding window size is SlideN, where SlideN is an integer multiple of 4. When the number of received data is less than the size of the sliding window, the current number of data is n, and the data set , using the direct averaging method, the filtered value The calculation formula is:
[0010] When the received data is greater than or equal to the size of the sliding window, the data set , using the weighted sliding average method, the sliding window data set is divided into 4 equal parts, each of which is , the data sets after the sliding window data is equally divided are , , as well as :
[0011]
[0012]
[0013]
[0014] Perform weighted averaging on the data in the sliding window, and the data set results The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , the filtered value The calculation formula is: .
[0015] Preferably, the step S1.2 comprises: When the number of filtered data is less than the fitting sliding interval size fitN=SlideN, no fitting operation is performed and the current value is returned directly; When the number of filtered data is greater than or equal to the fitting sliding interval size fitN, the least squares fitting is performed to fit the interval data set. ,in, Represents the data sequence number, Represents the corresponding filtered data value, and maps the data set F to a data set starting from the origin (0, 0). , use the least squares method to calculate the slope k and b in the linear regression equation of the fitting sliding interval:
[0016]
[0017] Then use the fitted slope to compensate the data to make up for the lag caused by the previous weighted moving average filter on the data set. Assume that the compensation coefficient is , then the signal data after fitting compensation The calculation formula is: .
[0018] Preferably, the step S2 comprises: judging the current processing working mode by the rising or falling trend of the linear wave; When the linear wave fitting slope K_linear has N consecutive values greater than or equal to 0, it is considered that the tank is in the filling mode; otherwise, when the linear wave fitting slope K_linear has N consecutive values less than 0, it is considered that the tank is in the consumption mode; When the tank is in the filling mode, the medium in the tank is increasing; when the tank is in the consumption mode, the medium in the tank is decreasing.
[0019] Preferably, step S3 comprises: When the triangular wave voltage value is within the threshold range for finding the maximum value, a current maximum value is recorded. When it is detected that the current maximum value minus the current value of the triangular wave voltage is greater than the height difference threshold Q for N consecutive times, it is determined that the maximum value of the triangular wave voltage value is found; When the triangular wave voltage value is within the threshold range for finding the minimum value, a current minimum value is recorded. When it is detected that the current value of the triangular wave voltage minus the current minimum value is greater than the height difference threshold Q for N consecutive times, it is determined that the minimum value of the triangular wave voltage value is found.
[0020] Preferably, the step S4 comprises: Step S4.1: modify the number of sensor nodes according to the current mode of the tank; when the working mode is the filling mode, the number of sensor nodes is reduced by 1; when the working mode is the consumption mode, the number of sensor nodes is increased by 1; Step S4.2: Select the corresponding liquid level calculation formula according to the parity of the number of sensor nodes and the current voltage value of the triangle wave to calculate the liquid level; When the number of sections of the liquid level sensor is an odd number and reduce When it is greater than 0, the liquid level calculation formula is:
[0021] in, Indicates the liquid level calculated by triangle wave, Indicates the voltage value after the current triangle wave filter fitting. Indicates the current minimum value of the triangle wave. Indicates the current maximum value of the triangle wave; U indicates the length of a single sensor section; S indicates the total number of bound sensor sections; s indicates the current number of sensor sections; D indicates the dead zone length; When the number of sections of the liquid level sensor is an odd number and reduce When it is less than or equal to 0, the liquid level calculation formula is:
[0022] When the number of nodes of the liquid level sensor is an even number and reduce When it is greater than 0, the calculation formula for the liquid level is:
[0023] When the number of nodes of the liquid level sensor is an even number and when reduce When it is less than or equal to 0, the calculation formula of liquid level is: .
[0024] An online real-time liquid level sensor liquid level height measurement system provided by the present invention comprises: Module M1: filtering the liquid level signal of the liquid level sensor including the triangular wave voltage signal and the linear wave voltage signal to obtain the triangular wave voltage signal and the linear wave voltage signal after filtering; Module M2: The linear wave voltage signal after filtering is used to determine whether the current tank mode is a filling mode or a consumption mode according to the slope of the local linear fitting; Module M3: After filtering, the triangular wave voltage signal uses an inflection point determination algorithm to obtain the maximum voltage value and the minimum voltage value of the triangular wave voltage value; Module M4: Determine the number of sections of the current liquid level sensor according to the current mode of the tank, and calculate the liquid level using the filtered triangular wave voltage signal, the number of sections of the liquid level sensor, and the maximum and minimum voltage values of the triangular wave voltage.
[0025] Preferably, the module M1 comprises: Module M1.1: The liquid level signal of the liquid level sensor, including the triangular wave voltage signal and the linear wave voltage signal, is filtered by using the weighted sliding filtering method; The sliding window size is SlideN, where SlideN is an integer multiple of 4. When the number of received data is less than the size of the sliding window, the current number of data is n, and the data set , using the direct averaging method, the filtered value The calculation formula is:
[0026] When the received data is greater than or equal to the size of the sliding window, the data set , using the weighted sliding average method, the sliding window data set is divided into 4 equal parts, each of which is , the data sets after the sliding window data is equally divided are , , as well as :
[0027]
[0028]
[0029]
[0030] Perform weighted averaging on the data in the sliding window, and the data set results The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , the filtered value The calculation formula is:
[0031] Module M1.2: Use the least square method to perform local linear fitting on the filtered triangular wave and linear wave voltage signals to obtain the filtered triangular wave voltage signals and linear wave voltage signals; When the number of filtered data is less than the fitting sliding interval size fitN=SlideN, no fitting operation is performed and the current value is returned directly; When the number of filtered data is greater than or equal to the fitting sliding interval size fitN, the least squares fitting is performed to fit the interval data set. ,in, Represents the data sequence number, Represents the corresponding filtered data value, and maps the data set F to a data set starting from the origin (0, 0). , use the least squares method to calculate the slope k and b in the linear regression equation of the fitting sliding interval:
[0032]
[0033] Then use the fitted slope to compensate the data to make up for the lag caused by the previous weighted moving average filter on the data set. Assume that the compensation coefficient is , then the signal data after fitting compensation The calculation formula is: .
[0034] Preferably, the module M2 comprises: judging the current processing working mode by the rising or falling trend of the linear wave; When the linear wave fitting slope K_linear has N consecutive values greater than or equal to 0, it is considered that the tank is in the filling mode; otherwise, when the linear wave fitting slope K_linear has N consecutive values less than 0, it is considered that the tank is in the consumption mode; When the tank is in the filling mode, the medium in the tank is increasing; when the tank is in the consumption mode, the medium in the tank is decreasing; The module M3 comprises: When the triangular wave voltage value is within the threshold range for finding the maximum value, a current maximum value is recorded. When it is detected that the current maximum value minus the current value of the triangular wave voltage is greater than the height difference threshold Q for N consecutive times, it is determined that the maximum value of the triangular wave voltage value is found; When the triangular wave voltage value is within the threshold range for finding the minimum value, a current minimum value is recorded. When it is detected that the current value of the triangular wave voltage minus the current minimum value is greater than the height difference threshold Q for N consecutive times, it is determined that the minimum value of the triangular wave voltage value is found; The module M4 comprises: Module M4.1: Modify the number of sensor nodes according to the current mode of the tank; when the working mode is the filling mode, the number of sensor nodes is reduced by 1; when the working mode is the consumption mode, the number of sensor nodes is increased by 1; Module M4.2: According to the parity of the number of sensor nodes and the current voltage value of the triangle wave, select the corresponding liquid level calculation formula to calculate the liquid level; When the number of sections of the liquid level sensor is an odd number and reduce When it is greater than 0, the liquid level calculation formula is:
[0035] in, Indicates the liquid level calculated by triangle wave, Indicates the voltage value after the current triangle wave filter fitting. Indicates the current minimum value of the triangle wave. Indicates the current maximum value of the triangle wave; U indicates the length of a single sensor section; S indicates the total number of bound sensor sections; s indicates the current number of sensor sections; D indicates the dead zone length; When the number of sections of the liquid level sensor is an odd number and reduce When it is less than or equal to 0, the liquid level calculation formula is:
[0036] When the number of nodes of the liquid level sensor is an even number and reduce When it is greater than 0, the calculation formula for the liquid level is:
[0037] When the number of nodes of the liquid level sensor is an even number and when reduce When it is less than or equal to 0, the calculation formula of liquid level is: .
[0038] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention removes the burrs of the data in real time, and the weighted sliding filter combined with the local linear fitting method can smooth the filter level signal, while ensuring the real-time performance of the data without delay; 2. The present invention searches for the inflection point of the triangular wave voltage value online in real time. The inflection point determination algorithm selects the appropriate number of consecutive times N and the height difference threshold Q based on the characteristics of the data. The inflection point determination algorithm has a high accuracy rate in finding the inflection point, and the delay of the inflection point found is small; 3. When calculating the liquid level height, the present invention uses the extreme value of the inflection point of the triangular wave found in real time, which reduces the influence of the ambient temperature change on the capacitance, that is, reduces the error of the liquid level measurement caused by the change of the dielectric constant; at the same time, the use of the triangular wave to calculate the liquid level height can avoid the cumulative error of the whole process caused by using the linear wave voltage value to calculate the liquid level height, thereby improving the accuracy of the liquid level measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 Shown is a flow chart of a method for measuring liquid level height of an online real-time liquid level sensor of the present invention.
[0040] Figure 2 Shown is a schematic diagram of a curve of a liquid level sensor signal changing over time according to the present invention.
[0041] Figure 3 Shown is a flow chart of the liquid level height calculation and processing method of the present invention. DETAILED DESCRIPTION
[0042] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0043] Example 1 An online real-time liquid level sensor liquid level height measurement method and system provided by the present invention is a liquid level height measurement method that finds the inflection point of a triangular wave voltage signal online with high real-time reliability and calculates the liquid level height based on the triangular wave voltage signal.
[0044] The online real-time liquid level sensor liquid level height measurement method is as follows: Figure 1 As shown, the following steps are included: Step 1: Filter the liquid level signal of the liquid level sensor including the triangular wave voltage signal and the linear wave voltage signal to eliminate the jitter and burr of the triangular wave voltage signal and the linear wave voltage signal, so as to obtain a stable value.
[0045] Specifically, the filtering algorithm is: using a weighted sliding filtering method to filter the original data, and then performing local linear fitting to finally obtain a triangular wave voltage value and a linear wave voltage value after filtering; More specifically, the sliding window size is SlideN, where SlideN is an integer multiple of 4. When the number of received data is less than the size of the sliding window, the current number of data is n, and the data set , using the direct averaging method, the filtered value The calculation formula is:
[0046] When the received data is greater than or equal to the size of the sliding window, the data set , using the weighted sliding average method, the sliding window data set is divided into 4 equal parts, each of which is , the data sets after the sliding window data is equally divided are , , as well as :
[0047]
[0048]
[0049]
[0050] Perform weighted averaging on the data in the sliding window, and the data set results The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , the filtered value The calculation formula is: .
[0051] When the number of filtered data is less than the fitting sliding interval size fitN=SlideN, no fitting operation is performed and the current value is returned directly; When the number of filtered data is greater than or equal to the fitting sliding interval size fitN, the least squares fitting is performed to fit the interval data set. ,in, Represents the data sequence number, Represents the corresponding filtered data value, and maps the data set F to a data set starting from the origin (0, 0). , use the least squares method to calculate the slope k and b in the linear regression equation of the fitting sliding interval:
[0052]
[0053] Then use the fitted slope to compensate the data to make up for the lag caused by the previous weighted moving average filter on the data set. Assume that the compensation coefficient is , then the signal data after fitting compensation The calculation formula is: .
[0054] Step 2: According to the linear wave voltage value after the above filtering and the slope of the local linear fitting, determine whether the current tank mode is a filling mode or a consumption mode; the filling mode is to increase the medium, and the consumption mode is to reduce the medium; Specifically, when the local fitting slope value of the linear wave voltage value is greater than 0, it is determined that the current state is in the filling mode; when the local fitting slope value of the linear wave voltage value is less than 0, it is determined that the current state is in the consumption mode; Step 3: According to the triangular wave voltage value after the above filtering, an inflection point determination algorithm is used to obtain the maximum voltage value and the minimum voltage value of the triangular wave voltage value; Specifically, the inflection point determination algorithm searches for the maximum value as follows: when the triangular wave voltage value is within the threshold range for searching for the maximum value, the algorithm needs to record a current maximum value, and when it is detected that the current maximum value minus the current value of the triangular wave voltage is greater than the height difference threshold Q for N consecutive times, it is determined that the maximum value of the triangular wave voltage value is found, that is, the inflection point of the maximum value of the triangular wave voltage is found; The inflection point determination algorithm, in which the minimum value is sought, is as follows: when the triangular wave voltage value is within the threshold range for seeking the minimum value, the algorithm needs to record a current minimum value, and when it is detected that the current value of the triangular wave voltage minus the current minimum value is greater than the height difference threshold Q for N consecutive times, it is determined that the minimum value of the triangular wave voltage value is found, that is, the inflection point of the minimum value of the triangular wave voltage is found; Furthermore, the number of continuations N is determined by the frequency of obtaining the liquid level signal data. When the frequency of receiving the liquid level data is 20 Hz, the value of the number of continuations N is [1,20].
[0055] Furthermore, the height difference threshold Q means the difference between the extreme point and the current triangle wave liquid level voltage value when an inflection point (i.e., an extreme point, a maximum point, or a minimum point) appears; the value of the height difference threshold affects the accuracy and speed of finding the inflection point; Step 4: After finding the extreme point of the triangular wave voltage value, on the one hand, it is necessary to update the maximum or minimum value corresponding to the current dielectric constant, and on the other hand, it is necessary to modify the node number of the liquid level sensor according to the current mode of the tank; Specifically, when the tank is in the filling mode, the number of liquid level sensor sections needs to be reduced after the extreme point is found; when the tank is in the consumption mode, the number of liquid level sensor sections needs to be increased after the extreme point is found; When using the triangle wave voltage value to calculate the liquid level, the number of sections of the liquid level sensor selects different liquid level calculation formulas; assuming that the value after triangle wave filtering compensation is , the minimum value of the triangle wave is (In the initial case, it is the bound triangle wave minimum value, and later it is the found triangle wave minimum value), the triangle wave maximum value is (Initially, it is the maximum value of the bound triangle wave, and later it is the maximum value of the found triangle wave), the number of bound sensor sections is S, the dead zone length is D, the single section length is U, the current number of sensor sections is s, and the triangle wave calculates the liquid level height ; When the number of sections of the liquid level sensor is an odd number and reduce When it is greater than 0, the liquid level calculation formula is:
[0056] When the number of sections of the liquid level sensor is an odd number and reduce When it is less than or equal to 0, the liquid level calculation formula is:
[0057] When the number of nodes of the liquid level sensor is an even number and reduce When it is greater than 0, the calculation formula for the liquid level is:
[0058] When the number of nodes of the liquid level sensor is an even number and when reduce When it is less than or equal to 0, the calculation formula of liquid level is: .
[0059] The present invention also provides an online real-time liquid level sensor liquid level height measurement system, which can be realized by executing the process steps of the online real-time liquid level sensor liquid level height measurement method, that is, those skilled in the art can understand the online real-time liquid level sensor liquid level height measurement method as a preferred implementation of the online real-time liquid level sensor liquid level height measurement system.
[0060] Example 2 Embodiment 2 is a preferred embodiment of Embodiment 1 like Figure 2 , 3 As shown, an online real-time liquid level sensor liquid level height measurement method of the present invention comprises: Filter the triangle wave and linear wave of the liquid level signal; The current working mode can be judged by the rising or falling trend of the linear wave. When the tank liquid level is increasing, it is the filling mode, and when the tank liquid level is decreasing, it is the consumption mode. Find the extreme points of the triangle wave (including the maximum and minimum values), correct the node number where the liquid level sensor is located, and use the extreme values to correct the parameters in the liquid level height calculation formula; Calculate the tank liquid level according to the node where the sensor is located.
[0061] In a specific embodiment, a schematic diagram of the liquid level signal of the liquid level sensor changing with time is shown as follows: Figure 2 As shown, the numbers 1-6 in the figure represent the section number of the current sensor, 1 represents the first section, 2 represents the second section, 3 represents the third section, 4 represents the fourth section, 5 represents the fifth section, and 6 represents the sixth section; In a specific implementation, the triangular wave and the linear wave are filtered, and a weighted sliding filtering method is used for preliminary filtering. The least square method is used to fit the linear regression of the sliding window interval to the triangular wave and the linear wave after preliminary filtering, and the slope K_tri and the offset b_tri of the linear wave regression equation of the triangular wave voltage, and the slope K_linear and the offset b_linear of the linear wave regression equation are calculated; In a specific implementation method, the current working mode is determined by the rising or falling trend of the linear wave. When the linear wave fitting slope K_linear has N (continuous times) values greater than or equal to 0 continuously, it is considered that the tank is in the filling mode. Otherwise, when K_linear has N consecutive values less than 0, it is considered that the tank is in the consumption mode. Find the maximum value of the extreme point of the triangular wave. This embodiment uses the height difference of the triangular wave to find the maximum value. The method sets a region for finding the maximum value. When the triangular wave exceeds the maximum value threshold, the maximum value search operation is performed. The filtered triangular wave is used to find the extreme value. A historical triangular wave maximum value is recorded. When it is detected that the recorded maximum value minus the current triangular wave voltage value is greater than the height difference threshold of 0.2 for N consecutive times, it is determined that the maximum value of the triangular wave voltage value is found, that is, the inflection point of the triangular wave voltage maximum value is found; Find the minimum value of the extreme point of the triangular wave. The method described in this article uses the height difference of the triangular wave to find the minimum value. The method sets an area for finding the minimum value. When the triangular wave is less than the minimum value threshold, the minimum value search operation is performed. The filtered triangular wave is used to find the minimum value, and a historical triangular wave minimum value is recorded. When it is detected that the current value of the triangular wave voltage minus the current minimum value is greater than the height difference threshold of 0.2 for N consecutive times, it is determined that the minimum value of the triangular wave voltage value is found, that is, the inflection point of the minimum value of the triangular wave voltage is found; In the specific implementation method, after finding the extreme point of the triangle wave, that is, the maximum or minimum value of the triangle wave, the number of sensor nodes is modified according to the current working mode. If the current working mode is the filling mode, the number of sensor nodes is reduced by 1, and if the current working mode is the consumption mode, the number of sensor nodes is increased by 1; Specifically, after finding the extreme points of the triangle wave, that is, the maximum value and the minimum value of the triangle wave, the maximum value and the minimum value in the liquid level height calculation formula are updated to improve the calculation accuracy of the liquid level height; Further, according to the number of nodes of the current sensor, select the corresponding formula to calculate the liquid level height. For details, see Figure 3 :When the number of nodes of the liquid level sensor is an odd number and reduce When it is greater than 0, the liquid level calculation formula is:
[0062] in is the liquid level height calculated by the triangular wave, is the value after the current triangle wave is filtered. is the current minimum value of the triangle wave, is the current maximum value of the triangle wave, U is the length of a single sensor section, S is the total number of bound sensor sections, s is the number of sensor sections currently located, and D is the dead zone length; When the number of sections of the liquid level sensor is an odd number and reduce When it is less than or equal to 0, the liquid level calculation formula is:
[0063] When the number of nodes of the liquid level sensor is an even number and reduce When it is greater than 0, the calculation formula for the liquid level is:
[0064] When the number of nodes of the liquid level sensor is an even number and when reduce When it is less than or equal to 0, the calculation formula of liquid level is: .
[0065] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0066] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. An online real-time liquid level sensor liquid level height measurement method, characterized in that: include: Step S1: filtering the liquid level signal of the liquid level sensor including the triangular wave voltage signal and the linear wave voltage signal to obtain the triangular wave voltage signal and the linear wave voltage signal after filtering; Step S2: After filtering, the linear wave voltage signal is used to determine whether the current tank mode is a filling mode or a consumption mode according to the slope of the local linear fitting; Step S3: using an inflection point determination algorithm to obtain a maximum voltage value and a minimum voltage value of the triangular wave voltage value from the triangular wave voltage signal after filtering; Step S4: Determine the number of sections of the current liquid level sensor according to the current mode of the storage tank, and calculate the liquid level height using the filtered triangular wave voltage signal, the number of sections of the liquid level sensor, and the maximum and minimum voltage values of the triangular wave voltage.
2. The method for measuring liquid level height using an online real-time liquid level sensor according to claim 1, characterized in that: The step S1 comprises: Step S1.1: filtering the liquid level signal of the liquid level sensor including the triangular wave voltage signal and the linear wave voltage signal by using a weighted sliding filtering method; Step S1.2: Perform local linear fitting on the filtered triangular wave and linear wave voltage signals using the least square method to obtain filtered triangular wave voltage signals and linear wave voltage signals.
3. The method for measuring liquid level height using an online real-time liquid level sensor according to claim 2, characterized in that: The step S1.1 comprises: The sliding window size is SlideN, where SlideN is an integer multiple of 4. When the number of received data is less than the size of the sliding window, the current number of data is n, and the data set , using the direct averaging method, the filtered value The calculation formula is: When the received data is greater than or equal to the size of the sliding window, the data set , using the weighted sliding average method, the sliding window data set is divided into 4 equal parts, each of which is , the data sets after the sliding window data is equally divided are , , as well as : Perform weighted averaging on the data in the sliding window, and the data set results The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , the filtered value The calculation formula is: 。 4. The method for measuring liquid level height by online real-time liquid level sensor according to claim 2, characterized in that: The step S1.2 comprises: When the number of filtered data is less than the fitting sliding interval size fitN=SlideN, no fitting operation is performed and the current value is returned directly; When the number of filtered data is greater than or equal to the fitting sliding interval size fitN, the least squares fitting is performed to fit the interval data set. ,in, Represents the data sequence number, Represents the corresponding filtered data value, and maps the data set F to a data set starting from the origin (0, 0). , use the least squares method to calculate the slope k and b in the linear regression equation of the fitting sliding interval: Then use the fitted slope to compensate the data to make up for the lag caused by the previous weighted moving average filter on the data set. Assume that the compensation coefficient is , then the signal data after fitting compensation The calculation formula is: 。 5. The method for measuring liquid level height by online real-time liquid level sensor according to claim 1, characterized in that: The step S2 includes: judging the current processing working mode by the rising or falling trend of the linear wave; When the linear wave fitting slope K_linear has N consecutive values greater than or equal to 0, it is considered that the tank is in the filling mode; otherwise, when the linear wave fitting slope K_linear has N consecutive values less than 0, it is considered that the tank is in the consumption mode; When the tank is in the filling mode, the medium in the tank is increasing; when the tank is in the consumption mode, the medium in the tank is decreasing.
6. The method for measuring liquid level height using an online real-time liquid level sensor according to claim 1, characterized in that: The step S3 comprises: When the triangular wave voltage value is within the threshold range for finding the maximum value, a current maximum value is recorded. When it is detected that the current maximum value minus the current value of the triangular wave voltage is greater than the height difference threshold Q for N consecutive times, it is determined that the maximum value of the triangular wave voltage value is found; When the triangular wave voltage value is within the threshold range for finding the minimum value, a current minimum value is recorded. When it is detected that the current value of the triangular wave voltage minus the current minimum value is greater than the height difference threshold Q for N consecutive times, it is determined that the minimum value of the triangular wave voltage value is found.
7. The method for measuring liquid level height using an online real-time liquid level sensor according to claim 1, characterized in that: The step S4 comprises: Step S4.1: modify the number of sensor nodes according to the current mode of the tank; when the working mode is the filling mode, the number of sensor nodes is reduced by 1; when the working mode is the consumption mode, the number of sensor nodes is increased by 1; Step S4.2: Select the corresponding liquid level calculation formula according to the parity of the number of sensor nodes and the current voltage value of the triangle wave to calculate the liquid level; When the number of sections of the liquid level sensor is an odd number and reduce When it is greater than 0, the liquid level calculation formula is: in, Indicates the liquid level calculated by triangular wave, Indicates the voltage value after the current triangle wave filter fitting. Indicates the current minimum value of the triangle wave. Indicates the current maximum value of the triangle wave; U indicates the length of a single sensor section; S indicates the total number of bound sensor sections; s indicates the current number of sensor sections; D indicates the dead zone length; When the number of sections of the liquid level sensor is an odd number and reduce When it is less than or equal to 0, the liquid level calculation formula is: When the number of nodes of the liquid level sensor is an even number and reduce When it is greater than 0, the calculation formula for the liquid level is: When the number of nodes of the liquid level sensor is an even number and when reduce When it is less than or equal to 0, the calculation formula of liquid level is: 。 8. An online real-time liquid level sensor liquid level height measurement system, characterized in that: include: Module M1: filtering the liquid level signal of the liquid level sensor including the triangular wave voltage signal and the linear wave voltage signal to obtain the triangular wave voltage signal and the linear wave voltage signal after filtering; Module M2: The linear wave voltage signal after filtering is used to determine whether the current tank mode is a filling mode or a consumption mode according to the slope of the local linear fitting; Module M3: After filtering, the triangular wave voltage signal uses an inflection point determination algorithm to obtain the maximum voltage value and the minimum voltage value of the triangular wave voltage value; Module M4: Determine the number of sections of the current liquid level sensor according to the current mode of the tank, and calculate the liquid level using the filtered triangular wave voltage signal, the number of sections of the liquid level sensor, and the maximum and minimum voltage values of the triangular wave voltage.
9. The online real-time liquid level sensor liquid level height measurement system according to claim 8, characterized in that: The module M1 comprises: Module M1.1: The liquid level signal of the liquid level sensor, including the triangular wave voltage signal and the linear wave voltage signal, is filtered by using the weighted sliding filtering method; The sliding window size is SlideN, where SlideN is an integer multiple of 4. When the number of received data is less than the size of the sliding window, the current number of data is n, and the data set , using the direct averaging method, the filtered value The calculation formula is: When the received data is greater than or equal to the size of the sliding window, the data set , using the weighted sliding average method, the sliding window data set is divided into 4 equal parts, each of which is , the data sets after the sliding window data is equally divided are , , as well as : Perform weighted averaging on the data in the sliding window, and the data set results The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , Dataset The corresponding weight is , the filtered value The calculation formula is: Module M1.2: Use the least square method to perform local linear fitting on the filtered triangular wave and linear wave voltage signals to obtain the filtered triangular wave voltage signals and linear wave voltage signals; When the number of filtered data is less than the fitting sliding interval size fitN=SlideN, no fitting operation is performed and the current value is returned directly; When the number of filtered data is greater than or equal to the fitting sliding interval size fitN, the least squares fitting is performed to fit the interval data set. ,in, Represents the data sequence number, Represents the corresponding filtered data value, and maps the data set F to a data set starting from the origin (0, 0). , use the least squares method to calculate the slope k and b in the linear regression equation of the fitting sliding interval: Then use the fitted slope to compensate the data to make up for the lag caused by the previous weighted moving average filter on the data set. Assume that the compensation coefficient is , then the signal data after fitting compensation The calculation formula is: 。 10. The online real-time liquid level sensor liquid level height measurement system according to claim 8, characterized in that: The module M2 includes: judging the current processing working mode by the rising or falling trend of the linear wave; When the linear wave fitting slope K_linear has N consecutive values greater than or equal to 0, it is considered that the tank is in the filling mode; otherwise, when the linear wave fitting slope K_linear has N consecutive values less than 0, it is considered that the tank is in the consumption mode; When the tank is in the filling mode, the medium in the tank is increasing; when the tank is in the consumption mode, the medium in the tank is decreasing; The module M3 comprises: When the triangular wave voltage value is within the threshold range for finding the maximum value, a current maximum value is recorded. When it is detected that the current maximum value minus the current value of the triangular wave voltage is greater than the height difference threshold Q for N consecutive times, it is determined that the maximum value of the triangular wave voltage value is found; When the triangular wave voltage value is within the threshold range for finding the minimum value, a current minimum value is recorded. When it is detected that the current value of the triangular wave voltage minus the current minimum value is greater than the height difference threshold Q for N consecutive times, it is determined that the minimum value of the triangular wave voltage value is found; The module M4 comprises: Module M4.1: Modify the number of sensor nodes according to the current mode of the tank; when the working mode is the filling mode, the number of sensor nodes is reduced by 1; when the working mode is the consumption mode, the number of sensor nodes is increased by 1; Module M4.2: According to the parity of the number of sensor nodes and the current voltage value of the triangle wave, select the corresponding liquid level calculation formula to calculate the liquid level; When the number of sections of the liquid level sensor is an odd number and reduce When it is greater than 0, the liquid level calculation formula is: in, Indicates the liquid level calculated by triangular wave, Indicates the voltage value after the current triangle wave filter fitting. Indicates the current minimum value of the triangle wave. Indicates the current maximum value of the triangle wave; U indicates the length of a single sensor section; S indicates the total number of bound sensor sections; s indicates the current number of sensor sections; D indicates the dead zone length; When the number of sections of the liquid level sensor is an odd number and reduce When it is less than or equal to 0, the liquid level calculation formula is: When the number of nodes of the liquid level sensor is an even number and reduce When it is greater than 0, the calculation formula for the liquid level is: When the number of nodes of the liquid level sensor is an even number and when reduce When it is less than or equal to 0, the calculation formula of liquid level is: 。
Citation Information
Patent Citations
Method and device for liquid level measurement based on sectional capacitor, and electronic device
CN108362355A
Carrier rocket pre-launch additional parameter monitoring method
CN112067081A
Liquid level height analysis method, device and system, equipment and storage medium
CN112798077A
Liquid level measuring method and system based on intelligent liquid level sensor
CN118706227A
Carrier rocket propellant liquid level measurement filtering method based on volume extrapolation
CN119197707A
Cited By
Liquid level sensor device of pesticide preparation tank
CN121475360A