A method and device for processing optical interference of an optoelectronic sensor
By acquiring the state data and interference parameters of the photoelectric sensor, determining the interference rules and judging the interference status, the problem of photoelectric sensors being susceptible to light interference is solved, and a simple and low-cost optical interference processing is achieved.
Patent Information
- Application Number
- CN202411162895.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2044-08-23
AI Technical Summary
Photoelectric sensors are susceptible to optical interference, and the prior art has limited means to deal with optical interference, resulting in problems such as signal instability, malfunction and prolonged response time.
By acquiring the first state sensor data and the first interference parameters, the interference rules are determined, and whether there is interference exists based on the change value and the optical interference threshold value is determined, and the output data of the photoelectric sensor is selected.
Accurate judgment on whether the photoelectric sensor is in an interfering state is achieved, reducing the computational complexity, only a small amount of historical data is required, and no need to change the sensor structure is required, which is low cost.
Smart Images

Figure CN119043377B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of sensors, and particularly relates to a method and device for processing optical interference of a photoelectric sensor. Background Art
[0002] A photoelectric sensor is a device that can convert an optical signal into an electrical signal. Commonly used photodetectors include photodiodes, phototransistors, photometers, etc. Due to its high sensitivity and response speed, it has been widely used in fields such as industrial automation, portable mobile devices such as mobile phones, transportation, and smart homes.
[0003] However, when there is other light in the working environment of the photoelectric sensor, the photoelectric sensor is susceptible to interference, and its output effect will be greatly reduced. For example, there are defects such as unstable signals, false operations, and extended response times. When the response signal of the photoelectric sensor is strong enough, in the face of strong light interference, at this time, it is impossible to find the normal signal from the interference, which will cause the photoelectric sensor to produce false operations and affect the normal detection of the sensor; and when the response signal of the photoelectric sensor is strong enough, in the face of weak light interference, at this time, the normal signal can be found from the interference, but the photoelectric response signal is in a state of being interfered at this time, and false operations may still occur; when the response signal of the photoelectric sensor is relatively weak, in the face of strong light interference, for example, when the photoelectric sensor is exposed to ultra-strong light with an intensity exceeding 50000 lux such as sunlight, at this time, it is impossible to find the normal signal from the interference, because the normal signal has been submerged by the interference, and the intensity of false operations reaches the maximum at this time, completely affecting the normal operation of the sensor; when the response signal of the photoelectric sensor is relatively weak, in the face of weak light interference, at this time, the normal signal can be found from the interference, but due to the insufficient signal intensity itself and the continuous existence of interference, the sensor function is blocked and remains in a state of false operation.
[0004] In the prior art, usually, optical filters with specific wavelengths are installed at the transmitting end and receiving end of the sensor. However, when the wavelength of the interfering light is close to the wavelength of the light emitted by the sensor itself, the optical filter cannot filter it out, and the light interference still exists; or self-learning algorithms such as neural networks are used for filtering, but the demand for past data and the amount of calculation of artificial intelligence algorithms are extremely large, the training cost is high, and the calculation complexity is high, which is not applicable to the anti-interference of all photoelectric sensors.
[0005] In addition, the ADC sampling rate inside a common photoelectric sensor is too low to achieve distortion-free sampling.
[0006] Based on the above, the present application provides a technical solution to solve the above technical problems. Summary of the Invention
[0007] In view of the defect that in the prior art, photoelectric sensors are vulnerable to light interference, but the means for dealing with light interference are limited, the present invention provides a method for dealing with light interference of a photoelectric sensor, including the following steps:
[0008] Step S1: Obtain the data of the first state sensor, and obtain the first interference parameter, and determine the interference rule based on the first interference parameter;
[0009] Step S2: Determine whether the data of the first state sensor conforms to the interference rule. If it conforms to the interference rule, enter step S3. If it does not conform to the interference rule, output the data of the first state sensor;
[0010] Step S3: Obtain the data of the second state sensor, and determine the change value S based on the data of the first state sensor and the data of the second state sensor;
[0011] Step S4: Obtain the first light interference threshold and the second light interference threshold;
[0012] Step S5: Select the output data of the photoelectric sensor based on the change value, the first light interference threshold, and the second light interference threshold.
[0013] In a specific embodiment of the present invention, the first interference parameter is the voltage difference V between the positive and negative power supplies of the analog-to-digital converter ADC in the photoelectric sensor.
[0014] In a specific embodiment of the present invention, step S2 includes:
[0015] Step S2.1: Obtain the maximum value MAX and the minimum value MIN in the data of the first state sensor, and obtain the voltage difference V between the positive and negative power supplies of the analog-to-digital converter ADC in the photoelectric sensor;
[0016] Step S2.2: Calculate the peak-to-peak value VPP of the waveform of the data of the first state sensor, where VPP = MAX - MIN. If VPP ≥ V, the waveform of the data of the first state sensor is in a saturated state. If VPP < V, the waveform of the data of the first state sensor is not in a saturated state.
[0017] In a specific embodiment of the present invention, step S3 includes:
[0018] The determination of the change value S based on the data of the first state sensor and the data of the second state sensor includes: where N is the total amount of the data of the first state sensor, x i is the i-th data of the first state sensor, is the average value of the data of the second state sensor.
[0019] In a specific embodiment of the present invention, the first threshold of optical interference is the optical interference occurrence threshold IN, and the second threshold of optical interference is the optical interference exit threshold OUT, where IN > OUT.
[0020] In a specific embodiment of the present invention, step S5 includes:
[0021] (a) If S > IN, it is determined that optical interference occurs, and the output of the photoelectric sensor in the previous cycle is maintained;
[0022] (b) If S < OUT, it is determined that there is no interference, and the first state sensor data is output;
[0023] (c) If OUT < S < IN, it is determined whether there is interference according to the state of the photoelectric sensor in the previous cycle.
[0024] In a specific embodiment of the present invention, if OUT < S < IN and the state of the photoelectric sensor in the previous cycle is the interference state, it is determined that the optical interference still exists, and the output state of the photoelectric sensor in the last cycle without receiving interference is traced back; if OUT < S < IN and the state of the photoelectric sensor in the previous cycle is the non - interference state, it is determined that the current situation of the photoelectric sensor is without interference, and the first state sensor data is output.
[0025] In a specific embodiment of the present invention, determining whether the first state sensor data conforms to the interference rule in step S2 includes: determining whether the first state sensor data conforms to the interference rule based on at least ten - cycle first state sensor data;
[0026] In a specific embodiment of the present invention, determining the change value S based on the first state sensor data and the second state sensor data in step S3 includes: determining the change value based on at least five - cycle first state sensor data and five - cycle second state sensor data.
[0027] In a specific embodiment of the present invention, the first state sensor data is the sensor data measured when the photoelectric sensor emits light by itself, and the second state sensor data is the sensor data measured when the photoelectric sensor does not emit light by itself.
[0028] The present invention also provides an optical interference processing device for a photoelectric sensor, which is implemented based on the optical interference processing method for a photoelectric sensor described in any one of the foregoing, and includes the following structures:
[0029] A first acquisition module, which acquires the first state sensor data and acquires the first interference parameter, and determines the interference rule based on the first interference parameter;
[0030] The first determination module determines whether the first status sensor data conforms to the interference rule. If it conforms to the interference rule, it calls the second acquisition module. If it does not conform to the interference rule, it outputs the first status sensor data.
[0031] The second acquisition module acquires the second status sensor data and determines the change value S based on the first status sensor data and the second status sensor data.
[0032] The threshold acquisition module acquires the first optical interference threshold and the second optical interference threshold.
[0033] The second determination module selects the output data of the photoelectric sensor based on the change value, the first optical interference threshold, and the second optical interference threshold.
[0034] The present invention can bring at least one of the following beneficial effects: The present invention proposes a method for processing optical interference of a photoelectric sensor, including: first, judging the first status sensor data and the first interference parameter, determining the interference rule based on the first interference parameter, and then determining whether the first status sensor data conforms to the interference rule. If it does not conform to the interference rule, the first status sensor data is output, that is, there is no interference at this time, and the directly perceived first status sensor data can be output; if it conforms to the interference rule, it is determined that there is interference at this time, the second status sensor data is acquired, and the change value is determined based on the first status sensor data and the second status sensor data. The output data of the photoelectric sensor is selected based on the change value, the first optical interference threshold, and the second optical interference threshold. The present invention performs a secondary numerical judgment on the first status sensor data. If it is initially determined that there is interference, it specifically judges whether there is interference according to the values before and after the photoelectric sensor emits light. If there is interference, the output state of the photoelectric sensor before the interference occurs is maintained. If there is no interference, the first status sensor data is directly output. The method and device for processing optical interference of the photoelectric sensor proposed by the present invention have a low computational complexity, and only a small amount of historical data is required to determine whether the photoelectric sensor is in an interference state. The implementation is simple, the structure of the photoelectric sensor does not need to be changed, and the implementation cost is low. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The following will further illustrate the above characteristics, technical features, advantages and their implementation manners in a clear and easy-to-understand manner in conjunction with the drawings in the preferred embodiments.
[0036] Figure 1 It is a schematic diagram of the steps of a method for processing optical interference of a photoelectric sensor proposed in Embodiment 1 of the present invention;
[0037] Figure 2 It is a waveform schematic diagram of the change value S in a method for processing optical interference of a photoelectric sensor proposed in Embodiment 1 of the present invention. Detailed implementation manners
[0038] The following further details each aspect of the present invention.
[0039] Unless otherwise defined or described, all professional and scientific terms used herein have the same meaning as those familiar to persons skilled in the art. In addition, any methods and materials similar or equivalent to the described content can be applied to the present invention.
[0040] The following explains the terms.
[0041] Unless otherwise clearly specified and limited, the "or" described in the present invention includes the relationship of "and". The "and" is equivalent to the Boolean logic operator "AND", the "or" is equivalent to the Boolean logic operator "OR", and "AND" is a subset of "OR".
[0042] It can be understood that although terms such as "first", "second", etc. can be used herein to describe different elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. Therefore, the first element can be called the second element without departing from the teachings of the inventive concept.
[0043] In the present invention, the terms "containing", "comprising" or "including" mean that various components can be applied together to the mixture or composition of the present invention. Therefore, the term "consisting essentially of..." is included in the terms "containing", "comprising" or "including".
[0044] Unless otherwise clearly specified and limited, the terms "connected", "communicated with", "connected to" of the present invention should be understood in a broad sense. For example, it can be a fixed connection, or can be connected through an intermediate medium, and can be the communication inside two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific situations.
[0045] For example, if an element (or component) is said to be on another element, coupled with another element or connected to another element, then the said one element can be directly formed on, coupled with or connected to the said another element, or there can be one or more intermediate elements between them. On the contrary, if the expressions "directly on...", "directly coupled with..." and "directly connected to..." are used herein, it means that there are no intermediate elements. Other words used to illustrate the relationship between elements should be interpreted similarly, such as "between..." and "directly between...", "attached" and "directly attached", "adjacent" and "directly adjacent", etc.
[0046] It should be further noted that the terms "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to the directions in the accompanying drawings. The terms "inner" and "outer" respectively refer to the directions towards or away from the geometric center of a specific component. It can be understood that here, these terms are used to describe the relationship of one element, layer or region relative to another element, layer or region as shown in the accompanying drawings. In addition to the orientations described in the accompanying drawings, these terms should also cover other orientations of the device.
[0047] Other aspects of the present invention will be apparent to those skilled in the art from the disclosure herein.
[0048] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the specific embodiments of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings, and other embodiments can also be obtained.
[0049] It should also be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. The diagrams only show the components related to the present application, rather than being drawn according to the number, shape and size of the components in actual implementation. The type, quantity and ratio of each component in its actual implementation can be arbitrarily changed, and the component layout type may also be more complex. For example, the thickness of the elements in the accompanying drawings may be exaggerated for clarity.
[0050] Embodiment 1
[0051] As Figure 1 shown, in view of the defect that in the prior art, photoelectric sensors are vulnerable to light interference, but the means for dealing with light interference are limited, the present invention provides a method for dealing with light interference of a photoelectric sensor, including the following steps:
[0052] Step S1: Obtain the first state sensor data, obtain the first interference parameter, and determine the interference rule based on the first interference parameter;
[0053] Step S2: Determine whether the first state sensor data conforms to the interference rule. If it conforms to the interference rule, go to step S3. If it does not conform to the interference rule, output the first state sensor data;
[0054] Step S3: Obtain the second state sensor data, and determine the change value S based on the first state sensor data and the second state sensor data;
[0055] Step S4: Obtain the first light interference threshold and the second light interference threshold;
[0056] Step S5: Select the output data of the photoelectric sensor based on the change value, the first optical interference threshold, and the second optical interference threshold.
[0057] Specifically, the first state sensor data is the sensor data measured when the photoelectric sensor emits light by itself, and the second state sensor data is the sensor data measured when the photoelectric sensor does not emit light by itself.
[0058] Furthermore, an analog-to-digital converter ADC is provided inside the photoelectric sensor. The ADC is 12-bit and is used to sample the photoelectric sensor data. The first interference parameter is the voltage difference V between the positive and negative power supplies of the ADC.
[0059] In a preferred embodiment of the present invention, as Figure 2 shown, step S2 includes:
[0060] Step S2.1: Obtain the maximum value MAX and the minimum value MIN in the first state sensor data, and obtain the sensor supply voltage V;
[0061] Step S2.2: Calculate the peak-to-peak value VPP of the first state sensor data waveform, where VPP = MAX - MIN. If VPP ≥ V, the first state sensor data waveform is in a saturated state; if VPP < V, the first state sensor data waveform is not in a saturated state.
[0062] In a specific embodiment of the present invention, step S3 includes:
[0063] The determination of the change value S based on the first state sensor data and the second state sensor data includes: where N is the total amount of the first state sensor data, x i is the i-th first state sensor data, is the average value of the second state sensor data.
[0064] It should be understood that the total amount of the first state sensor data is the same as that of the second state sensor data, both being N. Since the sampled data of the sensor is relatively concentrated when not affected by interference, and relatively discrete when affected by optical interference, through the calculation of the above change value S, the relatively discrete first state sensor data can be linearized. The change value S is shown in Figure 2 the red line part in.
[0065] In a preferred embodiment of the present invention, the first optical interference threshold is the optical interference occurrence threshold IN, and the second optical interference threshold is the optical interference exit threshold OUT, where IN > OUT.
[0066] Preferably, asFigure 2 As shown, step S5 includes:
[0067] (a) If S > IN, it is determined that light interference occurs, and the output of the photoelectric sensor in the previous cycle is maintained;
[0068] (b) If S < OUT, it is determined that there is no interference, and the first state sensor data is output;
[0069] (c) If OUT < S < IN, it is determined whether there is interference according to the state of the photoelectric sensor in the previous cycle.
[0070] Specifically, if OUT < S < IN and the state of the photoelectric sensor in the previous cycle is the interference state, it is determined that the light interference still exists, and then trace back to the output state of the last cycle when the photoelectric sensor did not receive interference; if OUT < S < IN and the state of the photoelectric sensor in the previous cycle is the non - interference state, it is determined that the current situation of the photoelectric sensor is non - interference, and the first state sensor data is output.
[0071] It should be noted that, in order to prevent misoperation, if S > IN for at least ten consecutive cycles, it is then determined that light interference occurs at this time; if S < OUT for at least ten consecutive cycles, it means that the photoelectric sensor has been stabilized in the non - interference state, and it is then determined that there is no interference at this time; if OUT < S < IN, it is determined whether there is interference according to the state of the photoelectric sensor in the previous cycle, so as to prevent the photoelectric sensor from repeatedly changing between the interference state and the non - interference state in a short time, avoiding misoperation and affecting the detection result.
[0072] In a preferred embodiment of the present invention, the determination of whether the first state sensor data conforms to the interference rule in step S2 includes: determining whether the first state sensor data conforms to the interference rule based on at least ten - cycle first state sensor data;
[0073] The determination of the change value S based on the first state sensor data and the second state sensor data in step S3 includes: determining the change value S based on at least five - cycle first state sensor data and five - cycle second state sensor data.
[0074] Embodiment 2
[0075] The present invention also provides a photoelectric sensor light interference processing device, which is implemented based on the photoelectric sensor light interference processing method described in Embodiment 1, and includes the following structures:
[0076] The first acquisition module acquires the first state sensor data and acquires the first interference parameter, and determines the interference rule based on the first interference parameter;
[0077] The first determination module determines whether the first status sensor data conforms to the interference rule. If it conforms to the interference rule, it calls the second acquisition module. If it does not conform to the interference rule, it outputs the first status sensor data.
[0078] The second acquisition module acquires the second status sensor data and determines the change value S based on the first status sensor data and the second status sensor data.
[0079] The threshold acquisition module acquires the first optical interference threshold and the second optical interference threshold.
[0080] The second determination module selects the output data of the photoelectric sensor based on the change value, the first optical interference threshold, and the second optical interference threshold.
[0081] In summary, the following effects are obtained by the present invention:
[0082] The present invention provides a method for processing optical interference of a photoelectric sensor, including: first, judging the first status sensor data and the first interference parameter, determining the interference rule based on the first interference parameter, and then determining whether the first status sensor data conforms to the interference rule. If it does not conform to the interference rule, the first status sensor data is output, that is, there is no interference at this time, and the directly perceived first status sensor data can be output; if it conforms to the interference rule, it is determined that there is interference at this time, the second status sensor data is acquired, and the change value is determined based on the first status sensor data and the second status sensor data. The output data of the photoelectric sensor is selected based on the change value, the first optical interference threshold, and the second optical interference threshold. The present invention performs a secondary numerical judgment on the first status sensor data. If it is initially determined that there is interference, it specifically judges whether there is interference according to the values before and after the photoelectric sensor emits light. If there is interference, the output state of the photoelectric sensor before the interference occurs is maintained. If there is no interference, the first status sensor data is directly output. The method and device for processing optical interference of the photoelectric sensor proposed by the present invention have a low computational complexity, and only a small amount of historical data is required to determine whether the photoelectric sensor is in an interference state. The implementation is simple, the structure of the photoelectric sensor does not need to be changed, and the implementation cost is low.
[0083] Based on the present application, those skilled in the art should understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspects described herein can be used to implement the device and / or practice the method. In addition, this device and / or this method can be implemented using other structures and / or functions in addition to one or more of the aspects described herein.
[0084] Those skilled in the art know that in addition to implementing the system and its various devices, modules, and units provided by the present invention in the form of pure computer-readable program code, the method steps can be logically programmed to enable the system and its various devices, modules, and units provided by the present invention to be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers, etc. to achieve the same functions. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a kind of hardware component, and the devices, modules, and units included therein for implementing various functions can also be regarded as the structures within the hardware component; the devices, modules, and units for implementing various functions can also be regarded as either software modules for implementing the method or the structures within the hardware component.
[0085] It should be noted that the above-mentioned embodiments can be freely combined as needed. The above are only the preferred embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
[0086] All the documents mentioned in the present invention are cited in this application as references, just as if each document is cited separately as a reference. In addition, it should be understood that after reading the above content of the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the appended claims of this application.
Claims
1. A method for processing light interference of a photoelectric sensor, characterized in that: The following steps are involved: Step S1, obtaining first state sensor data and first interference parameters, and determining interference rules based on the first interference parameters, wherein the first state sensor data is sensor data measured in the luminous state of the photoelectric sensor itself; Step S2, determining whether the first state sensor data conforms to the interference rule, if it conforms to the interference rule, proceeding to step S3, if it does not conform to the interference rule, outputting the first state sensor data; Step S3, obtaining second state sensor data, and determining a change value S based on the first state sensor data and the second state sensor data, wherein the second state sensor data is sensor data measured when the photoelectric sensor itself is in a non-luminous state; Step S4, obtaining a first light interference threshold and a second light interference threshold; Step S5: Select output data of the photoelectric sensor based on the change value and the light interference first threshold and the light interference second threshold.
2. A method for processing light interference of a photoelectric sensor according to claim 1, characterized in that: The first interference parameter is the voltage difference V between the positive and negative poles of the power supply of the analog-to-digital converter ADC in the photoelectric sensor.
3. A method for processing light interference of a photoelectric sensor according to claim 2, characterized in that: The step S2 comprises: Step S2.1, obtaining the maximum value MAX and the minimum value MIN in the first state sensor data, and obtaining the positive and negative voltage difference V of the power supply of the analog-to-digital converter ADC in the photoelectric sensor; Step S2.2, calculate the peak-to-peak value VPP=MAX-MIN of the first state sensor data waveform, if VPP≥V, the first state sensor data waveform is in a saturated state, if VPP<V, the first state sensor data waveform is not in a saturated state.
4. The method for processing light interference of a photoelectric sensor according to claim 1, characterized in that: Step S3 includes: The determining of the change value S based on the first state sensor data and the second state sensor data comprises: , where N is the total amount of sensor data in the first state, is the i-th first state sensor data, is the average value of the sensor data in the second state.
5. The method for processing light interference of a photoelectric sensor according to claim 4, characterized in that: The light interference first threshold is the light interference occurrence threshold IN, and the light interference second threshold is the light interference exit threshold OUT, wherein IN>OUT.
6. The method for processing light interference of a photoelectric sensor according to claim 5, characterized in that: Step S5 includes: (a) If S>IN, it is determined that light interference occurs, and the output of the photoelectric sensor in the previous cycle is maintained; (b) if S<OUT, it is determined that there is no interference, and the first state sensor data is output; (c) If OUT<S<IN, determine whether interference exists based on the state of the photoelectric sensor in the previous cycle.
7. The method for processing light interference of a photoelectric sensor according to claim 6, characterized in that: If OUT<S<IN and the state of the photoelectric sensor in the previous cycle is an interference state, it is determined that the light interference still exists, and the output state of the last cycle of the photoelectric sensor without interference is traced back; If OUT<S<IN and the state of the photoelectric sensor in the previous cycle is a state without interference, it is determined that the photoelectric sensor is currently in a state without interference, and the first state sensor data is output.
8. The method for processing light interference of a photoelectric sensor according to any one of claims 1 to 7, characterized in that: Determining whether the first state sensor data conforms to the interference rule in step S2 includes: determining whether the first state sensor data conforms to the interference rule based on at least ten cycles of the first state sensor data; Determining the change value based on the first state sensor data and the second state sensor data in step S3 includes: determining the change value based on at least five cycles of the first state sensor data and five cycles of the second state sensor data.
9. A photoelectric sensor light interference processing device, implemented based on the photoelectric sensor light interference processing method according to any one of claims 1 to 8, characterized in that: Includes the following structures: A first acquisition module acquires first state sensor data and first interference parameters, and determines interference rules based on the first interference parameters; A first determination module determines whether the first state sensor data conforms to the interference rule, and if so, calls the second acquisition module; if not, outputs the first state sensor data; A second acquisition module acquires second state sensor data, and determines a change value S based on the first state sensor data and the second state sensor data; A threshold acquisition module, which acquires a first light interference threshold and a second light interference threshold; The second determination module selects the output data of the photoelectric sensor based on the change value and the light interference first threshold and the light interference second threshold.
Citation Information
Patent Citations
Method, system and sensor for dynamically adjusting photoelectric detection parameters
CN114577240A
Anti-interference method for photoelectric sensor and photoelectric sensor
CN117191088A