Ultrasonic ranging method, system, device and storage medium based on sound speed correction
Patent Information
- Application Number
- CN202611235475.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-11-03
AI Technical Summary
In existing ultrasonic ranging technology, the ranging results are easily affected by changes in sound speed, especially under abnormal operating conditions, the ranging results are unreliable, resulting in unstable measurement accuracy.
By obtaining the ambient temperature to calculate the temperature-compensated sound velocity, and combining it with the reference echo round-trip time and reliability judgment parameters of the reference reflector, a double correction and weighted fusion calculation is performed to correct the sound velocity, ensuring the accuracy and continuity of the ranging.
It improves the reliability and accuracy of distance measurement results, taking into account both the accuracy of distance measurement under normal operating conditions and the continuity of distance measurement under abnormal operating conditions, and is suitable for various open channel flow measurement.
Smart Images

Figure CN123029535A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic ranging technology, and in particular to an ultrasonic ranging method, system, electronic device, and computer-readable storage medium based on sound velocity correction. Background Technology
[0002] Open channels are common fluid transport channels in water conservancy projects, urban water supply and drainage, and agricultural irrigation. Accurate measurement of water flow in open channels is of great significance for water resource management. Currently, open channel flow measurement mainly adopts ultrasonic ranging open channel flow meters based on the principle of ultrasonic ranging. This flow meter typically consists of an ultrasonic transducer, a temperature sensor, a signal acquisition circuit, a processor, and a flow calculation module. The ultrasonic transducer emits pulsed ultrasonic waves towards the water surface, receives the reflected echoes from the water surface, and obtains the round-trip propagation time. The processor calculates the sound velocity according to a preset temperature-sound velocity model based on the ambient temperature measured by the temperature sensor, and then calculates the distance from the ultrasonic transducer to the water surface using the sound velocity and round-trip propagation time, thereby calculating the liquid level. Combined with the channel's geometric parameters, the flow rate is calculated. This flow meter measures the liquid level in a non-contact manner and has advantages such as being unaffected by water quality and being easy to install and maintain. It has become the mainstream measurement equipment in this field and is suitable for various open channel flow measurement structures such as triangular weirs, rectangular weirs, trapezoidal weirs, broad-crested weirs, and Parshall flumes.
[0003] Since the accuracy of liquid level measurement is affected by the speed of sound, and the speed of sound is easily affected by the measurement environment, it is necessary to correct the speed of sound. For example, Chinese invention patent application CN104266718A discloses an automatically calibrated ultrasonic liquid level measurement system. By installing a metal rod as a standard rod between the ultrasonic probe and the target being measured, the speed of sound is calculated using the fixed distance between the standard rod and the ultrasonic probe, as well as the round-trip propagation time of the ultrasonic wave and its echo. That is, the speed of sound is calculated by using a fixed reference echo. The speed of sound is further calibrated by measuring the temperature through a temperature compensation circuit.
[0004] However, when using a fixed reference echo to calculate the speed of sound, the reference echo may be distorted or disappear due to abnormal changes such as condensation, water droplets, dirt, vibration, changes in the attitude of the reflecting end, or water level submerging the standard rod. Directly using its calculation results will lead to abrupt changes in the distance measurement. Therefore, the measurement results of the above scheme are unreliable in actual applications. Summary of the Invention
[0005] This invention provides an ultrasonic ranging method, system, electronic device, and computer-readable storage medium based on sound velocity correction, to solve the technical problem of unreliable ranging results in existing ultrasonic ranging technologies.
[0006] According to one aspect of the present invention, an ultrasonic ranging method based on sound velocity correction is provided for measuring the distance between an ultrasonic transducer and a target, wherein a reference reflector is provided between the ultrasonic transducer and the target, and the ultrasonic ranging method includes the following steps: The ambient temperature is obtained and a temperature compensation model is set. The ambient temperature is input into the temperature compensation model to calculate the temperature-compensated speed of sound. The reference distance between the ultrasonic transducer and the reference reflector, as well as the reference echo round-trip time between the ultrasonic transducer and the reference reflector, are obtained in order to calculate the reference measured sound velocity. Obtain and determine the confidence assessment parameters, set the confidence assessment conditions, determine whether the reference echo is valid based on the confidence assessment parameters and the set confidence assessment conditions, and calculate the corrected sound velocity according to the following steps based on the assessment results: If the reference echo is valid, the reference echo weight is calculated based on the confidence judgment parameter, and then the corrected sound velocity is calculated by using the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight. If the reference echo is invalid, the temperature-compensated speed of sound will be taken as the corrected speed of sound. The round-trip time of the target echo between the ultrasonic transducer and the target under test is obtained, and the corrected distance between the ultrasonic transducer and the target under test is calculated by combining the corrected sound velocity.
[0007] As a further improvement to the above technical solution: Furthermore, the reliability judgment parameters include the signal-to-noise ratio and time jitter of the reference echo, the absolute value of the sound velocity difference between the temperature-compensated sound velocity and the reference measured sound velocity, the safety interval between the reference reflector and the target under test, the signal-to-noise ratio threshold, the time jitter threshold, the sound velocity difference threshold, the reference distance, and the temperature-compensated distance between the ultrasonic transducer and the target under test calculated based on the temperature-compensated sound velocity. The reliability criteria for determining the validity of the reference echo are as follows: The signal-to-noise ratio is not less than the signal-to-noise ratio threshold. The time jitter is not greater than the time jitter threshold; The absolute value of the sound speed difference is not greater than the sound speed difference threshold. The temperature compensation distance is greater than the sum of the reference distance and the safety interval.
[0008] Furthermore, the formula for calculating the reference echo weight is as follows: w R =0.2+0.7q; In the formula, w R The reference echo weight is q, which is the weight parameter. q=mq S +nq σ +fq c ; In the formula, m, n, and f are weighting coefficients, and q s For signal-to-noise ratio weights, q σ For time-based jitter weighting, q c Weighted by the difference in sound speed; q s =clip[(S R -S min ) / (S full -S min [0, 1]; In the formula, clip is the clipping function, and S R For signal-to-noise ratio, S min S is the signal-to-noise ratio threshold. full Full-weighted signal-to-noise ratio; q σ =clip[(σ max -σ R ) / (σ max -σ good [0, 1]; In the formula, σ max σ is the time jitter threshold. R For time jitter, σ good For good reference echo timing jitter; q c =clip[1-|c R -c T | / Δc max [,0,1]; In the formula, c R For reference to the measured speed of sound, c T To compensate for the speed of sound at temperature, Δc max The threshold value is the sound speed difference.
[0009] Further initial calibration is performed to determine the reference distance between the ultrasonic transducer and the reference reflector, and the fixed electronic delay is calculated.
[0010] Furthermore, temperature sensors are arranged around the ultrasonic transmitter. During initial calibration, the temperature sensors are calibrated at one or two points, and the temperature sequence is subjected to amplitude limiting and / or moving average filtering.
[0011] Furthermore, after the ultrasonic wave is emitted, the predicted arrival time of the reference echo is calculated based on the temperature-compensated sound velocity and the reference distance. The maximum allowable time deviation of the predicted arrival time is set to form a reference time window, and the reference echo is retrieved within the reference time window.
[0012] Furthermore, the sampled signals within the reference time window are subjected to bandpass filtering and / or envelope processing.
[0013] According to another aspect of the present invention, an ultrasonic ranging system based on sound velocity correction is also provided, characterized in that it comprises: Compensated sound velocity calculation module: used to obtain the ambient temperature and set the temperature compensation model, and calculate the temperature compensation sound velocity by inputting the ambient temperature into the temperature compensation model; Measured sound velocity calculation module: used to obtain the reference distance between the ultrasonic transducer and the reference reflector, as well as the reference echo round-trip time between the ultrasonic transducer and the reference reflector, in order to calculate the reference measured sound velocity; The corrected sound velocity calculation module is used to acquire and determine the confidence judgment parameters, set the confidence judgment conditions, determine whether the reference echo is valid based on the confidence judgment parameters and the set confidence judgment conditions, and calculate the corrected sound velocity according to the following steps based on the judgment result: If the reference echo is valid, the reference echo weight is calculated based on the confidence judgment parameter, and then the corrected sound velocity is calculated by using the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight. If the reference echo is invalid, the temperature-compensated speed of sound will be taken as the corrected speed of sound. Corrected distance calculation module: used to obtain the round-trip time of the target echo between the ultrasonic transducer and the target under test, and calculate the corrected distance between the ultrasonic transducer and the target under test by combining the corrected sound velocity.
[0014] According to another aspect of the present invention, an electronic device is also provided, including a processor and a memory, wherein a computer program is stored in the memory, and the processor executes the steps of the ultrasonic ranging method based on sound speed correction as described above by calling the computer program stored in the memory.
[0015] According to another aspect of the present invention, a computer-readable storage medium is also provided for storing a computer program that, when run on a computer, executes the steps of the ultrasonic ranging method based on sound speed correction as described above.
[0016] The present invention has the following beneficial effects: The ultrasonic ranging method based on sound velocity correction of this invention obtains the ambient temperature and sets a temperature compensation model. The ambient temperature is input into the temperature compensation model to calculate the temperature-compensated sound velocity, which is then used as a continuously usable prior value. The method also obtains the reference distance between the ultrasonic transducer and the reference reflector, as well as the round-trip time of the reference echo between them, to calculate the reference measured sound velocity, which is then used as a real-time verification value for actual propagation conditions. Furthermore, the method obtains and determines reliability judgment parameters and sets reliability judgment conditions. Based on these parameters and conditions, it determines whether the reference echo is valid. The reliability of the reference measured sound velocity calculated based on the reference echo is assessed to determine whether the quality of the reference echo meets requirements, thus suppressing ranging abrupt changes caused by abnormal changes in the reference echo. Based on the judgment result, the corrected sound velocity is calculated according to the following steps: if the reference echo is valid, the reference echo weight is calculated based on the reliability judgment parameters, and then the corrected sound velocity is calculated using the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight. The accuracy of the corrected sound velocity is improved through dual correction and weighted fusion calculation. If the reference echo is invalid, the temperature-compensated sound velocity is used as the corrected sound velocity, i.e., a safety backoff is performed when the reference echo undergoes abnormal changes, and the continuity of the measurement data is ensured by utilizing the continuity of the temperature-compensated sound velocity. By obtaining the round-trip time of the target echo between the ultrasonic transducer and the measured target, and combining it with the corrected sound velocity, the corrected distance between the ultrasonic transducer and the measured target is calculated, providing reliable data support for subsequent flow calculations. Based on the above steps, this scheme achieves dual-source complementarity through temperature-compensated sound velocity and reference measured sound velocity, reducing the residual error caused by the inconsistency between the temperature measurement point and the propagation path. The use of abnormally abrupt reference echoes is avoided through credibility judgment. The accuracy of the corrected sound velocity is provided through dual correction and weighted fusion calculation, and the continuity of the measurement data is ensured through safety backoff. Compared with existing technologies, the corrected sound velocity used for distance calculation has high accuracy, reliable ranging results, and can take into account both the ranging accuracy under normal working conditions and the ranging continuity under abnormal working conditions. It is highly practical and suitable for widespread promotion and application.
[0017] In addition, the ultrasonic ranging system based on sound speed correction of the present invention also has the above-mentioned advantages.
[0018] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description
[0019] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1This is a flowchart illustrating the steps of a preferred embodiment of the ultrasonic ranging method based on sound velocity correction according to the present invention. Figure 2 This is a schematic diagram of a preferred embodiment of the ultrasonic ranging system based on sound velocity correction of the present invention. Figure 3 This is a schematic block diagram of an electronic device according to a preferred embodiment of the present invention. Detailed Implementation
[0020] The following description provides specific application scenarios and requirements for this specification, intended to enable those skilled in the art to make and use the contents of this specification. Various partial modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments and applications without departing from the spirit and scope of this specification.
[0021] like Figure 1 As shown, a preferred embodiment of this application provides an ultrasonic ranging method based on sound velocity correction, used to measure the distance between an ultrasonic transducer and a target. A reference reflector is provided between the ultrasonic transducer and the target. The ultrasonic ranging method includes the following steps: S10: Obtain the ambient temperature and set the temperature compensation model. Input the ambient temperature into the temperature compensation model to calculate the temperature-compensated sound velocity. S20: Obtain the reference distance between the ultrasonic transducer and the reference reflector, as well as the reference echo round-trip time between the ultrasonic transducer and the reference reflector, in order to calculate the reference measured sound velocity. S30: Obtain and determine the confidence assessment parameters, set the confidence assessment conditions, determine whether the reference echo is valid based on the confidence assessment parameters and the set confidence assessment conditions, and calculate the corrected sound velocity according to the following steps based on the assessment results: S31: If the reference echo is valid, the reference echo weight is calculated based on the confidence judgment parameter, and the corrected sound velocity is then calculated using the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight. S32: If the reference echo is invalid, the temperature-compensated speed of sound will be taken as the corrected speed of sound; S40: Obtain the round-trip time of the target echo between the ultrasonic transducer and the target under test, and calculate the corrected distance between the ultrasonic transducer and the target under test by combining the corrected sound velocity.
[0022] like Figure 1As shown, specifically, the ultrasonic ranging method based on sound velocity correction in this embodiment obtains the ambient temperature and sets a temperature compensation model. The ambient temperature is input into the temperature compensation model to calculate the temperature-compensated sound velocity, which is used as a continuously usable prior value. The reference distance between the ultrasonic transducer and the reference reflector, as well as the round-trip time of the reference echo between the ultrasonic transducer and the reference reflector, are obtained to calculate the reference measured sound velocity, which is used as a real-time verification value for the actual propagation conditions. By obtaining and determining the reliability judgment parameters and setting the reliability judgment conditions, the validity of the reference echo is determined based on the reliability judgment parameters and the set reliability judgment conditions. The reliability of the reference measured sound velocity calculated based on the reference echo is judged to determine whether the quality of the reference echo meets the requirements, so as to suppress the ranging change caused by abnormal change in the reference echo. According to the judgment result, the corrected sound velocity is calculated according to the following steps: If the reference echo is valid, the reference echo weight is calculated based on the reliability judgment parameters, and then the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight are used to calculate the corrected sound velocity. The corrected sound velocity is obtained, and its accuracy is improved through dual correction and weighted fusion calculation. If the reference echo is invalid, the temperature-compensated sound velocity is adopted as the corrected sound velocity, i.e., a safety backoff is performed when the reference echo undergoes abnormal changes, and the continuity of the measurement data is ensured by utilizing the continuity of the temperature-compensated sound velocity. By obtaining the round-trip time of the target echo between the ultrasonic transducer and the measured target, the corrected distance between the ultrasonic transducer and the measured target is calculated in combination with the corrected sound velocity, providing reliable data support for subsequent flow calculation. Based on the above steps, this scheme achieves dual-source complementarity through temperature-compensated sound velocity and reference measured sound velocity, reducing the residual error caused by the inconsistency between the temperature measurement point and the propagation path. The use of abnormally abrupt reference echoes is avoided through credibility judgment. The accuracy of the corrected sound velocity is provided through dual correction and weighted fusion calculation, and the continuity of the measurement data is ensured through safety backoff. Compared with the existing technology, the corrected sound velocity used for distance calculation has high accuracy, reliable ranging results, and can take into account both the ranging accuracy under normal working conditions and the ranging continuity under abnormal working conditions. It is highly practical and suitable for widespread promotion and application.
[0023] In this embodiment, the reference reflector is a standard rod. In another embodiment, the reference reflector is a rod with a planar reflective end, a thin sheet reflector, a ring reflector, or a fixed reflective component located in a local area of the main beam. Its effective reflection distance can be set to other fixed values that are greater than the conventional blind zone, depending on the blind zone and range.
[0024] Optionally, the temperature compensation model can employ analytical expressions, piecewise linear tables, lookup table interpolation, polynomial fitting, or empirical models calibrated on-site. Humidity or air pressure can also be introduced as additional corrections.
[0025] Optionally, the ambient temperature can be obtained through a temperature sensor.
[0026] It should be understood that since temperature sensors are usually placed around ultrasonic transducers, the temperature they acquire may differ from the average temperature along the actual propagation path of the ultrasonic wave, resulting in residual errors. This embodiment achieves dual-source complementarity by using temperature-compensated sound velocity and reference measured sound velocity, which can reduce the residual errors caused by the inconsistency between the temperature measurement point and the propagation path.
[0027] In this embodiment, before step S10, the method further includes: performing initialization calibration to determine the reference distance between the ultrasonic transducer and the reference reflector, and calculating the fixed electronic delay. Specifically, by ensuring the reliability of the reference distance, the accuracy of the calculated reference measured sound velocity is guaranteed. By calculating the fixed electronic delay, the deviation caused by the fixed electronic delay is eliminated during the sound velocity calculation, further improving the accuracy of the calculation results.
[0028] In this embodiment, during initial calibration, under the conditions that the reference reflector is not obstructed by the target being measured, the ambient temperature is stable, and the temperature sensor reading is valid, the reference distance L between the ultrasonic transducer and the reference reflector is first determined using a measuring tool or positioning fixture. R ; Ultrasonic transducer continuously emits Nc al Frame ultrasound (N cal 16 to 64 frames can be selected, preferably 32 frames, and the arrival time t of the reference echo for each frame is recorded. Ri After removing outlier frames that exceed the median ± 3 times the median absolute deviation, the median t is taken. R0 , with the calibrated temperature T cal c is calculated according to the temperature compensation model. Tcal and according to t0=t R0 -2L R / c Tcal Calculate the fixed electronic delay t0.
[0029] In this embodiment, since temperature sensors are arranged around the ultrasonic transmitter, single-point or two-point calibration is performed on the temperature sensors during initialization calibration, and the temperature sequence is subjected to amplitude limiting and / or moving average filtering. Specifically, the above steps ensure the measurement accuracy of the temperature sensors, thereby ensuring the accuracy of the calculated temperature-compensated sound velocity.
[0030] In this embodiment, the temperature compensation model is c. T =331.45×√(1+T / 273.15), when the ambient temperature exceeds the preset physical range, the amplitude is limited; since the temperature compensation model does not depend on the reference echo, it can be used as the safety backoff speed when the reference echo is invalid.
[0031] In this embodiment, after the ultrasonic wave is emitted, the predicted arrival time of the reference echo is calculated based on the temperature-compensated sound velocity and the reference distance. A maximum allowable time deviation of the predicted arrival time is set to form a reference time window, within which the reference echo is retrieved. Specifically, based on the above steps, the prior information of the fixed physical position of the reference reflector is used to constrain the search range of the reference echo within the reference time window, effectively cutting off the mechanical aftershock signal after the ultrasonic transducer emits the ultrasonic wave, and shielding the channel sidewall reflections and secondary and tertiary stray echoes outside the time window. This helps reduce the amount of data processing and avoids echo misjudgment caused by strong near-field interference or far-field multipath effects, providing a stable and reliable reference echo data source for subsequent steps. In addition, the reference window of the reference reflector with a fixed reference distance is separated from the ordinary liquid surface echo screening logic to avoid the reference echo being mistakenly rejected because it is close to the conventional blind zone threshold. Optionally, the maximum allowable time deviation of the predicted arrival time Δt W The Δt value is 50 μs to 100 μs. Preferably, Δt W It is 75 μs. It should be understood that Δt W The selection was based on the assembly tolerance of the reference reflector, the maximum residual of the temperature compensation model, and the sampling timing resolution.
[0032] In this embodiment, the sampled signal within the reference time window is bandpass filtered and / or envelope processed. Specifically, by bandpass filtering the sampled signal within the reference time window, low-frequency vibration noise and high-frequency circuit spike interference mixed in the time window are removed, so that the energy spectrum of the remaining signal within the window is highly concentrated within the effective frequency band of the transducer, significantly improving the signal-to-noise ratio of the reference echo. This creates high-purity signal conditions for accurate measurement of the reference echo round-trip time, and even under wide temperature range operating conditions, the amplitude-frequency characteristics of the reference echo used to calculate the speed of sound remain stable and will not lose effective signal components due to frequency drift. By enveloping the sampled signal within the reference time window, the slight time measurement error caused by waveform phase jitter is effectively avoided, making the extracted reference echo round-trip time highly repeatable.
[0033] In this embodiment, the reliability determination parameters include the signal-to-noise ratio and time jitter of the reference echo, the absolute value of the sound velocity difference between the temperature-compensated sound velocity and the reference measured sound velocity, the safety interval between the reference reflector and the target under test, the signal-to-noise ratio threshold, the time jitter threshold, the sound velocity difference threshold, the reference distance, and the temperature-compensated distance between the ultrasonic transducer and the target under test calculated based on the temperature-compensated sound velocity. The reliability criteria for determining the validity of the reference echo are as follows: The signal-to-noise ratio is not less than the signal-to-noise ratio threshold. The time jitter is not greater than the time jitter threshold; The absolute value of the sound speed difference is not greater than the sound speed difference threshold. The temperature compensation distance is greater than the sum of the reference distance and the safety interval.
[0034] Specifically, by using the aforementioned reliability judgment parameters and reliability judgment conditions, the validity of the reference echo is determined, thereby suppressing abnormal changes in the reference echo to the greatest extent and ensuring ranging accuracy under normal operating conditions.
[0035] Optionally, the signal-to-noise ratio is calculated as follows: calculate the candidate peak value A. P and the root mean square amplitude A of the noise windows on both sides N S was obtained R =20log10(A P / A N ).
[0036] Optionally, the signal-to-noise ratio threshold S min The value is 6 dB to 15 dB. Preferably, S min The value is 10dB; it should be understood that the signal-to-noise ratio threshold is selected based on the statistics of the empty window noise and the false detection rate.
[0037] Optionally, the time jitter threshold σ max The duration is 5 μs to 30 μs. Preferably, σ max The duration is 20 μs.
[0038] Optionally, the sound speed difference threshold Δc max The speed is 5 m / s to 30 m / s. Preferably, Δc max The value is 15 m / s. Specifically, the sound velocity difference threshold is used to exclude outliers where there is a significant discrepancy between the temperature-compensated sound velocity and the reference measured sound velocity.
[0039] Optionally, the safety interval d safe The distance is 30 mm to 80 mm. Preferably, the safety interval is 50 mm. Specifically, the safety interval ensures that the time interval between the target echo and the reference echo is greater than the reference window and the echo pulse is broadened, so as to avoid the measured target from getting too close to the reference reflector and causing aliasing.
[0040] It should be understood that the above values are all adjustable embodiments, and can be recalibrated according to the ultrasonic transducer frequency, emission pulse width, reference reflector assembly tolerance and on-site noise in actual applications.
[0041] In this embodiment, the formula for calculating the reference echo weight is as follows: w R =0.2+0.7q; In the formula, w R The reference echo weight is q, which is the weight parameter. q=mq S +nq σ +fq c ; In the formula, m, n, and f are weighting coefficients, and q s For signal-to-noise ratio weights, q σ For time-based jitter weighting, q c Weighted by the difference in sound speed; q s =clip[(S R -S min ) / (S full -S min [0, 1]; In the formula, clip is the clipping function, and S R For signal-to-noise ratio, S min S is the signal-to-noise ratio threshold. full Full-weighted signal-to-noise ratio; q σ =clip[(σ max -σ R ) / (σ max -σ good [0, 1]; In the formula, σ max σ is the time jitter threshold. R For time jitter, σ good For good reference echo timing jitter; q c =clip[1-|c R -c T | / Δc max [,0,1]; In the formula, c R For reference to the measured speed of sound, c T To compensate for the speed of sound at temperature, Δc max The threshold value is the sound speed difference.
[0042] Specifically, the reference echo weight is accurately calculated based on the above formula to ensure the accuracy of the subsequent calculation of the corrected sound velocity.
[0043] Optionally, in one embodiment, the weighting coefficients m is 0.5, n is 0.3, and f is 0.2.
[0044] It should be understood that the weighting coefficients can be adjusted according to the on-site error statistics, m+n+f=1.
[0045] Alternatively, in another embodiment, the reference echo weights employ threshold switching, robust median fusion, or amplitude-limited recursive filtering.
[0046] Optionally, the reference echo and the target echo can be acquired within different time windows of the same transmission, or independent measurement cycles with alternating transmissions, different pulse codes, or different gain levels can be used.
[0047] In this embodiment, the corrected distance D=cF ×(t W -t0) / 2+D0, where t W Given the target echo round-trip time and the installation offset of the ultrasonic transducer D0, the height of the target to be measured, h = H0 - D, is obtained based on the installation height H0. When the target to be measured is the liquid level of a certain open channel, h is input into the flow relationship formula of the open channel to calculate the instantaneous flow rate and cumulative flow rate. That is, the engineering parameters are not rewritten, and the compatibility is strong.
[0048] In one embodiment, a certain type of ultrasonic ranging open channel flow meter employs the aforementioned ultrasonic ranging method based on sound velocity correction. The ultrasonic ranging open channel flow meter includes an ultrasonic transducer, a temperature sensor disposed around the ultrasonic transducer, a reference reflector, and a controller. The reference reflector is a slender standard rod with a fixed effective reflecting end, and the standard rod is disposed along the main beam direction. The nominal one-way distance L between the reflecting end of the standard rod and the ultrasonic transducer is... R The cross-section of the standard rod is 25cm; the cross-section of the standard rod is smaller than the effective cross-section of the main beam, so that it can retain the propagation path of the water surface echo while forming a stable reference echo.
[0049] When measuring the distance between an ultrasonic distance-measuring open channel flow meter and a liquid surface, the following steps are included: Initialization calibration: Reference distance L between the ultrasonic transducer and the reference reflector R =0.25m, the safety interval d between the reference reflector and the target being measured. safe =0.05m; calibrated temperature T collected by the temperature sensor cal =20.0℃, input the calibration temperature into the temperature compensation model, and calculate the calibration sound velocity as c. Tcal =331.45×√(1+T cal / 273.15), c Tcal ≈343.37 m / s; The median arrival time t after continuously acquiring 32 frames of reference echoes by the ultrasonic transducer and removing outlier frames is approximately 343.37 m / s. R0 =1.516ms, the fixed electronic delay t0=t R0 -2L R / c Tcal =1.516ms-2×0.2500 / 343.37s, t0≈60μs; Temperature-compensated sound velocity calculation: During operation, the ambient temperature collected by the temperature sensor is T=25.0℃. This ambient temperature is input into the temperature compensation model to calculate the temperature-compensated sound velocity c. T ≈346.29m / s; Reference echo extraction and reference measured sound velocity calculation: Predicted arrival time t P =t0+2L R / c T=60μs + 2×0.2500 / 346.29s, t P ≈1.504ms, setting the maximum allowable time deviation Δt for the predicted arrival time. W =75μs, the reference echo is retrieved within the reference time window of 1.429ms to 1.579ms; based on the reference echo measured in the most recent 8 frames, the signal-to-noise ratio S is calculated. R =18dB, time jitter σ R =6μs, reference echo round-trip time t R =1.504ms, t R -t0=1.444ms, referencing the measured speed of sound c R =2L R / (t R -t0) = 2 × 0.2500 / 1.444 ms, c R ≈346.26m / s; Feasibility assessment; Signal-to-noise ratio threshold S min =10dB, time jitter threshold σ max =20μs, sound velocity difference threshold Δc max =15m / s, since the signal-to-noise ratio is not less than the signal-to-noise ratio threshold, the time jitter is not greater than the time jitter threshold, the absolute value of the sound velocity difference is not greater than the sound velocity difference threshold, and the temperature-compensated distance D1 between the ultrasonic transducer and the target obtained based on the temperature-compensated sound velocity calculation is 0.82m, d safe +L R =0.05m + 0.25mm = 0.30mm, D1 > d safe +L R Reference echo is valid; Corrected sound velocity calculation; calculated signal-to-noise ratio weight q s ≈0.83, time jitter weight q σ ≈0.93, weight of sound velocity difference q c ≈1.00, reference echo weight w R ≈0.83, corrected for the speed of sound c F =w R ×c R +(1-w R )×c T =0.83×346.26+0.17×346.29, c F ≈346.27m / s; Corrected distance calculation: The round-trip time t of the target echo between the ultrasonic transducer and the target being measured. W =4.735ms, installation offset D0=0, correction distance D=c F ×(t W-t0) / 2+D0, D≈0.810m; if the water level subsequently rises so that D1≤0.300m, S R ≤10dB, σ R >20μs、|c R -c T If |>15m / s, then the reference echo for that frame is invalid, i.e., let c F =c T D=D1, and simultaneously output the reference echo invalid status code.
[0050] like Figure 2 As shown, another preferred embodiment of this application also provides an ultrasonic ranging system based on sound velocity correction, characterized in that it includes: Compensated sound velocity calculation module: used to obtain the ambient temperature and set the temperature compensation model, and calculate the temperature compensation sound velocity by inputting the ambient temperature into the temperature compensation model; Measured sound velocity calculation module: used to obtain the reference distance between the ultrasonic transducer and the reference reflector, as well as the reference echo round-trip time between the ultrasonic transducer and the reference reflector, in order to calculate the reference measured sound velocity; The corrected sound velocity calculation module is used to acquire and determine the confidence judgment parameters, set the confidence judgment conditions, determine whether the reference echo is valid based on the confidence judgment parameters and the set confidence judgment conditions, and calculate the corrected sound velocity according to the following steps based on the judgment result: If the reference echo is valid, the reference echo weight is calculated based on the confidence judgment parameter, and then the corrected sound velocity is calculated by using the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight. If the reference echo is invalid, the temperature-compensated speed of sound will be taken as the corrected speed of sound. Corrected distance calculation module: used to obtain the round-trip time of the target echo between the ultrasonic transducer and the target under test, and calculate the corrected distance between the ultrasonic transducer and the target under test by combining the corrected sound velocity.
[0051] This embodiment provides an ultrasonic ranging system based on sound velocity correction, which employs the ultrasonic ranging method based on sound velocity correction described in the above embodiments to solve the technical problem of unreliable ranging results in existing ultrasonic ranging technologies. Compared with the prior art, the beneficial effects of the ultrasonic ranging system based on sound velocity correction provided in this embodiment are the same as those of the ultrasonic ranging method based on sound velocity correction provided in the above embodiments, and other technical features of the ultrasonic ranging system based on sound velocity correction are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0052] like Figure 3As shown, another preferred embodiment of this application also provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and the processor executes the steps of the ultrasonic ranging method based on sound speed correction as described above by calling the computer program stored in the memory.
[0053] The electronic device provided in this embodiment employs the ultrasonic ranging method based on sound speed correction described in the above embodiments to solve the technical problem of ultrasonic ranging based on sound speed correction. Compared with the prior art, the beneficial effects of the electronic device provided in this embodiment are the same as those of the ultrasonic ranging method based on sound speed correction provided in the above embodiments, and other technical features in the electronic device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0054] Another embodiment of this application provides a computer-readable storage medium for storing a computer program that, when run on a computer, executes the steps of the ultrasonic ranging method based on sound speed correction as described above.
[0055] Common computer-readable storage media include: floppy disks, flexible disks, hard disks, magnetic tapes, any other magnetic media, CD-ROMs, any other optical media, punch cards, paper tape, any other physical media with perforated patterns, random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash erasable programmable read-only memory (FLASH-EPROM), any other memory chips or cartridges, or any other media readable by a computer. Instructions may further be transmitted or received by a transmission medium. The term transmission medium can include any tangible or intangible medium used to store, encode, or carry instructions for execution by a machine, and includes digital or analog carrier communication signals or intangible media that facilitate communication of such instructions. Transmission media include coaxial cables, copper wires, and optical fibers, which contain conductors for transmitting a bus of computer data signals.
[0056] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0057] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0058] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0059] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0060] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0061] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
[0062] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. An ultrasonic ranging method based on sound velocity correction, used to measure the distance between an ultrasonic transducer and a target, wherein a reference reflector is provided between the ultrasonic transducer and the target, characterized in that, The ultrasonic ranging method includes the following steps: The ambient temperature is obtained and a temperature compensation model is set. The ambient temperature is input into the temperature compensation model to calculate the temperature-compensated speed of sound. The reference distance between the ultrasonic transducer and the reference reflector, as well as the reference echo round-trip time between the ultrasonic transducer and the reference reflector, are obtained in order to calculate the reference measured sound velocity. Obtain and determine the confidence assessment parameters, set the confidence assessment conditions, determine whether the reference echo is valid based on the confidence assessment parameters and the set confidence assessment conditions, and calculate the corrected sound velocity according to the following steps based on the assessment results: If the reference echo is valid, the reference echo weight is calculated based on the confidence judgment parameter, and then the corrected sound velocity is calculated by using the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight. If the reference echo is invalid, the temperature-compensated speed of sound will be taken as the corrected speed of sound. The round-trip time of the target echo between the ultrasonic transducer and the target under test is obtained, and the corrected distance between the ultrasonic transducer and the target under test is calculated by combining the corrected sound velocity.
2. The ultrasonic ranging method based on sound velocity correction according to claim 1, characterized in that, The reliability judgment parameters include the signal-to-noise ratio and time jitter of the reference echo, the absolute value of the sound velocity difference between the temperature-compensated sound velocity and the reference measured sound velocity, the safety interval between the reference reflector and the target under test, the signal-to-noise ratio threshold, the time jitter threshold, the sound velocity difference threshold, the reference distance, and the temperature-compensated distance between the ultrasonic transducer and the target under test calculated based on the temperature-compensated sound velocity. The reliability criteria for determining the validity of the reference echo are as follows: The signal-to-noise ratio is not less than the signal-to-noise ratio threshold. The time jitter is not greater than the time jitter threshold; The absolute value of the sound speed difference is not greater than the sound speed difference threshold. The temperature compensation distance is greater than the sum of the reference distance and the safety interval.
3. The ultrasonic ranging method based on sound velocity correction according to claim 2, characterized in that, The formula for calculating the reference echo weight is as follows: w R =0.2+0.7q; In the formula, w R The reference echo weight is q, which is the weight parameter. q=mq S +nq σ +fq c ; In the formula, m, n, and f are weighting coefficients, and q s For signal-to-noise ratio weights, q σ For time-based jitter weighting, q c Weighted by the difference in sound speed; q s =clip[(S R -S min ) / (S full -S min ),0,1]; In the formula, clip is the clipping function, and S R For signal-to-noise ratio, S min S is the signal-to-noise ratio threshold. full Full-weighted signal-to-noise ratio; q σ =clip[(s max -s R ) / (s max -s good ),0,1]; In the formula, σ max σ is the time jitter threshold. R For time jitter, σ good For good reference echo timing jitter; q c =clip[1-|c R -c T | / Δc max ,0,1]; In the formula, c R For reference to the measured speed of sound, c T To compensate for the speed of sound at temperature, Δc max The threshold value is the sound speed difference.
4. The ultrasonic ranging method based on sound velocity correction according to any one of claims 1-3, characterized in that, Initial calibration is performed to determine the reference distance between the ultrasonic transducer and the reference reflector, and the fixed electronic delay is calculated.
5. The ultrasonic ranging method based on sound velocity correction according to claim 4, characterized in that, Temperature sensors are arranged around the ultrasonic transmitter. During initialization calibration, the temperature sensors are calibrated at one or two points, and the temperature sequence is subjected to amplitude limiting and / or moving average filtering.
6. The ultrasonic ranging method based on sound velocity correction according to any one of claims 1-3, characterized in that, After the ultrasonic wave is emitted, the predicted arrival time of the reference echo is calculated based on the temperature-compensated sound velocity and the reference distance. The maximum allowable time deviation of the predicted arrival time is set to form a reference time window, and the reference echo is retrieved within the reference time window.
7. The ultrasonic ranging method based on sound velocity correction according to claim 6, characterized in that, Bandpass filtering and / or envelope processing are performed on the sampled signal within the reference time window.
8. An ultrasonic ranging system based on sound velocity correction, characterized in that, include: Compensated sound velocity calculation module: used to obtain the ambient temperature and set the temperature compensation model, and calculate the temperature compensation sound velocity by inputting the ambient temperature into the temperature compensation model; Measured sound velocity calculation module: used to obtain the reference distance between the ultrasonic transducer and the reference reflector, as well as the reference echo round-trip time between the ultrasonic transducer and the reference reflector, in order to calculate the reference measured sound velocity; The corrected sound velocity calculation module is used to acquire and determine the confidence judgment parameters, set the confidence judgment conditions, determine whether the reference echo is valid based on the confidence judgment parameters and the set confidence judgment conditions, and calculate the corrected sound velocity according to the following steps based on the judgment result: If the reference echo is valid, the reference echo weight is calculated based on the confidence judgment parameter, and then the corrected sound velocity is calculated by using the temperature-compensated sound velocity, the reference measured sound velocity, and the reference echo weight. If the reference echo is invalid, the temperature-compensated speed of sound will be taken as the corrected speed of sound. Corrected distance calculation module: used to obtain the round-trip time of the target echo between the ultrasonic transducer and the target under test, and calculate the corrected distance between the ultrasonic transducer and the target under test by combining the corrected sound velocity.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor executes the steps of the ultrasonic ranging method based on sound speed correction as described in any one of claims 1-7 by calling the computer program stored in the memory.
10. A computer-readable storage medium for storing computer programs, characterized in that, The computer program executes the steps of the ultrasonic ranging method based on sound velocity correction as described in any one of claims 1-7 when it runs on a computer.
Citation Information
Patent Citations
Automatically-calibrated ultrasonic liquid level measuring system
CN104266718A
