CN112526485B - Fault detection method, device, equipment, and storage medium - Google Patents
Fault detection method, device, equipment, and storage medium Download PDFInfo
- Publication number
- CN112526485B CN112526485B CN201910883251.1A CN201910883251A CN112526485B CN 112526485 B CN112526485 B CN 112526485B CN 201910883251 A CN201910883251 A CN 201910883251A CN 112526485 B CN112526485 B CN 112526485B
- Authority
- CN
- China
- Prior art keywords
- ranging module
- driving circuit
- detection result
- wave transmitter
- light wave
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 153
- 238000012360 testing method Methods 0.000 claims abstract description 64
- 238000000034 method Methods 0.000 claims abstract description 59
- 238000005259 measurement Methods 0.000 claims description 49
- 238000006243 chemical reaction Methods 0.000 claims description 22
- 230000004044 response Effects 0.000 claims description 13
- 238000009792 diffusion process Methods 0.000 claims description 12
- 230000003287 optical effect Effects 0.000 claims description 11
- 230000015654 memory Effects 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 21
- 230000008569 process Effects 0.000 description 16
- 238000005516 engineering process Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000008447 perception Effects 0.000 description 4
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 3
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000036559 skin health Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012805 post-processing Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000011076 safety test Methods 0.000 description 2
- 230000003238 somatosensory effect Effects 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000011895 specific detection Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000002604 ultrasonography Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S7/00—Details of systems according to groups G01S13/00, G01S15/00, G01S17/00
- G01S7/48—Details of systems according to groups G01S13/00, G01S15/00, G01S17/00 of systems according to group G01S17/00
- G01S7/497—Means for monitoring or calibrating
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Optical Radar Systems And Details Thereof (AREA)
Abstract
Description
技术领域Technical Field
本申请实施例涉及电子技术,涉及但不限于故障检测方法及装置、设备、存储介质。The embodiments of the present application relate to electronic technology, and relate to but are not limited to fault detection methods and devices, equipment, and storage media.
背景技术Background technique
目前,飞行时间(Time of Flight,TOF)测距方法被广泛应用于体感交互与控制、三维(3Dimensions,3D)物体识别与感知、智能环境感知以及动态地图构建等方面。电子设备可以利用TOF测距模组确定与目标物体之间的距离,具体方式为:控制TOF测距模组中的激光发射器发射激光工作脉冲,在接收到被目标物体反射的激光之后,通过计算激光的发射时间和接收时间之间的相位差,确定与目标物体之间的距离。At present, the time of flight (TOF) ranging method is widely used in somatosensory interaction and control, three-dimensional (3D) object recognition and perception, intelligent environment perception, and dynamic map construction. Electronic devices can use the TOF ranging module to determine the distance to the target object. The specific method is: control the laser transmitter in the TOF ranging module to emit laser working pulses, and after receiving the laser reflected by the target object, the distance to the target object is determined by calculating the phase difference between the laser emission time and the reception time.
然而,如果TOF测距模组中的部件发生故障,激光发射器发射的激光可能会对人眼和皮肤造成一定的伤害。因此,对TOF测距模组进行故障检测,以降低TOF测距模组伤害人眼和皮肤的风险,具有重要的意义。However, if a component in the TOF ranging module fails, the laser emitted by the laser transmitter may cause certain damage to human eyes and skin. Therefore, it is of great significance to perform fault detection on the TOF ranging module to reduce the risk of TOF ranging module damaging human eyes and skin.
发明内容Summary of the invention
有鉴于此,本申请实施例提供故障检测方法及装置、设备、存储介质。本申请实施例的技术方案是这样实现的:In view of this, the embodiments of the present application provide a fault detection method and apparatus, a device, and a storage medium. The technical solution of the embodiments of the present application is implemented as follows:
第一方面,本申请实施例提供一种故障检测方法,所述方法包括:接收开启指令,所述开启指令用于指示开启电子设备的测距模组;响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,控制所述光波发射器发射至少一个测试脉冲,以对所述测距模组进行故障检测,获得检测结果;其中,所述工作脉冲用于测量所述测距模组与目标物体之间的距离;根据所述检测结果,控制所述测距模组的工作状态。In a first aspect, an embodiment of the present application provides a fault detection method, the method comprising: receiving a start-up instruction, the start-up instruction being used to instruct to turn on a ranging module of an electronic device; in response to the start-up instruction, before controlling a light wave transmitter in the ranging module to transmit a working pulse at a first regular interval, controlling the light wave transmitter to transmit at least one test pulse to perform fault detection on the ranging module and obtain a detection result; wherein the working pulse is used to measure the distance between the ranging module and a target object; and according to the detection result, controlling the working state of the ranging module.
第二方面,本申请实施例提供一种故障检测装置,所述装置包括:接收模块,配置为接收开启指令,所述开启指令用于指示开启所述装置的测距模组;控制模块,配置为响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,控制所述光波发射器发射至少一个测试脉冲,以对所述测距模组进行故障检测,获得检测结果;其中,所述工作脉冲用于测量所述测距模组与目标物体之间的距离;所述控制模块,还配置为根据所述检测结果,控制所述测距模组的工作状态。In a second aspect, an embodiment of the present application provides a fault detection device, comprising: a receiving module, configured to receive a start-up instruction, wherein the start-up instruction is used to instruct to turn on a ranging module of the device; a control module, configured to respond to the start-up instruction, and before controlling the light wave transmitter in the ranging module to transmit a working pulse at a first regular interval, control the light wave transmitter to transmit at least one test pulse to perform fault detection on the ranging module and obtain a detection result; wherein the working pulse is used to measure the distance between the ranging module and a target object; and the control module is further configured to control the working state of the ranging module according to the detection result.
第三方面,本申请实施例提供一种电子设备,包括存储器和处理器,所述存储器存储有可在处理器上运行的计算机程序,所述处理器执行所述程序时实现本申请实施例所提供的故障检测方法中的步骤。In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the fault detection method provided in the embodiment of the present application are implemented.
第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现本申请实施例所提供的故障检测方法中的步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the fault detection method provided in the embodiment of the present application.
本申请实施例中,在接收到所述开启指令之后,响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,控制所述光波发射器发射至少一个测试脉冲,以对所述测距模组进行故障检测,获得检测结果;根据所述检测结果,控制所述测距模组的工作状态;如此,可以降低光波对人眼和皮肤造成伤害的风险。In an embodiment of the present application, after receiving the start-up instruction, in response to the start-up instruction, before controlling the light wave transmitter in the ranging module to transmit working pulses at a first regular interval, the light wave transmitter is controlled to transmit at least one test pulse to perform fault detection on the ranging module to obtain a detection result; based on the detection result, the working state of the ranging module is controlled; in this way, the risk of light waves causing damage to human eyes and skin can be reduced.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1A为本申请实施例TOF测距模组的结构示意图;FIG1A is a schematic diagram of the structure of a TOF ranging module according to an embodiment of the present application;
图1B为本申请实施例TOF测距模组中的红外发射单元的结构示意图;FIG1B is a schematic diagram of the structure of an infrared transmitting unit in a TOF ranging module according to an embodiment of the present application;
图2为本申请实施例故障检测方法的实现流程示意图;FIG2 is a schematic diagram of an implementation flow of a fault detection method according to an embodiment of the present application;
图3A为本申请实施例脉冲信号示意图;FIG3A is a schematic diagram of a pulse signal according to an embodiment of the present application;
图3B为本申请实施例通过第一规则发射工作脉冲的信号示意图;FIG3B is a schematic diagram of a signal of transmitting a working pulse according to a first rule in an embodiment of the present application;
图4为本申请实施例另一故障检测方法的实现流程示意图;FIG4 is a schematic diagram of an implementation flow of another fault detection method according to an embodiment of the present application;
图5为本申请实施例又一故障检测方法的实现流程示意图;FIG5 is a schematic diagram of an implementation flow of another fault detection method according to an embodiment of the present application;
图6为本申请实施例再一故障检测方法的实现流程示意图;FIG6 is a schematic diagram of a process flow of implementing yet another fault detection method according to an embodiment of the present application;
图7为本申请实施例的另一脉冲信号示意图;FIG7 is a schematic diagram of another pulse signal according to an embodiment of the present application;
图8为本申请实施例的又一脉冲信号示意图;FIG8 is a schematic diagram of another pulse signal according to an embodiment of the present application;
图9为本申请实施例另一故障检测方法的实现流程示意图;FIG9 is a schematic diagram of an implementation flow of another fault detection method according to an embodiment of the present application;
图10为本申请实施例的再一脉冲信号示意图;FIG10 is a schematic diagram of another pulse signal according to an embodiment of the present application;
图11为本申请实施例检测扩散片是否脱落的方法实现流程示意图;FIG11 is a schematic diagram of a method for detecting whether a diffusion sheet has fallen off according to an embodiment of the present application;
图12为本申请实施例故障检测装置的组成结构示意图;FIG12 is a schematic diagram of the structure of a fault detection device according to an embodiment of the present application;
图13为本申请实施例电子设备的一种硬件实体示意图。FIG. 13 is a schematic diagram of a hardware entity of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请的具体技术方案做进一步详细描述。以下实施例用于说明本申请,但不用来限制本申请的范围。In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the specific technical scheme of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅仅是是区别不同的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are merely used to distinguish different objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
首先,以测距模组为TOF测距模组为例,对TOF测距模组的结构和工作原理进行说明。如图1A所示,该模组10包括红外发射单元11、红外接收单元12和控制器15;其中,控制器15控制红外发射单元11发出经过调制的近红外光13,投射到目标物体14上,经过目标物体14的反射,由红外接收单元12接收,控制器15通过计算光线的发射时间与接收时间之间的时间差或相位差ΔΦ,得出该模组10与目标物体14之间的距离,从而产生深度信息。First, taking the distance measurement module as a TOF distance measurement module as an example, the structure and working principle of the TOF distance measurement module are described. As shown in FIG1A , the module 10 includes an infrared transmitting unit 11, an infrared receiving unit 12 and a controller 15; wherein the controller 15 controls the infrared transmitting unit 11 to emit modulated near-infrared light 13, which is projected onto a target object 14, and is reflected by the target object 14 and received by the infrared receiving unit 12. The controller 15 calculates the time difference or phase difference ΔΦ between the emission time and the reception time of the light, and obtains the distance between the module 10 and the target object 14, thereby generating depth information.
其中,红外发射单元11的结构如图1B所示,该单元11包括垂直腔面激光发射器(Vertical Cavity Surface Emitting Laser,VCSEL)111、光线扩散片112和光电二极管113(Photo Diode,PD)作为探测器;其中,VCSEL 111用于发射带有一定能量的激光脉冲,激光脉冲投射到目标物体14上之后,反射到红外接收单元12。该激光脉冲的波长为940纳米(nanometer,nm),属于近红外光,带有一定的能量,且肉眼不可见。根据国际电工委员会标准IEC60825-2014对人眼安全的定义,需要控制VCSEL 111发射的激光能量以达到使用安全的要求。The structure of the infrared emitting unit 11 is shown in FIG. 1B . The unit 11 includes a vertical cavity surface laser emitter (VCSEL) 111, a light diffuser 112 and a photodiode 113 (PD) as a detector. The VCSEL 111 is used to emit a laser pulse with a certain energy. After the laser pulse is projected onto the target object 14, it is reflected to the infrared receiving unit 12. The wavelength of the laser pulse is 940 nanometers (nanometer, nm), which belongs to near-infrared light, has a certain amount of energy, and is invisible to the naked eye. According to the definition of human eye safety in the International Electrotechnical Commission standard IEC60825-2014, it is necessary to control the laser energy emitted by the VCSEL 111 to meet the requirements of safety in use.
PD 113用于接收被发射的激光在经过光线扩散片112之后反射回来的激光能量,通过将接收到的激光能量转换成光电流,从而根据该电流的大小监测并判断激光能量是否发生变化。The PD 113 is used to receive the laser energy reflected back by the emitted laser after passing through the light diffuser 112, and convert the received laser energy into photocurrent, thereby monitoring and judging whether the laser energy changes according to the magnitude of the current.
本申请实施例提供一种故障检测方法,所述方法可以应用于包括测距模组的电子设备,所述电子设备可以是手机、平板电脑、笔记本电脑、机器人、无人机等具有测距能力的设备。所述故障检测方法所实现的功能可以通过所述电子设备中的处理器调用程序代码来实现,当然程序代码可以保存在计算机存储介质中,可见,所述电子设备至少包括处理器和存储介质。The embodiment of the present application provides a fault detection method, which can be applied to an electronic device including a ranging module, and the electronic device can be a mobile phone, a tablet computer, a laptop computer, a robot, a drone, or other device with ranging capability. The function implemented by the fault detection method can be implemented by calling a program code by a processor in the electronic device, and of course the program code can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium.
图2为本申请实施例故障检测方法的实现流程示意图,如图2所示,所述方法至少包括以下步骤S201至步骤S203:FIG. 2 is a schematic diagram of an implementation flow of a fault detection method according to an embodiment of the present application. As shown in FIG. 2 , the method at least includes the following steps S201 to S203:
步骤S201,接收开启指令,所述开启指令用于指示开启电子设备的测距模组。举例来说,当电子设备接收到用于指示开启相机应用的指令时,确定接收到所述开启指令。比如,在相机应用的图标上接收到触摸指令,或者接收到指示开启相机应用的语音指令。Step S201, receiving an opening instruction, wherein the opening instruction is used to instruct to open the distance measurement module of the electronic device. For example, when the electronic device receives an instruction for instructing to open a camera application, it is determined that the opening instruction is received. For example, a touch instruction is received on the icon of the camera application, or a voice instruction is received to instruct to open the camera application.
步骤S202,响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,控制所述光波发射器发射至少一个测试脉冲,以对所述测距模组进行故障检测,获得检测结果;其中,所述工作脉冲用于测量所述测距模组与目标物体之间的距离。Step S202, in response to the start-up instruction, before controlling the light wave transmitter in the ranging module to transmit working pulses at a first regular interval, controlling the light wave transmitter to transmit at least one test pulse to perform fault detection on the ranging module to obtain a detection result; wherein the working pulse is used to measure the distance between the ranging module and the target object.
本申请实施例中,对于光波发射器的类型不做限定,光波发射器可以是用于发射超声波、红外线、近红外线等光波的灯,例如光波发射器为激光发射器。In the embodiment of the present application, there is no limitation on the type of the light wave transmitter, and the light wave transmitter may be a lamp for transmitting light waves such as ultrasound, infrared, near-infrared, etc. For example, the light wave transmitter is a laser transmitter.
举例来说,如图3A所示,电子设备在接收到开启指令之后,不是直接控制测距模组中的光波发射器以第一规则间隔性地发射工作脉冲301至30M,M为大于1的整数;而是先控制光波发射器发射4个测试脉冲311至314,以对所述测距模组进行故障检测,这样,可以大大降低光波(例如激光)对人眼和皮肤的伤害。这是因为,电子设备在接收到开启指令之后,如果直接控制光波发射器发射工作脉冲,在这个过程中开始对光波发射器发射的工作脉冲进行安全测试,由于测试过程需要一定时间(例如0.5秒)才能完成,而工作脉冲的宽度通常远远小于0.5秒(例如工作脉冲的宽度为1至20纳秒),这样,电子设备在进行安全测试的这段时间内,光波发射器已经发射出去大量的工作脉冲,如果测距模组中的部件出现异常(例如,驱动电路短路或者扩散片脱落),将会使得这些工作脉冲的光功率大大增强,这足够给人眼和皮肤造成伤害。需要说明的是,图3A所示的工作脉冲,是电子设备在确定测距模组的部件没有发生障碍的前提下,控制光波发射器发射的脉冲信号。For example, as shown in FIG3A, after receiving the start-up instruction, the electronic device does not directly control the light wave transmitter in the distance measurement module to transmit working pulses 301 to 30M at first regular intervals, where M is an integer greater than 1; instead, the light wave transmitter is first controlled to transmit 4 test pulses 311 to 314 to perform fault detection on the distance measurement module, so that the damage of light waves (such as lasers) to human eyes and skin can be greatly reduced. This is because, after receiving the start-up instruction, if the electronic device directly controls the light wave transmitter to transmit working pulses, a safety test is started on the working pulses emitted by the light wave transmitter during this process. Since the test process takes a certain time (such as 0.5 seconds) to complete, and the width of the working pulse is usually much less than 0.5 seconds (such as the width of the working pulse is 1 to 20 nanoseconds), during this period of time when the electronic device is performing the safety test, the light wave transmitter has already emitted a large number of working pulses. If there is an abnormality in the components in the distance measurement module (for example, the driving circuit is short-circuited or the diffusion sheet falls off), the optical power of these working pulses will be greatly enhanced, which is enough to cause damage to human eyes and skin. It should be noted that the working pulse shown in FIG. 3A is a pulse signal that the electronic device controls the light wave transmitter to emit, under the premise that no obstacles occur to the components of the ranging module.
基于此,在本申请实施例中,电子设备在接收到开启指令之后,不直接发射工作脉冲,而是预先发射至少一个测试脉冲,以对测距模组进行故障检测,然后再根据故障检测的结果,控制测距模组的工作状态;如此,可以大大降低伤害人眼和皮肤健康的风险。Based on this, in an embodiment of the present application, after receiving a start-up instruction, the electronic device does not directly emit a working pulse, but instead pre-emits at least one test pulse to perform fault detection on the ranging module, and then controls the working state of the ranging module based on the result of the fault detection; in this way, the risk of harming human eyes and skin health can be greatly reduced.
需要说明的是,所述第一规则定义了光波发射器需要按照特定的脉冲频率、脉冲宽度和占空比发射工作脉冲,这些参数的配置均是符合人眼安全规范的。例如,图3B所示,控制光波发射器以脉冲频率为100兆赫兹(megahertz,MHZ)、占空比(Duty Cycle,DC)为33%、相位时间为350微秒(microsecond,us)、帧长为33.3毫秒(millisecond,ms)间隔性地发射工作脉冲;其中,根据脉冲频率和占空比,可以确定工作脉冲的脉冲宽度为33纳秒(nanosecond,ns)。It should be noted that the first rule defines that the light wave transmitter needs to transmit working pulses according to a specific pulse frequency, pulse width and duty cycle, and the configuration of these parameters is in compliance with the human eye safety specification. For example, as shown in FIG3B , the light wave transmitter is controlled to transmit working pulses intermittently with a pulse frequency of 100 megahertz (MHZ), a duty cycle (DC) of 33%, a phase time of 350 microseconds (microsecond, us), and a frame length of 33.3 milliseconds (millisecond, ms); wherein, according to the pulse frequency and duty cycle, the pulse width of the working pulse can be determined to be 33 nanoseconds (nanosecond, ns).
步骤S203,根据所述检测结果,控制所述测距模组的工作状态。Step S203: controlling the working state of the ranging module according to the detection result.
这里不同的检测结果,对应的测距模组的工作状态是不同的。例如通过如下实施例的步骤S505、步骤S507或步骤S509,实现对测距模组的工作状态进行控制。即,在所述检测结果为所述测距模组中的部件没有发生故障的情况下,控制所述测距模组将所述光波发射器的工作电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以所述第一规则间隔性地发射所述工作脉冲;在所述检测结果为所述扩散片已脱落的情况下,关闭所述测距模组,以禁止所述光波发射器发射所述工作脉冲;在所述检测结果为所述驱动电路已短路的情况下,关闭所述测距模组,或者控制所述测距模组将小于所述工作电流的其他电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以第二规则间隔性地发射工作脉冲。Here, different detection results correspond to different working states of the ranging module. For example, through step S505, step S507 or step S509 of the following embodiment, the working state of the ranging module is controlled. That is, when the detection result is that the components in the ranging module are not faulty, the ranging module is controlled to input the working current of the light wave transmitter into the driving circuit, so that the driving circuit drives the light wave transmitter to emit the working pulse at the first regular interval; when the detection result is that the diffuser has fallen off, the ranging module is turned off to prohibit the light wave transmitter from emitting the working pulse; when the detection result is that the driving circuit is short-circuited, the ranging module is turned off, or the ranging module is controlled to input other currents less than the working current into the driving circuit, so that the driving circuit drives the light wave transmitter to emit the working pulse at the second regular interval.
本申请实施例再提供一种故障检测方法,所述方法至少包括以下步骤S301至步骤S303:The present application further provides a fault detection method, which at least includes the following steps S301 to S303:
步骤S301,接收开启指令,所述开启指令用于指示开启电子设备的测距模组。Step S301, receiving an on instruction, wherein the on instruction is used to instruct to turn on a distance measurement module of an electronic device.
步骤S302,响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,将多个瞬时电流依次输入至所述测距模组中的驱动电路,使得所述驱动电路驱动所述光波发射器依次发射所述多个测试脉冲,以对所述测距模组进行故障检测,获得所述检测结果;其中,所述工作脉冲用于测量所述测距模组与目标物体之间的距离。Step S302, in response to the start-up instruction, before controlling the light wave transmitter in the ranging module to transmit working pulses at first regular intervals, a plurality of instantaneous currents are sequentially input into the driving circuit in the ranging module, so that the driving circuit drives the light wave transmitter to sequentially transmit the plurality of test pulses to perform fault detection on the ranging module and obtain the detection result; wherein the working pulse is used to measure the distance between the ranging module and the target object.
电子设备可以通过如下实施例中的步骤S402至步骤S404实现步骤S302,即,将多个瞬时电流依次输入至驱动电路,然后基于检测得到的每一光电流与预设的阈值范围之间的关系,确定检测结果;电子设备还可以通过如下实施例中的步骤S602至步骤S608实现步骤S302,即在输入一个瞬时电流至驱动电路,以驱动光波发射器发射一个测试脉冲之后,先检测在该测试脉冲的反射下光电转换元件所产生的光电流是否在对应的阈值范围内,如果是,再继续将下一个瞬时电流输入至驱动电路;否则,禁止光波发射器发射测试脉冲或者工作脉冲,或者输入较小的工作电流,以使光波发射器发射能量较小的工作脉冲。The electronic device can implement step S302 through steps S402 to S404 in the following embodiments, that is, input a plurality of instantaneous currents into the driving circuit in sequence, and then determine the detection result based on the relationship between each photocurrent detected and a preset threshold range; the electronic device can also implement step S302 through steps S602 to S608 in the following embodiments, that is, after inputting an instantaneous current into the driving circuit to drive the light wave transmitter to emit a test pulse, first detect whether the photocurrent generated by the photoelectric conversion element under the reflection of the test pulse is within the corresponding threshold range, and if so, continue to input the next instantaneous current into the driving circuit; otherwise, prohibit the light wave transmitter from emitting a test pulse or a working pulse, or input a smaller working current so that the light wave transmitter emits a working pulse with smaller energy.
需要说明的是,这里对于多个瞬时电流的数目、大小不做限定。一般来说,至少将两个瞬时电流依次输入至驱动电路,这样可以提高检测结果的准确率,降低误判概率。在实现时,多个瞬时电流的大小可以相同,也可以不同。但是,每一瞬时电流必须小于或等于光波发射器的最大工作电流,以符合人眼安全规范,避免瞬时电流过大给人眼和皮肤造成伤害。It should be noted that there is no limitation on the number and size of multiple instantaneous currents. Generally speaking, at least two instantaneous currents are input into the driving circuit in sequence, which can improve the accuracy of the detection results and reduce the probability of misjudgment. In implementation, the sizes of multiple instantaneous currents can be the same or different. However, each instantaneous current must be less than or equal to the maximum operating current of the light wave transmitter to comply with the human eye safety specification and avoid damage to the human eye and skin caused by excessive instantaneous current.
步骤S303,根据所述检测结果,控制所述测距模组的工作状态。Step S303: Control the working state of the ranging module according to the detection result.
在本申请实施例中,响应于开启指令,在控制测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,将多个瞬时电流依次输入至驱动电路,使得驱动电路驱动光波发射器依次发射多个测试脉冲,以对测距模组进行故障检测;这样,相比于直接将恒流电流输入至驱动电路来驱动光波发射器发射工作脉冲,基于工作脉冲进行安全检测的方法,前者能够获得以下技术效果:第一,可以减少对人眼和皮肤的伤害;第二,可以节约功耗;第三,可以降低因测距模组的部件出现异常,导致部件被烧坏的风险,因为在还没有确定测距模组的部件是否异常的情况下,直接通恒流电流(即工作电流),存在烧坏部件的风险。In an embodiment of the present application, in response to a start-up instruction, before controlling the light wave transmitter in the ranging module to transmit working pulses at a first regular interval, a plurality of instantaneous currents are sequentially input into the driving circuit, so that the driving circuit drives the light wave transmitter to sequentially transmit a plurality of test pulses to perform fault detection on the ranging module; in this way, compared with the method of directly inputting a constant current into the driving circuit to drive the light wave transmitter to transmit working pulses, the former can obtain the following technical effects based on the working pulse safety detection method: first, it can reduce damage to human eyes and skin; second, it can save power consumption; third, it can reduce the risk of components being burned out due to abnormalities in components of the ranging module, because when it is not determined whether the components of the ranging module are abnormal, the constant current (i.e., the working current) is directly passed, and there is a risk of burning out the components.
本申请实施例再提供一种故障检测方法,图4为本申请实施例另一故障检测方法的实现流程示意图,如图4所示,所述方法至少包括以下步骤S401至步骤S405:The present application further provides a fault detection method. FIG4 is a schematic diagram of an implementation flow of another fault detection method of the present application. As shown in FIG4 , the method at least includes the following steps S401 to S405:
步骤S401,接收开启指令,所述开启指令用于指示开启电子设备的测距模组。Step S401: receiving an on instruction, wherein the on instruction is used to instruct to turn on a distance measurement module of an electronic device.
步骤S402,响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,将多个瞬时电流依次输入至所述测距模组中的驱动电路,使得所述驱动电路驱动所述光波发射器依次发射所述多个测试脉冲。Step S402, in response to the start-up instruction, before controlling the light wave transmitter in the ranging module to transmit working pulses at a first regular interval, a plurality of instantaneous currents are sequentially input into the driving circuit in the ranging module, so that the driving circuit drives the light wave transmitter to transmit the plurality of test pulses sequentially.
步骤S403,检测在发射每一所述测试脉冲时所述测距模组中的光电转换元件所产生的光电流。Step S403, detecting the photocurrent generated by the photoelectric conversion element in the distance measurement module when each of the test pulses is emitted.
步骤S404,根据每一所述光电流与对应的阈值范围之间的关系,确定所述检测结果,以实现对所述测距模组进行故障检测。Step S404: determining the detection result according to the relationship between each photocurrent and the corresponding threshold range, so as to implement fault detection on the ranging module.
可以理解地,瞬时电流的大小不同时,驱动光波发射器发射的测试脉冲的能量也是不同的,因此通过扩散片反射至光电转换元件上的光子密度也是不同的,进而使得光电转换元件产生的光电流也不同。因此,不同的瞬时电流对应不同的阈值范围,即每一光电流对应有阈值范围;当然,不同的瞬时电流也可以对应相同的阈值范围。例如,在测距模组的部件没有故障的情况下,光波发射器的最小工作电流对应的光电流为所述阈值范围的下限值,最大工作电流对应的光电流为所述阈值范围的上限值。在实现时,还可以将下限值设置为接近于0的电流值。It can be understood that when the magnitude of the instantaneous current is different, the energy of the test pulse driven by the light wave transmitter is also different, so the photon density reflected by the diffuser to the photoelectric conversion element is also different, and the photocurrent generated by the photoelectric conversion element is also different. Therefore, different instantaneous currents correspond to different threshold ranges, that is, each photocurrent corresponds to a threshold range; of course, different instantaneous currents can also correspond to the same threshold range. For example, when there is no fault in the components of the ranging module, the photocurrent corresponding to the minimum operating current of the light wave transmitter is the lower limit of the threshold range, and the photocurrent corresponding to the maximum operating current is the upper limit of the threshold range. In implementation, the lower limit value can also be set to a current value close to 0.
电子设备可以通过如下实施例的步骤S504、步骤S506和步骤S508,确定不同的检测结果。The electronic device may determine different detection results through steps S504, S506, and S508 of the following embodiments.
步骤S405,根据所述检测结果,控制所述测距模组的工作状态。Step S405: controlling the working state of the ranging module according to the detection result.
在本申请实施例中,将多个瞬时电流依次输入至所述测距模组中的驱动电路,使得所述驱动电路驱动所述光波发射器依次发射所述多个测试脉冲;检测在发射每一所述测试脉冲时所述测距模组中的光电转换元件所产生的光电流;根据每一所述光电流与对应的阈值范围之间的关系,确定所述检测结果,从而使得电子设备能够更加快速地实现对测距模组进行故障检测。In an embodiment of the present application, a plurality of instantaneous currents are sequentially input into a driving circuit in the ranging module, so that the driving circuit drives the light wave transmitter to sequentially transmit the plurality of test pulses; the photocurrent generated by the photoelectric conversion element in the ranging module when each of the test pulses is transmitted is detected; and the detection result is determined based on the relationship between each of the photocurrents and the corresponding threshold range, so that the electronic device can more quickly perform fault detection on the ranging module.
本申请实施例再提供一种故障检测方法,图5为本申请实施例又一故障检测方法的实现流程示意图,如图5所示,所述方法至少包括以下步骤S501至步骤S509:The present application further provides a fault detection method. FIG5 is a schematic diagram of an implementation flow of another fault detection method of the present application. As shown in FIG5 , the method at least includes the following steps S501 to S509:
步骤S501,接收开启指令,所述开启指令用于指示开启电子设备的测距模组。Step S501: receiving an on instruction, wherein the on instruction is used to instruct to turn on a distance measurement module of an electronic device.
步骤S502,响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,将多个瞬时电流依次输入至所述测距模组中的驱动电路,使得所述驱动电路驱动所述光波发射器依次发射所述多个测试脉冲。Step S502, in response to the start-up instruction, before controlling the light wave transmitter in the ranging module to transmit working pulses at a first regular interval, a plurality of instantaneous currents are sequentially input into the driving circuit in the ranging module, so that the driving circuit drives the light wave transmitter to transmit the plurality of test pulses sequentially.
步骤S503,检测在发射每一所述测试脉冲时所述测距模组中的光电转换元件所产生的光电流。Step S503 , detecting the photocurrent generated by the photoelectric conversion element in the distance measurement module when each of the test pulses is emitted.
步骤S504,在每一所述光电流属于对应的阈值范围的情况下,确定所述检测结果为所述测距模组中的部件没有发生故障,进入步骤S505。Step S504: when each of the photocurrents falls within the corresponding threshold range, it is determined that the detection result is that no failure has occurred in the components of the ranging module, and the process proceeds to step S505.
举例来说,将2A的瞬时电流输入至驱动电路中,在测距模组中的部件没有故障的情况下,对应的光电流值为30微安(microamp,uA),在实现时可以将其对应的阈值范围设置为[1uA,50uA]。For example, when an instantaneous current of 2A is input into the driving circuit and there is no fault in the components in the ranging module, the corresponding photocurrent value is 30 microamps (uA). During implementation, the corresponding threshold range can be set to [1uA, 50uA].
步骤S505,控制所述测距模组将所述光波发射器的工作电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以所述第一规则间隔性地发射所述工作脉冲。Step S505 , controlling the distance measurement module to input the working current of the light wave transmitter into the driving circuit, so that the driving circuit drives the light wave transmitter to transmit the working pulse at the first regular interval.
例如,光波发射器的工作电流为1安培(Ampere,A)至3A,在实现时,将2A的工作电流输入至驱动电路。For example, the operating current of the light wave transmitter is 1 ampere (Ampere, A) to 3A. During implementation, an operating current of 2A is input to the driving circuit.
在其他实施例中,在光波发射器以第一规则间隔性地发射工作脉冲的过程中,电子设备还可以检测在发射每一工作脉冲时光电转换元件所产生的光电流,如果至少一个光电流大于预设阈值,或者小于预设阈值,可以根据该光电流与预设阈值之间的差值,调整当前工作电流,以使光波发射器发射的工作脉冲的光功率保持在一个特定范围,以解决多个电子设备发射的光强度不一致的问题。In other embodiments, during the process of the light wave transmitter emitting working pulses at first regular intervals, the electronic device may also detect the photocurrent generated by the photoelectric conversion element when emitting each working pulse. If at least one photocurrent is greater than a preset threshold, or less than a preset threshold, the current working current may be adjusted according to the difference between the photocurrent and the preset threshold so that the optical power of the working pulse emitted by the light wave transmitter is maintained within a specific range, so as to solve the problem of inconsistent light intensity emitted by multiple electronic devices.
步骤S506,在至少一个所述光电流大于对应的阈值范围的上限值的情况下,确定所述检测结果为所述驱动电路已短路,进入步骤S507。Step S506: When at least one of the photocurrents is greater than the upper limit of the corresponding threshold range, it is determined that the detection result is that the drive circuit is short-circuited, and the process proceeds to step S507.
可以理解地,如果驱动电路出现短路,即使将较小的电流输入至驱动电路,也会导致驱动电路输出较大的电流,从而触发光波发射器发射能量很强的光波,进而使得光电转换元件上的光子密度增大,产生较大的光电流。It can be understood that if a short circuit occurs in the driving circuit, even if a smaller current is input into the driving circuit, it will cause the driving circuit to output a larger current, thereby triggering the light wave transmitter to emit a very high-energy light wave, thereby increasing the photon density on the photoelectric conversion element and generating a larger photocurrent.
步骤S507,关闭所述测距模组,以禁止所述光波发射器发射所述工作脉冲,从而避免光波发射器发射大量强光,伤害人眼和皮肤健康。Step S507, turning off the distance measurement module to prohibit the light wave transmitter from emitting the working pulse, thereby preventing the light wave transmitter from emitting a large amount of strong light and damaging human eyes and skin health.
在其他实施例中,电子设备在检测出所述驱动电路已短路的情况下,还可以控制所述测距模组将小于所述工作电流的其他电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以第二规则间隔性地发射工作脉冲。这里需要说明的是,所述第二规则可以与所述第一规则相同,也可以不同;不同时,所述第二规则中的脉冲频率、脉冲宽度或者占空比等参数较小,这样才能够使得光波发射器发射较小功率的工作脉冲。In other embodiments, when the electronic device detects that the driving circuit is short-circuited, it can also control the ranging module to input other currents less than the working current into the driving circuit, so that the driving circuit drives the light wave transmitter to transmit working pulses at intervals according to the second rule. It should be noted here that the second rule can be the same as the first rule or different; when different, the parameters such as pulse frequency, pulse width or duty cycle in the second rule are smaller, so that the light wave transmitter can emit working pulses with lower power.
在其他实施例中,电子设备在检测出所述驱动电路已短路的情况下,还可以输出提示信息,以提示用户拉长测距模组与目标物体之间的距离。例如,用户在打开相机进行自拍时,在图像预览界面弹出提示消息,以提示用户将相机距离自己更远些。In other embodiments, when the electronic device detects that the driving circuit is short-circuited, it can also output a prompt message to prompt the user to increase the distance between the ranging module and the target object. For example, when the user opens the camera to take a selfie, a prompt message pops up on the image preview interface to prompt the user to move the camera further away from himself.
步骤S508,在每一所述光电流小于对应的阈值范围的下限值的情况下,确定所述检测结果为所述测距模组中的扩散片已脱落,进入步骤S509。Step S508 , when each of the photocurrents is less than the lower limit of the corresponding threshold range, it is determined that the detection result is that the diffusion sheet in the ranging module has fallen off, and the process proceeds to step S509 .
可以理解地,如果扩散片脱落,将会导致两个问题:第一,发射的脉冲信号的功率密度增大,这对于人眼和皮肤会造成伤害;第二,没有光子被反射至光电转换元件上,这样就会导致光电转换元件所产生的光电流很小,几乎接近于0。因此,电子设备在实现时,为了避免其他光信号对检测结果的干扰,这里一般将下限值设置为非零值,例如,将下限值设置为1uA。Understandably, if the diffuser falls off, two problems will occur: first, the power density of the emitted pulse signal increases, which can cause damage to human eyes and skin; second, no photons are reflected to the photoelectric conversion element, which will cause the photocurrent generated by the photoelectric conversion element to be very small, almost close to 0. Therefore, when the electronic device is implemented, in order to avoid interference of other optical signals on the detection results, the lower limit value is generally set to a non-zero value, for example, the lower limit value is set to 1uA.
步骤S509,关闭所述测距模组,以禁止所述光波发射器发射所述工作脉冲,从而降低伤害人眼和皮肤健康的风险。Step S509, turning off the distance measurement module to prohibit the light wave transmitter from emitting the working pulse, thereby reducing the risk of harming human eyes and skin health.
在本申请实施例中,根据每一所述光电流与对应的阈值范围之间的关系,确定具体的检测结果,从而为后续更好地控制测距模组的工作状态,提供依据条件。In the embodiment of the present application, a specific detection result is determined based on the relationship between each of the photocurrents and the corresponding threshold range, thereby providing a basis for better controlling the working state of the ranging module in the subsequent process.
本申请实施例再提供一种故障检测方法,图6为本申请实施例再一故障检测方法的实现流程示意图,如图6所示,所述方法至少包括以下步骤S601至步骤S610:The present application further provides a fault detection method. FIG6 is a schematic diagram of an implementation flow of another fault detection method of the present application. As shown in FIG6 , the method at least includes the following steps S601 to S610:
步骤S601,接收开启指令,所述开启指令用于指示开启电子设备的测距模组。Step S601: receiving an on instruction, wherein the on instruction is used to instruct to turn on a distance measurement module of an electronic device.
步骤S602,响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,将N个瞬时电流依次输入至所述测距模组中的驱动电路,以使所述驱动电路驱动所述光波发射器依次发射所述N个测试脉冲,N为大于1的整数。Step S602, in response to the start-up instruction, before controlling the light wave transmitter in the ranging module to transmit working pulses at a first regular interval, N instantaneous currents are sequentially input into the driving circuit in the ranging module, so that the driving circuit drives the light wave transmitter to transmit the N test pulses sequentially, where N is an integer greater than 1.
电子设备在实现步骤S602时,可以将N个瞬时电流按照由小到大的顺序,依次输入至驱动电路。例如,将光波发射器的最小工作电流Ia作为第一个瞬时电流输入至驱动电路,然后间隔一定时间之后,再将光波发射器的典型工作电流Ityp作为第二个瞬时电流输入至驱动电路。这样,通过将2个瞬时电流依次输入至驱动电路,一方面可以避免误检测,使得获得的检测结果更加准确;另一方面,第二个瞬时电流使用光波发射器的最大工作电流,可以提高检测灵敏度。在其他示例中,第一个瞬时电流小于第二个瞬时电流,第二个瞬时电流可以小于光波发射器的最大工作电流。When the electronic device implements step S602, N instantaneous currents can be input into the driving circuit in order from small to large. For example, the minimum operating current Ia of the light wave transmitter is input into the driving circuit as the first instantaneous current, and then after a certain interval, the typical operating current Ityp of the light wave transmitter is input into the driving circuit as the second instantaneous current. In this way, by inputting the two instantaneous currents into the driving circuit in sequence, on the one hand, false detection can be avoided, so that the obtained detection result is more accurate; on the other hand, the second instantaneous current uses the maximum operating current of the light wave transmitter, which can improve the detection sensitivity. In other examples, the first instantaneous current is less than the second instantaneous current, and the second instantaneous current can be less than the maximum operating current of the light wave transmitter.
这里对于N的值不做限定,也就是说,在实现时,可以将2个或者3个甚至更多的瞬时电流依次输入至驱动电路中。There is no limitation on the value of N here, that is, in implementation, 2 or 3 or even more instantaneous currents may be input into the driving circuit in sequence.
步骤S603,确定发射的第N个测试脉冲的特性是否满足条件;如果不满足,执行步骤S604;如果满足,执行步骤S605。Step S603, determine whether the characteristics of the transmitted Nth test pulse meet the conditions; if not, execute step S604; if so, execute step S605.
电子设备可以通过如下实施例中的步骤S703、步骤S704、步骤S706和步骤S708确定发射的第N个测试脉冲的特性是否满足条件。即,检测在发射所述第N个测试脉冲时所述测距模组中的光电转换元件所产生的光电流;在所述光电流属于对应的阈值范围的情况下,确定所述第N个测试脉冲的特性满足条件;反之,在所述光电流不在对应的阈值范围的情况下,确定所述第N个测试脉冲的特性不满足条件;在不满足条件的情况下,说明测距模组的某个部件可能存在异常(例如,驱动电路短路、扩散片脱落等),此时执行步骤S604,禁止继续将下一个瞬时电流输入至驱动电路,从而降低故障检测过程给人眼和皮肤带来的伤害。The electronic device can determine whether the characteristics of the Nth test pulse emitted meet the conditions through steps S703, S704, S706 and S708 in the following embodiments. That is, the photocurrent generated by the photoelectric conversion element in the distance measurement module when the Nth test pulse is emitted is detected; when the photocurrent belongs to the corresponding threshold range, it is determined that the characteristics of the Nth test pulse meet the conditions; conversely, when the photocurrent is not within the corresponding threshold range, it is determined that the characteristics of the Nth test pulse do not meet the conditions; when the conditions are not met, it indicates that a certain component of the distance measurement module may be abnormal (for example, the driving circuit is short-circuited, the diffusion sheet falls off, etc.), and step S604 is executed at this time to prohibit the next instantaneous current from being input into the driving circuit, thereby reducing the damage caused to human eyes and skin during the fault detection process.
步骤S604,禁止继续将下一瞬时电流输入至所述驱动电路,以结束对所述测距模组进行故障检测,并获得所述检测结果,然后根据所述检测结果执行步骤S609或者步骤S610。Step S604, prohibiting the next instantaneous current from being input into the driving circuit to end the fault detection of the ranging module and obtain the detection result, and then executing step S609 or step S610 according to the detection result.
电子设备可以根据在发射所述第N个测试脉冲时光电转换元件所产生的光电流与对应的阈值范围之间的关系,确定检测结果。例如,通过如下实施例的步骤S704或步骤S706确定检测结果。The electronic device may determine the detection result according to the relationship between the photocurrent generated by the photoelectric conversion element when the Nth test pulse is emitted and the corresponding threshold range, for example, by determining the detection result through step S704 or step S706 of the following embodiment.
步骤S605,继续将下一瞬时电流输入至所述驱动电路,使得所述驱动电路驱动所述光波发射器发射下一个测试脉冲。Step S605 , continue to input the next instantaneous current into the driving circuit, so that the driving circuit drives the light wave transmitter to emit the next test pulse.
电子设备在实现步骤S605时,可以继续将光波发射器的典型工作电流输入至驱动电路;这样,第一,可以增加检测结果的可靠性;第二,使得检测结果更有参考价值,这是因为在后续发射工作脉冲时,输入至驱动电路的工作电流为该典型工作电流。例如将2A的典型工作电流输入至驱动电路。When the electronic device implements step S605, it can continue to input the typical working current of the light wave transmitter into the driving circuit; in this way, first, the reliability of the detection result can be increased; second, the detection result is more valuable for reference, because when the working pulse is subsequently emitted, the working current input to the driving circuit is the typical working current. For example, a typical working current of 2A is input into the driving circuit.
步骤S606,确定在发射所述下一个测试脉冲时所述光电转换元件所产生的光电流是否满足条件;如果满足,执行步骤S607;如果不满足,执行步骤S608。Step S606, determining whether the photocurrent generated by the photoelectric conversion element when emitting the next test pulse meets the condition; if so, executing step S607; if not, executing step S608.
步骤S607,控制所述测距模组将所述光波发射器的工作电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以所述第一规则间隔性地发射所述工作脉冲。Step S607, controlling the distance measurement module to input the working current of the light wave transmitter into the driving circuit, so that the driving circuit drives the light wave transmitter to transmit the working pulse at the first regular interval.
在其他实施例中,如果在步骤S606中确定在发射所述下一个测试脉冲时所述光电转换元件所产生的光电流也满足条件时,继续将一个瞬时电流输入至所述驱动电路,使得所述驱动电路驱动所述光波发射器再发射一个测试脉冲,进而完成故障检测,这样可以增加检测结果的可靠性。In other embodiments, if it is determined in step S606 that the photocurrent generated by the photoelectric conversion element also meets the conditions when emitting the next test pulse, an instantaneous current continues to be input into the driving circuit, so that the driving circuit drives the light wave transmitter to emit another test pulse, thereby completing the fault detection, which can increase the reliability of the detection results.
步骤S608,结束对所述测距模组进行故障检测,并获得所述检测结果,然后根据所述检测结果执行步骤S609或者步骤S610。Step S608, ending the fault detection of the ranging module and obtaining the detection result, and then executing step S609 or step S610 according to the detection result.
步骤S609,在所述检测结果为所述扩散片已脱落的情况下,关闭所述测距模组,以禁止所述光波发射器发射所述工作脉冲。Step S609, when the detection result is that the diffusion sheet has fallen off, shut down the distance measurement module to prohibit the light wave transmitter from emitting the working pulse.
步骤S610,在所述检测结果为所述驱动电路已短路的情况下,关闭所述测距模组,或者控制所述测距模组将小于所述工作电流的其他电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以第二规则间隔性地发射工作脉冲。Step S610, when the detection result is that the driving circuit is short-circuited, turn off the ranging module, or control the ranging module to input other currents less than the working current into the driving circuit, so that the driving circuit drives the light wave transmitter to emit working pulses at a second regular interval.
本申请实施例再提供一种故障检测方法,所述方法至少包括以下步骤S701至步骤S703:The present application further provides a fault detection method, which at least includes the following steps S701 to S703:
步骤S701,接收开启指令,所述开启指令用于指示开启电子设备的测距模组。Step S701: receiving an on instruction, wherein the on instruction is used to instruct to turn on a distance measurement module of an electronic device.
步骤S702,响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,将N个瞬时电流依次输入至所述测距模组中的驱动电路,以使所述驱动电路驱动所述光波发射器依次发射所述N个测试脉冲,N为大于1的整数;Step S702, in response to the start instruction, before controlling the light wave transmitter in the distance measurement module to transmit working pulses at first regular intervals, sequentially inputting N instantaneous currents into the driving circuit in the distance measurement module, so that the driving circuit drives the light wave transmitter to sequentially transmit the N test pulses, where N is an integer greater than 1;
步骤S703,检测在发射所述第N个测试脉冲时所述测距模组中的光电转换元件所产生的光电流;Step S703, detecting the photocurrent generated by the photoelectric conversion element in the ranging module when the Nth test pulse is emitted;
步骤S704,至少在所述光电流大于对应的阈值范围的上限值的情况下,确定所述第N个测试脉冲的特性不满足条件,禁止继续将下一瞬时电流输入至所述驱动电路,以结束对所述测距模组进行故障检测,并确定所述检测结果为所述驱动电路已短路,进入步骤S705。Step S704, at least when the photocurrent is greater than the upper limit value of the corresponding threshold range, it is determined that the characteristics of the Nth test pulse do not meet the conditions, and it is prohibited to continue to input the next instantaneous current into the drive circuit to end the fault detection of the ranging module, and determine that the detection result is that the drive circuit is short-circuited, and enter step S705.
例如,如果在发射所述第N个测试脉冲时光电转换元件所产生的光电流大于对应的阈值范围的上限值,确定所述第N个测试脉冲的特性不满足条件,禁止继续将下一瞬时电流输入至所述驱动电路,以结束对所述测距模组进行故障检测,并确定所述检测结果为所述驱动电路已短路。再如,如果在发射所述N个测试脉冲中的每一测试脉冲时光电转换元件所产生的光电流大于对应的阈值范围的上限值,得到步骤S704中的结果。For example, if the photocurrent generated by the photoelectric conversion element when emitting the Nth test pulse is greater than the upper limit of the corresponding threshold range, it is determined that the characteristic of the Nth test pulse does not meet the condition, and it is prohibited to continue to input the next instantaneous current into the drive circuit to end the fault detection of the ranging module, and determine that the detection result is that the drive circuit is short-circuited. For another example, if the photocurrent generated by the photoelectric conversion element when each of the N test pulses is emitted is greater than the upper limit of the corresponding threshold range, the result in step S704 is obtained.
步骤S705,关闭所述测距模组,或者控制所述测距模组将小于所述工作电流的其他电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以第二规则间隔性地发射工作脉冲。Step S705, turning off the distance measurement module, or controlling the distance measurement module to input other currents smaller than the working current into the driving circuit, so that the driving circuit drives the light wave transmitter to emit working pulses at second regular intervals.
步骤S706,至少在所述光电流小于对应的阈值范围的下限值的情况下,确定所述第N个测试脉冲的特性不满足条件,并确定所述检测结果为所述测距模组中的扩散片已脱落,进入步骤S707。Step S706, at least when the photocurrent is less than the lower limit of the corresponding threshold range, determine that the characteristics of the Nth test pulse do not meet the conditions, and determine that the detection result is that the diffusion sheet in the ranging module has fallen off, and enter step S707.
步骤S707,关闭所述测距模组,以禁止所述光波发射器发射所述工作脉冲。Step S707, turning off the distance measurement module to prohibit the light wave transmitter from emitting the working pulse.
步骤S708,至少在所述光电流属于对应的阈值范围的情况下,继续将下一瞬时电流输入至所述驱动电路,使得所述驱动电路驱动所述光波发射器发射下一个测试脉冲;Step S708, at least when the photocurrent belongs to the corresponding threshold range, continue to input the next instantaneous current into the driving circuit, so that the driving circuit drives the light wave transmitter to emit the next test pulse;
步骤S709,确定在发射所述下一个测试脉冲时所述光电转换元件所产生的光电流是否满足条件;如果满足,执行步骤S710;如果不满足,执行步骤S711;Step S709, determining whether the photocurrent generated by the photoelectric conversion element when emitting the next test pulse meets a condition; if so, executing step S710; if not, executing step S711;
步骤S710,控制所述测距模组将所述光波发射器的工作电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以所述第一规则间隔性地发射所述工作脉冲。Step S710, controlling the distance measurement module to input the working current of the light wave transmitter into the driving circuit, so that the driving circuit drives the light wave transmitter to transmit the working pulse at the first regular interval.
步骤S711,结束对所述测距模组进行故障检测,并获得所述检测结果,然后根据所述检测结果执行步骤S705或者步骤S707。Step S711, end the fault detection of the ranging module and obtain the detection result, and then execute step S705 or step S707 according to the detection result.
随着体感交互与控制、3D物体识别与感知、智能环境感知以及动态地图构建等技术与市场的发展,如今各大应用场景都开始对3D视觉与识别技术产生日益浓厚的兴趣和日益旺盛的需求。With the development of technologies and markets such as body-sensing interaction and control, 3D object recognition and perception, intelligent environment perception, and dynamic map construction, major application scenarios are now beginning to have an increasing interest in and demand for 3D vision and recognition technologies.
技术方面,相比3D深度视觉的其他两种方案而言,TOF测距法在实际应用中的优势不言而喻。举例来讲,比如在画面拍摄后计算景深时不需要进行后处理,既可避免时间延迟,又可节省采用强大后处理系统带来的相关成本;而且,TOF测距规模弹性大,大多数情况下只需改变光源强度、光学视野以及激光发射器的脉冲频率即可完成测距规模的调整;此外,由于TOF测距模组具有不易受外界光干扰、体积小巧、响应速度快以及识别精度高等多重优势,使得TOF测距模组无论是在移动端还是车载等应用领域日渐成为3D视觉的首选技术方案。In terms of technology, compared with the other two solutions for 3D depth vision, the advantages of TOF distance measurement in practical applications are self-evident. For example, when calculating the depth of field after the picture is taken, no post-processing is required, which can avoid time delays and save the related costs of using a powerful post-processing system; moreover, TOF distance measurement has a large scale flexibility, and in most cases, the adjustment of the distance measurement scale can be completed by simply changing the light source intensity, optical field of view, and the pulse frequency of the laser transmitter; in addition, because the TOF distance measurement module has multiple advantages such as being not easily affected by external light interference, small size, fast response speed, and high recognition accuracy, the TOF distance measurement module is becoming the preferred technical solution for 3D vision in both mobile and automotive applications.
其中TOF测距模组用于手机等移动设备上时,可以用来测量距离和尺寸、对场景中的物体做三维建模、拍照虚化、体感游戏以及配合增强现实技术(Augmented Reality,AR)眼镜做相应的应用。When the TOF ranging module is used on mobile devices such as mobile phones, it can be used to measure distance and size, make three-dimensional modeling of objects in the scene, blur the camera, play somatosensory games, and cooperate with augmented reality (AR) glasses for corresponding applications.
在TOF测距模组中,影响红外发射单元发射的激光能量的因素主要包括:供电电流、脉冲频率(Frequency)、脉冲宽度和占空比;其中:In the TOF ranging module, the factors that affect the laser energy emitted by the infrared transmitting unit mainly include: power supply current, pulse frequency (Frequency), pulse width and duty cycle; among which:
脉冲频率:激光发射器(即所述光波发射器中的一种示例)发出经过调制后的脉冲信号,该信号的调制速度就是频率,通常在20MHZ至100MHZ之间;Pulse frequency: The laser transmitter (i.e., an example of the light wave transmitter) emits a modulated pulse signal. The modulation speed of the signal is the frequency, which is usually between 20 MHZ and 100 MHZ.
脉冲宽度:脉冲频率的倒数叫做周期,周期*占空比就是脉冲宽度,通常在1-20ns;Pulse width: The reciprocal of the pulse frequency is called the period, and the period * duty cycle is the pulse width, usually 1-20ns;
占空比:脉冲宽度/周期,通常在10%至50%之间;Duty cycle: Pulse width/period, usually between 10% and 50%;
脉冲频率、脉冲宽度和占空比是TOF传感器和VCSEL的驱动电路的配置参数,通常是在设定后就会固定下来。Pulse frequency, pulse width and duty cycle are configuration parameters of the TOF sensor and VCSEL drive circuit, which are usually fixed after setting.
而驱动电路的供电电流是影响激光能量的直接因素,通常情况下,TOF测距模组有过流保护机制,其具体原理就是:通过红外发射单元的光电二极管PD将接收反射回来的激光能量转换成相应的光电流,基于光电流的大小来判断激光发射器发射的激光能量是否发生变化。例如,预先根据激光发射器的最大驱动电流设定PD的电流阈值,若在工作过程中PD的光电流超过该电流阈值,则会触发保护机制,关闭激光发射器。The power supply current of the driving circuit is a direct factor affecting the laser energy. Usually, the TOF ranging module has an overcurrent protection mechanism. The specific principle is: the photodiode PD of the infrared emitting unit converts the reflected laser energy into a corresponding photocurrent, and judges whether the laser energy emitted by the laser transmitter has changed based on the size of the photocurrent. For example, the current threshold of the PD is set in advance according to the maximum driving current of the laser transmitter. If the photocurrent of the PD exceeds the current threshold during operation, the protection mechanism will be triggered to shut down the laser transmitter.
相关技术中的TOF安全检测和保护机制均是在激光发射器开始工作后进行的,若遇到异常情况,如激光发射器的驱动电路发生短路,则会导致激光发射器在刚上电时就会处于较高的电流水平,造成初始发射的激光的能量变大,此时使用该激光就会有人眼安全风险。The TOF safety detection and protection mechanisms in related technologies are all performed after the laser emitter starts working. If an abnormal situation occurs, such as a short circuit in the driving circuit of the laser emitter, the laser emitter will be at a higher current level when it is just powered on, causing the energy of the initial emitted laser to increase. At this time, using the laser will pose a risk to human eye safety.
相关的激光能量监测方案是在激光发射器开始工作后进行的,对于初始发射的激光能量监测不到。这种情况对于激光发射器的驱动电路出现异常后没有发现而去继续使用TOF测距模组,会有一定的人眼安全风险。The relevant laser energy monitoring scheme is carried out after the laser transmitter starts working, and the laser energy emitted initially cannot be monitored. In this case, if the TOF ranging module is used without discovering the abnormality of the laser transmitter's driving circuit, there will be certain risks to human eye safety.
基于此,下面将说明本申请实施例在一个实际的应用场景中的示例性应用。Based on this, an exemplary application of an embodiment of the present application in a practical application scenario will be described below.
本申请实施例,在相关的激光能量监测的基础上,通过不同的电流驱动激光发射器预发射若干个脉冲信号(即所述测试脉冲),通过PD的光电流判断驱动电路是否正常,以实现初始发射的激光能量的监测。In the embodiment of the present application, based on the relevant laser energy monitoring, the laser emitter is driven by different currents to pre-emit several pulse signals (i.e., the test pulses), and the photocurrent of the PD is used to determine whether the driving circuit is normal, so as to realize the monitoring of the initially emitted laser energy.
具体实现方法如下,以100MHZ的TOF测距模组为例作为说明,其实现方法为:The specific implementation method is as follows. Taking the 100MHZ TOF ranging module as an example, the implementation method is:
1)依据安全标准,针对100MHZ的TOF测距模组,计算出人眼安全可以接受的最大激光电流,记为Ia;1) According to the safety standards, for the 100MHZ TOF ranging module, calculate the maximum laser current that is acceptable to human eye safety, denoted as Ia;
2)根据激光发射器的工作电流范围,设定对应的PD的电流阈值范围;例如,激光发射器的工作电流范围是[Imin,Imax],典型值是Ityp;PD对应的电流值范围为[imin,imax];2) According to the operating current range of the laser transmitter, set the current threshold range of the corresponding PD; for example, the operating current range of the laser transmitter is [Imin, Imax], and the typical value is Ityp; the current value range corresponding to the PD is [imin, imax];
3)设定4档驱动电流(即瞬时电流),依次为第一电流(Imin)、第二电流(Ia)、第三电流(Ityp)、第四电流(Ityp),如图7所示,分别生成第一脉冲信号、第二脉冲信号、第三脉冲信号和第四脉冲信号,其中第三脉冲信号和第四脉冲信号相同,目的是为了验证第三电流的稳定性;4档脉冲信号的部分能量经过扩散片反射到PD上,则PD对应4个电流值;3) 4 drive currents (i.e. instantaneous currents) are set, which are the first current (Imin), the second current (Ia), the third current (Ityp), and the fourth current (Ityp), respectively. As shown in FIG7 , a first pulse signal, a second pulse signal, a third pulse signal, and a fourth pulse signal are generated, respectively. The third pulse signal and the fourth pulse signal are the same, and the purpose is to verify the stability of the third current. Part of the energy of the 4 pulse signals is reflected to the PD through the diffuser, and the PD corresponds to 4 current values.
4)在开启相位工作之前,按照4档电流驱动分别发射4个低频脉冲信号;4) Before starting the phase operation, four low-frequency pulse signals are respectively emitted according to the four-level current drive;
5)若4档驱动电流分别能够对应PD的电流阈值内,则判断为:激光发射器的驱动电流正常,此时相位工作开启,如图7所示,开始发射相位脉冲信号(即所述工作脉冲);5) If the four drive currents are within the corresponding current thresholds of the PD, it is determined that the drive current of the laser transmitter is normal, and the phase operation is turned on, as shown in FIG7 , and the phase pulse signal (ie, the working pulse) starts to be emitted;
6)如图8所示,若第二脉冲信号对应的PD电流值超出电流阈值范围的上限值,则判断为电流过大,停止相位工作;6) As shown in FIG8 , if the PD current value corresponding to the second pulse signal exceeds the upper limit of the current threshold range, it is determined that the current is too large and the phase operation is stopped;
如图9所示,电子设备在执行上述方法时,可以包括以下步骤S901至步骤S906:As shown in FIG. 9 , when the electronic device executes the above method, the following steps S901 to S906 may be included:
步骤S901,开启TOF测距模组,然后进入步骤S902;Step S901, turn on the TOF ranging module, and then go to step S902;
步骤S902,按照预先设定的4档驱动电流驱动激光发射器发射4个低频脉冲信号;Step S902, driving the laser transmitter to emit four low-frequency pulse signals according to four preset drive current levels;
步骤S903,读出4档驱动电流下的脉冲信号对应的PD电流值;Step S903, reading out the PD current value corresponding to the pulse signal under the 4-level driving current;
步骤S904,判断每一PD电流值是否在对应的阈值范围内;如果是,执行步骤S905;否则,执行步骤S906;Step S904, determining whether each PD current value is within the corresponding threshold range; if yes, executing step S905; otherwise, executing step S906;
步骤S905,以激光发射器的工作电流驱动激光发射器按照预先配置的参数,间隔性地发射工作脉冲(即开启相位工作);Step S905, driving the laser emitter with the working current of the laser emitter according to the pre-configured parameters to intermittently emit working pulses (i.e., start phase operation);
步骤S906,第二脉冲信号对应的PD电流值超过电流阈值范围的上限值,则判断为电流过大,此时停止相位工作。Step S906: If the PD current value corresponding to the second pulse signal exceeds the upper limit of the current threshold range, it is determined that the current is too large, and the phase operation is stopped.
在本申请实施例中,一方面实现了对于初始的激光能量的监测,有利于提前发现驱动电路异常并及时触发保护机制,关闭激光发射器;另一方面可以在工作过程中对激光的发射能量进行有效的控制。In the embodiments of the present application, on the one hand, the initial laser energy is monitored, which is conducive to early detection of drive circuit abnormalities and timely triggering of protection mechanisms to shut down the laser emitter; on the other hand, the laser emission energy can be effectively controlled during operation.
在本申请实施例中,通过不同的电流驱动预发射若干个脉冲信号,通过PD的电流判断电流驱动是否正常,以实现初始发射的激光能量的监测。In the embodiment of the present application, several pulse signals are pre-emitted by different current driving, and whether the current driving is normal is judged by the current of the PD, so as to realize the monitoring of the laser energy emitted initially.
在其他实施例中,还可以将4档电流驱动,依次设定为第一电流(I0)、第二电流(I1)、第三电流(I2)和第四电流(I3),这4档电流依次增大,如图10所示,分别生成第一脉冲信号、第二脉冲信号、第三脉冲信号和第四脉冲信号;第一脉冲信号到第四脉冲信号对应的幅值均小于最大电流对应的幅值。In other embodiments, four current drives can also be set in sequence as the first current (I0), the second current (I1), the third current (I2) and the fourth current (I3). These four currents increase in sequence, as shown in FIG10, to generate a first pulse signal, a second pulse signal, a third pulse signal and a fourth pulse signal respectively; the amplitudes corresponding to the first pulse signal to the fourth pulse signal are all smaller than the amplitude corresponding to the maximum current.
若这4档驱动电流能够对应PD的电流阈值内,则判断为激光驱动电流正常,此时如图10所示,开启相位工作;反之,相位工作不开启。If the four drive currents are within the corresponding current threshold of the PD, it is determined that the laser drive current is normal, and at this time, as shown in FIG. 10 , the phase operation is turned on; otherwise, the phase operation is not turned on.
在其他实施例中,此方案也可以用来提前检测扩散片是否脱落;具体地,在使用激光发射器之前,扩散片(diffuser)的状态是未知的。1)若此时diffuser是脱落的状态,激光发射器按照正常的设定发射激光,在检测并判断到diffuser脱落的这段时间内,已发射的激光就会对人眼和皮肤造成伤害;2)若此时diffuser没有脱落,但是激光发射器的驱动电路异常导致电流变大,激光发射器按照正常的设定发射激光,光脉冲功率也会变大,已发射的激光就会对人眼和皮肤造成伤害。In other embodiments, this scheme can also be used to detect in advance whether the diffuser has fallen off; specifically, before using the laser transmitter, the state of the diffuser is unknown. 1) If the diffuser is in a state of falling off at this time, the laser transmitter emits laser according to normal settings. During the period of time when the diffuser is detected and judged to have fallen off, the emitted laser will cause damage to human eyes and skin; 2) If the diffuser has not fallen off at this time, but the driving circuit of the laser transmitter is abnormal, causing the current to increase, the laser transmitter emits laser according to normal settings, and the light pulse power will also increase, and the emitted laser will cause damage to human eyes and skin.
所以,可以通过发射3个低频脉冲信号,判断diffuser的状态,再决定是否开启相位工作。如图11所示,TOF测距模组被开启之后,发射3个低频脉冲信号,判断PD电流值是否小于第一阈值;如果3次的PD电流值都小于第一阈值,则判断diffuser脱落,不开启相位工作;3次的PD电流值大于第一阈值且小于第二阈值,则判断diffuser正常,激光电流也正常,开启相位工作。Therefore, the state of the diffuser can be determined by emitting three low-frequency pulse signals, and then whether to start the phase operation can be determined. As shown in Figure 11, after the TOF ranging module is turned on, three low-frequency pulse signals are emitted to determine whether the PD current value is less than the first threshold; if the PD current values of the three times are all less than the first threshold, it is determined that the diffuser is off and the phase operation is not turned on; if the PD current values of the three times are greater than the first threshold and less than the second threshold, it is determined that the diffuser is normal, the laser current is also normal, and the phase operation is turned on.
基于前述的实施例,本申请实施例提供一种故障检测装置,该装置包括所包括的各模块、以及各模块所包括的各单元,可以通过电子设备中的处理器来实现;当然也可通过具体的逻辑电路实现;在实施的过程中,处理器可以为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等。Based on the foregoing embodiments, an embodiment of the present application provides a fault detection device, which includes the modules included and the units included in the modules, and can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
图12为本申请实施例故障检测装置的组成结构示意图,如图12所示,所述装置120包括接收模块121和控制模块122,其中:FIG12 is a schematic diagram of the structure of a fault detection device according to an embodiment of the present application. As shown in FIG12 , the device 120 includes a receiving module 121 and a control module 122, wherein:
接收模块121,配置为接收开启指令,所述开启指令用于指示开启所述装置120的测距模组;The receiving module 121 is configured to receive an opening instruction, wherein the opening instruction is used to instruct to open the distance measurement module of the device 120;
控制模块122,配置为响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,控制所述光波发射器发射至少一个测试脉冲,以对所述测距模组进行故障检测,获得检测结果;其中,所述工作脉冲用于测量所述测距模组与目标物体之间的距离;The control module 122 is configured to, in response to the start instruction, control the light wave transmitter in the distance measurement module to transmit at least one test pulse before controlling the light wave transmitter in the distance measurement module to transmit working pulses at first regular intervals, so as to perform fault detection on the distance measurement module and obtain a detection result; wherein the working pulse is used to measure the distance between the distance measurement module and the target object;
所述控制模块122,还配置为根据所述检测结果,控制所述测距模组的工作状态。The control module 122 is further configured to control the working state of the ranging module according to the detection result.
在其他实施例中,所述控制模块122,配置为响应于所述开启指令,在控制所述测距模组中的光波发射器以第一规则间隔性地发射工作脉冲之前,将多个瞬时电流依次输入至所述测距模组中的驱动电路,使得所述驱动电路驱动所述光波发射器依次发射所述多个测试脉冲,以对所述测距模组进行故障检测,获得所述检测结果。In other embodiments, the control module 122 is configured to respond to the start-up instruction and, before controlling the light wave transmitter in the ranging module to transmit working pulses at first regular intervals, sequentially input a plurality of instantaneous currents into the driving circuit in the ranging module, so that the driving circuit drives the light wave transmitter to transmit the plurality of test pulses sequentially to perform fault detection on the ranging module and obtain the detection result.
在其他实施例中,所述控制模块122,包括:第一驱动单元,配置为将多个瞬时电流依次输入至所述测距模组中的驱动电路,使得所述驱动电路驱动所述光波发射器依次发射所述多个测试脉冲;第一检测单元,配置为检测在发射每一所述测试脉冲时所述测距模组中的光电转换元件所产生的光电流;第一确定单元,配置为根据每一所述光电流与对应的阈值范围之间的关系,确定所述检测结果,以实现对所述测距模组进行故障检测。In other embodiments, the control module 122 includes: a first driving unit, configured to input multiple instantaneous currents into the driving circuit in the ranging module in sequence, so that the driving circuit drives the light wave transmitter to sequentially emit the multiple test pulses; a first detection unit, configured to detect the photocurrent generated by the photoelectric conversion element in the ranging module when each of the test pulses is emitted; and a first determination unit, configured to determine the detection result based on the relationship between each of the photocurrents and the corresponding threshold range, so as to realize fault detection of the ranging module.
在其他实施例中,所述第一确定单元,配置为:在每一所述光电流属于对应的阈值范围的情况下,确定所述检测结果为所述测距模组中的部件没有发生故障;在至少一个所述光电流大于对应的阈值范围的上限值的情况下,确定所述检测结果为所述驱动电路已短路;在每一所述光电流小于对应的阈值范围的下限值的情况下,确定所述检测结果为所述测距模组中的扩散片已脱落。In other embodiments, the first determination unit is configured to: when each of the photocurrents belongs to the corresponding threshold range, determine that the detection result is that there is no failure in the components of the ranging module; when at least one of the photocurrents is greater than the upper limit value of the corresponding threshold range, determine that the detection result is that the driving circuit is short-circuited; when each of the photocurrents is less than the lower limit value of the corresponding threshold range, determine that the detection result is that the diffusion sheet in the ranging module has fallen off.
在其他实施例中,所述控制模块122,包括:第二驱动单元,配置为将N个瞬时电流依次输入至所述测距模组中的驱动电路,以使所述驱动电路驱动所述光波发射器依次发射所述N个测试脉冲,N为大于1的整数;第二确定单元,配置为在发射的第N个测试脉冲的特性不满足条件的情况下,禁止继续将下一瞬时电流输入至所述驱动电路,以结束对所述测距模组进行故障检测,并获得所述检测结果。In other embodiments, the control module 122 includes: a second driving unit, configured to input N instantaneous currents into the driving circuit in the ranging module in sequence, so that the driving circuit drives the optical wave transmitter to transmit the N test pulses in sequence, where N is an integer greater than 1; a second determining unit, configured to prohibit the next instantaneous current from being input into the driving circuit when the characteristics of the transmitted Nth test pulse do not meet the conditions, so as to end the fault detection of the ranging module and obtain the detection result.
在其他实施例中,所述第二确定单元,配置为:检测在发射所述第N个测试脉冲时所述测距模组中的光电转换元件所产生的光电流;至少在所述光电流大于对应的阈值范围的上限值的情况下,确定所述第N个测试脉冲的特性不满足条件,并确定所述检测结果为所述驱动电路已短路;至少在所述光电流小于对应的阈值范围的下限值的情况下,确定所述第N个测试脉冲的特性不满足条件,并确定所述检测结果为所述测距模组中的扩散片已脱落。In other embodiments, the second determination unit is configured to: detect the photocurrent generated by the photoelectric conversion element in the ranging module when the Nth test pulse is emitted; at least when the photocurrent is greater than the upper limit value of the corresponding threshold range, determine that the characteristics of the Nth test pulse do not meet the conditions, and determine that the detection result is that the driving circuit is short-circuited; at least when the photocurrent is less than the lower limit value of the corresponding threshold range, determine that the characteristics of the Nth test pulse do not meet the conditions, and determine that the detection result is that the diffusion sheet in the ranging module has fallen off.
在其他实施例中,所述控制模块122,配置为:在所述检测结果为所述测距模组中的部件没有发生故障的情况下,控制所述测距模组将所述光波发射器的工作电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以所述第一规则间隔性地发射所述工作脉冲;在所述检测结果为所述扩散片已脱落的情况下,关闭所述测距模组,以禁止所述光波发射器发射所述工作脉冲;在所述检测结果为所述驱动电路已短路的情况下,关闭所述测距模组,或者控制所述测距模组将小于所述工作电流的其他电流输入至所述驱动电路,以使所述驱动电路驱动所述光波发射器以第二规则间隔性地发射工作脉冲。In other embodiments, the control module 122 is configured to: when the detection result is that there is no failure in the components of the ranging module, control the ranging module to input the working current of the light wave transmitter into the driving circuit, so that the driving circuit drives the light wave transmitter to emit the working pulse at the first regular interval; when the detection result is that the diffuser has fallen off, turn off the ranging module to prohibit the light wave transmitter from emitting the working pulse; when the detection result is that the driving circuit is short-circuited, turn off the ranging module, or control the ranging module to input other currents less than the working current into the driving circuit, so that the driving circuit drives the light wave transmitter to emit working pulses at second regular intervals.
以上装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请装置实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
需要说明的是,本申请实施例中,如果以软件功能模块的形式实现上述的故障检测方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得电子设备(可以是手机、平板电脑、笔记本电脑、机器人、无人机等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ReadOnly Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本申请实施例不限制于任何特定的硬件和软件结合。It should be noted that in the embodiment of the present application, if the above-mentioned fault detection method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable an electronic device (which can be a mobile phone, a tablet computer, a laptop computer, a robot, a drone, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
对应地,本申请实施例提供一种电子设备,图13为本申请实施例电子设备的一种硬件实体示意图,如图13所示,该电子设备130的硬件实体包括:包括存储器131和处理器132,所述存储器131存储有可在处理器132上运行的计算机程序,所述处理器132执行所述程序时实现上述实施例中提供的故障检测方法中的步骤。Correspondingly, an embodiment of the present application provides an electronic device, and Figure 13 is a schematic diagram of a hardware entity of the electronic device of the embodiment of the present application. As shown in Figure 13, the hardware entity of the electronic device 130 includes: a memory 131 and a processor 132, the memory 131 stores a computer program that can be run on the processor 132, and the processor 132 implements the steps in the fault detection method provided in the above embodiment when executing the program.
存储器131配置为存储由处理器132可执行的指令和应用,还可以缓存待处理器132以及电子设备130中各模块待处理或已经处理的数据(例如,图像数据、音频数据、语音通信数据和视频通信数据),可以通过闪存(FLASH)或随机访问存储器(Random AccessMemory,RAM)实现。The memory 131 is configured to store instructions and applications executable by the processor 132, and can also cache data to be processed or processed by the processor 132 and various modules in the electronic device 130 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
对应地,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例中提供的故障检测方法中的步骤。Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the fault detection method provided in the above embodiment are implemented.
这里需要指出的是:以上存储介质和设备实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请存储介质和设备实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memories (ROM), magnetic disks or optical disks.
或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得电子设备(可以是手机、平板电脑、笔记本电脑、机器人、无人机等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including several instructions for an electronic device (which can be a mobile phone, tablet computer, laptop computer, robot, drone, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, magnetic disks or optical disks.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
以上所述,仅为本申请的实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910883251.1A CN112526485B (en) | 2019-09-18 | 2019-09-18 | Fault detection method, device, equipment, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910883251.1A CN112526485B (en) | 2019-09-18 | 2019-09-18 | Fault detection method, device, equipment, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112526485A CN112526485A (en) | 2021-03-19 |
CN112526485B true CN112526485B (en) | 2024-04-09 |
Family
ID=74975149
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910883251.1A Active CN112526485B (en) | 2019-09-18 | 2019-09-18 | Fault detection method, device, equipment, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112526485B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW591210B (en) * | 2003-10-23 | 2004-06-11 | Asia Optical Co Inc | Method for testing rangefinders |
CN103217612A (en) * | 2013-03-22 | 2013-07-24 | 北京大学 | Fault on-line monitoring and real-time distance measurement method for armored power cable |
CN104977466A (en) * | 2015-05-29 | 2015-10-14 | 福建联迪商用设备有限公司 | Stepping motor pulse frequency test method, system and equipment thereof |
CN106961094A (en) * | 2017-03-30 | 2017-07-18 | 昂宝电子(上海)有限公司 | The system that input undervoltage and overvoltage protection are provided for supply convertor |
CN109066288A (en) * | 2018-05-30 | 2018-12-21 | Oppo广东移动通信有限公司 | Laser projector control system, terminal, and laser projector control method |
CN110198409A (en) * | 2019-05-30 | 2019-09-03 | Oppo广东移动通信有限公司 | Terminal control method and control device, terminal and computer-readable storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
ES2366564T3 (en) * | 2008-11-20 | 2011-10-21 | Sick Ag | OPTOELECTRONIC SENSOR. |
-
2019
- 2019-09-18 CN CN201910883251.1A patent/CN112526485B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW591210B (en) * | 2003-10-23 | 2004-06-11 | Asia Optical Co Inc | Method for testing rangefinders |
CN103217612A (en) * | 2013-03-22 | 2013-07-24 | 北京大学 | Fault on-line monitoring and real-time distance measurement method for armored power cable |
CN104977466A (en) * | 2015-05-29 | 2015-10-14 | 福建联迪商用设备有限公司 | Stepping motor pulse frequency test method, system and equipment thereof |
CN106961094A (en) * | 2017-03-30 | 2017-07-18 | 昂宝电子(上海)有限公司 | The system that input undervoltage and overvoltage protection are provided for supply convertor |
CN109066288A (en) * | 2018-05-30 | 2018-12-21 | Oppo广东移动通信有限公司 | Laser projector control system, terminal, and laser projector control method |
CN110198409A (en) * | 2019-05-30 | 2019-09-03 | Oppo广东移动通信有限公司 | Terminal control method and control device, terminal and computer-readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112526485A (en) | 2021-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102566716B1 (en) | Time-of-flight assembly, terminal device and control method of time-of-flight assembly | |
CN111708040B (en) | Distance measuring device, distance measuring method and electronic equipment | |
CN110914705A (en) | Integrated LIDAR lighting power control | |
CN110198409B (en) | Terminal control method and control device, terminal and computer-readable storage medium | |
CN108966402B (en) | TOF camera module and TOF circuit and heat dissipation method and manufacturing method and application thereof | |
TW202004217A (en) | Time of flight range finder for a structured light system | |
KR20220044533A (en) | Apparatus and methods for safe pulsed laser operation | |
US20230015889A1 (en) | Automatic parameter adjustment for scanning event cameras | |
WO2020259334A1 (en) | Adjustment method, adjustment apparatus, terminal and computer-readable storage medium | |
CN107820572A (en) | Flight time(TOF)System calibration | |
JP2013096941A (en) | Imaging device, imaging method, and program | |
KR20190033462A (en) | Power control method, distance measurement module and electronic device | |
CN105763803A (en) | Control method, control device and electronic device | |
KR20210006605A (en) | Electronic device including sensor and method of operation thereof | |
CN110266394A (en) | Adjustment method, terminal and computer-readable storage medium | |
CN112526485B (en) | Fault detection method, device, equipment, and storage medium | |
CN108281100A (en) | Laser-projector control method, equipment and laser-projector | |
CN105657279A (en) | Control method, control device and electronic device | |
CN109946704A (en) | Control system and control method of time-of-flight assembly and terminal | |
CN115079193A (en) | Photoelectric detection device, control method, electronic apparatus, and storage medium | |
CN114549609A (en) | A depth measurement system and method | |
CN113126066B (en) | Laser safety circuit and laser safety equipment | |
CN113126111B (en) | Time of flight modules and electronics | |
CN110907032B (en) | Illuminance correction device, illumination correction method, and illumination detection method | |
JP2016502068A (en) | Light source drive circuit for depth imager |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |