Ultra-thin light curtain sensor anti-interference method, sensor, product and medium
By using bandpass filtering and standard signal characteristic comparison technology in the light curtain sensor, combined with the method of adjusting the emission power of ambient light intensity, the problem of low reliability of the detection results of the light curtain sensor when the ambient light changes is solved, and higher detection accuracy and stability are achieved.
Patent Information
- Application Number
- CN202510017521.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-01-06
AI Technical Summary
The existing light curtain sensors have low reliability in the detection results when ambient light changes and are susceptible to local environmental factors.
The ultra-thin light curtain sensor anti-interference method is adopted to emit infrared light beams in order of infrared emitting array through the transmitter. The receiver receives and performs bandpass filtering to remove ambient light interference signals. It compares with standard signal characteristics to record the effective detection signal and correspondence between each transmitting unit and each receiving unit, and adjusts the transmission power according to the ambient light intensity.
It improves the reliability of the detection results of the light curtain sensor under the influence of the environment, enhances the accuracy of judging the state of the light curtain being blocked, adapts to different ambient light interferences, and ensures detection accuracy and stability.
Smart Images

Figure CN119805604A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of light curtain sensors, and in particular to an anti-interference method, sensor, product and medium for an ultra-thin light curtain sensor. Background Art
[0002] With the rapid development of modern industrial automation, the demand for safety protection and precision detection is increasing. As an important industrial safety protection device, light curtain sensors play a key role in mechanical equipment, automated production lines and other scenarios. Especially in precision instruments and highly integrated industrial environments, higher requirements are placed on the volume and performance stability of sensors.
[0003] In related technologies, light curtain sensors mainly use traditional photoelectric devices and fixed threshold signal processing methods. By using preset fixed power parameters at the light beam transmitting end, the receiving end determines whether the light beam is blocked based on the pre-set threshold.
[0004] However, since the optical path conditions will change with the changes in ambient light, the detection method with fixed parameters is difficult to adapt to such dynamic changes, and the signal transmission path is more easily affected by local environmental factors, resulting in reduced reliability of the detection results. Summary of the invention
[0005] The present application provides an ultra-thin light curtain sensor anti-interference method, sensor, product and medium, which are used to improve the reliability of the light curtain sensor detection results.
[0006] In the first aspect, the present application provides an anti-interference method for an ultra-thin light curtain sensor, which is applied to the ultra-thin light curtain sensor. The anti-interference system includes a transmitter and a receiver. The method includes: the transmitter sequentially emits infrared light beams according to an infrared light-emitting array to form a detection light curtain; the receiver receives the infrared light beams and converts them into electrical signals to obtain an initial detection signal, which is used to characterize the blocked state of the light curtain; the receiver removes the ambient light interference signal in the initial detection signal through bandpass filtering, and compares the filtered initial detection signal with the standard signal characteristics, and takes the initial detection signal that exceeds a preset matching threshold with the standard signal characteristics as a valid detection signal; the receiver records the valid detection signals and the corresponding relationship between each transmitting unit and each receiving unit to obtain multiple light paths; when there is a target light path among the multiple light paths, and the ambient light intensity detected by the receiving unit corresponding to the target light path exceeds the preset ambient light threshold, the transmitter adjusts the transmission power of the transmitting unit corresponding to the target light path.
[0007] By adopting the above technical solution, the transmitter emits infrared light beams in the order of the infrared light array, ensuring the uniformity and stability of the detection light curtain, so that the light curtain can effectively cover the detection area, and the receiver receives and processes the light beam to obtain the initial detection signal, thereby accurately grasping the light curtain blocking state. Bandpass filtering removes ambient light interference signals, and compares the standard signal characteristics to obtain effective signals, effectively eliminating the interference of ambient light factors, and establishing an optical path mapping relationship based on the effective signal. The transmitter adjusts the transmission power and acquisition threshold accordingly, which allows the light curtain sensor to better adapt to changes in ambient light and improves the reliability of the light curtain sensor detection results under environmental influences.
[0008] In combination with some embodiments of the first aspect, in some embodiments, the step of the receiver removing the ambient light interference signal in the initial detection signal through bandpass filtering specifically includes: the receiver detects the ambient light intensity value received by each receiving unit in the receiver when the transmitter stops transmitting; the receiver sets the filtering parameters of the bandpass filter according to the ambient light intensity value; the receiver performs bandpass filtering on the initial detection signal according to the filtering parameters to obtain the initial detection signal after filtering.
[0009] By adopting the above technical solution, the receiver detects the ambient light intensity value of each receiving unit when the transmitter stops transmitting. Reasonable filtering parameters can enable the bandpass filter to more accurately remove the ambient light interference signal in the initial detection signal. The reduction of ambient light interference makes it possible to more accurately identify the effective detection signal when comparing it with the standard signal characteristics later. The accuracy of the effective detection signal is improved, thereby improving the accuracy of the entire light curtain sensor in judging the blocked state of the light curtain.
[0010] In combination with some embodiments of the first aspect, in some embodiments, the receiver records the valid detection signal and the corresponding relationship between each transmitting unit and each receiving unit to obtain the step of multiple optical paths, specifically including: the receiver records the number of each transmitting unit and the receiving unit number corresponding to each transmitting unit; the receiver records the signal strength value of the valid detection signal between each pair of transmitting units and receiving units; the receiver combines the transmitting unit number, the receiving unit number and the signal strength value into an optical path information to obtain multiple optical paths.
[0011] By adopting the above technical solution, the receiver records the transmitting unit number, the receiving unit number and the signal strength value of the effective detection signal between the two to form the optical path information, and completely constructs the optical path mapping relationship. Detailed optical path information helps to accurately analyze the status of each optical path and quickly locate problems when they occur. For example, when the ambient light intensity of the target optical path is abnormal, the transmitter can quickly determine the corresponding transmitting unit based on this to adjust the power.
[0012] In combination with some embodiments of the first aspect, in some embodiments, the step of the transmitter adjusting the transmission power and the signal acquisition threshold according to the timing change information of the optical path mapping relationship specifically includes: the transmitter increases the transmission power of the transmission unit corresponding to the target optical path to a preset power threshold; the receiver updates the signal acquisition threshold of the abnormal optical path according to the preset power threshold.
[0013] By adopting the above technical solution, the transmitter increases the transmission power of the transmitting unit corresponding to the target optical path to the preset power threshold, which can enhance the infrared light beam intensity of the optical path. This makes the signal received by the receiver clearer and more stable, and effectively reduces signal misjudgment caused by interference such as ambient light. The receiver updates the signal collection threshold of the target optical path according to the preset power threshold, which can ensure that the collected signal accurately reflects the state of the optical path. When the ambient light intensity of the target optical path is abnormal, the signal transmission and detection of the optical path are timely optimized, thereby improving the detection accuracy of the light curtain sensor for a specific optical path.
[0014] In combination with some embodiments of the first aspect, in some embodiments, after the transmitter adjusts the transmission power of the transmission unit corresponding to the target optical path, and the transmitter sequentially transmits infrared light beams according to the infrared light-emitting array to form a detection light curtain, the method also includes: the transmitter collects real-time ambient light data of the current environment; the transmitter divides the infrared light-emitting array into multiple transmission groups according to the real-time ambient light data, and assigns different transmission timing and power parameters to each transmission group; when the real-time ambient light intensity is greater than a first preset threshold, the transmitter increases the transmission power of the transmission group to a preset first power threshold and reduces the transmission frequency to a preset first frequency threshold; when the real-time ambient light intensity is less than a second preset threshold, the transmitter reduces the transmission power of the transmission group to a preset second power threshold and increases the transmission frequency to a preset second frequency threshold, the first preset threshold is greater than the second preset threshold, the preset first power threshold is greater than the preset second power threshold, and the preset first frequency threshold is less than the preset second frequency threshold.
[0015] By adopting the above technical solution, the transmitter collects real-time ambient light data, divides the infrared light-emitting array emission groups according to the data and assigns different parameters to make the emission more targeted, adjusts the emission power and frequency when the ambient light intensity changes, increases the power and reduces the frequency to enhance penetration under strong light, reduces the power and increases the frequency to save energy and stabilize detection under weak light, can effectively cope with different ambient light interference, optimize the emission effect, ensure that the light curtain works stably under various lighting conditions, improve the environmental adaptability of the light curtain sensor, and ensure that its detection accuracy and stability are not affected by changes in ambient light.
[0016] In combination with some embodiments of the first aspect, in some embodiments, after the transmitter adjusts the transmission power of the transmission unit corresponding to the target optical path, the method further includes: the transmitter counts the number of occlusions of the detection light curtain within a preset time window, and when the number of occlusions is greater than a preset occlusion frequency threshold, it is determined to be a frequent occlusion state; in the frequent occlusion state, the transmitter divides the detection light curtain into multiple detection areas; the transmitter counts the occlusion frequency of each detection area respectively to determine a high-frequency occlusion area; the transmitter increases the signal sampling frequency of the high-frequency occlusion area to a preset sampling frequency threshold, and reduces the signal judgment sensitivity of the high-frequency occlusion area to a preset sensitivity threshold.
[0017] By adopting the above technical solution, the transmitter counts the number of times the light curtain is blocked to determine the frequent blockage state, so as to timely grasp the changes in the working state of the light curtain. When it is frequently blocked, the detection area is divided and the blockage frequency of each area is counted to determine the high-frequency blockage area, so as to realize zoning management and increase the signal sampling frequency in the high-frequency blockage area. This can obtain more signal details for accurate judgment, reduce the sensitivity of signal judgment, and avoid misjudgment due to frequent blockage.
[0018] In combination with some embodiments of the first aspect, in some embodiments, after the step of the transmitter adjusting the transmission power of the transmission unit corresponding to the target optical path, the method also includes: the transmitter scans the detection light curtain according to a preset frame scanning period, and triggers each infrared light-emitting unit of the transmission group to emit an infrared light beam in turn in each frame scanning period; the receiver collects the signal strength value at a preset sampling moment, and when the signal strength value is greater than the signal collection threshold, it is determined to be a light-transmitting state, and when the signal strength value is less than the signal collection threshold, it is determined to be a light-shielding state.
[0019] By adopting the above technical solution, the transmitter scans the light curtain according to the preset frame scanning cycle, and sequentially triggers the transmitting group to emit infrared light beams. The receiver collects the signal strength value at a specific sampling time, and can judge the light path light-clearing or light-blocking state based on the comparison with the signal collection threshold, thereby achieving accurate detection.
[0020] In a second aspect, an embodiment of the present application provides an ultra-thin light curtain sensor, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the ultra-thin light curtain sensor to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions. When the above-mentioned computer program product runs on an ultra-thin light curtain sensor, the above-mentioned ultra-thin light curtain sensor executes the method described in the first aspect and any possible implementation method of the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions. When the instructions are executed on an ultra-thin light curtain sensor, the ultra-thin light curtain sensor executes the method described in the first aspect and any possible implementation method in the first aspect.
[0023] It can be understood that the ultra-thin light curtain sensor provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. This application ensures the uniformity and stability of the detection light curtain by transmitting infrared light beams in the order of the infrared light-emitting array through the transmitter, so that the light curtain can effectively cover the detection area. The receiver receives and processes the light beam to obtain the initial detection signal, thereby accurately grasping the light curtain blocking state. Bandpass filtering removes the ambient light interference signal, and compares the standard signal characteristics to obtain the effective signal, effectively eliminating the interference of environmental factors, and establishing an optical path mapping relationship based on the effective signal. The transmitter adjusts the transmission power and acquisition threshold accordingly, which allows the light curtain sensor to better adapt to environmental changes and improves the reliability of the light curtain sensor detection results under environmental influences.
[0025] 2. The present application increases the transmitting power of the transmitting unit corresponding to the target optical path to a preset power threshold through the transmitter, which can enhance the infrared light beam intensity of the optical path. This makes the signal received by the receiver clearer and more stable, and effectively reduces signal misjudgment caused by interference such as ambient light. The receiver updates the signal collection threshold of the target optical path according to the preset power threshold, which can ensure that the collected signal accurately reflects the state of the optical path. When the ambient light intensity of the target optical path is abnormal, the signal transmission and detection of the optical path are timely optimized, thereby improving the detection accuracy of the light curtain sensor for the specific optical path.
[0026] 3. This application determines the frequent occlusion state by counting the number of times the light curtain is blocked by the transmitter, so as to timely grasp the changes in the working state of the light curtain. When it is frequently blocked, the detection area is divided and the occlusion frequency of each area is counted to determine the high-frequency occlusion area, so as to realize zoning management and increase the signal sampling frequency in the high-frequency occlusion area. More signal details can be obtained to facilitate accurate judgment, reduce the sensitivity of signal judgment, and avoid misjudgment due to frequent occlusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flow chart of the anti-interference method of the ultra-thin light curtain sensor in the embodiment of the present application; Figure 2 is another flow chart of the anti-interference method for the ultra-thin light curtain sensor in the embodiment of the present application; Figure 3 is another flow chart of the anti-interference method for the ultra-thin light curtain sensor in the embodiment of the present application; Figure 4 It is a schematic diagram of the physical device structure of the ultra-thin light curtain sensor in the embodiment of the present application. DETAILED DESCRIPTION
[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.
[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0030] For ease of understanding, the following is a description of the process of the method provided by this implementation. Figure 1 , which is a flow chart of the anti-interference method for the ultra-thin light curtain sensor in an embodiment of the present application.
[0031] S101, the transmitter emits infrared light beams in sequence according to the infrared light emitting array to form a detection light curtain.
[0032] Among them, the infrared light array refers to a group of emission units composed of multiple infrared light-emitting diodes in a specific spacing and arrangement. Sequential emission means that the light-emitting units emit light beams one by one or in groups in an orderly manner according to a preset timing control scheme. The detection light curtain is used to represent a continuous detection area formed by multiple parallel or crossed infrared light beams.
[0033] This step is performed after the system is started and the initialization configuration is completed. Specifically, the transmitter first performs initial configuration on the infrared light-emitting array, setting the basic emission power (usually 5-20mW) and emission timing (such as 100μs emission interval) of each light-emitting unit. Then, each light-emitting unit is triggered to emit infrared beams in sequence from left to right or from top to bottom. The emission time intervals of adjacent light-emitting units need to be precisely controlled to ensure the continuity of detection while avoiding crosstalk interference between adjacent beams.
[0034] The light beam emission and light curtain formation can be realized in the following ways: Optionally, a shift register control scheme is adopted, and an emission control chain is formed by connecting 8-bit shift registers in series, shifting one bit in each clock cycle, lighting up the corresponding light-emitting units in turn, and reloading the initial value after completing a scan; Optionally, a multiplexer scheme is adopted, and the light-emitting units are grouped and connected to the output end of the multiplexer, and the emission timing of each group of units is controlled by polling the selection signal to realize orderly emission. It is understandable that other emission control methods can also be used to realize orderly light beam emission and light curtain formation.
[0035] S102: The receiver receives the infrared light beam and converts it into an electrical signal to obtain an initial detection signal, where the initial detection signal is used to indicate a blocked state of the light curtain.
[0036] Receiving an infrared light beam means sensing an incident infrared light signal through a photodetector. Converting to an electrical signal means converting an optical signal into a corresponding voltage or current signal through photoelectric conversion. The initial detection signal is used to represent the unprocessed original electrical signal. The blocking state indicates whether the light beam is blocked by an object.
[0037] This step is performed immediately after the transmitter emits a light beam. Specifically, the photodetector in the receiver monitors the incident light beam in real time. When a light signal is detected, it is converted into a current signal through the photoelectric effect. The current signal is converted into a voltage signal through a transimpedance amplifier, amplified and filtered by a signal conditioning circuit, and finally converted into a digital initial detection signal. The amplitude of the signal reflects the on-off state of the light beam.
[0038] Photoelectric signal conversion and processing can be achieved in the following ways: Optionally, a high-speed PIN photodiode is used to receive the light beam, and a high-gain transimpedance amplifier is used to convert the light signal into a voltage signal, which is then amplified and filtered by an operational amplifier; Optionally, a phototransistor array is used to receive the light beam, and its current amplification function is used to directly generate a large current signal, and the required voltage signal is obtained after current-voltage conversion. It is understandable that other photoelectric conversion methods can also be used to achieve the conversion of optical signals to electrical signals.
[0039] S103, the receiver removes the ambient light interference signal in the initial detection signal through bandpass filtering, and compares the filtered initial detection signal with the standard signal characteristics, and takes the initial detection signal whose characteristics exceed a preset matching threshold with the standard signal as a valid detection signal.
[0040] Among them, bandpass filtering refers to a filtering method used to retain signal components within a specific frequency range and attenuate other frequency components outside the range. The ambient light interference signal refers to the light signal from natural or artificial light sources that affects the detection. The standard signal characteristic refers to the typical characteristic parameters of the pre-set ideal light curtain signal. The preset matching threshold is used to represent the standard value for determining the validity of the signal. The effective detection signal refers to the signal confirmed to be reliable after filtering and matching.
[0041] This step is performed immediately after the initial detection signal is obtained. Specifically, the receiver first processes the initial detection signal through a bandpass filter, and the center frequency of the filter is set to the modulation frequency of the transmitted signal (usually 38kHz) and the bandwidth range is ±2kHz. The filtered signal is then correlated with the stored standard signal characteristics, including signal amplitude, waveform, and phase. When the correlation exceeds the preset matching threshold (typically 85%), the signal is determined to be a valid detection signal.
[0042] In some embodiments, signal filtering and feature matching can be achieved in a variety of ways: optionally, a digital bandpass filtering scheme is used, first the initial signal is converted to digital, then digitally filtered through an FIR filter, then the correlation coefficient between the filtered signal and the standard feature is calculated, and finally the signal validity is judged according to the relevant threshold; optionally, an analog bandpass filtering scheme is used, a multi-stage active filter is used to filter the signal in the analog domain, and then the signal feature is extracted using a peak detection circuit, and then a threshold judgment is made through a comparator. It is understandable that other signal processing methods can also be used to achieve interference removal and validity judgment, which are not limited here.
[0043] It should be noted that the standard signal characteristics refer to the characteristic parameter set of the standard infrared light signal collected by the light curtain sensor under ideal working conditions (no interference, no obstruction). Specifically, it includes signal amplitude (peak-to-peak value of the signal under ideal conditions, usually 3.3V), waveform characteristics (envelope shape of 38kHz square wave modulation), phase relationship (phase difference between the rising edge of the signal and the system clock), duty cycle (high and low level time ratio of the standard signal, set to 50%), modulation depth (ratio of the maximum value to the minimum value of the signal, the standard value is 0.9) and other parameters. The purpose of comparing with the standard signal characteristics is to distinguish effective infrared detection signals from other interference signals, because ambient light interference usually does not have 38kHz modulation characteristics, the waveform characteristics of electromagnetic interference signals are significantly different from standard signals, the phase relationship of crosstalk signals is inconsistent with expectations, and the amplitude and modulation depth of the reflected signal are significantly lower than the standard values.
[0044] The comparison process is implemented using a multi-step strategy: first, the filtered signal is sampled at a sampling rate of 2MHz, and 1024 points of data are collected each time; then feature extraction is performed, including calculating the signal amplitude (peak-to-peak detection), measuring the modulation frequency (zero-crossing detection), calculating the duty cycle (high and low level time statistics), and measuring the phase difference (system clock synchronization); then the similarity of each dimension is calculated, including amplitude similarity Sa=min(measured value, standard value) / max(measured value, standard value), frequency similarity Sf=|1-|measured frequency-38kHz| / 38kHz|, phase similarity Sp=cos(phase difference), duty cycle similarity Sd=|1-|measured duty cycle-50%| / 50%|; finally, a comprehensive judgment is made, and the total similarity S=0.4×Sa+0.3×Sf+0.2×Sp+0.1×Sd. When S≥0.85, it is determined to be a valid signal.
[0045] S104: The receiver records the effective detection signals and the corresponding relationship between each transmitting unit and each receiving unit to obtain multiple optical paths.
[0046] Among them, the transmitting unit refers to a single light-emitting diode in the infrared light-emitting array. The receiving unit represents a single photodetector in the photodetector array. The effective detection signal and the corresponding relationship refer to the signal transmission status between a specific transmitting-receiving unit pair. The optical path is used to represent the propagation path of the optical signal from the transmitting unit to the receiving unit.
[0047] This step is performed after valid detection signals are confirmed. Specifically, the receiver assigns a unique identification number to each transmitting unit and receiving unit, and then establishes a mapping table to record the correspondence between the transmitting-receiving unit pairs. For each pair of units, the key parameters of its valid detection signal are recorded, including signal strength, timing information, and stability indicators. This information is combined to form a complete optical path description, and finally multiple optical path information covering the entire detection area is obtained.
[0048] In some embodiments, the recording and management of optical path information can be achieved in a variety of ways: optionally, a matrix storage solution is adopted to construct an NxM storage matrix (N is the number of transmitting units, M is the number of receiving units), the matrix elements store the signal parameters of the corresponding unit pairs, and the specific optical path information is quickly accessed through the row and column indexes; optionally, a linked list storage solution is adopted to create a data node for each optical path, the node contains the fields such as the transmitting unit number, the receiving unit number, and the signal parameters, and a complete optical path information linked list is formed through pointer links. It can be understood that other data structures can also be used to implement the organization and management of optical path information, which is not limited here.
[0049] S105. When there is a target light path among the multiple light paths, and the ambient light intensity detected by the receiving unit corresponding to the target light path exceeds a preset ambient light threshold, the transmitter adjusts the transmission power of the transmitting unit corresponding to the target light path.
[0050] The target optical path refers to the optical signal transmission path between a specific transmitting-receiving unit pair that requires special attention or processing. The ambient light intensity refers to the background light intensity value at the location of the receiving unit. The preset ambient light threshold refers to the reference value for judging the degree of ambient light interference, which is used to trigger power adjustment. Transmit power adjustment means dynamically changing the output power of the transmitting unit according to the actual situation.
[0051] This step is triggered when it is detected that the ambient light interference exceeds the normal range. Specifically, the receiver continuously monitors the ambient light intensity at each receiving unit location. When the ambient light intensity detected by the receiving unit corresponding to a certain optical path exceeds the preset threshold (typical value is 50,000 lux), the system marks the optical path as a target optical path. The transmitter then adjusts the power of the transmitting unit corresponding to the target optical path. The adjustment strategy takes into account factors such as the current ambient light intensity value, signal stability requirements, and power consumption limits. The power adjustment range is usually between 50% and 200% of the original power, and the adjustment step is 10% of the original power.
[0052] In some embodiments, adaptive adjustment of the transmission power can be achieved in a variety of ways: optionally, a hierarchical adjustment scheme is adopted, firstly, the ambient light intensity value is read and compared with multiple preset thresholds, then the current ambient light level is determined based on the comparison result, then the standard power value corresponding to the level is found, and finally the transmission power is gradually adjusted to the target value through PWM modulation, and the signal quality index is continuously monitored during the period; optionally, a proportional adjustment scheme is adopted, firstly, the deviation ratio of the ambient light intensity to the reference value is calculated, then the power adjustment amount is determined based on the ratio, then the power gradient curve is designed to avoid sudden changes, and finally the constant current source circuit is used to achieve smooth adjustment of the power, and the adjustment effect is tracked in real time. It is understandable that other control strategies can also be used to achieve dynamic adjustment of the transmission power, which is not limited here.
[0053] It should be noted that the specific implementation of power adjustment adopts a closed-loop control strategy. When the receiving unit detects that the ambient light intensity exceeds 50,000 lux, the power increase procedure is started. First, the current optical path is marked as the target optical path, and the initial power value of its transmitting unit (standard value 20mW) is read. Then, the required power increment ΔP = (measured light intensity-50,000) / 1000 is calculated according to the ambient light intensity, in units of mW. Then, the power is gradually increased by 2mW each time through the PWM control circuit until any of the following conditions is met: (1) the signal quality is restored to the standard level (signal strength>3000, signal-to-noise ratio>40dB); (2) the power reaches the maximum limit of 40mW; (3) the junction temperature of the light-emitting diode exceeds 85℃. While increasing, the operating current of the transmitting unit is monitored in real time through the constant current source circuit to ensure that it does not exceed 100mA. When the ambient light intensity drops below 30,000 lux, the power recovery procedure is started: reduce 1mW every 1 second until it returns to the standard power value of 20mW. During the whole process, the system continuously monitors the signal quality indicators (signal strength, signal-to-noise ratio) to ensure stable detection performance. At the same time, the cumulative working time of each transmitting unit is counted. When it exceeds 8 hours, a power reset is enforced to prevent long-term high-power operation.
[0054] The following is a more detailed description of the process of the method provided by this implementation. Figure 2 , is another flow chart of the anti-interference method for the ultra-thin light curtain sensor in an embodiment of the present application.
[0055] S201, the transmitter emits infrared light beams in sequence according to the infrared light emitting array to form a detection light curtain.
[0056] Infrared light array is a group of light-emitting units composed of multiple infrared light-emitting diodes (LEDs) arranged at a specific pitch, and each light-emitting unit can emit an infrared beam of a specific wavelength. The detection light curtain is a continuous detection area formed by multiple parallel or crossed infrared beams, which is used to detect objects passing through the area. Sequential emission means that the light-emitting units emit light beams one by one or in groups in an orderly manner according to a preset timing control scheme.
[0057] In the specific implementation process, the transmitter controller first initializes the configuration of the infrared light array, sets the basic emission power (such as 5-20mW) and emission timing (such as 100μs emission interval) of each light-emitting unit. Then, each light-emitting unit is triggered to emit infrared beams in sequence from left to right or from top to bottom. The emission time intervals of adjacent light-emitting units need to be precisely controlled to ensure the continuity of detection and avoid crosstalk interference between adjacent light beams. Through this orderly emission process, a stable detection light curtain is finally formed between the transmitter and the receiver.
[0058] S202: The receiver receives the infrared light beam and converts it into an electrical signal to obtain an initial detection signal, where the initial detection signal is used to indicate a blocked state of the light curtain.
[0059] The receiver is a photoelectric conversion device, which is composed of a photodiode array. Each photodiode can convert the incident infrared light into a current signal. The infrared beam is an invisible light signal with a wavelength of about 850nm, which is emitted by the infrared light emitting diode of the transmitter. The electrical signal includes the photocurrent generated by the photodiode and the voltage signal after amplification and conversion. The initial detection signal refers to the original electrical signal without filtering and other processing, which contains valid signals and various interference signals. The blocked state of the light curtain indicates whether there is an object in the detection area that blocks the transmission of the infrared beam.
[0060] In specific implementation, the receiver uses a high-sensitivity PIN photodiode array as a detection element. The response time of each diode is less than 100ns and the response wavelength range is 800-900nm. The photodiode converts the received infrared light into a weak current (typical value is 10-100μA), which is converted into a voltage signal (1-10V) through a transimpedance amplifier (gain 100kΩ). The converted voltage signal is amplified by an operational amplifier with a bandwidth of 2MHz, and then digitally converted by a 12-bit ADC with a sampling rate of 2MSPS. The digital signal is processed in real time by the FPGA, and the signal amplitude is compared with the preset threshold (usually 30% of the full scale) to determine whether the light curtain is blocked.
[0061] S203: The receiver detects the ambient light intensity value received by each receiving unit in the receiver when the transmitter stops transmitting.
[0062] The receiving unit refers to a single photoelectric detection device in the receiver, including a photodiode and related signal conditioning circuits. The transmitter stops transmitting and temporarily shuts down all infrared light-emitting diodes. The ambient light intensity value refers to the background light intensity generated by natural light sources or artificial lighting in the absence of an active light source, and the unit is lux.
[0063] In practical applications, the receiver uses a 16-bit high-precision ADC (such as AD7606) to sample the output of each receiving unit. The system first sends a stop transmission command to the transmitter and waits 100μs to ensure that all light-emitting units are completely turned off. Then, within a 1ms time window, each receiving unit is sampled 16 times with a sampling interval of 62.5μs. The sampled data is digitally filtered (8-point mean filter) to obtain a stable ambient light intensity value. These intensity values are stored in a 32-bit data register, with the upper 16 bits storing the receiving unit number and the lower 16 bits storing the corresponding ambient light intensity value.
[0064] S204: The receiver sets filtering parameters of a bandpass filter according to the ambient light intensity value.
[0065] A bandpass filter is a filter that only allows signals within a specific frequency range to pass through. It is composed of a cascade of high-pass and low-pass filters. The filter parameters include center frequency, bandwidth, gain and other parameters, which are used to determine the frequency response characteristics of the filter. The ambient light intensity value is used to dynamically adjust the filter parameters so that the filter can more effectively suppress interference signals.
[0066] The filter parameter setting adopts an adaptive algorithm: first, the ambient light intensity is divided into three levels (weak light <1000lux, medium light 1000-10000lux, strong light >10000lux). For each level, the system sets different filter parameters: in a weak light environment, the center frequency is set to 38kHz, the bandwidth is ±2kHz, and the gain is 20dB; in a medium light environment, the center frequency is 38kHz, the bandwidth is ±1.5kHz, and the gain is 15dB; in a strong light environment, the center frequency is 38kHz, the bandwidth is ±1kHz, and the gain is 10dB. The filter is implemented using a second-order Butterworth structure, and the parameter configuration is completed by updating the filter coefficient register. The signal-to-noise ratio of the filtered signal is improved by 15-20dB, which effectively suppresses ambient light interference.
[0067] S205. The receiver performs bandpass filtering on the initial detection signal according to the filtering parameters to obtain the filtered initial detection signal, and compares the filtered initial detection signal with the standard signal characteristics, and takes the initial detection signal whose characteristics exceed a preset matching threshold with the standard signal as a valid detection signal.
[0068] Filter parameters refer to the core characteristic parameters of the bandpass filter, including center frequency, bandwidth, gain, etc. The initial detection signal is the original unprocessed electrical signal after photoelectric conversion. Bandpass filtering is a signal processing method used to extract signal components within a specific frequency range. Standard signal characteristics include characteristic parameters such as signal waveform, amplitude, phase, etc. under ideal conditions. The preset matching threshold is the standard value for judging the validity of the signal, which is usually set to 85% similarity. A valid detection signal refers to a detection signal that is confirmed to be reliable after filtering and feature matching.
[0069] In the specific implementation, the receiver uses a digital signal processor (DSP) to perform the filtering and matching process. The filter adopts an FIR structure with an order of 32 and a sampling frequency of 2MHz. The filtering process first sends the 12-bit digital signal collected by the ADC into the FIR filter, and obtains a clean signal after bandpass filtering. Then the correlation coefficient between the filtered signal and the pre-stored standard feature is calculated, and the calculation formula is R=Σ(Xi×Yi) / √(Σ(Xi²)×Σ(Yi²)), where Xi is the filtered signal and Yi is the standard feature. When the correlation coefficient R is greater than 0.85, the signal is marked as a valid detection signal. The filtering and matching results are stored in the dual-port RAM for subsequent processing.
[0070] S206: The receiver records the number of each transmitting unit and the number of the receiving unit corresponding to each transmitting unit.
[0071] The transmitting unit is a single light-emitting diode in the infrared light-emitting array, which is responsible for emitting a modulated infrared light beam. The transmitting unit number is a digital code used to uniquely identify each light-emitting diode, represented by an 8-bit binary number. The receiving unit is a single photodiode in the photoelectric detection array, which is responsible for receiving the corresponding infrared light beam. The receiving unit number also uses an 8-bit binary number as a unique identifier. The corresponding relationship represents a one-to-one mapping relationship between a specific transmitting unit and a receiving unit.
[0072] The number recording process is implemented using a table storage structure. First, a 256×16-bit mapping table is established in the EEPROM, with the upper 8 bits storing the transmitter unit number and the lower 8 bits storing the corresponding receiver unit number. The transmitter units are numbered from top to bottom according to their physical positions (0x00-0x7F), and the receiver units are numbered in the same way. When the system is initialized, the number correspondence is established through automatic scanning: the controller triggers each transmitter unit in turn, and at the same time detects which receiver unit receives the strongest signal, and writes the pair of numbers to the corresponding position in the mapping table. The complete mapping table is checked by CRC to ensure data integrity.
[0073] S207: The receiver records the signal strength value of the effective detection signal between each pair of the transmitting unit and the receiving unit.
[0074] The effective detection signal is a signal that is confirmed to be reliable after filtering and feature matching. The signal strength value represents the intensity of the optical signal received by the receiving unit, which is represented by a 12-bit digital quantity after ADC conversion, ranging from 0 to 4095. The transmitting-receiving unit pair refers to the corresponding transmitting unit and receiving unit combination determined by the mapping table.
[0075] The intensity value record adopts a real-time updated data structure. The system allocates 512KB space in the Flash memory to establish an intensity value database. Each record occupies 32 bits: bits 31-24 store the transmitting unit number, bits 23-16 store the receiving unit number, bits 15-12 are reserved, and bits 11-0 store the signal intensity value. In each scanning cycle (2ms), the system reads the intensity values of all valid detection signals and updates the database through DMA. At the same time, the average and standard deviation of the most recent 16 intensity values are calculated to evaluate the stability of the signal. The database supports fast retrieval by number, which is convenient for real-time acquisition of the signal status of any optical path.
[0076] S208. The receiver combines the transmitting unit number, the receiving unit number and the signal strength value into one piece of optical path information to obtain multiple optical paths.
[0077] Optical path information is a data structure that fully describes an optical signal transmission path, including the identification of the transmitter and receiver as well as the transmission quality parameters. The transmitting unit number uses an 8-bit binary number (0x00-0x7F) to identify the position of the light-emitting diode. The receiving unit number also uses an 8-bit binary number to identify the position of the photodiode. The signal strength value is a 12-bit digital quantity (0-4095) that indicates the strength of the received optical signal. Multiple optical paths refer to a collection of optical signal transmission channels consisting of multiple transmitting-receiving unit pairs.
[0078] In actual applications, the optical path information is encapsulated in a 32-bit data format: the upper 8 bits store the transmitting unit number, the second upper 8 bits store the receiving unit number, the lower 12 bits store the signal strength value, and the middle 4 bits are used to store the status flag. The system establishes an optical path information table in RAM with a capacity of 1024×32 bits, supporting up to 1024 optical paths to be recorded simultaneously. After each scanning cycle (2ms), the new optical path information is written into the table. The information table adopts a double buffer structure, and the writing process does not affect the reading operation. Each piece of optical path information is quickly assembled through bit operations: (transmitting number <<24) | (receiving number <<16) | (status flag <<12) | signal strength value.
[0079] S209: The transmitter increases the transmission power of the transmission unit corresponding to the target optical path to a preset power threshold.
[0080] The target optical path refers to the specific optical signal transmission path that currently needs to be adjusted in power. The transmit power is the output optical power of the light emitting diode, which is controlled by adjusting the drive current and has a range of 5-50mW. The preset power threshold is the maximum value allowed for the transmit power, which is set to 40mW to prevent the light emitting diode from overheating and damage. The transmitting unit is a light emitting diode that generates an infrared beam, and its transmit power is controlled by a PWM signal.
[0081] The power adjustment process is implemented through a dedicated current control circuit. The controller first reads the transmitter unit number of the target optical path, and then outputs the control voltage through an 8-bit DAC (such as DAC8831). The voltage passes through the V / I conversion circuit to generate a driving current in the range of 0-100mA. The power adjustment adopts a step-by-step increase method: each increase is 2mW, and the adjustment interval is 100μs. The junction temperature of the light-emitting diode is detected (using an NTC thermistor) to ensure that the operating temperature does not exceed 85℃. When the power reaches 40mW, it stops increasing, and the new power value is written to the EEPROM for storage as the operating parameter of the transmitter unit.
[0082] S210: The receiver updates the signal collection threshold of the target optical path according to the preset power threshold.
[0083] The signal acquisition threshold is the reference value for judging the on / off status of the optical path, expressed as a 12-bit digital quantity. The target optical path is the optical signal transmission path where the current transmit power is adjusted. The preset power threshold is the maximum allowable value of the transmit power, 40mW. The update process refers to dynamically adjusting the signal judgment standard according to the new transmit power.
[0084] The acquisition threshold is updated using a linear mapping algorithm. First, the original acquisition threshold is read (typically 30% of the full scale, i.e. 1229), and then the new threshold is calculated based on the power change ratio: new threshold = original threshold × (new power / standard power), where the standard power is 20mW. For example, when the transmit power increases to 40mW, the new acquisition threshold will be adjusted to 2458. The threshold update is achieved by modifying the comparator reference voltage of the ADC, using a 12-bit DAC (such as DAC7811) to output a reference voltage of 0-3.3V. The updated threshold is stored in the Flash memory, and the controller is notified through the CAN bus to complete the threshold adjustment. The system uses the new threshold for signal judgment in subsequent detections.
[0085] The following is a more detailed description of the process of the method provided by this implementation. Figure 3 , is another flow chart of the anti-interference method for the ultra-thin light curtain sensor in an embodiment of the present application.
[0086] S301, the transmitter collects real-time ambient light data of the current environment.
[0087] Real-time ambient light data refers to the ambient light intensity information collected by the photosensitive sensor, including visible light and infrared light components. The ambient light data is represented by a 16-bit digital quantity, covering a measurement range of 0-100,000 lux. The current environment refers to the lighting environment within 10cm around the transmitter.
[0088] In the specific implementation, the transmitter uses a high-precision ambient light sensor array for data collection. The sensor model is BH1750FVI, which has high measurement accuracy (1 lux) and fast response characteristics (response time <180ms). Eight light sensors are evenly distributed around the transmitter housing, and the sampling period of each sensor is set to 50ms. After the collected data is converted by 16-bit ADC, it is transmitted to the main controller through the I2C bus. The controller performs weighted average calculation on the data of the 8 sensors. The weight coefficient is determined according to the sensor position (the weight of the front sensor is 1.5, and the weight of other positions is 1.0), and finally a comprehensive ambient light intensity value is obtained.
[0089] S302: The transmitter divides the infrared light emitting array into a plurality of emission groups according to the real-time ambient light data, and allocates different emission timing and power parameters to each emission group.
[0090] The emission group refers to a collection of infrared light-emitting units with the same working parameters. The emission timing is the timing signal that controls the opening time of the light-emitting unit. The power parameter includes the configuration information of the emission power size and modulation mode.
[0091] An adaptive partitioning algorithm is used to divide the emission groups: first, the emission array is divided into three levels (high, medium, and low interference areas) according to the ambient light intensity. Each level area is further divided into several emission groups according to the physical location, and each group contains 4-8 adjacent light-emitting units. The emission group in the high interference area (ambient light > 50,000 lux) uses a 40mW emission power, and the emission timing interval is set to 200μs; the medium interference area (10,000-50,000 lux) uses a 30mW emission power, and the emission timing interval is 150μs; the low interference area (<10,000 lux) uses a 20mW emission power, and the emission timing interval is 100μs. The parameters of each emission group are configured through a 32-bit control word, including: power level (8 bits), timing interval (8 bits), PWM frequency (8 bits) and modulation mode (8 bits).
[0092] S303: When the real-time ambient light intensity is greater than a first preset threshold, the transmitter increases the transmission power of the transmission group to a preset first power threshold and reduces the transmission frequency to a preset first frequency threshold.
[0093] The first preset threshold is a standard value for judging the severity of ambient light interference, which is set to 80,000 lux. The first power threshold is the maximum allowable value of the transmission power, which is set to 50mW. The first frequency threshold is the minimum allowable value of the transmission frequency, which is set to 2kHz.
[0094] When the ambient light sensor detects that the light intensity exceeds 80,000 lux, the strong interference response strategy is activated: the transmission power of all transmission groups is uniformly increased to 50mW, PWM modulation is used, and the duty cycle is set to 80%. At the same time, the transmission frequency is reduced from the standard 5kHz to 2kHz, and the duration of a single transmission is extended from 100μs to 250μs. The power increase and frequency adjustment are gradual, with each adjustment step of 5mW and 0.5kHz, and the adjustment interval is 100μs to avoid parameter mutations that cause system instability. At the same time, over-temperature protection monitoring is activated. When the temperature of the light-emitting unit exceeds 85℃, the power is immediately reduced to 30mW to ensure reliable operation of the system.
[0095] S304. When the real-time ambient light intensity is less than the second preset threshold, the transmitter reduces the transmission power of the transmission group to the preset second power threshold and increases the transmission frequency to the preset second frequency threshold, the first preset threshold is greater than the second preset threshold, the preset first power threshold is greater than the preset second power threshold, and the preset first frequency threshold is less than the preset second frequency threshold.
[0096] The second preset threshold is the low threshold of the ambient light intensity, which is set to 5,000 lux. The preset second power threshold is the minimum operating value of the transmission power, which is set to 15mW. The preset second frequency threshold is the maximum operating value of the transmission frequency, which is set to 8kHz. The first preset threshold (80,000 lux), the preset first power threshold (50mW) and the preset first frequency threshold (2kHz) respectively constitute the upper and lower limits of the system parameters with the second preset threshold, the preset second power threshold and the preset second frequency threshold.
[0097] When the ambient light sensor detects that the light intensity is less than 5,000 lux, the weak interference working mode is activated: the transmission power of all transmitting groups is uniformly reduced to 15mW, PWM modulation is used, and the duty cycle is set to 40%. At the same time, the transmission frequency is increased from the standard 5kHz to 8kHz, and the duration of a single transmission is shortened from 100μs to 62.5μs. The parameter adjustment is carried out in a step-by-step manner, with the power reduced by 2mW each time and the frequency increased by 0.5kHz each time, with an adjustment interval of 50μs. The junction temperature of the light-emitting unit is monitored in real time through the PWM controller to ensure operation within the range of 15-35℃. In this working mode, the system power consumption is reduced by about 60%, while maintaining stable detection performance.
[0098] S305. The transmitter counts the number of times the light curtain is blocked within a preset time window. When the number of times is greater than a preset blocking frequency threshold, it is determined to be in a frequent blocking state.
[0099] The preset time window is the time range for counting blockage events, which is set to 1000ms. The number of blockages refers to the cumulative number of times the beam is blocked. The preset blockage frequency threshold is the standard value for judging whether to enter the frequent blockage state, which is set to 50 times / second. The frequent blockage state refers to the working state when the system detects high-frequency blockage events.
[0100] The specific implementation uses a 32-bit counter to count the occlusion events in real time. Whenever the receiver detects a signal interruption of more than 2ms, it is recorded as an occlusion event. The counter is reset every 1000ms to form a sliding time window. Within the time window, the occlusion event is recorded by the interrupt service program. When the count value exceeds 50, the frequent occlusion flag position of the system status register is set to 1. The structure of the status register is: bit31-16 stores the occlusion count value, bit15-8 stores the time window number, and bit7-0 stores the system status flag.
[0101] S306: In the frequent shielding state, the transmitter divides the detection light curtain into multiple detection areas.
[0102] The detection area refers to the spatial division of the light curtain, each area contains multiple adjacent light beams. The area division under frequent occlusion is to achieve zoning management and targeted protection.
[0103] In the case of frequent occlusion, the system uses an adaptive partitioning algorithm to divide the light curtain. First, the light curtain is divided into 4 basic areas according to the physical coordinates, and the size of each area is 1 / 4 of the total height of the light curtain. Then, it is divided again according to the occlusion frequency of each area: the area with an occlusion frequency of more than 80 times / second is further divided into 2 sub-areas. Each detection area is configured with an independent parameter control word (32 bits), including: area number (8 bits), transmission power level (8 bits), sampling frequency (8 bits) and detection threshold (8 bits). The area information is stored in the Flash memory and supports dynamic updates. This partitioning mechanism enables the system to adopt differentiated detection strategies for different areas.
[0104] S307: The transmitter counts the occlusion frequency of each detection area respectively to determine a high-frequency occlusion area.
[0105] The occlusion frequency refers to the number of occlusions in the detection area per unit time, which is recorded by a 32-bit counter. The high-frequency occlusion area refers to the detection area where the occlusion frequency exceeds 100 times / second. The spatial range of the detection area is determined by its starting and ending coordinates, and each area contains 16-32 transmitting-receiving unit pairs.
[0106] A distributed counter array is used in the statistical process, and each detection area is configured with an independent counting unit. The counting unit contains: a 32-bit main counter (recording the number of occlusions), a 16-bit timestamp (recording the counting cycle) and an 8-bit status register (recording the area status). The system reads the count value every 10ms and calculates the occlusion frequency f=count×100 / time, where count is the count value and time is the timestamp value (unit: 10ms). When f>100, the status flag position of the area is set to 1, marking it as a high-frequency occlusion area. The counting results are transmitted to the main controller via DMA to ensure real-time performance.
[0107] S308: The transmitter increases the signal sampling frequency of the high-frequency occlusion area to a preset sampling frequency threshold, and reduces the signal judgment sensitivity of the high-frequency occlusion area to a preset sensitivity threshold.
[0108] The signal sampling frequency refers to the rate at which the photoelectric signal is converted into digital form. The preset sampling frequency threshold is set to 2MHz. The signal judgment sensitivity refers to the degree of response of the system to signal changes, and the preset sensitivity threshold is set to 50% of the standard sensitivity.
[0109] The following strategy is used to adjust the parameters of the high-frequency occlusion area: First, the ADC sampling frequency of the area is increased from the standard 1MHz to 2MHz, and more signal details are obtained by increasing the sampling rate. At the same time, the signal processing parameters are modified to increase the signal judgment threshold from 20% of the standard value to 50%, that is, the signal amplitude change is required to exceed 50% to trigger the occlusion judgment. These parameters are set through a 32-bit configuration register, and the structure is: bit31-24 is the area ID, bit23-16 is the sampling frequency gear, bit15-8 is the judgment threshold, and bit7-0 is the control flag. The new parameter configuration is sent to each signal processing unit in real time through the SPI bus.
[0110] S309, the transmitter scans the detection light curtain according to a preset frame scanning cycle, and sequentially triggers each infrared light-emitting unit of the transmitting group to emit an infrared light beam in each frame scanning cycle.
[0111] The frame scanning cycle is the time required to complete a full light curtain scan, and the standard value is 2ms. The emission group is the smallest control unit composed of multiple infrared light-emitting units, and each group contains 4-8 light-emitting units. The infrared beam is a modulated infrared signal emitted by the light-emitting unit.
[0112] The scanning process uses time division multiplexing: the 2ms frame period is divided into 32 time slots, each time slot is 62.5μs long. Each transmission group occupies a time slot, and the light-emitting units in the group are triggered in turn in its time slot. The trigger signal is generated by FPGA and uses precise timing control: the turn-on time of a single light-emitting unit is 10μs, and the unit interval is 2μs. The transmission power is modulated by PWM, and the PWM frequency is 100kHz. The scanning sequence is stored in the program memory and supports dynamic modification through the configuration register. When an abnormal state of a certain transmission group is detected, the system will automatically adjust the trigger timing of the group to ensure the reliability of detection.
[0113] S310, the receiver collects the signal strength value at the preset sampling time, and when the signal strength value is greater than the signal collection threshold, it is determined to be a light-transmitting state, and when the signal strength value is less than the signal collection threshold, it is determined to be a light-shielding state.
[0114] The preset sampling time refers to the designated time point for sampling the intensity of the received signal, which is usually set 1-2μs after the transmitted signal stabilizes. The signal strength value is the amplitude of the optical signal received by the photodetector after it is converted into an electrical signal. It is represented by a 12-bit digital quantity with a range of 0-4095. The signal acquisition threshold is the decision threshold for distinguishing between the light-through state and the light-blocking state. The standard value is set to 30% of the full scale (i.e. 1229). The light-through state indicates that the light path is not blocked, and the light-blocking state indicates that the light path is blocked.
[0115] In the specific implementation, the receiver uses a high-speed photodiode array and a dedicated signal processing circuit. Each receiving unit contains: a PIN photodiode (response time <100ns), a transimpedance amplifier (gain 100kΩ, bandwidth 2MHz), a signal conditioning circuit and a 12-bit ADC (sampling rate 2MSPS). The system clock is provided by the FPGA, and the sampling time is selected by a programmable delay generator with a delay accuracy of 20ns. When the transmitting unit emits a light beam, the delay generator generates a sampling trigger pulse, and the ADC samples on the rising edge of the pulse. The sampled data is compared with the threshold after 8-point average filtering: if the filtered signal value V>1229, the light-through flag (1) is output; if V≤1229, the light-shielding flag (0) is output. The comparison result is cached by a 16-bit shift register and updated once every frame period. At the same time, the system records 16 consecutive sampling results for signal stability analysis. In order to improve the anti-interference ability, the hysteresis comparison method is adopted: a 30% threshold (1229) is used in the conversion from light-through to light-shielding, and a 35% threshold (1434) is used in the conversion from light-shielding to light-through to avoid misjudgment caused by signal jitter near the threshold. When a drastic signal fluctuation is detected (the difference between two adjacent samplings exceeds 20%), the system will start 50 fast samplings and determine the light path status through statistical analysis. All judgment results are processed by the state machine and reported to the main controller through the CAN bus.
[0116] In some embodiments, steps S301 to S310 may be performed after step S210 or after step S106, which is not limited here.
[0117] It should be noted that in actual industrial production lines, ultra-thin light curtain sensors are designed to be extremely compact, using an efficient microcontroller STC8H1K08-36I to manage the entire signal process. In the transmitter part, through the carefully designed shift register control, the infrared light-emitting diodes light up in turn in each frame scanning cycle, emitting precisely positioned infrared rays, while the receiver monitors the feedback signal in real time. Once an interrupt signal is received, the signal processing process is immediately started to ensure that no matter whether the light conditions change or the electromagnetic noise interferes, it can accurately determine whether the object is blocked, thereby triggering the corresponding action, such as pausing the machine or alarming.
[0118] It should be noted that the hardware of the ultra-thin light curtain sensor is mainly composed of an infrared transmitter A and an infrared receiver B. The infrared transmitter A includes a first power module A1 to provide power, a transmitting drive circuit A4 to drive an infrared transmitting lamp array A5 to emit infrared light beams, a transmitter MCUA2 as a core control unit to coordinate the work of each module, a transmitting signal processing circuit A3 to process the transmitting signal, a working status indication circuit A8 to display the working status, and a synchronization signal input detection circuit A7 to detect the synchronization signal. The infrared receiver B is powered by a power module B1, an infrared receiving acquisition circuit B5 to collect infrared signals, a receiver MCUB4 to control each module, a receiving signal processing circuit B2 to process the receiving signal, an output control circuit B3 to control external devices, a periodic scanning module B7 to perform periodic scanning, a working status indication circuit B8 to indicate the status, and a synchronization signal output circuit B9 to ensure synchronization. The two are connected through the synchronization signal input detection circuit A7 and the synchronization signal output circuit B9, and work together to realize the light curtain detection function.
[0119] In normal state, when the light curtain is in the light-transmitting state (OSSD-ON), the indicator lights of the transmitter and receiver are both green, indicating that the light curtain is working normally and there is no obstruction; when the light curtain is in the light-blocking state (OSSD-OFF), the indicator lights of the transmitter and receiver are both red, indicating that the light curtain is blocked but the system is still operating normally. In abnormal state, if there is no Link signal, the indicator light of the transmitter will flash red and green, while the receiver will have no corresponding display.
[0120] Among them, the working status of the transmitter is crucial to whether the entire system can accurately detect the obstruction of objects. At the beginning, the transmitter waits for the synchronization pulse, which ensures synchronization with the system timing. After receiving it, the selected infrared transmitting tube is lit to emit an 8us light beam, and then turned off. After each transmission, the synchronization timer breakdown is increased by 1, and the shift register is shifted back by 1 to select the next transmitting tube. When breakdown is greater than 50, the indicator light is controlled to flash according to the light condition and the timer6 value (when the light is on, the indicator light is controlled according to different values of timer6, such as green is always on to indicate normal; when the light is blocked, red is always on). In this process, timer 0 (1ms interrupt) is used to control the flashing time of the indicator light. It records the time information by interrupting the count timer6 plus 1, providing a basis for the indicator light status control, which helps to monitor the working status of the transmitter; Timer 0 and timer 1 work together to ensure the normal operation of the transmitter: the timer 0 (1ms) interrupt function is of great significance to the transmitter. It is configured as a 1ms interrupt, mainly to accurately time the number of interrupts, and use variables (such as timer6) to record, and each interrupt variable is increased by 1. At the same time, when timer6 is greater than 1000, it is determined whether the indicator light flashes when there is no synchronization signal. If the synchronization signal is abnormal, the indicator light flashes according to the rules to warn the user to check and repair, to ensure the stability of the transmitter and the system. When timer 1 is interrupted, it means that a frame scan is about to end. At this time, the function reinitializes the shift register value, pointing to the first infrared transmitter, and prepares for the next frame scan. This ensures that the transmitter tubes are cycled in sequence to achieve stable scanning.
[0121] The PWM input interrupt process measures the synchronization signal period T by detecting the falling edge of the PWM signal. The measurement is started when the falling edge is detected. The working state of the light curtain is determined by the length of the period T. Different period values correspond to different states (e.g. 240us±20us may indicate "light passing and 1 frame scanning is completed", etc.). After the judgment, the falling interrupt flag is cleared, the period value T is read and the flag bit (light blocking, receiving synchronization signal, etc.) is set, and finally the initial value of timer 1 (140us) is reloaded.
[0122] In the light curtain sensor, the receiver needs to monitor abnormalities, and the external interrupt 0 is configured for the overcurrent signal. Initialization sets the GPIO to the falling edge interrupt according to the circuit schematic, which is triggered when the level changes from high to low, and responds quickly to overcurrent changes. At the same time, the interrupt priority is set to the highest, and the processing program can be quickly executed when triggered, such as stopping dangerous operations and recording abnormal information.
[0123] The receiver timer 0 is initialized to 1000 microseconds, 24.000MHz clock, automatic reload mode, and fine-tuned configuration of the clock mode (1T mode) and the initial value of the timing. The 1T mode improves the response speed and timing accuracy, and the initial value is set to generate an interrupt every 1000 microseconds. In actual operation, the timer 0 interrupt is used for overcurrent debounce and protection release. When detecting overcurrent, debounce is controlled by timing and interrupt to avoid misjudgment, such as taking protective measures after multiple detections and confirmations; after the overcurrent is released, the release timing is controlled.
[0124] The receiver timer 1 sends the synchronization pulse regularly, and is initialized to the timing mode (1T clock), the input capture function is turned off, the initial value is carefully set, the digital filter length is configured, and the falling edge capture mode is selected. The initial value determines the synchronization pulse period, the filter filters the noise, and the falling edge capture accurately triggers the transmission. In the infinite loop, when the timing interrupt flag is 1, the synchronization pulse is sent according to the program to ensure the synchronization of transmission and reception.
[0125] The ultra-thin light curtain sensor in the embodiment of the present invention is described below from the perspective of hardware processing. Figure 4, is a schematic diagram of a physical device structure of an ultra-thin light curtain sensor in an embodiment of the present application.
[0126] It should be noted that Figure 4 The structure of the ultra-thin light curtain sensor shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0127] like Figure 4 As shown, the ultra-thin light curtain sensor includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in RAM403. CPU401, ROM402 and RAM403 are connected to each other through bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0128] The following components are connected to the I / O interface 405: an input section 406 including an audio input device, a button switch, etc.; an output section 407 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.
[0129] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from a removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, various functions defined in the present invention are performed.
[0130] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0131] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.
[0132] Specifically, the ultra-thin light curtain sensor of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the anti-interference method of the ultra-thin light curtain sensor provided in the above embodiment is implemented.
[0133] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the ultra-thin light curtain sensor described in the above embodiment; or may exist independently without being assembled into the ultra-thin light curtain sensor. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the ultra-thin light curtain sensor, the ultra-thin light curtain sensor implements the ultra-thin light curtain sensor anti-interference method provided in the above embodiment.
[0134] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0135] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0136] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. An anti-interference method for an ultra-thin light curtain sensor, characterized in that: Applied to an ultra-thin light curtain sensor, the anti-interference system includes a transmitter and a receiver, and the method includes: The emitter emits infrared light beams in sequence according to the infrared light emitting array to form a detection light curtain; The receiver receives the infrared light beam and converts it into an electrical signal to obtain an initial detection signal, wherein the initial detection signal is used to indicate a blocked state of the light curtain; The receiver removes the ambient light interference signal in the initial detection signal by bandpass filtering, and compares the filtered initial detection signal with the standard signal feature, and takes the initial detection signal whose feature exceeds a preset matching threshold with the standard signal feature as a valid detection signal; The receiver records the effective detection signals and the corresponding relationship between each transmitting unit and each receiving unit to obtain multiple optical paths; When there is a target light path among the multiple light paths, and the ambient light intensity detected by the receiving unit corresponding to the target light path exceeds a preset ambient light threshold, the transmitter adjusts the transmission power of the transmitting unit corresponding to the target light path.
2. The method according to claim 1, characterized in that The step of removing the ambient light interference signal in the initial detection signal by the receiver through bandpass filtering specifically includes: The receiver detects the ambient light intensity value received by each receiving unit in the receiver when the transmitter stops transmitting; The receiver sets filtering parameters of a bandpass filter according to the ambient light intensity value; The receiver performs bandpass filtering on the initial detection signal according to the filtering parameters to obtain a filtered initial detection signal.
3. The method according to claim 1, characterized in that The receiver records the effective detection signal and the corresponding relationship between each transmitting unit and each receiving unit to obtain multiple light paths, specifically including: The receiver records the number of each transmitting unit and the number of the receiving unit corresponding to each transmitting unit; The receiver records the signal strength value of the effective detection signal between each pair of the transmitting unit and the receiving unit; The receiver combines the transmitting unit number, the receiving unit number and the signal strength value into one optical path information to obtain multiple optical paths.
4. The method according to claim 1, characterized in that: The step of adjusting the transmission power of the transmission unit corresponding to the target optical path by the transmitter specifically includes: The transmitter increases the transmission power of the transmission unit corresponding to the target optical path to a preset power threshold; The receiver updates the signal collection threshold of the target optical path according to the preset power threshold.
5. The method according to claim 1, characterized in that After the emitter sequentially emits infrared light beams according to the infrared light emitting array to form a detection light curtain, the method further includes: The transmitter collects real-time ambient light data of the current environment; The transmitter divides the infrared light emitting array into a plurality of emission groups according to the real-time ambient light data, and assigns different emission timing and power parameters to each emission group; When the real-time ambient light intensity is greater than a first preset threshold, the transmitter increases the transmission power of the transmission group to a preset first power threshold and reduces the transmission frequency to a preset first frequency threshold; When the real-time ambient light intensity is less than a second preset threshold, the transmitter reduces the transmission power of the transmission group to a preset second power threshold and increases the transmission frequency to a preset second frequency threshold, the first preset threshold is greater than the second preset threshold, the preset first power threshold is greater than the preset second power threshold, and the preset first frequency threshold is less than the preset second frequency threshold.
6. The method according to claim 1, characterized in that After the step of adjusting the transmission power of the transmission unit corresponding to the target optical path by the transmitter, the method further includes: The transmitter counts the number of times the light curtain is blocked within a preset time window, and when the number of times is greater than a preset blocking frequency threshold, it is determined to be a frequent blocking state; In the frequent shielding state, the transmitter divides the detection light curtain into a plurality of detection areas; The transmitter counts the occlusion frequency of each detection area respectively to determine a high-frequency occlusion area; The transmitter increases the signal sampling frequency of the high-frequency occlusion area to a preset sampling frequency threshold, and reduces the signal judgment sensitivity of the high-frequency occlusion area to a preset sensitivity threshold.
7. The method according to claim 1, characterized in that After the step of adjusting the transmission power of the transmission unit corresponding to the target optical path by the transmitter, the method further includes: The transmitter scans the detection light curtain according to a preset frame scanning cycle, and sequentially triggers the infrared light emitting units of each transmitting group to emit infrared light beams in each frame scanning cycle; The receiver collects a signal strength value at a preset sampling moment. When the signal strength value is greater than a signal collection threshold, it is determined to be a light-transmitting state. When the signal strength value is less than the signal collection threshold, it is determined to be a light-shielding state.
8. An ultra-thin light curtain sensor, characterized in that: The ultra-thin light curtain sensor includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the ultra-thin light curtain sensor to execute the method described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on the ultra-thin light curtain sensor, the ultra-thin light curtain sensor executes the method as claimed in any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product runs on an ultra-thin light curtain sensor, the ultra-thin light curtain sensor is enabled to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
System and method for bidirectional detecting anti-light-inference elevator light screen
CN101274726A
Photoelectric sensor anti-interference method, system and device and storage medium
CN116793394A
Mobile robot
CN209951165U
Light curtain
EP4191552A1
Apparatus for and method of electro-optically reading a target in the presence of ambient light by suppressing the ambient light
US20140339310A1
Cited By
Optical sensor chip for distance detection and intelligent equipment
CN120044532A
Grid object detection method and system and intelligent cabinet
CN121634312A