Method for suppressing co-channel interference based on photoelectric switch identification ID and photoelectric switch
Patent Information
- Application Number
- CN202611073551.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]鉴于上述问题,本申请实施例提供了基于光电开关标识ID实现抑制同频干扰的方法及光电开关,克服了上述或者至少部分地解决了上述光电开关间在对向安装或密集安装场景相互产生同频干扰的问题
[0018]In one alternative approach, the photoelectric switch is a diffuse reflection photoelectric switch.
Smart Images

Figure CN122932647A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of photoelectric switches, specifically to a method for suppressing co-channel interference based on a photoelectric switch identifier ID, and a photoelectric switch thereof. Background Technology
[0002] A photoelectric switch is a non-contact sensor that uses light signals to detect the presence or absence of an object. It is widely used in industrial automation, intelligent logistics, and security monitoring. Diffuse reflection photoelectric switches, a common type, work by emitting their own light signal and detecting the light signal reflected back from the target object. When they receive sufficiently strong reflected light, they output a detection signal. Due to their advantages such as fast response speed, non-contact detection, and strong adaptability, photoelectric switches have become one of the core components of automated control systems.
[0003] In actual industrial settings, multiple photoelectric switches are often densely arranged, or even installed facing each other. When two diffuse reflection photoelectric switches are installed facing each other, the light emitted by photoelectric switch A may directly illuminate the receiver of photoelectric switch B, and vice versa. In this case, even if there is no object being measured in the detection area, the direct light from the opposing photoelectric switch may be misinterpreted as a valid reflected signal by the receiver of the other switch, causing the photoelectric switch to output incorrectly. This interference caused by the mutual illumination of optical signals of the same frequency is called co-frequency optical interference.
[0004] Therefore, there is an urgent need for a method to avoid mutual interference between photoelectric switches in opposite or densely installed scenarios. Summary of the Invention
[0005] In view of the above problems, this application provides a method and a photoelectric switch for suppressing co-channel interference based on the photoelectric switch identifier ID, which overcomes or at least partially solves the problem of co-channel interference between photoelectric switches in opposite or densely installed scenarios.
[0006] A first aspect of this application provides a method for suppressing co-channel interference based on a photoelectric switch identifier ID, applied to a first photoelectric switch and a second photoelectric switch installed opposite to each other, the method comprising: The first and second photoelectric switches each acquire their own unique identifier (ID). Based on their respective unique identifiers, they calculate their own set of emission interval values bit by bit, and determine their respective emission interval sequences based on these values. The emission interval sequences of the first and second photoelectric switches are distinct. The first and second photoelectric switches emit light sequentially according to their respective emission interval sequences, detecting any light interference from the opposing photoelectric switch during the emission process. When the first photoelectric switch detects light interference from the second photoelectric switch, it delays for a first preset time and then switches to a first fixed emission frequency. When the second photoelectric switch detects light interference from the first photoelectric switch after emitting light itself, it identifies the frequency of the interference signal. If the second photoelectric switch identifies the frequency of the interference signal as the first fixed emission frequency, it delays for a second preset time and then switches to a second fixed emission frequency, different from the first fixed emission frequency.
[0007] In this embodiment, the first and second photoelectric switches generate distinct light emission interval sequences using their unique identifiers (IDs), avoiding long-term synchronization or integer multiple relationships in their light emission timing when they are installed opposite each other. When interference occurs, the photoelectric switch that detects the interference first switches to a first fixed light emission frequency, and the photoelectric switch that detects the interference later automatically switches to a different second fixed light emission frequency after recognizing that frequency. This ensures that the two photoelectric switches eventually stabilize at different fixed light emission frequencies, effectively avoiding erroneous outputs caused by co-frequency interference, and without affecting the response speed of the photoelectric switches to the actual tested object. Furthermore, this application utilizes the unique identifiers (IDs) of the photoelectric switches themselves, requiring no manual intervention, no external controller, and no additional hardware costs, making it plug-and-play with good compatibility.
[0008] In one alternative approach, the unique identifier ID is either a globally unique ID of the microcontroller or a unique number set by the photoelectric switch manufacturer.
[0009] In one optional approach, multiple emission interval values are calculated bit-by-bit based on the unique identifier ID, including: assuming the unique identifier ID is m bits, it is divided into r groups of n consecutive bits each, and the calculation is performed using a carry-over method; the value of each group of n bits is N; the emission interval value T satisfies: T = + N × t, where The base interval time is given by t, which is the time interval during which the photoelectric switch cannot detect interference. The calculated r T values are arranged sequentially to form a light emission interval sequence.
[0010] In one alternative approach, the emission interval values T are not integer multiples of each other, and satisfy: N × t < .
[0011] By constraining the emission interval values T to be non-integer multiples of each other, and combining N×t< This ensures that the emission pulses of any two photoelectric switches always have a phase drift in the time domain, preventing interference from being hidden for a long time in the time interval t that the photoelectric switches cannot detect due to period overlap or integer multiple synchronization. As a result, the interference will inevitably fall into the detectable area within r emission cycles, ensuring that the frequency switching mechanism can be triggered in a timely manner.
[0012] In one alternative approach, the number of groups r is less than the preset flipping period q, i.e., r < q.
[0013] By making r < q, the number of consecutively disturbed cycles is interrupted before reaching the preset flip cycle q, thus avoiding erroneous output.
[0014] In one alternative approach, a first fixed emission frequency is detected after light interference. Second fixed emission frequency The following constraints must be met: ; ; , where q is the preset flipping period.
[0015] This embodiment uses constraints Ensure that the photoelectric switch that detects interference can operate at 2 The interference frequency was completely captured and identified within a short period of time. To facilitate the subsequent switch to Provide accurate judgment criteria; constraints To ensure that the two fixed-frequency light pulses are gradually staggered due to their period difference, the interference cycles are naturally interrupted before accumulating to a preset flip period q, thus avoiding erroneous output caused by continuous interference accumulation; constraints This ensures that when the actual object being measured appears, the effective reflected signal can accumulate a sufficient number of consecutive effective cycles in the interference gap to exceed q, thus guaranteeing that the photoelectric switch will open and output in a timely and correct manner.
[0016] In one alternative approach, the first preset time is the time interval t during which the photoelectric switch cannot detect interference; the second preset time is 2... , The base interval time.
[0017] In a second aspect, this application provides a photoelectric switch, which, when in use, employs the method for suppressing co-channel interference based on the photoelectric switch identifier ID provided in the foregoing embodiments of this application.
[0018] In one alternative approach, the photoelectric switch is a diffuse reflection photoelectric switch.
[0019] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram illustrating a method for suppressing co-channel interference based on photoelectric switch identifier ID, provided in some embodiments of this application.
[0022] Figure 2 This is a schematic diagram of the light emission timing of a photoelectric switch. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0025] The terms "comprising" and "having," and any variations thereof, used in the specification, claims, and drawings of this application are intended to cover without excluding other meanings. The words "a" or "an" do not exclude the existence of multiple entities.
[0026] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0027] Furthermore, the terms "first," "second," etc., in the specification and claims of this application or in the aforementioned drawings are used to distinguish different objects rather than to describe a specific order, and may explicitly or implicitly include one or more of the features.
[0028] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).
[0029] In practical applications, sometimes two diffuse reflection photoelectric switches are installed facing each other. Even though there is no object being measured in the detection area of the photoelectric switches, the opposing photoelectric switches can cause light interference, leading to erroneous outputs. Because there is no object being measured, the first photoelectric switch will not receive its own light signal, but it can receive the light signal from the second photoelectric switch; the same applies to the second photoelectric switch. In this situation, both photoelectric switches will produce erroneous outputs.
[0030] Figure 1 This is a schematic diagram illustrating a method for suppressing co-channel interference based on photoelectric switch identifier ID provided in some embodiments of this application. (Refer to...) Figure 1 The first aspect of the application provides a method for suppressing co-channel interference based on photoelectric switch identifiers (IDs). This method is applied to a first photoelectric switch and a second photoelectric switch installed opposite each other. The method includes: the first photoelectric switch and the second photoelectric switch acquiring their respective unique identifiers (IDs); calculating a set of emission interval values for each switch based on their respective unique identifiers (IDs), and determining their respective emission interval sequences based on their respective emission interval values. The emission interval sequences of the first photoelectric switch and the second photoelectric switch are different from each other. The first photoelectric switch and the second photoelectric switch emit light sequentially according to their respective emission interval sequences, and detect whether there is light interference from the opposing photoelectric switch during the emission process. When the first photoelectric switch detects light interference from the second photoelectric switch, the first photoelectric switch delays for a first preset time and then switches to a first fixed emission frequency. The second photoelectric switch emits light. After emitting light itself, it detects light interference from the first photoelectric switch and identifies the frequency of the interference signal. If the second photoelectric switch identifies the frequency of the interference signal as the first fixed emission frequency... Then, after a second preset time delay, the second photoelectric switch switches to the same frequency as the first fixed light emission frequency. Different second fixed emission frequencies It emits light. If the second photoelectric switch does not detect an interference signal with the first fixed emission frequency... Then it continues to emit light according to its own emission interval sequence.
[0031] The first preset time is the time interval t during which the photoelectric switch cannot detect interference; the second preset time is 2. , The base interval time. Figure 1 In the diagram, photoelectric switch B is the first photoelectric switch, and photoelectric switch A is the second photoelectric switch.
[0032] It should be noted that in this application, the first photoelectric switch and the second photoelectric switch are only used to distinguish two photoelectric switches installed opposite each other. Their roles (who detects interference first and who detects interference later) are determined by the actual physical timing and are not inherent properties of the photoelectric switches themselves. First fixed emission frequency Second fixed emission frequency These are two different fixed frequency values, and the specific values must be selected under the constraints disclosed in this application.
[0033] It should also be noted that the first fixed emission frequency Second fixed emission frequency This refers to the predefined fixed frequency parameter in this application. In actual products, this parameter can exist in each photoelectric switch in various ways, such as through firmware hard encoding, storage in non-volatile memory, or dynamic generation by the system according to preset rules. When the second photoelectric switch needs to identify the frequency of the interference signal, it compares the actually detected pulse interval with the locally existing first fixed emission frequency. The corresponding values can be compared. This application specifies the first fixed emission frequency. Second fixed emission frequency The specific storage or generation method is not limited, as long as the photoelectric switch can obtain the frequency value to perform identification and switching operations.
[0034] In this embodiment, the first and second photoelectric switches generate distinct light emission interval sequences using their unique identifiers (IDs), preventing long-term synchronization or integer multiple relationships in their light emission timing when they are installed opposite each other. When interference occurs, the photoelectric switch that detects the interference first switches to a first fixed light emission frequency. After detecting the interference, the photoelectric switch identified the frequency and automatically switched to a different second fixed emission frequency. This ensures that the two photoelectric switches eventually stabilize at different fixed emission frequencies, effectively avoiding erroneous outputs caused by co-frequency interference, and does not affect the response speed of the photoelectric switches to the actual measured object; at the same time, this application achieves this through the unique identification ID of the photoelectric switch itself, requiring no manual intervention, no external controller, and no additional hardware costs, making it plug-and-play with good compatibility.
[0035] In some embodiments, the unique identifier ID is the globally unique ID of the microcontroller, or a unique number set by the photoelectric switch manufacturer.
[0036] Currently, mainstream microcontrollers (such as STM32, GD32, ESP32, etc.) all have a unique chip identifier built in at the factory. This identifier is usually a 96-bit or 128-bit binary code, which is written into a special storage area of the chip by the chip manufacturer during production. Users can obtain this unique identifier ID by reading the corresponding register or storage address. Because this unique identifier ID is globally unique and cannot be changed, it can be directly used as the unique identifier of the photoelectric switch without additional programming or configuration. This simplifies the production process and fundamentally ensures the uniqueness of the unique identifier ID of different photoelectric switches.
[0037] In another alternative approach, the unique identifier (ID) is a unique number set by the photoelectric switch manufacturer. For microcontrollers that do not have a built-in globally unique identifier (ID), or for products with specific coding requirements (such as including product model, production batch, production date, etc.), the photoelectric switch manufacturer can assign a unique number to each photoelectric switch during the product manufacturing or testing phase by programming or writing it into a non-volatile memory (such as EEPROM or Flash). This number is also globally unique and is read by the photoelectric switch's control unit for subsequent calculations, functioning completely equivalent to the globally unique identifier (ID) of a microcontroller.
[0038] Both methods described above can provide a reliable and unique source of identification for this application. In practical applications, the choice can be made flexibly based on the selected hardware platform and production management needs, without affecting the implementation effect of this application. In practical applications, for microcontroller solutions equipped with globally unique identifiers, the microcontroller's own identifier can be used to reduce production processes and costs; for hardware platforms without unique identifiers, a number set by the manufacturer can be used to supplement the identification, ensuring the universality and portability of the method in this application.
[0039] In some embodiments, multiple emission interval values are calculated bit-by-bit based on the unique identifier ID, including: assuming the unique identifier ID is m bits, it is divided into r groups of n consecutive bits each, and the calculation is performed using a carry-over method; the value of each group of n bits is N; the emission interval value T satisfies: T = + N × t, where The base interval time is given by t, which is the time interval during which the photoelectric switch cannot detect interference. The calculated r T values are arranged sequentially to form a light emission interval sequence.
[0040] Figure 2 This is a schematic diagram of the light emission timing of a photoelectric switch. Figure 2 This diagram illustrates the detectable light interference time Tt and the undetectable interference time interval t. The undetectable interference time interval t refers to the period from after each light-emitting action of the photoelectric switch until its receiving circuit completes signal acquisition and conversion. During this time interval, the photoelectric switch's receiving end is in signal processing mode (such as analog-to-digital conversion, signal amplification, threshold comparison, etc.) and cannot effectively detect externally incident light signals. The undetectable interference time interval t is determined by the hardware circuit characteristics of the photoelectric switch, including but not limited to: the driving response time of the light-emitting element, the photoelectric conversion time of the receiving element, the setup time of the signal amplification and filtering circuit, and the sampling and conversion time of the analog-to-digital converter. Different models or hardware configurations of photoelectric switches may have different undetectable interference time intervals t, but once the hardware scheme is determined, t is a fixed value that can be pre-determined and stored in the photoelectric switch's memory during the software design phase.
[0041] In some embodiments, the emission interval values T are not integer multiples of each other, and satisfy: N × t < .
[0042] By constraining the emission interval values T to be non-integer multiples of each other, and combining N×t< This ensures that the emission pulses of any two photoelectric switches always have a phase drift in the time domain, preventing interference from being hidden for a long time in the time interval t that the photoelectric switches cannot detect due to period overlap or integer multiple synchronization. As a result, the interference will inevitably fall into the detectable area within r emission cycles, ensuring that the frequency switching mechanism can be triggered in a timely manner.
[0043] In some embodiments, the number of groups r is less than the preset flipping period q, that is, r < q.
[0044] By making r < q, the number of consecutively disturbed cycles is interrupted before reaching the preset flip cycle q, thus avoiding erroneous output.
[0045] Understandably, the flip cycle is a threshold number of consecutive valid or invalid cycles used internally by the photoelectric switch to determine whether the output state has changed. Specifically, if the photoelectric switch detects a valid pulse signal during self-illumination, it records that cycle as signal "1"; if no valid pulse signal is detected, it records it as signal "0". When the detected signal is "1" for q consecutive cycles, the photoelectric switch turns on the output; when the detected signal is "0" for q consecutive cycles, the photoelectric switch turns off the output; otherwise, it maintains the current output state.
[0046] This application can further constrain the number of consecutive interference cycles x < q and the number of consecutive valid signal cycles y > q, so that even if there is co-frequency interference, the output state will not change due to misjudgment for q consecutive cycles; at the same time, when the actual object under test appears, the valid signal can be stably sustained for at least q cycles, thereby triggering the correct output action.
[0047] For example, assuming a certain model of photoelectric switch uses a 12-bit microcontroller to uniquely identify the ID, and n=3, then r = 12 / 3 = 4 groups. Let the base interval time be... = 1000μs, blind time t = 100μs. Let the 12-bit unique identifier ID of the first photoelectric switch be 101110011001. Taking n=3, it is divided into 4 groups: 101, 110, 011, and 001. The corresponding N values for each group are 5, 6, 3, and 1, respectively. Substituting these values into T = + N×t, where =1000μs, t=100μs, and the four emission interval values are calculated to be 1500μs, 1600μs, 1300μs, and 1100μs respectively. Therefore, the emission interval sequence of the first photoelectric switch is [1500μs, 1600μs, 1300μs, 1100μs], and it emits light in a cyclical manner using this sequence.
[0048] Let the 12-bit unique identifier ID of the second photoelectric switch be 110010101011, which is also divided into 4 groups: 110, 010, 101, and 011. The corresponding N values for each group are 6, 2, 5, and 3, respectively. Substituting into the same formula, the four emission interval values are calculated to be 1600μs, 1200μs, 1500μs, and 1300μs, respectively. Therefore, the emission interval sequence of photoelectric switch B is [1600μs, 1200μs, 1500μs, 1300μs], and it emits light in a cyclical manner based on this sequence.
[0049] Comparing the two sequences reveals that the emission interval sequences of the first and second photoelectric switches are distinct. Taking any two emission interval values of the first photoelectric switch as an example, 1500μs, 1600μs, 1300μs, and 1100μs are not integer multiples of each other; similarly, the intervals of the second photoelectric switch (1600μs, 1200μs, 1500μs, and 1300μs) are also not integer multiples of each other. Furthermore, the maximum N value in both calculations is 6, and N×t=600μs is less than... =1000μs, satisfying N×t< The constraints are as follows: the number of groups r=4, the preset flip period q=5, and r<q, thus ensuring that any two photoelectric switches can detect the opposing interference within q periods and trigger the subsequent frequency switching mechanism.
[0050] In some embodiments, a first fixed emission frequency is detected after light interference. Second fixed emission frequency The following constraints must be met: ; ; , where q is the preset flipping period.
[0051] This embodiment uses constraints Ensure that the photoelectric switch that detects interference can operate at 2 The interference frequency was completely captured and identified within a short period of time. To facilitate the subsequent switch to Provide accurate judgment criteria; constraints To ensure that the two fixed-frequency light pulses are gradually staggered due to their period difference, the interference cycles are naturally interrupted before accumulating to a preset flip period q, thus avoiding erroneous output caused by continuous interference accumulation; constraints This ensures that when the actual object being measured appears, the effective reflected signal can accumulate a sufficient number of consecutive effective cycles in the interference gap to exceed q, thus guaranteeing that the photoelectric switch will open and output in a timely and correct manner.
[0052] When three or more photoelectric switches are densely installed, each photoelectric switch acquires its own unique identifier (ID) and generates a distinct emission interval sequence. Because each switch has a different ID, their emission interval sequences are different, and no two photoelectric switches will experience long-term synchronization within q cycles. When a switch detects light interference from any opposing switch, it switches to a fixed emission frequency according to the method described in this application. If multiple interference sources of different frequencies exist simultaneously, the photoelectric switch can select an unused frequency for switching through frequency identification, thereby achieving adaptive avoidance in multi-switch scenarios.
[0053] Other embodiments of this application also provide a photoelectric switch, which, when in use, employs the method for suppressing co-channel interference based on the photoelectric switch identifier ID provided in the foregoing embodiments of this application.
[0054] In some embodiments, the photoelectric switch may be a diffuse reflection photoelectric switch.
[0055] Those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.
[0056] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for suppressing co-channel interference based on photoelectric switch identifier ID, applied to a first photoelectric switch and a second photoelectric switch installed opposite each other, characterized in that, The method includes: The first photoelectric switch and the second photoelectric switch each acquire their own unique identifier ID; Based on their respective unique identifiers (IDs), each photoelectric switch calculates its own set of light emission interval values by grouping them bit by bit, and determines its own light emission interval sequence based on its respective light emission interval values; the light emission interval sequences of the first photoelectric switch and the second photoelectric switch are different from each other; The first photoelectric switch and the second photoelectric switch emit light sequentially according to their respective light emission interval sequences, and detect whether there is light interference from the opposite photoelectric switch during the light emission process; When the first photoelectric switch detects light interference from the second photoelectric switch, the first photoelectric switch delays for a first preset time and then switches to a first fixed light emission frequency to emit light. When the second photoelectric switch detects light interference from the first photoelectric switch after emitting its own light, it identifies the frequency of the interference signal. If the second photoelectric switch identifies the frequency of the interference signal as the first fixed emission frequency, then after a second preset time, the second photoelectric switch switches to a second fixed emission frequency that is different from the first fixed emission frequency to emit light.
2. The method according to claim 1, characterized in that, The unique identifier ID is either a globally unique ID of the microcontroller or a unique number set by the photoelectric switch manufacturer.
3. The method according to claim 1, characterized in that, The calculation of multiple emission interval values based on the unique identifier ID, grouped by bit, includes: Let the unique identifier ID be m bits, divided into r groups of n consecutive bits each, and calculated using the carry-over method; The value of each group of n-bit binary numbers is N; The emission interval value T satisfies: T = + N × t, where The base interval time is t, which is the time interval during which the photoelectric switch cannot detect interference. The calculated r T values are arranged sequentially to form the emission interval sequence.
4. The method according to claim 3, characterized in that, The emission interval values T are not integer multiples of each other, and satisfy: N × t < .
5. The method according to claim 3, characterized in that, The number of groups r is less than the preset flipping period q, that is, r < q.
6. The method according to claim 3, characterized in that, The first fixed emission frequency f1 and the second fixed emission frequency f2 after detecting light interference satisfy the following constraints: ; ; , where q is the preset flipping period.
7. The method according to claim 1, characterized in that, The first preset time is the time interval t during which the photoelectric switch cannot detect interference; the second preset time is 2. , The base interval time.
8. A photoelectric switch, characterized in that, The photoelectric switch is used in accordance with the method described in any one of claims 1-7.
9. The photoelectric switch according to claim 8, characterized in that, The photoelectric switch is a diffuse reflection photoelectric switch.