Liquid level measurement method and liquid level measurement system
Through the liquid level measurement method combined with MCU and 60G pulse coherent radar, the problem of poor working performance of existing liquid level detection technology in harsh environments is solved, and high-precision and low-error level detection is achieved.
Patent Information
- Application Number
- CN202010485611.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-01
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2040-06-01
AI Technical Summary
The existing liquid level detection technology has poor working performance in harsh environments, and the hardware design requirements of high-frequency connected wave (FMCW) radars are high, and lidar detection is easily affected by light, resulting in large errors in the detection result.
The liquid level measurement method combined with MCU and 60G pulse coherent radar is adopted to obtain the temperature value through the temperature sensor module, radar initialization and calibration is performed, stable distance is obtained using the index averaging algorithm, and detection results are output through the RS485 communication interface.
It realizes accurate detection of liquid level in harsh environments, reduces detection errors, improves detection accuracy and resolution, and can effectively detect errors caused by instantaneous jump of the filtrate surface.
Smart Images

Figure CN111521240B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of liquid level detection, and in particular to a liquid level measurement method and a liquid level measurement system for detecting liquid level through radar. Background Art
[0002] The existing technologies for non-contact level measurement include ultrasonic, high frequency continuous wave (FMCW) radar and laser radar. Ultrasonic waves are easily affected by dust, temperature, humidity and other environmental factors, and have certain limitations in working in harsh outdoor environments; FMCW level meters involve the design of analog circuits, which have relatively high requirements for hardware design and production processes, and consistency is difficult to control; laser radar detection is easily affected by light, such as the difference in light in the morning and evening, and the detection results also have certain errors. Summary of the invention
[0003] One of the purposes of the present invention is to provide a liquid level measurement method in order to overcome the deficiencies in the prior art.
[0004] A second object of the present invention is to provide a liquid level measurement system.
[0005] The technical solution of the present invention is as follows:
[0006] A liquid level measurement method, the steps are as follows:
[0007] S01: MCU reads the configuration parameters of the liquid level meter, obtains the temperature value T0 through the temperature sensor module, and the radar is initialized;
[0008] S02: The radar is calibrated and the leakage area value is obtained. The MCU obtains the temperature value T1 again through the temperature sensor module;
[0009] S03: Calculate whether the absolute value of (T0-T1) is greater than 5°C. If so, update the temperature value T0 and recalibrate the radar. Otherwise, execute S04.
[0010] S04: MCU starts radar detection and obtains radar detection data, and MCU processes the data;
[0011] S05: MCU outputs the detection result through the RS485 communication interface.
[0012] The specific steps of data processing performed by MCU in the above step S04 are as follows:
[0013] S11: Determine whether the detection range is within the leakage area, if yes, execute S12, otherwise obtain the peak value R3 through fixed threshold comparison and calculate the current distance;
[0014] S12: Calculate the fluctuation value R1 of the leakage area through the dynamic threshold, and calculate the peak value R2 outside the leakage area through the fixed threshold;
[0015] S13: Determine whether the peak value R2 outside the leakage area is true, if so, calculate the current distance, otherwise execute S14:
[0016] S14: Determine whether the peak value R2 outside the leakage area is true, otherwise calculate the current distance, if yes, compare R1 and R2 to see which one is closer to the true target value, and calculate the current distance;
[0017] S15: Get the stable distance through the exponential averaging algorithm.
[0018] Furthermore, when the detection range is within the leakage area, R1[i]=∑ N (P[i]-P s [i]) calculates the difference between the current detection value and the calibration value; where P[i] is the value collected by the radar scanning once in the set leakage area, the spacing of i is 0.484 mm, P s [i] is the value in the leakage area saved during radar calibration, that is, the fluctuation value R1 of the leakage area is obtained; R2 can be obtained by calculating the maximum peak value outside the leakage area. If R2 is greater than the set threshold, R2 is true. Finally, by comparing the values of R1 and R2, the larger the value, the stronger the reflection point detected by the radar, which is the target value of this detection.
[0019] Furthermore, when the detection range is not within the leakage area, the peak value R3 of the data collected by the radar can be directly calculated by the set threshold. If R3 is 0, there is no detected target. If R3 is greater than 0, it is the target value detected by the radar at that time.
[0020] The liquid level measurement system comprises an MCU, a first power module for supplying power to the MCU, a second power module connected to the first power module, a radar connected to the second power module and supplied with power by the second power module, a level conversion module respectively connected to the MCU and the radar, a temperature sensor module connected to the MCU, and an RS485 communication interface; the temperature sensor module detects temperature and transmits temperature data to the MCU, the radar detects liquid level distance, the radar transmits the detected distance data to the MCU, and the MCU obtains accurate distance data from the radar to the liquid level through calculation.
[0021] The first power module converts 5-24V DC power into 3.3V to power the MCU; the second power module converts the 3.3V DC power of the first power module into 1.8V to power the radar.
[0022] The level conversion module converts the 3.3V level signal of the MCU into a 1.8V level signal, which then matches the 1.8V level of the radar.
[0023] The radar communicates with the MCU via an SPI interface.
[0024] The above RS485 communication interface transmits data via the MODBUS protocol or character string.
[0025] Furthermore, it also includes a system operation indicator light module, and the system operation indicator light module is connected to the MCU.
[0026] Beneficial effects of the present invention:
[0027] 1. The present invention obtains a stable distance through an exponential average algorithm, which can effectively filter out the detection error caused by the instantaneous jump of the liquid level, and can also accurately detect the liquid level with large flow rate and fluctuation; through the method of adaptive baseline, the blind area of measurement is reduced.
[0028] 2. The radar of the present invention adopts a high-precision 60G pulse coherent radar to achieve high detection accuracy, with a resolution accurate to 1 mm and a detection fluctuation of plus or minus 2 mm. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flow chart of the liquid level measurement method of the present invention;
[0030] Figure 2 This is a flow chart of distance measurement calculation of the present invention;
[0031] Figure 3 Schematic diagram of the liquid level measurement system of the present invention. DETAILED DESCRIPTION
[0032] In order to better illustrate the present invention, further description is now given in conjunction with embodiments and drawings.
[0033] like Figure 1 As shown, a liquid level measurement method, the steps are as follows:
[0034] S01: MCU reads the configuration parameters of the liquid level meter, obtains the temperature value T0 through the temperature sensor module, and the radar is initialized;
[0035] S02: The radar is calibrated and the leakage area value is obtained. The MCU obtains the temperature value T1 again through the temperature sensor module;
[0036] S03: Calculate whether the absolute value of (T0-T1) is greater than 5°C. If so, update the temperature value T0 and recalibrate the radar. Otherwise, execute S04.
[0037] S04: MCU starts radar detection and obtains radar detection data, and MCU processes the data;
[0038] S05: MCU outputs the detection result through the RS485 communication interface.
[0039] like Figure 2 As shown, the specific steps of data processing by MCU in step S04 are as follows:
[0040] S11: Determine whether the detection range is within the leakage area, if yes, execute S12, otherwise obtain the peak value R3 through fixed threshold comparison and calculate the current distance;
[0041] S12: Calculate the fluctuation value R1 of the leakage area through the dynamic threshold, and calculate the peak value R2 outside the leakage area through the fixed threshold;
[0042] S13: Determine whether the peak value R2 outside the leakage area is true, if so, calculate the current distance, otherwise execute S14:
[0043] S14: Determine whether the peak value R2 outside the leakage area is true, otherwise calculate the current distance, if yes, compare R1 and R2 to see which one is closer to the true target value, and calculate the current distance;
[0044] S15: Get the stable distance through the exponential averaging algorithm.
[0045] Specifically, when the detection range is within the leakage area, through R1[i]=∑ N (P[i]-P s [i]) calculates the difference between the current detection value and the calibration value; where P[i] is the value collected by the radar scanning once in the set leakage area, the spacing of i is 0.484 mm, P s [i] is the value in the leakage area saved during radar calibration, that is, the fluctuation value R1 of the leakage area is obtained; R2 can be obtained by calculating the maximum peak value outside the leakage area. If R2 is greater than the set threshold, R2 is true. Finally, by comparing the values of R1 and R2, the larger the value, the stronger the reflection point detected by the radar, which is the target value of this detection.
[0046] In another case, when the detection range is not within the leakage area, the peak value R3 of the data collected by the radar can be directly calculated by the set threshold. If R3 is 0, there is no detected target. If R3 is greater than 0, it is the target value detected by the radar at that time.
[0047] like Figure 3As shown, the liquid level measurement system includes an MCU, a first power module for supplying power to the MCU, a second power module connected to the first power module, a radar connected to the second power module and supplied by the second power module, a level conversion module connected to the MCU and the radar, a temperature sensor module connected to the MCU, and an RS485 communication interface; the temperature sensor module detects the temperature and transmits the temperature data to the MCU, the radar detects the liquid level distance, the radar transmits the detected distance data to the MCU, and the MCU obtains accurate distance data between the radar and the liquid level by calculation. In this embodiment, the MCU adopts STM32FF412RCT6.
[0048] Specifically, the first power module converts 5-24V DC into 3.3V to power the MCU; the second power module converts the 3.3V DC of the first power module into 1.8V to power the radar; the level conversion module converts the 3.3V level signal of the MCU into a 1.8V level signal, which then matches the 1.8V level of the radar. The radar and MCU communicate through the SPI interface; the RS485 communication interface is the communication interface between the MCU and the external host, which transmits data through the MODBUS protocol or character string, and the relevant parameters of the liquid level measurement system can be configured through the RS485 communication interface. The temperature sensor module detects the real-time temperature inside the temperature sensor and compensates the detection structure by detecting temperature changes.
[0049] Furthermore, the system also includes a system operation indicator light module, which is connected to the MCU. The system operation indicator light module is used to indicate various conditions of system operation by flashing LEDs, including fault prompts, out-of-range prompts, and communication prompts.
[0050] The working process of the liquid level measurement system of the present invention is as follows:
[0051] The first power module stabilizes the 5-24V DC power input at 3.3V to power the MCU. The second power module stabilizes the 3.3V voltage of the first power module at 1.8V to power the radar. The level conversion module converts the MCU 3.3V level signal into a 1.8V level signal, which then matches the 1.8V level of the radar. The temperature sensor module obtains the temperature value, the radar works to obtain the distance data from the radar to the liquid surface, the MCU starts the radar detection, and obtains the radar detection data through the SPI interface. The MCU obtains the distance data from the radar to the liquid surface by calculation.
[0052] When the detection range is within the leakage area, through R1[i] = ∑ N (P[i]-P s[i]) calculates the difference between the current detection value and the calibration value; where P[i] is the value collected by the radar scanning once in the set leakage area, the spacing of i is 0.484 mm, P s [i] is the value in the leakage area saved during radar calibration, that is, the fluctuation value R1 of the leakage area is obtained; R2 can be obtained by calculating the maximum peak value outside the leakage area. If R2 is greater than the set threshold, R2 is true. Finally, by comparing the values of R1 and R2, the larger the value, the stronger the reflection point detected by the radar, which is the target value of this detection.
[0053] When the detection range is not within the leakage area, the peak value R3 of the data collected by the radar can be directly calculated through the set threshold. If R3 is 0, there is no detected target. If R3 is greater than 0, it is the target value detected by the radar at that time.
[0054] Furthermore, the exponential average algorithm is used to obtain a stable distance, thereby obtaining accurate distance data.
[0055] The MCU transmits the distance data to the external host through the RS485 communication interface.
[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A liquid level measurement method, characterized in that: Here are the steps: S01: MCU reads the configuration parameters of the liquid level meter, obtains the temperature value T0 through the temperature sensor module, and the radar is initialized; S02: The radar is calibrated and the leakage area value is obtained. The MCU obtains the temperature value T1 again through the temperature sensor module; S03: Calculate whether the absolute value of (T0-T1) is greater than 5°C. If so, update the temperature value T0 and recalibrate the radar. Otherwise, execute S04. S04: MCU starts radar detection and obtains radar detection data, and MCU processes the data; S05: MCU outputs the test results through the RS485 communication interface; The specific steps of data processing by MCU in step S04 are as follows: S11: Determine whether the detection range is within the leakage area, if yes, execute S12, otherwise obtain the peak value R3 through fixed threshold comparison and calculate the current distance; S12: Calculate the fluctuation value R1 of the leakage area through the dynamic threshold, and calculate the peak value R2 outside the leakage area through the fixed threshold; S13: Determine whether the peak value R2 outside the leakage area is true, if so, calculate the current distance, otherwise execute S14: S14: Determine whether the peak value R2 outside the leakage area is true, otherwise calculate the current distance, if yes, compare R1 and R2 to see which one is closer to the true target value, and calculate the current distance; S15: Get the stable distance through the exponential averaging algorithm.
2. The liquid level measurement method according to claim 1, characterized in that: When the detection range is within the leakage area, through R1[i] = ∑ N (P[i]-P s [i]) Calculate the difference between the current detection value and the calibration value; Where P[i] is the value collected by a radar scan in the set leakage area, the interval of i is 0.484 mm, P s [i] is the value in the leakage area saved during radar calibration, that is, the fluctuation value R1 of the leakage area is obtained; R2 can be obtained by calculating the maximum peak value outside the leakage area. If R2 is greater than the set threshold, R2 is true. Finally, by comparing the values of R1 and R2, the larger the value, the stronger the reflection point detected by the radar, which is the target value of this detection.
3. The liquid level measurement method according to claim 1, characterized in that: When the detection range is not within the leakage area, the peak value R3 of the data collected by the radar can be directly calculated through the set threshold. If R3 is 0, there is no detected target. If R3 is greater than 0, it is the target value detected by the radar at that time.
Citation Information
Patent Citations
Signal processing circuit component for radar liquidometer
CN202255549U
Liquid level measuring system
CN211954331U