Disclosure of Invention
The invention provides a ranging method using a reflective TOF ranging sensor, which improves the accuracy of a measurement result.
In order to solve the problems, the invention adopts the following technical scheme:
The embodiment of the invention provides a ranging method using a reflection-type TOF ranging sensor, wherein the reflection-type TOF ranging sensor is connected with a control module and comprises an infrared ranging signal transmitting module, a reflection wave receiving module, a signal amplifying module, a signal shaping module and a phase comparison module; the infrared ranging signal transmitting module comprises an infrared signal transmitting tube for transmitting pulse signals to a target object according to an external driving signal; the device comprises a reflected wave receiving module, a signal amplifying module, a signal shaping module and a phase comparison module, wherein the reflected wave receiving module is used for receiving a reflected wave signal reflected by a target object, the signal amplifying module is used for amplifying the reflected wave signal, the signal shaping module is used for shaping the amplified reflected wave signal, the phase comparison module is used for receiving the shaped reflected wave signal and a driving signal, carrying out phase discrimination processing on the driving signal and the shaped reflected wave signal and outputting a measuring result signal; the method comprises the following steps:
(1) The control module samples the voltage RBL_val representing the background light intensity at the two ends of the infrared signal transmitting tube;
(2) Placing a reference object at a plurality of reference positions in an effective measurement range, controlling an infrared ranging signal transmitting module to transmit pulse signals to the reference object each time by a control module, and acquiring voltage RTOF _val of a measurement result signal output by a phase comparison module aiming at each reference position, the real distance from the reference position to a ranging sensor and voltage ROBJ_val representing the background light intensity of the measured object at two ends of an infrared signal transmitting tube by the control module;
(3) The voltage RTOF _val of the measurement result signals of the plurality of reference positions, the real distance from the reference position to the ranging sensor and the voltage ROBJ_val representing the background light intensity of the measured object are brought into the following formula:
rm_val=k (a_ RTOF _val+b_rbl_val+c) ×rob_val, where k, a, b, and c are all scaling factors, rm_val is the distance from the measured object to the ranging sensor, and the values of k, a, b, and c are calculated by back-pushing;
(4) The control module controls the infrared ranging signal transmitting module to transmit a pulse signal to a target object, and the control module acquires the voltage RTOF _val of the measuring result signal output by the phase comparison module and the voltage ROBJ_val at two ends of the infrared signal transmitting tube, wherein the voltage ROBJ_val represents the background light intensity of the measured object;
(5) The control module brings the voltage rbl_val of the background light intensity, the voltage RTOF _val of the measurement result signal for the target object, the voltage robj_ val, k, a, b of the background light intensity of the target object and c into the formula rm_val=k (a× RTOF _val+b×rbl_val+c) ×robj_val, and calculates the distance rm_val from the target object to the ranging sensor.
In some embodiments, after step (1), further comprising the steps of: placing a reference object in a measuring environment, controlling an infrared ranging signal emitting module to emit pulse signals to the reference object by a control module, obtaining voltage ROBJ_val representing background light intensity of the reference object at two ends of an infrared signal emitting tube, comparing the voltage ROBJ_val representing background light intensity of the reference object with a preset strong light explosion background value RMAX_val, judging whether the ROBJ_val is larger than or equal to the RMAX_val, and continuously executing the step (2) if the ROBJ_val is larger than or equal to the RMAX_val; if ROBJ_val is smaller than RMAX_val, repeating the step (1) until ROBJ_val is larger than or equal to RMAX_val.
In some embodiments, the phase comparison module includes a chip SN74LVC1G80DBVR, a1 pin of the chip SN74LVC1G 80G DBVR is used to receive an external driving signal, a2 pin of the chip SN74LVC1G80DBVR is connected to the signal shaping module, and a 4 pin of the chip SN74LVC1G80DBVR is used to output a measurement result signal.
In some embodiments, the 4 pin of the chip SN74LVC1G80DBVR is connected with a filter circuit.
In some embodiments, the infrared ranging signal transmitting module further includes a protection resistor, a driving signal receiving end, a twenty-third resistor and a fourth triode, the anodes of the direct current power supply, the protection resistor and the infrared signal transmitting tube are sequentially connected, the cathodes of the infrared signal transmitting tube are connected with the collector of the fourth triode, the emitter of the fourth triode is grounded, the bases of the driving signal receiving end, the twenty-third resistor and the fourth triode are sequentially connected, and the driving signal receiving end is used for receiving an external driving signal.
In some embodiments, the protection resistor comprises a twenty-first resistor and a twenty-second resistor, and the direct current power supply, the twenty-first resistor, the twenty-second resistor and the anode of the infrared signal emitting tube are sequentially connected; the infrared ranging signal transmitting module further comprises at least one first filter capacitor and at least one second filter capacitor, the direct current power supply, the first filter capacitor and the grounding end are sequentially connected, and the middle node of the twenty-first resistor and the twenty-second resistor, the second filter capacitor and the grounding end are sequentially connected.
In some embodiments, the reflected wave receiving module includes a second inductor, an infrared signal receiving tube, a third resistor, at least one third filter capacitor and at least one fourth filter capacitor, where the dc power supply, the second inductor and the cathode of the infrared signal receiving tube are sequentially connected, and the anode of the infrared signal receiving tube, the third resistor and the ground terminal are sequentially connected; the direct current power supply, the third filter capacitor and the grounding end are sequentially connected, and the cathode of the infrared signal receiving tube, the fourth filter capacitor and the grounding end are sequentially connected.
In some embodiments, the signal amplification module includes a first operational amplifier, a second operational amplifier, a twentieth capacitance, a seventh capacitance, a fourth resistance, a fifth resistance, an eighth resistance, a twelfth resistance, a twenty-first capacitance, a seventh resistance, a ninth resistance, a first resistance, and an eleventh resistance; the cathode, the twentieth capacitor, the fourth resistor and the negative input end of the first operational amplifier of the infrared signal receiving tube are sequentially connected; the positive electrode, the seventh capacitor, the fifth resistor and the positive input end of the first operational amplifier of the infrared signal receiving tube are sequentially connected, and the positive input end, the eighth resistor and the grounding end of the first operational amplifier are sequentially connected; two ends of the twelfth resistor are respectively connected with the negative input end of the first operational amplifier and the output end of the first operational amplifier; the output end of the first operational amplifier, the twenty-first capacitor, the seventh resistor and the positive input end of the second operational amplifier are sequentially connected, and the positive input end of the second operational amplifier, the ninth resistor and the grounding end are sequentially connected; the negative input end, the first resistor and the grounding end of the second operational amplifier are sequentially connected, and two ends of the eleventh resistor are respectively connected with the negative input end and the output end of the second operational amplifier.
In some embodiments, the signal shaping module includes a chip SN74LVC2G14DBVR, a1 pin of the chip SN74LVC2G14DBVR is connected to the signal amplifying module, a3 pin of the chip SN74LVC2G14DBVR is connected to a 6 pin, and a 4 pin of the chip SN74LVC2G14DBVR is connected to the phase comparing module.
The invention has at least the following beneficial effects: the infrared signal transmitting tube is used for transmitting pulse signals to a target object according to external driving signals, the reflected wave receiving module receives the pulse signals and then generates a voltage pulse signal, the voltage pulse signal is amplified by the signal amplifying module and shaped by the signal shaping module and then is input to the phase comparison module, the phase comparison module carries out phase discrimination processing on the driving signals and the shaped reflected wave signals and outputs measurement result signals, the measurement result signals represent the distance from the target object to the ranging sensor, the measurement mode is not easy to be interfered by other factors, the frequency of the pulse signal can be higher, and the accuracy of the measurement result can be improved.
Meanwhile, the device is not easily limited by factors such as transmitting power and the like, and the measurable distance range is wider; the whole circuit has simple structure, can reduce the manufacturing cost and realize the miniaturization of the whole volume of the sensor.
Detailed Description
The following description is provided with reference to the accompanying drawings to assist in a comprehensive understanding of various embodiments of the invention as defined in the claims and their equivalents. The description includes various specific details to aid in understanding, but these details should be regarded as merely exemplary. Accordingly, those skilled in the art will recognize that various changes and modifications of the various embodiments described herein can be made without departing from the scope and spirit of the invention.
In the description of the present invention, references to orientation descriptions such as upper, lower, front, rear, left, right, etc. are based on the orientation or positional relationship shown in the drawings, only for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the apparatus or element in question must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
It will be understood that when an element (e.g., a first element) is "connected" to another element (e.g., a second element), the element can be directly connected to the other element or there can be intervening elements (e.g., a third element) between the element and the other element.
An embodiment of the present invention provides a reflection type TOF ranging sensor, as shown in fig. 1, including an infrared ranging signal transmitting module 100, a reflected wave receiving module 200, a signal amplifying module 300, a signal shaping module 400, and a phase comparing module 500. The infrared ranging signal transmitting module 100 includes an infrared signal transmitting tube for transmitting a pulse signal to a target object according to an external driving signal, which is emitted from an external device such as a controller, for example, may be emitted from the control module 600 to indicate a distance from the target object 10 to be measured to the ranging sensor, since the ranging sensor is generally used in cooperation with the ranging sensor. The frequency of the driving signal is consistent with that of the pulse signal, and the period of the driving signal can reach nanosecond level in order to improve the measurement precision.
The reflected wave receiving module 200, the signal amplifying module 300, the signal shaping module 400, and the phase comparing module 500 are sequentially connected. After the infrared pulse signal is emitted to the target object 10, the target object 10 reflects the signal back, and the reflected wave receiving module 200 is configured to receive the reflected wave signal reflected by the target object 10, and the signal amplifying module 300 amplifies the reflected wave signal again because the signal machine is weak. The amplified reflected wave signal is a narrow pulse signal, and the edges thereof may be undesirable and may affect the subsequent phase comparison, so the signal shaping module 400 is configured to shape the amplified reflected wave signal into a relatively standard square wave pulse signal. Because the driving signal and the reflected wave signal necessarily have a phase difference, the phase comparison module 500 is configured to receive the shaped reflected wave signal and the driving signal, perform phase discrimination processing on the driving signal and the shaped reflected wave signal, and output a measurement result signal, where the measurement result signal characterizes the distance from the target object to the ranging sensor, and the measurement mode is not easily interfered by other factors, and the frequency of the pulse signal can be higher, so that the accuracy of the measurement result can be improved.
Meanwhile, the device is not easily limited by factors such as transmitting power and the like, and the measurable distance range is wider; the whole circuit has simple structure, can reduce the manufacturing cost and realize the miniaturization of the whole volume of the sensor.
In some embodiments, as shown in fig. 2, the phase comparison module includes a chip SN74LVC1G80DBVR, and a chip U2 in fig. 2 is the chip SN74LVC1G80DBVR, and the 5 pin of the chip SN74LVC1G80DBVR is connected to the dc power VCC and the 3 pin is grounded. The 1 pin of the chip SN74LVC1G80DBVR is used for receiving an external driving signal, the 2 pin of the chip SN74LVC1G80DBVR is connected to the signal shaping module, and the 4 pin of the chip SN74LVC1G80DBVR is used for outputting a measurement result signal.
The chip SN74LVC1G80DBVR is used as a D flip-flop for phase comparison, outputting a phase-discrimination signal whose width is proportional to the phase difference. The larger the width of the phase-discrimination wave signal is, the larger the phase difference is, and the farther the distance between the objects is correspondingly, whereas the smaller the width of the phase-discrimination wave signal is, the smaller the phase difference is, and the closer the distance between the objects is correspondingly. The distance to the target object 10 can be calculated by this proportional relationship.
Further, in order to make the measurement result signal purer, reduce the interference of the impurity wave, promote the accuracy of the final measurement result, the 4 pin of the chip SN74LVC1G80DBVR is connected with a filter circuit, and after the filtering process of the filter circuit, an analog voltage signal is output from the AD terminal in fig. 2.
The filter circuit may be as shown in fig. 2, and includes a resistor R2, a resistor R6, a capacitor C3, and a capacitor C6, where the 4 pins of the chip SN74LVC1G80DBVR, the resistor R2, the resistor R6, and the AD terminal are sequentially connected, and the intermediate node of the resistor R2 and the resistor R6, the capacitor C3, and the ground terminal are sequentially connected, so as to form an RC filter circuit. Of course, other feasible filter circuits can be selected according to practical needs.
In some embodiments, as shown in fig. 2, the infrared ranging signal transmitting module includes a protection resistor, an infrared signal transmitting tube D4, a driving signal receiving end TXD, a twenty-third resistor R23, and a fourth triode Q4, where the anodes of the direct current power supply, the protection resistor, and the infrared signal transmitting tube are sequentially connected, the cathodes of the infrared signal transmitting tube are connected with the collector of the fourth triode, the emitter of the fourth triode is grounded, the driving signal receiving end, the twenty-third resistor, and the base of the fourth triode are sequentially connected, and the driving signal receiving end is used for receiving an external driving signal.
The driving signal drives the fourth triode to be conducted or cut off, when the fourth triode is conducted, the infrared signal emitting tube is electrified to work and emits infrared light outwards, and when the fourth triode is cut off, the infrared signal emitting tube is not operated. The driving signal is a pulse signal, so that the infrared signal emitting tube emits an infrared pulse signal. The fourth triode can be an N-type triode or a P-type triode, and is preferably a P-type triode, so that the level states of the driving signal and the infrared pulse signal can be the same in the same period.
Further, the protection resistor comprises a twenty-first resistor R21 and a twenty-second resistor R22, and the anodes of the direct current power supply, the twenty-first resistor, the twenty-second resistor and the infrared signal emission tube are sequentially connected; the infrared ranging signal transmitting module further comprises at least one first filter capacitor and at least one second filter capacitor, the direct current power supply, the first filter capacitor and the grounding end are sequentially connected, the intermediate node of the twenty-first resistor and the twenty-second resistor, the second filter capacitor and the grounding end are sequentially connected, a pi-shaped filter circuit is formed, purity of the direct current power supply signal is guaranteed, and conditions are provided for the infrared pulse signal to reach nanosecond level.
Meanwhile, the direct-current power supply can charge the first filter capacitor and the second filter capacitor by utilizing the gap time of the emitted infrared signals, and when the infrared signals are emitted by the infrared signal emitting tube, the capacitor provides the emitted power so as to reduce the disturbance of the sudden infrared emission power to the power supply.
As shown in fig. 2, two first filter capacitors, C10 and C11, respectively, may be used, and two second filter capacitors, C12 and C13, respectively, may be used.
In some embodiments, as shown in fig. 2, the reflected wave receiving module includes a second inductor L2, an infrared signal receiving tube D3, a third resistor R3, at least one third filter capacitor and at least one fourth filter capacitor, where the dc power supply, the second inductor and the cathode of the infrared signal receiving tube are sequentially connected, and the anode of the infrared signal receiving tube, the third resistor and the ground terminal are sequentially connected; the direct current power supply, the third filter capacitor and the grounding end are sequentially connected, and the cathode of the infrared signal receiving tube, the fourth filter capacitor and the grounding end are sequentially connected.
When the infrared signal receiving tube receives the infrared pulse signal, the infrared signal receiving tube generates resistance change, and the resistance change and the resistor R3 form partial pressure, so that the resistance change can form voltage disturbance, and the voltage at two ends of the infrared signal receiving tube forms a tiny pulse signal. The second inductor, the third filter capacitor and the fourth filter capacitor form a pi-shaped LC filter circuit, so that the direct-current voltage is purer, the interference of impurity waves is reduced, the accuracy of a final measurement result is improved, and a condition is provided for a pulse signal to reach nanosecond level.
As shown in fig. 2, two third filter capacitors, C5 and C2, respectively, and two fourth filter capacitors, C1 and C4, respectively, may be used.
Further, the signal amplifying module includes a first operational amplifier U6, a second operational amplifier U5, a twentieth capacitor C20, a seventh capacitor C7, a fourth resistor R4, a fifth resistor R5, an eighth resistor R8, a twelfth resistor R12, a twenty-first capacitor C21, a seventh resistor R7, a ninth resistor R9, a first resistor R1, and an eleventh resistor R11. The cathode, the twentieth capacitor, the fourth resistor and the negative input end of the first operational amplifier of the infrared signal receiving tube are sequentially connected; the positive electrode, the seventh capacitor, the fifth resistor and the positive input end of the first operational amplifier of the infrared signal receiving tube are sequentially connected, and the positive input end, the eighth resistor and the grounding end of the first operational amplifier are sequentially connected; two ends of the twelfth resistor are respectively connected with the negative input end of the first operational amplifier and the output end of the first operational amplifier; the output end of the first operational amplifier, the twenty-first capacitor, the seventh resistor and the positive input end of the second operational amplifier are sequentially connected, and the positive input end of the second operational amplifier, the ninth resistor and the grounding end are sequentially connected; the negative input end of the second operational amplifier, the first resistor and the grounding end are sequentially connected, and two ends of the eleventh resistor are respectively connected with the negative input end of the second operational amplifier and the output end of the second operational amplifier.
The embodiment adopts a two-stage amplifying circuit structure, can amplify more than 10 ten thousand times, and finally obtains a square wave pulse signal. The operational amplifier should have a sufficient high frequency bandwidth and very small input errors, preferably an operational amplifier above 1GHz, with an input offset of 10uV.
In some embodiments, as shown in fig. 2, the signal shaping module includes a chip U4, the chip U4 is a chip SN74LVC2G14DBVR pins of the chip SN74LVC2G14DBVR are connected to a dc power supply, the 2 pins are grounded, the 1 pin of the chip SN74LVC2G14DBVR is connected to the signal amplifying module, the 3 pin of the chip SN74LVC2G14DBVR is connected to the 6 pin, and the 4 pin of the chip SN74LVC2G14DBVR is connected to the phase comparing module.
The chip SN74LVC2G14DBVR forms a schmitt trigger, which can increase the steepness of the leading edge of the pulse waveform, so that it is more similar to a standard square wave pulse signal.
The embodiment of the present invention further provides a ranging method using the reflective TOF ranging sensor of any one of the above embodiments, and specific description of the reflective TOF ranging sensor may refer to the above embodiments, which are not repeated herein. In a specific application, the ranging sensor is connected with a control module, the control module can comprise a singlechip chip, a programmable logic device and the like, and as shown in fig. 3, the ranging method comprises the following steps:
(1) The control module samples the voltage RBL_val representing the background light intensity at the two ends of the infrared signal emitting tube. The light intensity of the measuring environment where the ranging sensor is located is background light intensity, the control module can be directly connected with two ends of the infrared signal receiving tube to directly sample the voltage at the two ends of the infrared signal receiving tube, or the control module is connected with the signal amplifying module to sample the voltage of the signal output by the signal amplifying module and calculate the voltage at the two ends of the infrared signal receiving tube according to the voltage in a reverse pushing mode.
(2) The control module controls the infrared ranging signal transmitting module to transmit pulse signals to the reference object each time, namely, to the reference object positioned at each reference position, and acquires the voltage RTOF _val of the measuring result signal output by the phase comparison module aiming at each reference position, the real distance from the reference position to the ranging sensor and the voltage ROBJ_val representing the background light intensity of the measured object at two ends of the infrared signal transmitting tube.
The reference position needs to be within the effective measurement range of the ranging sensor, otherwise the reference object cannot be measured. At each reference position, the control module sends a driving signal to the infrared ranging signal transmitting module to control the infrared ranging signal transmitting module to transmit a pulse signal to a reference object, the reflected wave receiving module receives the reflected wave signal, the signal amplifying module amplifies the signal, the signal shaping module shapes the signal, the phase comparison module carries out phase discrimination processing on the driving signal and the shaped reflected wave signal and outputs a measuring result signal, meanwhile, the control module also samples a voltage ROBJ_val representing the background light intensity of the measured object (the measured object is a reference object here and is also representing the background light intensity of the reference object) at two ends of the infrared ranging signal transmitting tube, the real distance from the reference position to the ranging sensor is known or can be measured in other modes, and the position is relatively more accurate. Since there are a plurality of reference positions, at each of which there is a voltage RTOF _val of the measurement result signal, the true distance of the reference position to the ranging sensor, and a voltage robj_val characterizing the background light intensity of the measured object.
The reference object may be placed at a position 15 ° to the left of the distance measuring sensor and 1 meter away from the distance measuring sensor, or may be placed at a position 15 ° to the right of the distance measuring sensor and 1 meter away from the distance measuring sensor, or may be placed at other positions.
(3) The voltage RTOF _val of the measurement result signals of the plurality of reference positions, the real distance from the reference position to the ranging sensor and the voltage ROBJ_val representing the background light intensity of the measured object are brought into the following formula:
Rm_val=k (a_ RTOF _val+b_rbl_val+c) ×rob_val, where k, a, b, and c are all scaling coefficients, rm_val is the distance from the measured object to the ranging sensor, and the calculated values of k, a, b, and c are used as the distances from the target object to the ranging sensor for subsequent calculation.
(4) The control module controls the infrared ranging signal transmitting module to transmit pulse signals to the target object, and the control module obtains the voltage RTOF _val of the measuring result signal output by the phase comparison module and the voltage ROBJ_val representing the background light intensity of the measured object at two ends of the infrared signal transmitting tube.
After the numerical values of k, a, b and c are calculated for a plurality of times, the control module sends a driving signal to the infrared ranging signal transmitting module to control the infrared ranging signal transmitting module to formally transmit a pulse signal to a target object, the reflected wave receiving module receives the reflected wave signal, the signal amplifying module amplifies the signal, the signal shaping module carries out signal shaping, the phase comparison module carries out phase discrimination processing on the driving signal and the shaped reflected wave signal and outputs a measuring result signal, the control module can acquire the voltage RTOF _val of the measuring result signal, and meanwhile, the voltage ROBJ_val of the background light intensity of the measured object (the measured object at the two ends of the infrared ranging signal transmitting tube is the target object, and therefore the background light intensity of the measured object is characterized).
(5) The control module brings the voltage RBL_val of the background light intensity, the voltage RTOF _val of the measurement result signal aiming at the target object, the voltages ROBJ_ val, k, a, b and c of the background light intensity of the target object into the formula, and calculates the distance RM_val between the target object and the ranging sensor.
Since the voltage rbl_val characterizing the background light intensity, the voltage RTOF _val of the measurement result signal for the target, and the voltages rob_ val, k, a, b and c of the background light intensity of the target are all known, the distance rm_val from the target to the ranging sensor is calculated by taking the formula rm_val=k (a× RTOF _val+b×rbl_val+c) ×rob_val.
In some embodiments, as shown in fig. 4, after step (1), the following steps are further included: placing a reference object in a measuring environment, controlling an infrared ranging signal emitting module to emit pulse signals to the reference object by a control module, obtaining voltage ROBJ_val representing background light intensity of the reference object at two ends of an infrared signal emitting tube, comparing the voltage ROBJ_val representing background light intensity of the reference object with a preset strong light explosion background value RMAX_val, judging whether the ROBJ_val is larger than or equal to the RMAX_val, and continuously executing the step (2) if the ROBJ_val is larger than or equal to the RMAX_val; if ROBJ_val is smaller than RMAX_val, repeating the step (1) until ROBJ_val is larger than or equal to RMAX_val.
Since the interference of the background light may affect the measurement result, the present embodiment may determine the validity of the background light, compare the rob_val with the rmax_val by taking the strong light burst background value rmax_val as a set value, and if the rob_val is greater than or equal to the rmax_val, it indicates that the current measurement environment is valid background light, so that the step (2) and the subsequent steps thereof are continuously performed. If ROBJ_val is smaller than RMAX_val, the background light of the current measuring environment is invalid, the step (2) and the subsequent steps are not executed, the step (1) is executed repeatedly, the measuring personnel need to change the measuring environment, if ROBJ_val is changed to be larger than or equal to RMAX_val, the current measuring environment is changed, the current measuring environment has effective background light, and the step (2) and the subsequent steps are executed continuously.
The terms and words used in the above description and claims are not limited to literal meanings but are only used by the applicant to enable a clear and consistent understanding of the invention. Accordingly, it will be apparent to those skilled in the art that the foregoing description of the various embodiments of the invention has been provided for illustration only and not for the purpose of limiting the invention as defined by the appended claims and their equivalents.