Disclosure of Invention
The invention mainly aims to provide an ultrasonic distance measurement obstacle avoidance method, and aims to solve the technical problem that detection and judgment are easily affected by interference signals in the ultrasonic distance measurement obstacle avoidance process.
In order to achieve the above object, the present invention provides an ultrasonic ranging obstacle avoidance method, which includes an ultrasonic ranging device, and includes the following steps:
the ultrasonic ranging device approaches a target obstacle and transmits a first ultrasonic signal to the target obstacle, and the first ultrasonic signal is reflected by the target obstacle to form a first reflected signal;
receiving the first reflected signal;
comparing the first reflection signal with a reference threshold corresponding to the current position;
judging whether the first reflection signal exceeds a reference threshold value;
and if so, executing obstacle avoidance action, and if not, continuing to approach the obstacle.
Further, the reference threshold includes a preset threshold and a recording threshold, and the recording threshold is obtained by measuring a usage environment.
Further, before the approaching to the target obstacle and the transmitting of the first ultrasonic signal to the target obstacle, the method further includes the following steps:
approaching a target obstacle, and simultaneously respectively transmitting a second ultrasonic signal to the target obstacle and receiving and reflecting the second ultrasonic signal to form a second reflected signal at different positions;
obtaining a reflection parameter range through configuration parameters based on the second reflection signal;
and recording the reflection parameter range and the corresponding position to obtain a recording threshold value.
Further, after the recording of the reflection parameter range and the corresponding position to obtain a recording threshold, the method further includes the following steps:
repeating a plurality of reciprocating movements at positions farthest from and closest to the target obstacle;
respectively transmitting a third ultrasonic signal to the target barrier at different positions and receiving and reflecting to form a third reflected signal;
comparing the third reflection signal with a recording threshold corresponding to the current position;
judging whether the third reflection signal exceeds a recording threshold value;
if so, the parameters are reconfigured, and if not, the recording threshold is maintained.
Further, the step of approaching the target obstacle includes:
the ultrasonic ranging device is driven by the driving unit to approach the target barrier.
Further, the position information of the current position is provided by a drive unit.
Furthermore, the driving unit adopts one of a Hall encoder motor, a photoelectric encoder motor and a stepping motor.
Further, the step of performing an obstacle avoidance action includes:
stopping approaching or departing from the target obstacle.
The invention also provides an obstacle avoidance device which is operated by adopting the method, and the obstacle avoidance device comprises:
the ultrasonic transmitting module is used for transmitting an ultrasonic signal to the target obstacle;
the ultrasonic receiving module is used for receiving the reflected signal;
the driving module is used for driving the ultrasonic transmitting module and the ultrasonic receiving module to approach a target obstacle;
a storage module for storing a reference threshold;
and the calculation module is used for judging whether the reflected signal exceeds a reference threshold value.
The invention also provides ultrasonic ranging obstacle avoidance equipment, which comprises a controller and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the controller to realize the ultrasonic ranging obstacle avoidance method.
The technical scheme provides an ultrasonic ranging obstacle avoidance method, which comprises the following steps: approaching a target obstacle, and simultaneously transmitting a first ultrasonic signal to the target obstacle, wherein the first ultrasonic signal forms a first reflection signal after being reflected by the target obstacle; receiving the first reflected signal; comparing the first reflection signal with a reference threshold corresponding to the current position; and if the first reflection signal exceeds the reference threshold, executing obstacle avoidance action, and if not, continuing to approach the obstacle. According to the method, the using environment is learned in advance, the ultrasonic reflection signals are compared with the reference threshold obtained after learning is completed, whether the obstacle exists or not is judged, and compared with the method for judging the obstacle through distance measurement, the method can eliminate other influence factors such as ultrasonic aftershock and motor interference waves, and therefore obstacle avoidance accuracy is improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that if directional indications (such as up, down, left, right, front, and back … …) are involved in the embodiment of the present invention, the directional indications are only used to explain the relative positional relationship between the components, the movement situation, and the like in a specific posture, and if the specific posture is changed, the directional indications are changed accordingly.
In addition, if there is a description of "first", "second", etc. in an embodiment of the present invention, the description of "first", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, if the meaning of "and/or" and/or "appears throughout, the meaning includes three parallel schemes, for example," A and/or B "includes scheme A, or scheme B, or a scheme satisfying both schemes A and B. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
In practical application, because the physical characteristics of ultrasonic wave trembler can be along with the production of aftershock when producing the ultrasonic wave, can disturb the ultrasonic wave that the target that awaits measuring reflects back, simultaneously, in some ultrasonic waves carry out the application of keeping away the barrier, also can produce the interference wave when because the motor removes to influence ultrasonic detection effect. Therefore, if it is determined whether or not an obstacle exists based on the detected distance, the above-described interference factor exists, and a determination error is likely to occur.
The invention mainly aims to provide an ultrasonic distance measurement obstacle avoidance method, and aims to solve the technical problem that detection and judgment are easily affected by interference signals in the ultrasonic distance measurement obstacle avoidance process.
Referring to fig. 1, in an embodiment of the ultrasonic distance measuring and obstacle avoiding method of the present invention, the method is applied to an obstacle avoiding device, and the obstacle avoiding device is provided with an ultrasonic distance measuring device and a driving unit. The ultrasonic ranging device adopts the prior art, and the method comprises the following steps:
s100: the ultrasonic ranging device approaches a target obstacle and transmits a first ultrasonic signal to the target obstacle, and the first ultrasonic signal is reflected by the target obstacle to form a first reflected signal;
s200: receiving the first reflected signal;
s300: comparing the first reflection signal with a reference threshold corresponding to the current position;
s400: judging whether the first reflection signal exceeds a reference threshold value;
s500: and if so, executing obstacle avoidance action, and if not, continuing to approach the obstacle.
Further, in the present embodiment, the reference threshold is set to be completed before step S100. The reference threshold value comprises a preset threshold value and a recording threshold value, the preset threshold value is artificially configured, and the recording threshold value is obtained by measuring the use environment.
Further, at step S100: the ultrasonic ranging device approaches a target obstacle and simultaneously emits a first ultrasonic signal to the target obstacle, and the step of measuring the use environment is further included before the first ultrasonic signal is reflected by the target obstacle to form a first reflected signal. The purpose of this step is to form and record a second reflection signal at a different position before the actual detection, where the second reflection signal includes a plurality of interference signals, and the second reflection signal can be used as a basis for determining whether there is an obstacle during the actual detection because the travel path of the ultrasonic ranging device during the actual detection is the same as the travel path during the measurement of the use environment.
The method specifically comprises the following steps:
s10: approaching a target obstacle, and simultaneously respectively transmitting a second ultrasonic signal to the target obstacle and receiving and reflecting the second ultrasonic signal to form a second reflected signal at different positions;
s20: obtaining a reflection parameter range through configuration parameters based on the second reflection signal;
s30: and recording the reflection parameter range and the corresponding position to obtain a recording threshold value.
It should be noted that the second reflected signal may be an ultrasonic reflected signal without interference factors, but may also be a second reflected signal formed by interference factors including ultrasonic aftershocks and motor interference waves.
It will be appreciated that the second reflected signal is a set of multiple values, since it is generated at different locations respectively. In one embodiment, the measurement use environment is first taken: the ultrasonic ranging device starts to approach the target obstacle from the position farthest away from the target obstacle, and simultaneously transmits a second ultrasonic signal to the target obstacle and receives a second reflected signal formed by reflection at different positions. When the movement position of the ultrasonic ranging device is 300, the second reflection signal received at the position is 50db, the configuration parameter is +/-3, and the range of the reflection parameter obtained based on the second reflection signal is 47-53 db; similarly, at other locations, different or the same range of reflection parameters may be obtained. When a plurality of reflection parameter ranges are collected, the reflection parameter ranges and corresponding position information are recorded, and then a plurality of recording threshold values are formed, namely, the measuring use environment is completed.
When the ultrasonic ranging device carries out actual detection, the ultrasonic ranging device operates to the motion position of 300, the received first reflection signal is 55db, the value is compared with the reflection parameter range (47-53db) corresponding to the current position (300), the first reflection signal is judged to exceed the reflection parameter range, and obstacle avoidance action is carried out.
In summary, in the using process of the ultrasonic ranging device, because the using environment changes, the interference factors faced by the ultrasonic ranging device include not only the ultrasonic aftershock and the motor interference waves, but also factors causing inaccurate reception due to the change of the angle of the transmitted ultrasonic signal when the ultrasonic ranging device moves. Therefore, after the service environment is changed, the step of learning and measuring the service environment is implemented, so that different recording threshold values can be generated, and then the step can be used as a judgment basis for detecting the obstacle in actual detection, thereby realizing real-time adjustment aiming at different service environments and achieving the optimal obstacle avoidance effect.
According to the method, the using environment is learned and measured in advance, the ultrasonic reflection signals are compared with the reference threshold value obtained after learning is completed, whether the obstacle exists or not is judged, and compared with the method for judging the obstacle through distance measurement, the method can eliminate other influence factors such as ultrasonic aftershock and motor interference waves, and therefore obstacle avoidance accuracy is improved.
Specifically, the preset threshold value can be manually configured by connecting the ultrasonic ranging device with a serial communication network. In this embodiment, the preset threshold is a group of multiple values, and the data form and the effect of the preset threshold are the same as the recording threshold obtained by learning the measurement using environment, which is not described herein again.
Further, in order to record the threshold more accurately and then improve the accuracy of judgment at the time of actual measurement, at said step S30: recording the reflection parameter range and the corresponding position, and after obtaining a recording threshold value, further comprising the following steps:
s40: repeating a plurality of reciprocating movements at positions farthest from and closest to the target obstacle;
s50: respectively transmitting a third ultrasonic signal to the target barrier at different positions and receiving and reflecting to form a third reflected signal;
s60: comparing the third reflection signal with a recording threshold corresponding to the current position;
s70: judging whether the third reflection signal exceeds a recording threshold value;
s80: if so, the parameters are reconfigured, and if not, the recording threshold is maintained.
Further, the step of approaching the target obstacle specifically includes: the ultrasonic ranging device is driven by the driving unit to approach the target barrier.
Specifically, in the present embodiment, the driving unit serves as a power source for driving the ultrasonic ranging device to approach or depart from the target obstacle.
Further, in this embodiment, the driving unit employs one of a hall encoder motor, a photoelectric encoder motor, and a stepping motor. In this embodiment, the driving unit employs a hall encoder motor.
Further, in the above distance measuring and obstacle avoiding method, the position information of the current position is provided by a driving unit.
Specifically, the hall encoder motor and the photoelectric encoder motor are execution devices capable of outputting motor rotating speed electric signals. The photoelectric encoder is a sensor which converts mechanical geometric displacement on an output shaft into pulse digital quantity through photoelectric conversion; the Hall encoder is a sensor which converts mechanical geometric displacement on an output shaft of a motor into pulse or digital quantity through magnetoelectric conversion; the stepping motor is an actuating device which is matched with a driver to convert a digital pulse signal into angular displacement. The motor obtains the rotating speed through the encoder or the driver, the moving distance of the ultrasonic ranging device can be obtained through the rotating speed, the operating time and the transmission ratio, and then the current position information of the ultrasonic ranging device is obtained.
Further, in step S500, the step of executing the obstacle avoidance operation includes:
stopping approaching or departing from the target obstacle.
Referring to fig. 2, the present invention further provides an obstacle avoidance device, which operates by using the above ultrasonic ranging obstacle avoidance method, and the obstacle avoidance device includes:
the ultrasonic transmitting module is used for transmitting an ultrasonic signal to the target obstacle;
the ultrasonic receiving module is used for receiving the reflected signal;
the driving module is used for driving the ultrasonic transmitting module and the ultrasonic receiving module to approach a target obstacle;
a storage module for storing a reference threshold;
and the calculation module is used for judging whether the reflected signal exceeds a reference threshold value. Since the obstacle avoidance device adopts all technical schemes of all embodiments of the ultrasonic ranging obstacle avoidance method, all beneficial effects brought by the technical schemes of the embodiments are at least achieved, and are not repeated herein.
The invention also provides ultrasonic ranging obstacle avoidance equipment which comprises a controller and a memory, wherein at least one instruction or at least one section of program is stored in the memory, and the at least one instruction or the at least one section of program is loaded and executed by the controller to realize the ultrasonic ranging obstacle avoidance method. Since the ultrasonic ranging obstacle avoidance device adopts all technical schemes of all embodiments of the ultrasonic ranging obstacle avoidance method, all beneficial effects brought by the technical schemes of the embodiments are at least achieved, and are not repeated herein.
The above description is only an alternative embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.