Disclosure of Invention
The invention provides an ultrasonic radar ranging method and device, which aim to overcome the defects in the prior art and improve the ranging accuracy while reducing the same-frequency interference of an ultrasonic radar.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
in one aspect, the present invention provides an ultrasonic radar ranging method, including:
step 1, controlling a radar system to work in a first mode, wherein the first mode is a random mode in a built-in radar working mode;
step2, obtaining the initial distance of the obstacle according to the echo of each radar sensor;
Step 3, synchronizing with the radar system wave, acquiring an image in the radar system field of view, identifying whether an obstacle exists, if so, acquiring a reference distance from the obstacle, otherwise, executing step 5;
Step 4, judging whether the absolute value of the difference value between the reference distance and the initial distance is larger than a preset error threshold value, if yes, executing step 5, otherwise, judging that the initial distance meets the preset requirement;
And 5, controlling the radar system to work in a second mode, and returning to the step 2, wherein the second mode is a random mode except the first mode in the built-in radar working mode.
Specifically, the step2 includes:
Step 201, sampling a continuous preset number of echo signals in a preset period, and storing obtained sampling points;
step 202, determining the peak value of each echo signal according to the sampling points;
step 203, determining the maximum peak value of the peak values and the corresponding period serial number of the echo signals;
step 204, determining a reference point, wherein the reference point is a peak point which is larger than the ratio of the maximum peak value to the cycle number of the echo signal corresponding to the maximum peak value;
step 205, searching a first pair of adjacent sampling points which accord with preset amplitude characteristics from the reference point backwards, wherein the preset amplitude characteristics are that the amplitude of a front sampling point in the adjacent sampling points is positive, and the amplitude of a rear sampling point is negative;
Step 206, calculating echo time according to a first preset formula;
Step 206, calculating the initial distance of the obstacle according to a second preset formula.
Specifically, the first preset formula is:
Δt=ts { m+a (m)/[ (a (m) -a (m+1) ] }, wherein Δt represents the echo time, ts represents the sampling period, m represents the storage sequence number of the preceding sampling point, a (m) represents the amplitude of the preceding sampling point, and a (m+1) represents the amplitude of the following sampling point.
Specifically, the second preset formula is:
Si=c×Δt/2, where Si represents the initial distance of the obstacle, c represents the sound velocity, and Δt represents the echo time.
Further, after the step 4, the method further includes:
and step 41, judging whether the initial distance is matched with the current probe configuration parameters, if so, taking the initial distance as a final measurement distance, otherwise, switching the probe configuration parameters to the probe configuration parameters matched with the initial distance, and returning to the step 1.
Specifically, the current probe configuration parameter is a default probe configuration parameter or a last used probe configuration parameter.
Specifically, the probe configuration parameters comprise the number of the probes, the measurement time, the amplification factor and the sensitivity.
Another aspect of the present invention provides an ultrasonic radar ranging apparatus, comprising: the system comprises a control module, a radar sensor group, an image sensor, an error judging module, a first distance calculating module and a second distance calculating module, wherein the radar sensor group, the image sensor and the error judging module are connected with the control module;
The radar sensor group comprises at least three radar sensors and is used for working according to a mode set by the control module, and transmitting or/and receiving detection sound waves;
The image sensor is used for acquiring images in the field of view of the radar system;
the first distance calculation module is used for obtaining the initial distance of the obstacle according to a preset calculation rule through the echo;
The second distance calculation module is used for obtaining the reference distance of the obstacle according to the image;
The error judging module is used for sending a radar working mode switching signal to the control module according to the relation between the reference distance and the initial distance;
the control module is used for setting an initial working mode of the radar sensor group and receiving a working mode switching signal sent by the error judging module to switch the working mode of the radar sensor group.
Further, the first distance calculation module is also connected with the control module, and further comprises a configuration storage module connected with the control module, which is used for storing probe configuration parameters corresponding to each detection distance interval of the radar sensor;
and the control module is used for reading the matched probe configuration parameters from the configuration storage module to configure the working parameters of the radar sensor group when the initial distance is not matched with the current probe configuration parameters.
Specifically, the image sensor is a wide-angle camera.
The invention has the beneficial effects that: according to the invention, the radar system is controlled to work in a randomly selected mode, the initial distance of the obstacle is obtained according to the echo, the reference distance is obtained according to the image, and then whether the working mode of the radar system is changed is determined according to the relation between the reference distance and the initial distance, so that the accuracy of ranging is improved while the same-frequency interference of the ultrasonic radar is reduced.
Detailed Description
Embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which are for reference and illustration only, and are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, the present embodiment provides an ultrasonic radar ranging method, including:
Step 1, controlling a radar system to work in a first mode, wherein the first mode is a random mode in a built-in radar working mode.
In this embodiment, the radar system includes at least three radars, namely, a first radar, a second radar and a third radar, each of which can operate in a direct measurement mode and an indirect measurement test mode, and each of which can receive echoes transmitted by itself and adjacent radars.
The built-in radar operation modes can be combined according to the measurement mode and the wave-generating mode of each radar. As one example of implementation, some built-in radar modes of operation are as follows:
1) The first radar and the second radar send sound waves with fixed frequency and receive echo signals of the first radar and the second radar, and the third radar and the fourth radar do not send waves but receive echoes of the first radar and the second radar;
2) The first radar and the third radar send sound waves with fixed frequency, and the second radar and the fourth radar receive echoes;
3) The first radar transmits a decreasing LFM sound wave, the second radar transmits an increasing LFM sound wave, the third radar and the fourth radar receives an echo;
4) The third radar transmits an incremental LFM sound wave, the fourth radar transmits a decremental LFM sound wave, and the first radar and the second radar work to receive echoes;
5) Etc.
LFM is an abbreviation of Linear Frequency Modulation, i.e. chirping, LFM signal means a signal whose instantaneous frequency varies linearly with time.
And 2, obtaining the initial distance of the obstacle according to the echo of each radar sensor.
In this embodiment, the step 2 includes:
Step 201, sampling a preset number of echo signals continuously in a preset period, and storing the obtained sampling points.
For example, if the preset number is n, the cycle number i of each echo signal is sequentially 1,2,3 … n-1.
And 202, determining the peak value of each echo signal according to the sampling points.
Step 203, determining the maximum peak value of the peak values and the corresponding period sequence number of the echo signals.
Step 204, determining a reference point, where the reference point is a peak point that is greater than a ratio of the maximum peak value to a cycle number of the echo signal corresponding to the maximum peak value.
Step 205, searching a first pair of adjacent sampling points which accord with preset amplitude characteristics from the reference point backwards, wherein the preset amplitude characteristics are that the amplitude of a front sampling point in the adjacent sampling points is positive, and the amplitude of a rear sampling point is negative.
Step 206, calculating the echo time according to a first preset formula.
In this embodiment, the first preset formula is:
Δt=ts { m+a (m)/[ (a (m) -a (m+1) ] }, wherein Δt represents the echo time, ts represents the sampling period, m represents the storage sequence number of the preceding sampling point, a (m) represents the amplitude of the preceding sampling point, and a (m+1) represents the amplitude of the following sampling point.
Step 206, calculating the initial distance of the obstacle according to a second preset formula.
In this embodiment, the second preset formula is:
Si=c×Δt/2, where Si represents the initial distance of the obstacle, c represents the sound velocity, and Δt represents the echo time.
And step 3, synchronizing with the radar system wave, acquiring an image in the radar system field of view, identifying whether an obstacle exists, if so, acquiring a reference distance from the obstacle, otherwise, executing step 5.
The distance between the image acquisition and the obstacle is the prior art and will not be described in detail here.
If it is determined by image recognition that no obstacle exists in the image in the field of view of the radar system, it may be determined that the echo signal received in step 2 is an interference signal, the initial distance should be ignored, and the operation mode of the radar is changed.
And step 4, judging whether the absolute value of the difference value between the reference distance and the initial distance is larger than a preset error threshold value, if so, executing step 5, otherwise, judging that the initial distance meets the preset requirement.
In this embodiment, the preset error threshold may be determined according to an actual calibration.
And 5, controlling the radar system to work in a second mode, and returning to the step 2, wherein the second mode is a random mode except the first mode in the built-in radar working mode.
As shown by calculation, by using the above steps, if the refresh period of the obstacle distance of the system is 100ms and the wave-generating period (working period) of the radar system is 10ms, the co-channel interference probability P at the same position and the same time is:
Wherein, Indicating the number of combinations selected to operate in the first mode for two transmit cycles in a 100ms refresh period,Indicating the number of combinations of the other 8 transmit cycles in which two transmit cycles are selected to operate in the second mode.
Therefore, the interference probability of the ultrasonic radar can be greatly reduced through random wave generation.
And error judgment is carried out by fusing the reference distance of the camera, so that interference is further filtered.
Example 2
Unlike embodiment 1, this embodiment further includes, after the step4:
and step 41, judging whether the initial distance is matched with the current probe configuration parameters, if so, taking the initial distance as a final measurement distance, otherwise, switching the probe configuration parameters to the probe configuration parameters matched with the initial distance, and returning to the step 1.
In a specific embodiment, according to each detection distance interval (0.5 m/2m/3 m) of the radar, a plurality of corresponding groups of probe configuration parameters, such as probe configuration parameters A, B, C, are stored in advance.
In this embodiment, the probe configuration parameters include, but are not limited to, number of hairs, measurement time, amplification factor, sensitivity.
In this embodiment, the current probe configuration parameter is a default probe configuration parameter or a probe configuration parameter used last time.
For example, if the probe configuration parameter a (corresponding to a 0.5m probe distance interval) is currently used and the initial ranging of the radar is 1.2m, the measurement result is not very accurate, and thus in order to obtain a more accurate measurement result, the probe configuration parameter may be switched to B.
According to the embodiment, the initial distance is dynamically matched with the corresponding probe configuration parameters, so that distance measurement is more accurate.
Example 3
As shown in fig. 2, the present embodiment provides an ultrasonic radar ranging apparatus, including: the system comprises a control module, a radar sensor group, an image sensor, an error judging module, a first distance calculating module and a second distance calculating module, wherein the radar sensor group, the image sensor and the error judging module are connected with the control module;
The radar sensor group comprises at least three radar sensors and is used for working according to a mode set by the control module, and transmitting or/and receiving detection sound waves;
The image sensor is used for acquiring images in the field of view of the radar system;
the first distance calculation module is used for obtaining the initial distance of the obstacle according to a preset calculation rule;
The second distance calculation module is used for obtaining the reference distance of the obstacle according to the image;
The error judging module is used for sending a radar working mode switching signal to the control module according to the relation between the reference distance and the initial distance;
the control module is used for setting an initial working mode of the radar sensor group and receiving a working mode switching signal sent by the error judging module to switch the working mode of the radar sensor group.
In this embodiment, the image sensor is a wide-angle camera.
The working process of the ultrasonic radar ranging device in this embodiment corresponds to the method described in embodiment 1, and is not described again.
Example 4
As shown in fig. 3, unlike embodiment 3, in the ultrasonic radar ranging apparatus provided in this embodiment, the first distance calculating module is further connected to the control module, and further includes a configuration storage module connected to the control module, and configured to store probe configuration parameters corresponding to each detection distance interval of the radar sensor;
and the control module is used for reading the matched probe configuration parameters from the configuration storage module to configure the working parameters of the radar sensor group when the initial distance is not matched with the current probe configuration parameters.
The working process of the ultrasonic radar ranging device in this embodiment corresponds to the method described in embodiment 2, and is not described again.
The above disclosure is illustrative of the preferred embodiments of the present invention and should not be construed as limiting the scope of the invention, which is defined by the appended claims.