CN110365405B - Photoelectric sensor detection method and device, readable storage medium and terminal equipment - Google Patents

Photoelectric sensor detection method and device, readable storage medium and terminal equipment Download PDF

Info

Publication number
CN110365405B
CN110365405B CN201910548682.2A CN201910548682A CN110365405B CN 110365405 B CN110365405 B CN 110365405B CN 201910548682 A CN201910548682 A CN 201910548682A CN 110365405 B CN110365405 B CN 110365405B
Authority
CN
China
Prior art keywords
preset
value
photoelectric sensor
signal
intensity
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
Application number
CN201910548682.2A
Other languages
Chinese (zh)
Other versions
CN110365405A (en
Inventor
郭灿照
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Original Assignee
Shenzhen Yihua Computer Co Ltd
Shenzhen Yihua Time Technology Co Ltd
Shenzhen Yihua Financial Intelligent Research Institute
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Yihua Computer Co Ltd, Shenzhen Yihua Time Technology Co Ltd, Shenzhen Yihua Financial Intelligent Research Institute filed Critical Shenzhen Yihua Computer Co Ltd
Priority to CN201910548682.2A priority Critical patent/CN110365405B/en
Publication of CN110365405A publication Critical patent/CN110365405A/en
Application granted granted Critical
Publication of CN110365405B publication Critical patent/CN110365405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/07Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems
    • H04B10/075Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal
    • H04B10/079Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal using measurements of the data signal
    • H04B10/0791Fault location on the transmission path
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/07Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems
    • H04B10/075Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal
    • H04B10/079Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal using measurements of the data signal
    • H04B10/0795Performance monitoring; Measurement of transmission parameters

Abstract

The invention belongs to the technical field of machine tool detection, and particularly relates to a photoelectric sensor detection method and device, a computer readable storage medium and terminal equipment. The method comprises the steps of adjusting a preset pulse width modulation signal of a first light-emitting tube to a preset detection signal value, wherein the first light-emitting tube is a light-emitting tube in a photoelectric sensor to be detected; detecting the intensity of an electric signal converted by a preset first photoelectric receiving tube under a preset first condition and a preset second condition respectively, wherein the first condition is that a medium passes through the photoelectric sensor to be detected, the second condition is that no medium passes through the photoelectric sensor to be detected, and the first photoelectric receiving tube is a photoelectric receiving tube in the photoelectric sensor to be detected; and if the intensity of the first electric signal is smaller than a preset first intensity threshold value, or the intensity of the second electric signal is larger than a preset second intensity threshold value, judging that the photoelectric sensor to be detected has a fault.

Description

Photoelectric sensor detection method and device, readable storage medium and terminal equipment
Technical Field
The invention belongs to the technical field of machine tool detection, and particularly relates to a photoelectric sensor detection method and device, a computer readable storage medium and terminal equipment.
Background
In the bill module and the financial equipment module, a large number of photoelectric sensors are used for detecting whether residues exist in the paper feeding channel and the condition that bills pass through the paper feeding channel. The working principle of the device is shown in fig. 1, the light intensity is controlled by adjusting a pulse width modulation signal (namely a PWM value) of a light emitting tube LED, light emitted by the light emitting tube reaches a receiving end through a channel and a prism, and a photoelectric receiving tube converts a received light signal into an analog electric signal. By detecting the intensity of the electrical signal converted by the photoelectric receiving tube (i.e. ADC value), it can be judged whether there is a medium passing through the position of the photoelectric sensor. The signal intensity of the receiving end of the photoelectric sensor is influenced by the following factors: the performance characteristics of the photoelectric sensor, the assembly position, the tightness degree of a prism assembly screw, the electromagnetic interference of a cable and the like, wherein any one factor is in a problem, can cause the photoelectric sensor to be out of order. However, in the prior art, an effective method for detecting whether a photoelectric sensor has a fault is lacking, so that a large number of misjudgments may occur when the photoelectric sensor operates, for example, a situation that a medium passes through is misjudged as a situation that no medium passes through.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for detecting a photo sensor, a computer-readable storage medium, and a terminal device, so as to solve the problem that a large amount of erroneous determinations may occur when the photo sensor operates due to a lack of an effective method for detecting whether the photo sensor fails in the prior art.
A first aspect of an embodiment of the present invention provides a method for detecting a photosensor, which may include:
adjusting a preset pulse width modulation signal of a first light-emitting tube to a preset detection signal value, wherein the first light-emitting tube is a light-emitting tube in a photoelectric sensor to be detected;
detecting the intensity of an electric signal converted by a preset first photoelectric receiving tube under a preset first condition and a preset second condition respectively, wherein the first condition is that a medium passes through the photoelectric sensor to be detected, the second condition is that no medium passes through the photoelectric sensor to be detected, the first photoelectric receiving tube is a photoelectric receiving tube in the photoelectric sensor to be detected, and the first photoelectric receiving tube receives an optical signal emitted by the first luminous tube and converts the optical signal into an electric signal;
and if the first electric signal intensity is smaller than a preset first intensity threshold value, or the second electric signal intensity is larger than a preset second intensity threshold value, determining that the photoelectric sensor to be detected has a fault, wherein the first electric signal intensity is the electric signal intensity converted by the first photoelectric receiving tube under the first condition, and the second electric signal intensity is the electric signal intensity converted by the first photoelectric receiving tube under the second condition.
Further, the setting process of the detection signal value may include:
traversing and sampling a signal value of a pulse width modulation signal of a preset second light-emitting tube, wherein the second light-emitting tube is a light-emitting tube in a preset standard photoelectric sensor, and the standard photoelectric sensor is a photoelectric sensor which has the same type as the photoelectric sensor to be detected and works normally;
respectively detecting the converted electric signal intensity of a preset second photoelectric receiving tube at each sampling point under the condition that no medium passes through the standard photoelectric sensor, wherein the second photoelectric receiving tube is a photoelectric receiving tube in the standard photoelectric sensor;
and selecting the detection signal value from each sampling point according to the electric signal intensity converted by the second photoelectric receiving tube at each sampling point.
Further, the selecting the detection signal value from each sampling point according to the intensity of the electrical signal converted by the second photoelectric receiving tube at each sampling point may include:
traversing the sampling points according to the sequence of the signal values from low to high, and determining the first sampling point which meets the following formula as a stable region inflection point:
Figure BDA0002104839780000021
wherein k is the serial number of each sampling point, ADCkSetting MinADC as the minimum value of the electric signal intensity of each sampling point, Thresh1 as a preset first difference threshold, Thresh2 as a preset second difference threshold, wherein the second difference threshold is smaller than the first difference threshold;
and selecting a value from the signal value of the inflection point of the stable region and a preset signal extreme value as the detection signal value.
Further, the selecting a value from the signal value of the inflection point of the stable region and a preset signal extreme value as the detection signal value may include:
and taking the signal value of the inflection point of the stable region and the average value of the extreme value of the signal as the detection signal value.
Further, after it is determined that the to-be-detected photosensor has a fault, the method may further include:
and under the working state, adjusting the pulse width modulation signal of the first luminous tube to a preset correction signal value, wherein the correction signal value is the signal value of the next sampling point of the inflection point of the stable region.
A second aspect of an embodiment of the present invention provides a photosensor detection apparatus, which may include:
the first adjusting module is used for adjusting a preset pulse width modulation signal of a first light-emitting tube to a preset detection signal value, wherein the first light-emitting tube is a light-emitting tube in a photoelectric sensor to be detected;
the first detection module is used for detecting the intensity of an electric signal converted by a preset first photoelectric receiving tube under a preset first condition and a preset second condition respectively, wherein the first condition is that a medium passes through the photoelectric sensor to be detected, the second condition is that no medium passes through the photoelectric sensor to be detected, the first photoelectric receiving tube is a photoelectric receiving tube in the photoelectric sensor to be detected, and the first photoelectric receiving tube receives an optical signal emitted by the first luminous tube and converts the optical signal into an electric signal;
and the fault judging module is used for judging that the photoelectric sensor to be detected has a fault if the first electric signal intensity is smaller than a preset first intensity threshold value or the second electric signal intensity is larger than a preset second intensity threshold value, wherein the first electric signal intensity is the electric signal intensity converted by the first photoelectric receiving tube under the first condition, and the second electric signal intensity is the electric signal intensity converted by the first photoelectric receiving tube under the second condition.
Further, the photosensor detection apparatus may further include:
the traversal sampling module is used for performing traversal sampling on a signal value of a pulse width modulation signal of a preset second light-emitting tube, wherein the second light-emitting tube is a light-emitting tube in a preset standard photoelectric sensor, and the standard photoelectric sensor is a photoelectric sensor which has the same type as the photoelectric sensor to be detected and works normally;
the second detection module is used for respectively detecting the converted electric signal intensity of a preset second photoelectric receiving tube at each sampling point under the condition that no medium passes through the standard photoelectric sensor, and the second photoelectric receiving tube is a photoelectric receiving tube in the standard photoelectric sensor;
and the signal value selection module is used for selecting the detection signal value from each sampling point according to the electric signal intensity converted by the second photoelectric receiving tube at each sampling point.
Further, the signal value selecting module may include:
a stable region inflection point determining unit, configured to traverse the sampling points according to a sequence from low to high of the signal value, and determine a first sampling point satisfying the following equation as a stable region inflection point:
Figure BDA0002104839780000041
wherein k is the serial number of each sampling point, ADCkSetting MinADC as the minimum value of the electric signal intensity of each sampling point, Thresh1 as a preset first difference threshold, Thresh2 as a preset second difference threshold, wherein the second difference threshold is smaller than the first difference threshold;
and the signal value selecting unit is used for selecting a value from the signal value of the inflection point of the stable region and a preset signal extreme value as the detection signal value.
Further, the signal value selecting unit is specifically configured to use the signal value of the inflection point of the stable region and the average value of the extreme value of the signal as the detection signal value.
Further, the photosensor detection apparatus may further include:
and the second adjusting module is used for adjusting the pulse width modulation signal of the first luminous tube to a preset correction signal value in a working state, wherein the correction signal value is a signal value of a next sampling point of the inflection point of the stable region.
A third aspect of embodiments of the present invention provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of any one of the above-mentioned photosensor detection methods.
A fourth aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, where the processor implements the steps of any one of the above-mentioned photosensor detection methods when executing the computer readable instructions.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: considering that when the photoelectric sensor fails, a PWM-ADC characteristic curve of which an ADC value changes with a PWM value changes significantly, an effective operating interval (i.e., a PWM value-taking interval in which whether a medium passes or not can be effectively determined) of the photoelectric sensor becomes very narrow, and outside the interval, whether a medium passes or not cannot be effectively determined. Therefore, the invention presets a detection signal value outside the interval, adjusts the pulse width modulation signal of the light-emitting tube to the detection signal value, detects the electric signal intensity converted by the photoelectric receiving tube under a preset first condition (with medium passing) and a second condition (without medium passing), respectively, under a normal condition, the first electric signal intensity (the electric signal intensity when the medium passes) should be greater than a preset first intensity threshold value, and the second electric signal intensity (the electric signal intensity when the medium does not pass) should be less than a preset second intensity threshold value, if the first electric signal intensity is less than the first intensity threshold value, or the second electric signal intensity is greater than the second intensity threshold value, it indicates that the photoelectric sensor cannot effectively judge whether the medium passes, and then it can be judged that the photoelectric sensor to be detected has a fault.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic diagram of the working principle of a photoelectric sensor;
FIG. 2 is a flow chart of an embodiment of a method for detecting a photo sensor in an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a setup process of detection signal values;
FIG. 4 is a schematic diagram of a PWM-ADC characteristic curve when the photoelectric sensor is working normally;
FIG. 5 is a schematic diagram of a PWM-ADC characteristic curve when a photosensor fails;
FIG. 6 is a block diagram of an embodiment of a photo sensor detection device according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of a terminal device in an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 2, an embodiment of a method for detecting a photo sensor according to an embodiment of the present invention may include:
step S201, adjusting a preset pwm signal of the first light emitting tube to a preset detection signal value.
The first light-emitting tube is a light-emitting tube in the photoelectric sensor to be detected.
As shown in fig. 3, the setting process of the detection signal value may specifically include:
step S301, traversing and sampling a signal value of a pulse width modulation signal of a preset second light-emitting tube.
The second light-emitting tube is a light-emitting tube in a preset standard photoelectric sensor, and the standard photoelectric sensor is a photoelectric sensor which has the same type as the photoelectric sensor to be detected and works normally.
In the present embodiment, the interval for sampling the pulse width modulation signal (i.e. PWM value) in a traversal manner may be selected according to actual conditions, for example, the interval for sampling in the traversal manner may be set to [0,500 ], in the sampling interval, one PWM value is selected as a sampling point at regular sampling intervals, the sampling interval may be set according to actual conditions, in the present embodiment, the sampling interval is preferably set to 16, and the selected sampling points are PWM values equal to 0, 16, 32, 48, 64, … …, and so on.
And step S302, respectively detecting the converted electric signal intensity of the preset second photoelectric receiving tube at each sampling point under the condition that no medium passes through the standard photoelectric sensor.
Including but not limited to banknotes, tickets, vouchers and the like.
The second photoelectric receiving tube is a photoelectric receiving tube in the standard photoelectric sensor, receives the optical signal emitted by the second light-emitting tube and converts the optical signal into an electrical signal.
After detecting the electrical signal strength (i.e., ADC value) of each sampling point, a PWM-ADC characteristic curve of the ADC value varying with the PWM value can be established as shown in fig. 4, wherein the horizontal axis represents the PWM value and the vertical axis represents the ADC value. Fig. 4 shows two PWM-ADC characteristic curves in common, where the upper PWM-ADC characteristic curve is the PWM-ADC characteristic curve when a medium passes through the standard photosensor, and the lower PWM-ADC characteristic curve is the PWM-ADC characteristic curve when no medium passes through the standard photosensor.
Step S303, selecting the detection signal value from each sampling point according to the electric signal intensity converted by the second photoelectric receiving tube at each sampling point.
Specifically, the sampling points may be traversed according to the sequence from low to high of the PWM value, and the first sampling point satisfying the following equation is determined as the knee point of the plateau region:
Figure BDA0002104839780000071
wherein k is the serial number of each sampling point, ADCkThe electrical signal intensity of the kth sampling point is obtained, MinADC is the minimum value of the electrical signal intensity of each sampling point, Thresh1 is a preset first difference threshold, Thresh2 is a preset second difference threshold, and the second difference threshold is smaller than the first difference threshold. The specific values of the first difference threshold and the second difference threshold may be set according to an actual situation, and preferably, the first difference threshold may be set to 200, and the second difference threshold may be set to 100.
Then, a value can be selected from the signal value of the inflection point of the stable region and a preset signal extreme value as the detection signal value.
The specific value of the signal extreme value may be set according to an actual situation, and preferably, may be set to 300. In this embodiment, a value may be arbitrarily selected from the signal value of the knee point in the stable region and the signal extreme value as the detection signal value, and preferably, an average value of the signal value of the knee point in the stable region and the signal extreme value may be used as the detection signal value.
Step S202, detecting the intensity of the electrical signal converted by the first preset photo-receiver tube under the first preset condition and the second preset condition, respectively.
The first condition is that a medium passes through the photoelectric sensor to be detected, the second condition is that no medium passes through the photoelectric sensor to be detected, the first photoelectric receiving tube is a photoelectric receiving tube in the photoelectric sensor to be detected, and the first photoelectric receiving tube receives an optical signal emitted by the first light emitting tube and converts the optical signal into an electrical signal.
And step S203, judging whether a preset judgment condition is met.
The judging condition is that the intensity of the first electric signal is smaller than a preset first intensity threshold value, or the intensity of the second electric signal is larger than a preset second intensity threshold value. The first electrical signal intensity is the electrical signal intensity converted by the first photoelectric receiving tube under the first condition, and the second electrical signal intensity is the electrical signal intensity converted by the first photoelectric receiving tube under the second condition. The first intensity threshold is greater than the second intensity threshold, and specific values of the first intensity threshold and the second intensity threshold may be set according to an actual situation, for example, the first intensity threshold may be set to 1900, and the second intensity threshold may be set to 1400.
Fig. 5 shows a PWM-ADC characteristic curve when the photosensor fails, in which the PWM-ADC characteristic curve when a medium passes through the photosensor is located above, and the PWM-ADC characteristic curve when no medium passes through the photosensor is located below, as compared with fig. 4, it can be seen that the PWM-ADC characteristic curve is significantly changed, and an effective operating interval (i.e., a PWM value interval in which the medium can be effectively determined to pass or not pass) is narrow, and outside the interval, the medium can not be effectively determined to pass or not pass.
If the determination condition is not satisfied, step S104 is executed, and if the determination condition is satisfied, step S105 is executed.
And S104, judging that the photoelectric sensor to be detected works normally.
And S105, judging that the photoelectric sensor to be detected has a fault.
When the photoelectric sensor to be detected has a fault, the hardware parameters of the photoelectric sensor to be detected are properly adjusted until the photoelectric sensor can normally work. Particularly, under the condition that hardware parameters cannot be adjusted, if the photoelectric sensor is used, the pulse width modulation signal of the first light emitting tube can be adjusted to a preset correction signal value in a working state, wherein the correction signal value is a signal value of a next sampling point of the inflection point of the stable region. The reason why such adjustment can be performed is that although the effective working interval of the photosensor becomes very narrow, the next sampling point of the inflection point of the stable region of the photosensor is still generally in the effective working interval, and therefore, whether a medium passes through or not can be effectively judged by using the signal value of the sampling point.
In summary, in the embodiments of the present invention, when the photosensor fails, the PWM-ADC characteristic curve of the ADC value changing with the PWM value changes significantly, the effective operating interval (i.e., the PWM value-taking interval in which whether a medium passes or not can be effectively determined) becomes very narrow, and outside the interval, whether a medium passes or not cannot be effectively determined. Therefore, the invention presets a detection signal value outside the interval, adjusts the pulse width modulation signal of the light-emitting tube to the detection signal value, detects the electric signal intensity converted by the photoelectric receiving tube under a preset first condition (with medium passing) and a second condition (without medium passing), respectively, under a normal condition, the first electric signal intensity (the electric signal intensity when the medium passes) should be greater than a preset first intensity threshold value, and the second electric signal intensity (the electric signal intensity when the medium does not pass) should be less than a preset second intensity threshold value, if the first electric signal intensity is less than the first intensity threshold value, or the second electric signal intensity is greater than the second intensity threshold value, it indicates that the photoelectric sensor cannot effectively judge whether the medium passes, and then it can be judged that the photoelectric sensor to be detected has a fault.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 6 is a structural diagram of an embodiment of a photosensor detection apparatus according to an embodiment of the present invention, which corresponds to the photosensor detection method described in the foregoing embodiment.
In this embodiment, a photosensor detection apparatus may include:
the first adjusting module 601 is configured to adjust a preset pulse width modulation signal of a first light emitting tube to a preset detection signal value, where the first light emitting tube is a light emitting tube in a to-be-detected photoelectric sensor;
a first detecting module 602, configured to detect intensity of an electrical signal converted by a preset first photoelectric receiving tube under a preset first condition and a preset second condition, where the first condition is that a medium passes through the to-be-detected photosensor, the second condition is that no medium passes through the to-be-detected photosensor, the first photoelectric receiving tube is a photoelectric receiving tube in the to-be-detected photosensor, and the first photoelectric receiving tube receives an optical signal emitted by the first luminous tube and converts the optical signal into an electrical signal;
a failure determination module 603, configured to determine that the to-be-detected photosensor fails if a first electrical signal intensity is smaller than a preset first intensity threshold, or a second electrical signal intensity is greater than a preset second intensity threshold, where the first electrical signal intensity is an electrical signal intensity converted by the first photoelectric receiving tube under the first condition, and the second electrical signal intensity is an electrical signal intensity converted by the first photoelectric receiving tube under the second condition.
Further, the photosensor detection apparatus may further include:
the traversal sampling module is used for performing traversal sampling on a signal value of a pulse width modulation signal of a preset second light-emitting tube, wherein the second light-emitting tube is a light-emitting tube in a preset standard photoelectric sensor, and the standard photoelectric sensor is a photoelectric sensor which has the same type as the photoelectric sensor to be detected and works normally;
the second detection module is used for respectively detecting the converted electric signal intensity of a preset second photoelectric receiving tube at each sampling point under the condition that no medium passes through the standard photoelectric sensor, and the second photoelectric receiving tube is a photoelectric receiving tube in the standard photoelectric sensor;
and the signal value selection module is used for selecting the detection signal value from each sampling point according to the electric signal intensity converted by the second photoelectric receiving tube at each sampling point.
Further, the signal value selecting module may include:
a stable region inflection point determining unit, configured to traverse the sampling points according to a sequence from low to high of the signal value, and determine a first sampling point satisfying the following equation as a stable region inflection point:
Figure BDA0002104839780000101
wherein k is the serial number of each sampling point, ADCkSetting MinADC as the minimum value of the electric signal intensity of each sampling point, Thresh1 as a preset first difference threshold, Thresh2 as a preset second difference threshold, wherein the second difference threshold is smaller than the first difference threshold;
and the signal value selecting unit is used for selecting a value from the signal value of the inflection point of the stable region and a preset signal extreme value as the detection signal value.
Further, the signal value selecting unit is specifically configured to use the signal value of the inflection point of the stable region and the average value of the extreme value of the signal as the detection signal value.
Further, the photosensor detection apparatus may further include:
and the second adjusting module is used for adjusting the pulse width modulation signal of the first luminous tube to a preset correction signal value in a working state, wherein the correction signal value is a signal value of a next sampling point of the inflection point of the stable region.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, modules and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Fig. 7 shows a schematic block diagram of a terminal device according to an embodiment of the present invention, and for convenience of description, only the relevant parts related to the embodiment of the present invention are shown.
As shown in fig. 7, the terminal device 7 of this embodiment includes: a processor 70, a memory 71 and a computer program 72 stored in said memory 71 and executable on said processor 70. The processor 70, when executing the computer program 72, implements the steps in the various photosensor detection method embodiments described above, such as the steps S201-S205 shown in fig. 2. Alternatively, the processor 70, when executing the computer program 72, implements the functions of each module/unit in the above-mentioned device embodiments, for example, the functions of the modules 601 to 603 shown in fig. 6.
Illustratively, the computer program 72 may be partitioned into one or more modules/units that are stored in the memory 71 and executed by the processor 70 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 72 in the terminal device 7.
It will be understood by those skilled in the art that fig. 7 is only an example of the terminal device 7, and does not constitute a limitation to the terminal device 7, and may include more or less components than those shown, or combine some components, or different components, for example, the terminal device 7 may further include an input-output device, a network access device, a bus, etc.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing the computer programs and other programs and data required by the terminal device 7. The memory 71 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A method of detecting a photosensor, comprising:
adjusting a preset pulse width modulation signal of a first light-emitting tube to a preset detection signal value, wherein the first light-emitting tube is a light-emitting tube in a photoelectric sensor to be detected;
detecting the intensity of an electric signal converted by a preset first photoelectric receiving tube under a preset first condition and a preset second condition respectively, wherein the first condition is that a medium passes through the photoelectric sensor to be detected, the second condition is that no medium passes through the photoelectric sensor to be detected, the first photoelectric receiving tube is a photoelectric receiving tube in the photoelectric sensor to be detected, and the first photoelectric receiving tube receives an optical signal emitted by the first luminous tube and converts the optical signal into an electric signal;
if the first electric signal intensity is smaller than a preset first intensity threshold value, or the second electric signal intensity is larger than a preset second intensity threshold value, determining that the photoelectric sensor to be detected has a fault, wherein the first electric signal intensity is the electric signal intensity converted by the first photoelectric receiving tube under the first condition, and the second electric signal intensity is the electric signal intensity converted by the first photoelectric receiving tube under the second condition;
the setting process of the detection signal value comprises the following steps:
traversing and sampling a signal value of a pulse width modulation signal of a preset second light-emitting tube, wherein the second light-emitting tube is a light-emitting tube in a preset standard photoelectric sensor, and the standard photoelectric sensor is a photoelectric sensor which has the same type as the photoelectric sensor to be detected and works normally;
respectively detecting the converted electric signal intensity of a preset second photoelectric receiving tube at each sampling point under the condition that no medium passes through the standard photoelectric sensor, wherein the second photoelectric receiving tube is a photoelectric receiving tube in the standard photoelectric sensor;
and selecting the detection signal value from each sampling point according to the electric signal intensity converted by the second photoelectric receiving tube at each sampling point.
2. The method as claimed in claim 1, wherein said selecting the detection signal value from each sampling point according to the intensity of the electrical signal converted by the second photo receiver tube at each sampling point comprises:
traversing the sampling points according to the sequence of the signal values from low to high, and determining the first sampling point which meets the following formula as a stable region inflection point:
Figure FDA0002500153560000021
wherein k is the serial number of each sampling point, ADCkSetting MinADC as the minimum value of the electric signal intensity of each sampling point, Thresh1 as a preset first difference threshold, Thresh2 as a preset second difference threshold, wherein the second difference threshold is smaller than the first difference threshold;
and selecting a value from the signal value of the inflection point of the stable region and a preset signal extreme value as the detection signal value.
3. The method as claimed in claim 2, wherein the selecting a value between the signal value of the inflection point of the plateau region and a preset signal extreme value as the detection signal value comprises:
and taking the signal value of the inflection point of the stable region and the average value of the extreme value of the signal as the detection signal value.
4. The photosensor detection method of claim 2, further comprising, after determining that the photosensor to be detected is malfunctioning:
and under the working state, adjusting the pulse width modulation signal of the first luminous tube to a preset correction signal value, wherein the correction signal value is the signal value of the next sampling point of the inflection point of the stable region.
5. A photosensor detection apparatus, comprising:
the first adjusting module is used for adjusting a preset pulse width modulation signal of a first light-emitting tube to a preset detection signal value, wherein the first light-emitting tube is a light-emitting tube in a photoelectric sensor to be detected;
the first detection module is used for detecting the intensity of an electric signal converted by a preset first photoelectric receiving tube under a preset first condition and a preset second condition respectively, wherein the first condition is that a medium passes through the photoelectric sensor to be detected, the second condition is that no medium passes through the photoelectric sensor to be detected, the first photoelectric receiving tube is a photoelectric receiving tube in the photoelectric sensor to be detected, and the first photoelectric receiving tube receives an optical signal emitted by the first luminous tube and converts the optical signal into an electric signal;
the fault determination module is configured to determine that the to-be-detected photosensor has a fault if a first electrical signal intensity is smaller than a preset first intensity threshold value or a second electrical signal intensity is greater than a preset second intensity threshold value, where the first electrical signal intensity is an electrical signal intensity converted by the first photoelectric receiving tube under the first condition, and the second electrical signal intensity is an electrical signal intensity converted by the first photoelectric receiving tube under the second condition;
the traversal sampling module is used for performing traversal sampling on a signal value of a pulse width modulation signal of a preset second light-emitting tube, wherein the second light-emitting tube is a light-emitting tube in a preset standard photoelectric sensor, and the standard photoelectric sensor is a photoelectric sensor which has the same type as the photoelectric sensor to be detected and works normally;
the second detection module is used for respectively detecting the converted electric signal intensity of a preset second photoelectric receiving tube at each sampling point under the condition that no medium passes through the standard photoelectric sensor, and the second photoelectric receiving tube is a photoelectric receiving tube in the standard photoelectric sensor;
and the signal value selection module is used for selecting the detection signal value from each sampling point according to the electric signal intensity converted by the second photoelectric receiving tube at each sampling point.
6. The photosensor detection apparatus of claim 5, wherein the signal value selection module comprises:
a stable region inflection point determining unit, configured to traverse the sampling points according to a sequence from low to high of the signal value, and determine a first sampling point satisfying the following equation as a stable region inflection point:
Figure FDA0002500153560000031
wherein k is the serial number of each sampling point, ADCkSetting MinADC as the minimum value of the electric signal intensity of each sampling point, Thresh1 as a preset first difference threshold, Thresh2 as a preset second difference threshold, wherein the second difference threshold is smaller than the first difference threshold;
and the signal value selecting unit is used for selecting a value from the signal value of the inflection point of the stable region and a preset signal extreme value as the detection signal value.
7. A computer readable storage medium storing computer readable instructions, wherein the computer readable instructions, when executed by a processor, implement the steps of the photosensor detection method of any one of claims 1-4.
8. A terminal device comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, characterized in that the processor implements the steps of the photosensor detection method according to any one of claims 1 to 4 when executing the computer readable instructions.
CN201910548682.2A 2019-06-24 2019-06-24 Photoelectric sensor detection method and device, readable storage medium and terminal equipment Active CN110365405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910548682.2A CN110365405B (en) 2019-06-24 2019-06-24 Photoelectric sensor detection method and device, readable storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910548682.2A CN110365405B (en) 2019-06-24 2019-06-24 Photoelectric sensor detection method and device, readable storage medium and terminal equipment

Publications (2)

Publication Number Publication Date
CN110365405A CN110365405A (en) 2019-10-22
CN110365405B true CN110365405B (en) 2020-11-17

Family

ID=68216774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910548682.2A Active CN110365405B (en) 2019-06-24 2019-06-24 Photoelectric sensor detection method and device, readable storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN110365405B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110827493B (en) * 2019-11-26 2022-03-25 珠海优特物联科技有限公司 Anti-theft system
WO2021102908A1 (en) * 2019-11-29 2021-06-03 深圳市汇顶科技股份有限公司 Signal adjustment method and apparatus, and computer storage medium
CN113053020A (en) * 2019-12-27 2021-06-29 深圳怡化电脑股份有限公司 Bill thickness detection method and device, computer equipment and storage medium
CN111993798B (en) * 2020-08-12 2022-04-12 福建实达电脑设备有限公司 Automatic correction method of page gap sensor
CN113311268A (en) * 2021-05-27 2021-08-27 浙江华消科技有限公司 Method, device, equipment and medium for detecting service life of infrared emission tube

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1490631A (en) * 2002-10-16 2004-04-21 ƽ Method for detecting missing element utilizing photoelectric sensor in electric circuit board test
CN205229486U (en) * 2015-11-25 2016-05-11 天津市森特尔新技术有限公司 Correlation formula photoelectric sensor with trouble display function
CN207379521U (en) * 2017-09-28 2018-05-18 深圳市柯莱顿光电科技有限公司 A kind of photoelectric sensor detection device
CN109455003A (en) * 2018-12-14 2019-03-12 贵州七十二弯信息科技有限公司 Monochrome laser printer fault diagnosis system

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003001245A1 (en) * 2001-06-21 2003-01-03 Tri-Tronics Company, Inc. Adjusting the performance characteristics of a photoelectric sensor
CN101325062A (en) * 2007-06-14 2008-12-17 上海市闵行中学 Method for recovering failure of FD photoelectricity inductor
KR101175191B1 (en) * 2010-12-17 2012-08-20 주식회사 한영넉스 Sensor with self-test function
US10139341B2 (en) * 2016-05-31 2018-11-27 Tt Electronics Plc Self-calibrating optical detector
JP6852481B2 (en) * 2017-03-15 2021-03-31 オムロン株式会社 Photoelectric sensor
CN107170147B (en) * 2017-05-17 2019-12-10 深圳怡化电脑股份有限公司 method and apparatus for correcting photoelectric sensor, electronic device and storage medium
CN108931539B (en) * 2017-05-25 2022-01-28 北京君和信达科技有限公司 Detector self-checking method, device, medium and radiation type checking system
CN108107865B (en) * 2017-11-13 2020-05-19 中车青岛四方机车车辆股份有限公司 Fault diagnosis method and equipment for inner end door of motor train unit
CN109059181B (en) * 2018-07-31 2021-07-16 广东美的制冷设备有限公司 Photoelectric sensor calibration method and device, air conditioner and readable storage medium
CN109410480B (en) * 2018-10-30 2021-06-04 恒银金融科技股份有限公司 Non-contact online infrared photoelectric sensor detector

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1490631A (en) * 2002-10-16 2004-04-21 ƽ Method for detecting missing element utilizing photoelectric sensor in electric circuit board test
CN205229486U (en) * 2015-11-25 2016-05-11 天津市森特尔新技术有限公司 Correlation formula photoelectric sensor with trouble display function
CN207379521U (en) * 2017-09-28 2018-05-18 深圳市柯莱顿光电科技有限公司 A kind of photoelectric sensor detection device
CN109455003A (en) * 2018-12-14 2019-03-12 贵州七十二弯信息科技有限公司 Monochrome laser printer fault diagnosis system

Also Published As

Publication number Publication date
CN110365405A (en) 2019-10-22

Similar Documents

Publication Publication Date Title
CN110365405B (en) Photoelectric sensor detection method and device, readable storage medium and terminal equipment
CN108737815B (en) Quality detection method and system of image sensor
EP2869023B1 (en) Image processing apparatus, image processing method and corresponding computer program
CN107170147B (en) method and apparatus for correcting photoelectric sensor, electronic device and storage medium
US20070029514A1 (en) Method and system for detecting the position of an edge of a web
CN105094494B (en) Fingerprint identification method, device and electronic equipment
CN106464754A (en) Method, apparatus and device for correcting detection distance
KR101873024B1 (en) Apparatus for accurately detecting fabric pattern in weft straightener
JP2016523481A (en) Image scanning apparatus and control method thereof
CN109085811B (en) Equipment point inspection method and device
CN108764225B (en) Method and device for identifying transversely spliced paper money and electronic equipment
KR101875301B1 (en) Hotknot based proximity detection method, apparatus and touch screen terminal
CN110290129A (en) A kind of method and device of Web Hole Detection
JP2006211510A (en) Demodulation device
CN107552414B (en) Pipe arranging machine detection method and pipe arranging machine detection device
CN102353814B (en) Method for detecting output signal failure of wind direction sensor
US20170059718A1 (en) Signal processing device and radiation measurement device
CN111833341A (en) Method and device for determining stripe noise in image
JPH0547054B2 (en)
CN106791280A (en) The method and apparatus for determining gain and side-play amount and its corresponding relation in ADC
CN107655801A (en) A kind of dust sensor detecting system
CN108346213B (en) Method and device for identifying characteristics of paper money image
CN107464337B (en) Image acquisition method, image acquisition device and terminal equipment
CN113203430A (en) Photoelectric sensor calibration method and system, photoelectric sensor and readable storage medium
CN113327552A (en) Gamma debugging method and device, electronic equipment and storage medium

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