Tank Level Reference Application#
The tank level reference application shows the liquid level in a tank with an A121 sensor mounted at the top. This reference application is built on top of the distance detector (see Distance Detector) with some additional configurations specific to the tank level application.
- Measurement range
The liquid level in the tank can be measured from a minimum distance of 3 cm from the sensor to a maximum distance of 20 m.
- Presets
The application includes three predefined configurations optimized for tanks of varying sizes: small, medium, and large, corresponding to depths of 50 cm, 6.0 m, and 20.0 m, respectively.
- Configuration
The configuration parameter
start_m
defines the distance from the sensor to the surface of the liquid when the tank is full. Similarly,end_m
defines the distance from the sensor to the tank base, i.e., the liquid level when the tank is empty.Multiple peaks can be detected in the distance domain by the detector due to various factors such as sensor installation, tank geometry, etc. The peak sorting method in the detector parameters can be used to ensure that the correct peak is chosen as the first peak for calculating the liquid level. Refer to Distance Detector for a detailed description of the detector parameters.
- Calibration
The distance detector calibration process performs noise level estimation and offset compensation. The close range measurement calibration is also performed in case the close range measurement is active, which depends on the starting distance. In addition, the recorded threshold is also computed if the detector is configured to use the recorded threshold or if the close range measurement is active.
Before starting level measurements, the detector needs to be calibrated. For close range measurements, no object must be present in the close range when the calibration is started.
- Processing
The liquid level is given as the distance of the surface of the liquid from the tank base, and is calculated using the distance to the first peak in the distance detector results. Due to movement in the surface of the liquid, the level measurements may fluctuate. A median filter is employed to counter the fluctuation in the level results by calculating the median of
median_filter_length
results. Averagingnum_medians_to_average
median filter results can further improve the confidence in the level result.
GUI#
The GUI includes three plots. The top left plot indicates the fluid level, and the top right plot shows the level history. The bottom plot shows the tank size, the subsweeps, and the threshold used by the distance detector to detect amplitude peaks in the subsweeps. The subsweeps and different threshold types are described in Distance Detector.
![../../_images/a121_tank_level.png](../../_images/a121_tank_level.png)
Testing#
- Test setup
The level estimation performance of the reference application is tested using the three different setups shown below, which correspond to small (left), medium (middle), and large (right) tanks.
- Test equipment
A121 EVK + XR121
FZP lens ( for medium and large tanks)
Small tank (height = 30 cm)
Test tank (height = 1.0 m)
Exploration tool with Tank level reference application
A simple workaround is used to estimate the performance for the medium and the large tank, where the sensor is mounted at a height to have the water level in at a longer distance than the actual test tank size.
- Test case
Fill tank x cm and verify that the actual distance is equal to the measured distance.
- Configurations
Table 13 Application parameter configurations# Parameter
Small
Medium
Large
Median filter length
5
3
3
Num measurements averaged
5
3
1
Tank start
0.03 m
0.05 m
0.5 m
Tank end
0.3 m
2.7 m
7.8 m
Max step length
1
2
8
Max profile
1
3
5
Threshold method
CFAR
CFAR
CFAR
Reflector shape
Planar
Planar
Planar
Peak sorting method
Closest
Strongest
Strongest
Threshold sensitivity
0.0
0.0
0.0
Signal quality
20
20
20
- Results
Few results obtained using the above configurations are listed below.
Table 14 Test results# Tank
Actual level (m)
Measured level (m)
Small
0.106
0.104
Medium
0.398
0.401
Large
0.100
0.085
Configuration parameters#
- class acconeer.exptool.a121.algo.tank_level._ref_app.RefAppConfig(*, max_step_length: int | None = None, max_profile=Profile.PROFILE_5, close_range_leakage_cancellation: bool = False, signal_quality: float = 15.0, threshold_method=ThresholdMethod.CFAR, peaksorting_method=PeakSortingMethod.STRONGEST, reflector_shape=ReflectorShape.GENERIC, num_frames_in_recorded_threshold: int = 100, fixed_threshold_value: float = 100.0, fixed_strength_threshold_value: float = 0.0, threshold_sensitivity: float = 0.5, update_rate: float | None = 50.0, start_m: float = 0.03, end_m: float = 0.5, median_filter_length: int = 5, num_medians_to_average: int = 1)#
- start_m: float#
Start of measurement range.
- end_m: float#
End of measurement range.
- median_filter_length: int#
Length of the median filter used to improve robustness of the result.
- num_medians_to_average: int#
Number of medians averaged to obtain the final level.
Results#
- class acconeer.exptool.a121.algo.tank_level._ref_app.RefAppResult(*, peak_detected: bool | None, peak_status: ProcessorLevelStatus | None, level: float | None, extra_result: RefAppExtraResult)#
- peak_detected: bool | None#
True if a peak (level) is detected, False if no peak is detected, or None if a result is not available.
- peak_status: ProcessorLevelStatus | None#
Status assigned to the detected peak.
- level: float | None#
Liquid level relative to the base of the tank.
- extra_result: RefAppExtraResult#
Extra result: Only used for the plots in the GUI.