An infrared protection control system and method based on adaptive power regulation and attenuation compensation
Patent Information
- Application Number
- CN202610982511.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-02
- Publication Date
- 2026-08-28
AI Technical Summary
现有系统的红外发射管与接收管会随着时间老化,导致发光强度衰减、接收灵敏度下降,存在“静默失效”的风险,即光束已无效但系统无法感知,安全功能丧失;
通过脉冲计数在数字域进行信号判别,抗模拟量漂移和环境光干扰能力强。自适应调功功能实时补偿器件老化与污垢带来的衰减,维持探测灵敏度长期稳定,有效避免了“静默失效”;
Smart Images

Figure CN122653079A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of equipment safety protection technology, and in particular to an infrared protection control system and method based on adaptive power adjustment and attenuation compensation. Background Technology
[0002] In the field of automation, preventing personnel from having their hands pinched is a crucial safety requirement. Currently, the mainstream solution is to use safety light curtains that comply with safety standards (such as IEC 61496). These products offer high safety, but they are expensive and bulky, making them difficult to apply to small devices where cost and installation space are extremely critical. Some devices attempt to construct simple light barriers using ordinary infrared beam modules (transmitters and receivers facing each other).
[0003] Existing patents disclose an infrared transceiver system based on a single infrared diode. The invention includes an infrared transmitting circuit, an infrared receiving circuit, and a digital controller. The infrared transmitting circuit includes a data buffer with an enable function, an NMOS transistor, and an infrared LED. The infrared receiving circuit includes a current detection circuit, a detector circuit, a hysteresis comparator, and auxiliary circuitry. The current detection circuit includes two amplifiers and a feedback circuit. The detector circuit includes a shaping circuit, a delay circuit, a switching circuit, a current source, and a filter capacitor. The digital controller's input terminals include a command input terminal, a clock input terminal, and a signal receiving terminal; its output terminals include a signal output terminal, a transmit enable terminal, and a receive enable terminal. This application uses a single infrared diode for transmission and reception, resulting in a simple receiving circuit structure, low input impedance, enhanced current receiving capability, and an output impedance RD that can be configured according to the magnitude of the current signal received by the infrared diode, thus expanding the circuit's operating range.
[0004] The existing technical solutions described above have the following drawbacks: The infrared emitter and receiver tubes of the existing system will age over time, resulting in a decrease in light intensity and a decrease in receiving sensitivity, posing a risk of "silent failure," that is, the beam is no longer effective but the system cannot detect it, and the safety function is lost. It is easily affected by changes in ambient light (such as sunlight and lighting), which may lead to false triggering or missed triggering; single beams have detection blind spots and incomplete protection. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the purpose of this application is to provide an infrared protection control system and method based on adaptive power regulation and attenuation compensation. By performing intelligent analysis and closed-loop control of optical pulse signals in the digital domain, the safety protection performance based on low-cost hardware is significantly improved.
[0006] This was achieved using the following technical solutions: In a first aspect, this application provides an infrared protection control system based on adaptive power regulation and attenuation compensation, comprising: The microcontroller module is used to generate PWM pulse signals according to pulse frequency parameters, receive digital pulse signals, record the number of valid pulses, correct the pulse frequency parameters in combination with channel judgment rules, and output device safety protection commands. An infrared emitting module array is connected to the pins of the microcontroller module to receive the PWM pulse signal and generate the original light pulse signal. An infrared receiver module array, arranged in a one-to-one correspondence with an infrared transmitter module array, is used to receive raw light pulse signals; Both the infrared emitting module array and the infrared receiving module array include the same number of infrared diodes that correspond one-to-one, serving as pairs of infrared emitting and receiving diodes. The pairs of infrared emitting and receiving diodes are installed in pairs on both sides of the hazardous area of the equipment to form an infrared beam barrier.
[0007] The conditioning and comparison module is connected at one end to the infrared receiving module array and at the other end to the pin of the microcontroller module. It is used to amplify and filter the original optical pulse signal, convert it into a digital pulse signal, and transmit it to the microcontroller module. The security protection module is used to receive and distribute equipment security protection instructions to the corresponding security protection mechanism and generate security protection alarms.
[0008] By adopting the above technical solution, the infrared transmitting and receiving array is driven by the PWM pulse signal generated by the microcontroller module. The optical pulse signal is amplified, filtered and converted into digital pulses by the conditioning and comparison circuit. The microcontroller module corrects the frequency parameters and records the number of valid pulses according to the channel judgment rules, thereby accurately outputting the equipment safety protection command. This realizes non-contact, high anti-interference safety protection closed-loop control, which significantly improves the reliability, response speed and environmental adaptability of the grating system.
[0009] This application further specifies a microcontroller module, including: The signal generation unit is used to generate PWM pulse signals based on the pulse frequency parameters and pulse width modulation. The signal receiving unit is used to receive digital pulse signals according to the timestamp; The mode conversion unit is used to sequentially execute the learning mode and the working mode according to the duty cycle of the digital pulse signal, and determine the channel status in combination with the channel judgment rules, trigger the adaptive power adjustment mechanism, and correct the PWM pulse signal.
[0010] By adopting the above technical solution, the microcontroller module generates pulse signals based on PWM, realizes the switching between learning and working modes through duty cycle recognition, and triggers an adaptive power adjustment mechanism according to the channel status judgment rules to dynamically correct the pulse frequency parameters, thereby improving the robustness of the grating system to environmental interference and the long-term operational stability.
[0011] This application is further configured as: a learning mode, including: The duty cycle of the transmitting channel is set to zero according to the preset measurement time window, and the number of background noise pulses is obtained by counting the rising edges of the pulses in the receiving channel. Adjust the duty cycle of the transmitting channel until the receiving channel can detect the corresponding pulse signal, and determine the critical effective power; Based on the critical effective power and the measurement time window, the transmitting channel generates a PWM pulse signal, and the corresponding receiving channel captures the digital pulse signal and records the total number of digital pulses. The total number of digital pulses and the number of background noise pulses are calculated to obtain the effective number of pulses, which is then compared with a preset pulse count threshold. If the number of valid pulses is less than the pulse number threshold, it indicates that the transmit power of the current transmit channel is not up to standard, and a power step value is generated. If the number of effective pulses is greater than or equal to the pulse number threshold, it indicates that the transmission power of the current transmission channel is stable. The current duty cycle and the number of effective pulses are repeatedly measured to determine the initial operating point duty cycle and the reference number of effective pulses.
[0012] By adopting the above technical solution, the learning mode first measures the number of background noise pulses through a preset time window, and then gradually adjusts the duty cycle of the transmission channel to the critical receiving power. After multiple rounds of steady-state verification, the initial operating point duty cycle and the reference effective pulse number are determined, realizing adaptive calibration and threshold optimization of grating transmission power, and improving the anti-interference capability and operational reliability of the system in complex industrial environments.
[0013] This application is further configured with: a working mode, including: According to the preset fixed time window and the duty cycle of the initial operating point, the transmitting channel generates the corresponding PWM pulse signal, the receiving channel captures and converts the corresponding current digital pulse signal, and calculates the total number of digital pulses in the cycle. The total number of digital pulses in a period is calculated based on the number of background noise pulses, and the current number of valid digital pulses is then selected. Based on the channel judgment rules, the current number of valid digital pulses is used to determine the channel status and trigger the corresponding safety response adjustment mechanism. If the channel status is normal, maintain the current transmission duty cycle and start the next detection cycle. If the channel state is attenuating, an adaptive power adjustment mechanism is triggered to correct the PWM pulse signal corresponding to the current transmit duty cycle, and this correction is applied to the next detection cycle. If a channel is obstructed, it is considered a security threat. Based on multi-beam fusion decision-making, the number of transmit and receive channels is adjusted, triggering an emergency shutdown of the equipment. If the channel status is faulty, it is determined to be a hardware fault, triggering the highest level fault alarm and forcibly initiating a safety lockout state.
[0014] By adopting the above technical solution, the working mode is based on pulse counting and background noise filtering within a fixed time window. The normal, attenuated, blocked or faulty states are accurately identified through channel judgment rules. The system adaptively triggers hold, power adjustment, multi-beam fusion decision or emergency stop / lock response, realizing high anti-interference closed-loop control and intelligent hierarchical processing of the grating safety system. This significantly improves the reliability of equipment safety protection, environmental adaptability and fault response speed.
[0015] This application further specifies: channel judgment rules, including: If the number of valid pulses is greater than or equal to the reference number of valid pulses multiplied by the first coefficient, the channel status is normal. If the number of effective pulses is less than the reference number of effective pulses multiplied by a first coefficient, but greater than or equal to the reference number of effective pulses multiplied by a second coefficient, then the channel state is attenuated; wherein, the first coefficient is greater than the second coefficient; If the number of effective pulses is less than the reference number of effective pulses multiplied by the second coefficient, and the duration is greater than the preset de-jitter time, then the status is occlusion. If the current transmission duty cycle has reached the duty cycle limit, but the number of effective pulses is less than the reference value multiplied by the second coefficient, then the channel status is faulty.
[0016] By adopting the above technical solution, based on the ratio of the effective pulse number to the reference value and the duration, the system can intelligently determine four states of the channel: normal, attenuated, blocked, or faulty. Combined with duty cycle limits and jitter reduction processing, it achieves graded response, thereby improving the interference suppression capability and environmental adaptability of the safety light curtain.
[0017] This application further includes: an adaptive power adjustment mechanism, comprising: The error pulse signal number is obtained by multiplying the current effective pulse number and the reference effective pulse number by the second coefficient and performing a difference operation. Based on the preset control algorithm and the number of error pulse signals, the current transmission duty cycle is corrected to obtain a new transmission duty cycle; Based on the new transmission duty cycle and the transmission channel, a new PWM pulse signal is generated, and the number of new valid pulses is filtered by the receiving channel. If the number of new effective pulses is greater than or equal to the reference number of effective pulses multiplied by the first coefficient, the channel status is normal, and the correction adjustment is stopped. If not, the duty cycle of the new transmission will be cyclically corrected until the channel status returns to normal or the duty cycle of the new transmission reaches the duty cycle limit value.
[0018] By adopting the above technical solution, the error between the current effective pulse count and the reference value (scaled by the first coefficient) is calculated, and the transmission duty cycle is corrected based on the error feedback closed loop. After generating a PWM signal with the new duty cycle, the effective pulse count at the receiving end is checked. If the target is not met, the loop is iterated until recovery or limit is reached, which significantly improves the anti-interference capability and operational reliability of the grating system in dynamic environments.
[0019] This application further specifies that the infrared protection control system also includes an attenuation diagnostic module; the attenuation diagnostic module includes: Based on the attenuation diagnosis period, the new transmission duty cycle of each transmission channel is globally fitted, and the fitting slope and moving average are calculated. If the sign of the fitted slope is positive and the moving average is within the tolerance range of the duty cycle of the initial operating point, then the components of the current transmission channel are determined to be in a healthy performance state. If the sign of the fitted slope is positive, but the moving average is not within the tolerance range of the initial operating point duty cycle, then the components of the current transmission channel are determined to be in a state of performance degradation, and an early warning notification is generated.
[0020] By adopting the above technical solution, based on the global fitting of the new transmission duty cycle of each transmission channel, the performance trend is judged by the slope sign, and combined with the comparison of the moving average and the initial tolerance range, the healthy or deteriorated state of the channel is actively identified and an early warning is generated. This realizes real-time online diagnosis and pre-maintenance of infrared grating component attenuation, which significantly improves the long-term stability and reliability of the system.
[0021] Secondly, this application also provides an infrared protection control method based on adaptive power adjustment and attenuation compensation, employing the following technical solution: An infrared protection control method based on adaptive power regulation and attenuation compensation includes: Control the transmission channel to shut down, and measure and record the number of background noise pulses for each receiving channel; Adjust the duty cycle of the transmitting channel until the receiving channel can detect the corresponding pulse signal, capture and record the number of valid pulses until the pulse number threshold is reached, and determine the initial operating point duty cycle and the reference number of valid pulses; According to the preset fixed time window, the transmitting channel generates the corresponding PWM pulse signal according to the initial operating point duty cycle, the receiving channel captures and converts the corresponding current digital pulse signal, and counts the total number of digital pulses in the cycle. The current effective pulse count is calculated based on the total number of digital pulses in the period and the number of background noise pulses. Based on the channel judgment rules and the reference valid pulse count, the current valid digital pulse count is judged to determine the channel status and trigger the corresponding safety response adjustment mechanism.
[0022] By adopting the above technical solution, the background noise baseline is measured by first closing the transmission channel, and then the duty cycle is gradually adjusted until the receiving channel stably captures effective pulses to determine the initial operating point. The current effective pulse count is counted within a fixed time window, and the channel status is judged by comparing it with the reference effective pulse count and triggering safety response adjustment. This achieves closed-loop self-calibration and dynamic monitoring of the grating signal, improving the system's adaptability to environmental disturbances and component aging and its long-term reliability.
[0023] Thirdly, this application also provides an electronic device that adopts the following technical solution: An electronic device, comprising: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.
[0024] By adopting the above technical solution, the infrared protection control method based on adaptive power adjustment and attenuation compensation is presented in the form of computer-readable code and stored in the memory. When the processor runs the computer-readable code in the memory, the steps of the infrared protection control method based on adaptive power adjustment and attenuation compensation are executed, thereby reducing the intensity of manual labor and improving the degree of automation.
[0025] Fourthly, this application also provides a computer storage medium, employing the following technical solution: A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0026] In summary, the beneficial technical effects of this application are as follows: Signal discrimination in the digital domain is achieved through pulse counting, exhibiting strong resistance to analog signal drift and ambient light interference. The adaptive power adjustment function compensates in real-time for attenuation caused by device aging and dirt accumulation, maintaining long-term stable detection sensitivity and effectively avoiding "silent failure." Employing a general-purpose MCU and low-cost infrared photodiodes, it eliminates the need for expensive dedicated safety light curtain chips or high-precision ADCs, significantly reducing hardware costs. The module's compact size makes it easy to integrate into space-constrained devices. It possesses self-learning, self-calibration, and self-diagnostic capabilities, predicting device lifespan and providing early warnings, enabling predictive maintenance and improving overall equipment availability. Attached Figure Description
[0027] Figure 1 This is a flowchart of the infrared protection control system in this application; Figure 2 This is the circuit schematic of the conditioning and comparison module in this application; Figure 3 This is a flowchart illustrating the operation of the learning mode in this application; Figure 4 This is a flowchart illustrating the working mode and adaptive power adjustment in this application; Figure 5 This is a flowchart of the operation of the attenuation diagnosis module in this application. Detailed Implementation
[0028] The present application will be further described in detail below with reference to the accompanying drawings.
[0029] Reference Figure 1 Firstly, this application discloses an infrared protection control system based on adaptive power adjustment and attenuation compensation, comprising: The microcontroller module is used to generate PWM pulse signals according to pulse frequency parameters, receive digital pulse signals, record the number of valid pulses, correct the pulse frequency parameters in combination with channel judgment rules, and output device safety protection commands. An infrared emitting module array is connected to the pins of the microcontroller module to receive the PWM pulse signal and generate the original light pulse signal. An infrared receiver module array, arranged in a one-to-one correspondence with an infrared transmitter module array, is used to receive raw light pulse signals; Both the infrared emitting module array and the infrared receiving module array include the same number of infrared diodes that correspond one-to-one, serving as pairs of infrared emitting and receiving diodes. The pairs of infrared emitting and receiving diodes are installed in pairs on both sides of the hazardous area of the equipment to form an infrared beam barrier.
[0030] The conditioning and comparison module is connected at one end to the infrared receiving module array and at the other end to the pin of the microcontroller module. It is used to amplify and filter the original optical pulse signal, convert it into a digital pulse signal, and transmit it to the microcontroller module. The security protection module is used to receive and distribute equipment security protection instructions to the corresponding security protection mechanism and generate security protection alarms.
[0031] The implementation principle of this embodiment is as follows: An infrared emitting module array consists of at least two infrared emitting diodes. Each infrared emitting diode is connected to a PWM output pin of the microcontroller module via a pulse driving circuit, and is driven by a PWM pulse signal of a specific frequency generated by the microcontroller module. An infrared receiving module array consists of infrared receiving diodes corresponding one-to-one with the infrared emitting diodes. The output terminal of each infrared receiving diode is sequentially connected to a signal conditioning circuit and a voltage comparator. The voltage comparator is used to convert the received analog light signal into a digital pulse signal. The output terminal of each voltage comparator is connected to a timer input capture pin of the microcontroller module. The MCU can be a general-purpose chip with multiple PWM outputs and timer input capture functions, such as the STM32 series. The infrared emitting and receiving diodes are installed in pairs on both sides of the hazardous area of the equipment, forming multiple beam barriers.
[0032] The microcontroller module is configured to: continuously record the real-time duty cycle required to maintain the effective pulse count near the reference; analyze the trend of the real-time duty cycle over time; generate a device aging warning signal when the real-time duty cycle exceeds a certain proportion of the initial operating point duty cycle or its growth rate exceeds a threshold; the microcontroller module adopts multi-beam fusion decision logic: the safety output step is finally triggered only when two or more consecutive adjacent channels are simultaneously determined to be in an obstructed state.
[0033] Reference Figure 2 The transmit drive circuit of the conditioning and comparator module is connected to the gate of the N-channel MOSFET Q1 via the MCU's PWM pin and resistor R1. The source of Q1 is grounded via sampling resistor R2, and the drain is connected to the cathode of the infrared emitting diode D1. The anode of D1 is connected to the power supply VCC. The MCU controls the average current flowing through D1 by changing the duty cycle of the PWM, thereby adjusting its emission power. On the receiving end, a hysteresis comparator is cleverly constructed using the low-cost general-purpose operational amplifier U1 and its internal dual op-amp structure. This converts the analog light intensity signal received by the infrared receiver into a stable digital pulse signal, providing strong anti-interference capability. The infrared receiver D1 is connected in parallel in reverse in the voltage divider circuit. When it receives an infrared light pulse, D1 converts the light signal into a weak electrical signal. Its reverse current changes with the infrared radiation intensity, and the output AC signal provides the basis for subsequent circuit processing. Simultaneously, the RECE_VREF reference voltage is connected to the inverting input of the LM358, providing a reference voltage for the circuit to determine the validity of the input signal. The non-inverting amplifier circuit of U1 amplifies the weak input signal, and the amplified signal REC_DATA is output to the input capture pin of the MCU.
[0034] Preferably, the microcontroller module includes: The signal generation unit is used to generate PWM pulse signals based on the pulse frequency parameters and pulse width modulation. The signal receiving unit is used to receive digital pulse signals according to the timestamp; The mode conversion unit is used to sequentially execute the learning mode and the working mode according to the duty cycle of the digital pulse signal, and determine the channel status in combination with the channel judgment rules, trigger the adaptive power adjustment mechanism, and correct the PWM pulse signal.
[0035] In this embodiment, the microcontroller module is configured to perform the following steps: Learning mode steps: Control the infrared emitting tube to emit pulses at the lowest duty cycle, and count the number of pulses output by the infrared receiving tube within the first preset time to obtain the background noise reference value; gradually increase the emission duty cycle until the number of effective pulses obtained reaches the expected value, and record the duty cycle at this time as the initial operating point and the corresponding number of effective pulses as the reference; Working mode steps: During the subsequent detection cycle, continuously count the number of effective pulses for each channel; compare the number of effective pulses with the benchmark, and determine the channel status as normal, attenuated, blocked, or faulty based on the comparison result; Adaptive power adjustment steps: When the channel status is determined to be attenuation, increase the PWM pulse duty cycle of the corresponding infrared emitter to restore the effective pulse count to near the reference. Safety output procedure: When any channel is determined to be blocked or faulty, the safety protection module is activated to trigger the equipment to stop or alarm.
[0036] Preferably, refer to Figure 3 Learning modes include: The duty cycle of the transmitting channel is set to zero according to the preset measurement time window, and the number of background noise pulses is obtained by counting the rising edges of the pulses in the receiving channel. Adjust the duty cycle of the transmitting channel until the receiving channel can detect the corresponding pulse signal, and determine the critical effective power; Based on the critical effective power and the measurement time window, the transmitting channel generates a PWM pulse signal, and the corresponding receiving channel captures the digital pulse signal and records the total number of digital pulses. The total number of digital pulses and the number of background noise pulses are calculated to obtain the effective number of pulses, which is then compared with a preset pulse count threshold. If the number of valid pulses is less than the pulse number threshold, it indicates that the transmit power of the current transmit channel is not up to standard, and a power step value is generated. If the number of effective pulses is greater than or equal to the pulse number threshold, it indicates that the transmission power of the current transmission channel is stable. The current duty cycle and the number of effective pulses are repeatedly measured to determine the initial operating point duty cycle and the reference number of effective pulses. Channel determination rules include: If the number of valid pulses is greater than or equal to the reference number of valid pulses multiplied by the first coefficient, the channel status is normal. If the number of effective pulses is less than the reference number of effective pulses multiplied by a first coefficient, but greater than or equal to the reference number of effective pulses multiplied by a second coefficient, then the channel state is attenuated; wherein, the first coefficient is greater than the second coefficient; If the number of effective pulses is less than the reference number of effective pulses multiplied by the second coefficient, and the duration is greater than the preset de-jitter time, then the status is occlusion. If the current transmission duty cycle has reached the duty cycle limit, but the number of effective pulses is less than the reference value multiplied by the second coefficient, then the channel status is faulty.
[0037] The implementation principle of this embodiment is as follows: The MCU sets the duty cycle D=0 for all transmit channels. Within T_measure (e.g., 100ms), the rising edge of the pulse on each receive channel pin is counted by a timer to obtain the noise floor N_noise.
[0038] The MCU controls the infrared transmitter of the target channel to begin transmitting with a preset, extremely low PWM duty cycle, D_current. This duty cycle (e.g., D_min = 1%) corresponds to an extremely low average transmit power, and its initial value, D_min, should ensure that, under ideal (new device, clean) conditions, the receiver has a very small probability of detecting the signal. This provides a safe starting point, preventing the fine calibration of the "critical point" from being skipped due to excessive initial power.
[0039] The MCU initiates a fixed measurement time window T_measure (e.g., 100ms). Within this window: Transmitter: Continuously transmits PWM pulses at a fixed frequency (such as a 1kHz or 38kHz carrier) with the current duty cycle D_current.
[0040] Receiver: The MCU's timer counts the rising (or falling) edges of the digital output signals (from the integrated receiver module or comparator) of the corresponding receiver channel within the T_measure window to obtain the total number of captured pulses N_total.
[0041] T_measure provides a standardized "sampling window" to ensure that the statistical basis of each measurement is consistent and the results are comparable.
[0042] Calculate the number of effective pulses: N_effective = N_total - N_noise Subtracting the false trigger pulses caused by ambient light and circuit noise measured in the first step, we obtain the effective pulse count purely generated by the infrared light from the transmitting end. This is a direct digital quantity for judging signal quality.
[0043] Compare N_effective with an expected threshold N_expected_threshold. The threshold is generally set according to system performance and reliability requirements, for example: N_expected_threshold=f_carrier*T_measure*D_current*η Wherein: f_carrier is the transmission pulse frequency / carrier frequency, and η is the system efficiency factor, a constant less than 1, which is used to reserve a safety margin. It accounts for inherent losses of pulses during transmission, reception and demodulation (such as optical path alignment deviation, device response time, circuit delay, etc.). Setting η (e.g., 0.7) means that instead of pursuing 100% pulse capture rate, a stable and reliable sub-optimal level is pursued to enhance system robustness.
[0044] If N_effective<N_expected_threshold: it indicates that the current transmission power is insufficient and the effective signal is too weak. The MCU increases D_current by a step value (ΔD, such as 1% or 5%), and then returns to step 3 to re-perform measurement with the new higher power.
[0045] If N_effective>=N_expected_threshold: it indicates that the current transmission power can already enable the receiving end to obtain a sufficiently strong stable signal. The iteration stops.
[0046] After the iteration stops, the system does not immediately take the current D_current and N_effective as the final reference. Generally, the MCU performs multiple repeated measurements near this state (D_current and D_current-ΔD) to verify the stability of the signal N_effective (the fluctuation is within the allowable range).
[0047] Once stability is confirmed, formal recording is performed: reference effective pulse number: N_ref=N_effective (or take the average value after stabilization). Initial operating point duty cycle: D_work_init=D_current.
[0048] With reference to Figure 4 , the operating mode includes: According to a preset fixed time window and based on the initial operating point duty cycle, the transmitting channel generates a corresponding PWM pulse signal, the receiving channel captures and converts the corresponding current digital pulse signal, and calculates the total number of digital pulses in a cycle; Calculating the total number of digital pulses in the cycle according to the number of background noise pulses, and screening the current number of effective digital pulses; Based on the channel judgment rules, the current number of valid digital pulses is used to determine the channel status and trigger the corresponding safety response adjustment mechanism. If the channel status is normal, maintain the current transmission duty cycle and start the next detection cycle. If the channel state is attenuating, an adaptive power adjustment mechanism is triggered to correct the PWM pulse signal corresponding to the current transmit duty cycle, and this correction is applied to the next detection cycle. If a channel is obstructed, it is considered a security threat. Based on multi-beam fusion decision-making, the number of transmit and receive channels is adjusted, triggering an emergency shutdown of the equipment. If the channel status is faulty, it is determined to be a hardware fault, triggering the highest level fault alarm and forcibly initiating a safety lockout state.
[0049] Adaptive power adjustment mechanism, including: The error pulse signal number is obtained by multiplying the current effective pulse number and the reference effective pulse number by the second coefficient and performing a difference operation. Based on the preset control algorithm and the number of error pulse signals, the current transmission duty cycle is corrected to obtain a new transmission duty cycle; Based on the new transmission duty cycle and the transmission channel, a new PWM pulse signal is generated, and the number of new valid pulses is filtered by the receiving channel. If the number of new effective pulses is greater than or equal to the reference number of effective pulses multiplied by the first coefficient, the channel status is normal, and the correction adjustment is stopped. If not, the duty cycle of the new transmission will be cyclically corrected until the channel status returns to normal or the duty cycle of the new transmission reaches the duty cycle limit value.
[0050] The implementation principle of this embodiment is as follows: it runs continuously with a high-frequency detection cycle, monitors the signal quality of each infrared beam in real time, and dynamically adjusts the driving power of the transmitter through a closed-loop control algorithm to actively compensate for signal attenuation caused by device aging, lens contamination or environmental interference, thereby maintaining stable detection sensitivity during long-term operation, and triggering safety protection actions when the signal is completely lost (blocked) or the system itself fails.
[0051] All infrared channels are scanned at a fixed period T_cycle (e.g., 20ms). Within each cycle, the MCU performs the following operations: Synchronous transmission and capture: Control each transmitting transistor to transmit pulses at a specific frequency according to its current PWM duty cycle (D_current). At the same time, start the timer input capture function of the corresponding receiving channel.
[0052] Within the T_cycle time, the number of valid digital pulses output by the receiver is counted. For integrated receiver modules (such as IRM-H6XXT), the count is of the demodulated valid data packets; for discrete comparator schemes, the count is of the shaped square wave pulses.
[0053] Calculate the effective signal: N_effective = N_total - N_noise. Where N_noise is the background noise value measured in learning mode and may be updated periodically. N_effective is the number of pulses successfully received purely from the infrared light emitted by the transmitter within the current cycle; it is a direct digital quantity for judging the channel's health status.
[0054] The MCU compares the current N_effective with the benchmark N_ref and introduces two key threshold coefficients (α and β, usually set to 0 < α < β < 1, for example α = 0.7, β = 0.9) to accurately classify the channel state into four categories and trigger corresponding actions, as shown in Table 1.
[0055] Table 1 State Action Table Normal N_effective>=β*N_ref Maintain the current launch duty cycle D_current and proceed to the next detection cycle. Attenuation α*N_ref<=N_effective<β*N_ref Trigger the "adaptive power adjustment" algorithm: slightly increase the transmit duty cycle D_current of this channel (e.g., increase by 1%-5%), attempting to boost N_effective back above β*N_ref in the next cycle. Blockage N_effective < α*N_ref, and the duration is > T_debounce If a security threat is detected, and in conjunction with the "multi-beam fusion decision" (e.g., two consecutive beams of light need to be blocked simultaneously), a command is immediately sent to the security protection module to trigger an emergency shutdown (E-stop) of the equipment. Fault In the "decay" state, even if D_current has been adjusted to the preset maximum safe duty cycle D_max, N_effective will still remain lower than α*N_ref. If the system is determined to have a hardware failure, the highest level of fault alarm (audible and visual indication) will be triggered, and the system will be forced into a safety lock state (shutdown) to prevent the loss of protection functions due to "silent failure". The controller (MCU) detects that the controlled variable (N_effective) is lower than the set value (β*N_ref) and generates an error signal.
[0056] The controller increases the control quantity (transmit PWM duty cycle D_current) according to a predetermined rule (such as proportional-integral-PI or a simple fixed-step algorithm).
[0057] D_current_new=D_current_old+Kp*(β*N_ref-N_effective), where Kp is the scaling factor.
[0058] The controlled object (infrared emitter) emits infrared light at a higher power, resulting in a stronger light signal at the receiving end.
[0059] In the next detection cycle, the new N_effective is measured. If N_effective returns to the normal range, the adjustment stops; if it is still too low, D_current continues to increase. This process repeats until N_effective returns to normal or reaches the D_max limit.
[0060] The traditional, fixed-threshold "detection-alarm" mode has been upgraded to an intelligent "detection-compensation-maintenance" mode. The system no longer passively waits for the signal to fall below a certain fixed point before triggering an alarm; instead, it actively "resists" signal attenuation, maintaining the operating point near its optimal state. This significantly extends the system's effective service life and substantially improves reliability.
[0061] Preferably, refer to Figure 5 The infrared protection control system also includes an attenuation diagnostic module; the attenuation diagnostic module includes: Based on the attenuation diagnosis period, the new transmission duty cycle of each transmission channel is globally fitted, and the fitting slope and moving average are calculated. If the sign of the fitted slope is positive and the moving average is within the tolerance range of the duty cycle of the initial operating point, then the components of the current transmission channel are determined to be in a healthy performance state. If the sign of the fitted slope is positive, but the moving average is not within the tolerance range of the initial operating point duty cycle, then the components of the current transmission channel are determined to be in a state of performance degradation, and an early warning notification is generated.
[0062] In this embodiment, the sole and crucial data source for attenuation diagnosis is the "Operating Mode and Adaptive Power Adjustment" function generated during operation. Whenever the system initiates adaptive power adjustment due to signal "attenuation" in a certain channel and successfully adjusts the transmit duty cycle D_current to a new, higher value, this new D_current value (along with a timestamp) is recorded in the dedicated historical dataset for that channel.
[0063] Diagnostic algorithms analyze the historical D_current data sequence for each channel periodically (e.g., every minute or hour), rather than reacting to individual instantaneous values. The analysis focuses on long-term trends rather than short-term fluctuations. Common methods include: Calculate the moving average of D_current over a period of time (e.g., 24 hours) and observe whether this average increases monotonically over time.
[0064] Perform a linear regression on recent data (such as data from one week) and calculate its slope. A significantly positive slope indicates that the power required to maintain the signal is increasing steadily and continuously.
[0065] Compare the current average (or fitted) value of D_current with the initial working point D_work_init. For example, calculate the increase in current power relative to the initial power.
[0066] Based on the results of trend analysis, the system will make a classification judgment: D_current fluctuates slightly around D_work_init, without a sustained upward trend. No output.
[0067] When analysis shows that D_current has been rising continuously and exceeds a certain percentage (e.g., 150%) of D_work_init, or its growth rate exceeds a certain threshold, the diagnostic module determines that the channel device has "performance degradation".
[0068] Trigger a "warning" signal. This signal should not cause an emergency shutdown of the equipment, but should instead notify the user through secondary indications, such as: Turn on the yellow "Maintenance" indicator light.
[0069] Display "Recommended Check" information for a specific channel on the equipment's human-machine interface (HMI).
[0070] The warning code is sent to the host computer management system through the communication interface.
[0071] Inform the operator that "the sensor is still working, but it is no longer in optimal condition and its lifespan is expected to end. Please arrange for cleaning or replacement at your convenience."
[0072] The second aspect is an infrared protection control method based on adaptive power regulation and attenuation compensation, including: Control the transmission channel to shut down, and measure and record the number of background noise pulses for each receiving channel; Adjust the duty cycle of the transmitting channel until the receiving channel can detect the corresponding pulse signal, capture and record the number of valid pulses until the pulse number threshold is reached, and determine the initial operating point duty cycle and the reference number of valid pulses; According to the preset fixed time window, the transmitting channel generates the corresponding PWM pulse signal according to the initial operating point duty cycle, the receiving channel captures and converts the corresponding current digital pulse signal, and counts the total number of digital pulses in the cycle. The current effective pulse count is calculated based on the total number of digital pulses in the period and the number of background noise pulses. Based on the channel judgment rules and the reference valid pulse count, the current valid digital pulse count is judged to determine the channel status and trigger the corresponding safety response adjustment mechanism.
[0073] The implementation principle of this embodiment is as follows: S1: Learning mode stage S11: Control all infrared emitters to turn off, measure and record the number of background noise pulses for each receiving channel; S12: For each channel, control the transmitter tube to emit at the lowest duty cycle and gradually increase the duty cycle until the number of effective pulses captured within the statistical window reaches a stable expected value. Record the current duty cycle as the initial working point D_work_init and the number of effective pulses as the reference N_ref; S2: Working Mode Phase S21: Within each detection cycle T_cycle, control the transmitting tube to transmit PWM pulses at a fixed frequency with the current duty cycle, and synchronously capture the total number of pulses of each receiving channel; S22: Calculate the current effective pulse count for each channel N_effective = total pulse count - background noise pulse count; S23: Compare N_effective with N_ref to determine the current status of each channel; S24: If the channel status is attenuation, increase the PWM duty cycle of the corresponding transmitter and return to step S21; if the channel status is normal, maintain the current duty cycle and enter the next detection cycle; if the channel status is obstruction or fault, execute step S3. S3: Safety Response Phase: Based on the channel status, trigger emergency shutdown of the equipment, audible and visual alarms, or fault indications.
[0074] An electronic device, comprising: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.
[0075] A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0076] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. An infrared protection control system based on adaptive power adjustment and attenuation compensation, characterized in that, include: The microcontroller module is used to generate PWM pulse signals according to pulse frequency parameters, receive digital pulse signals, record the number of valid pulses, correct the pulse frequency parameters in combination with channel judgment rules, and output device safety protection commands. An infrared emitting module array is connected to the pins of the microcontroller module to receive the PWM pulse signal and generate the original light pulse signal. An infrared receiver module array, arranged in a one-to-one correspondence with an infrared transmitter module array, is used to receive raw light pulse signals; The conditioning and comparison module is connected at one end to the infrared receiving module array and at the other end to the pin of the microcontroller module. It is used to amplify and filter the original optical pulse signal, convert it into a digital pulse signal, and transmit it to the microcontroller module. The security protection module is used to receive and distribute equipment security protection instructions to the corresponding security protection mechanism and generate security protection alarms.
2. The infrared protection control system based on adaptive power adjustment and attenuation compensation according to claim 1, characterized in that, The microcontroller module includes: The signal generation unit is used to generate PWM pulse signals based on the pulse frequency parameters and pulse width modulation. The signal receiving unit is used to receive digital pulse signals according to the timestamp; The mode conversion unit is used to sequentially execute the learning mode and the working mode according to the duty cycle of the digital pulse signal, and determine the channel status in combination with the channel judgment rules, trigger the adaptive power adjustment mechanism, and correct the PWM pulse signal.
3. The infrared protection control system based on adaptive power adjustment and attenuation compensation according to claim 1, characterized in that: Both the infrared emitting module array and the infrared receiving module array include the same number of infrared diodes that correspond one-to-one, serving as pairs of infrared emitting and receiving diodes. The pairs of infrared emitting and receiving diodes are installed on both sides of the hazardous area of the equipment to form an infrared beam barrier.
4. The infrared protection control system based on adaptive power adjustment and attenuation compensation according to claim 2, characterized in that, The learning modes include: The duty cycle of the transmitting channel is set to zero according to the preset measurement time window, and the number of background noise pulses is obtained by counting the rising edges of the pulses in the receiving channel. Adjust the duty cycle of the transmitting channel until the receiving channel can detect the corresponding pulse signal, and determine the critical effective power; Based on the critical effective power and the measurement time window, the transmitting channel generates a PWM pulse signal, and the corresponding receiving channel captures the digital pulse signal and records the total number of digital pulses. The total number of digital pulses and the number of background noise pulses are calculated to obtain the effective number of pulses, which is then compared with a preset pulse count threshold. If the number of valid pulses is less than the pulse number threshold, it indicates that the transmit power of the current transmit channel is not up to standard, and a power step value is generated. If the number of effective pulses is greater than or equal to the pulse number threshold, it indicates that the transmission power of the current transmission channel is stable. The current duty cycle and the number of effective pulses are repeatedly measured to determine the initial operating point duty cycle and the reference number of effective pulses.
5. The infrared protection control system based on adaptive power adjustment and attenuation compensation according to claim 2, characterized in that, The working modes include: According to the preset fixed time window and the duty cycle of the initial operating point, the transmitting channel generates the corresponding PWM pulse signal, the receiving channel captures and converts the corresponding current digital pulse signal, and calculates the total number of digital pulses in the cycle. The total number of digital pulses in a period is calculated based on the number of background noise pulses, and the current number of valid digital pulses is then selected. Based on the channel judgment rules, the current number of valid digital pulses is used to determine the channel status and trigger the corresponding safety response adjustment mechanism. If the channel status is normal, maintain the current transmission duty cycle and start the next detection cycle. If the channel state is attenuating, an adaptive power adjustment mechanism is triggered to correct the PWM pulse signal corresponding to the current transmit duty cycle, and this correction is applied to the next detection cycle. If a channel is obstructed, it is considered a security threat. Based on multi-beam fusion decision-making, the number of transmit and receive channels is adjusted, triggering an emergency shutdown of the equipment. If the channel status is faulty, it is determined to be a hardware fault, triggering the highest level fault alarm and forcibly initiating a safety lockout state.
6. The infrared protection control system based on adaptive power adjustment and attenuation compensation according to claim 5, characterized in that, The channel determination rules include: If the number of valid pulses is greater than or equal to the reference number of valid pulses multiplied by the first coefficient, the channel status is normal. If the number of effective pulses is less than the reference number of effective pulses multiplied by a first coefficient, but greater than or equal to the reference number of effective pulses multiplied by a second coefficient, then the channel state is attenuated; wherein, the first coefficient is greater than the second coefficient; If the number of effective pulses is less than the reference number of effective pulses multiplied by the second coefficient, and the duration is greater than the preset de-jitter time, then the status is occlusion. If the current transmission duty cycle has reached the duty cycle limit, but the number of effective pulses is less than the reference value multiplied by the second coefficient, then the channel status is faulty.
7. The infrared protection control system based on adaptive power adjustment and attenuation compensation according to claim 5, characterized in that, The adaptive power adjustment mechanism includes: The error pulse signal number is obtained by multiplying the current effective pulse number and the reference effective pulse number by the second coefficient and performing a difference operation. Based on the preset control algorithm and the number of error pulse signals, the current transmission duty cycle is corrected to obtain a new transmission duty cycle; Based on the new transmission duty cycle and the transmission channel, a new PWM pulse signal is generated, and the number of new valid pulses is filtered by the receiving channel. If the number of new effective pulses is greater than or equal to the reference number of effective pulses multiplied by the first coefficient, the channel status is normal, and the correction adjustment is stopped. If not, the duty cycle of the new transmission will be cyclically corrected until the channel status returns to normal or the duty cycle of the new transmission reaches the duty cycle limit value.
8. The infrared protection control system based on adaptive power adjustment and attenuation compensation according to claim 1, characterized in that, The infrared protection and control system also includes an attenuation diagnostic module; The attenuation diagnosis module includes: Based on the attenuation diagnosis period, the new transmission duty cycle of each transmission channel is globally fitted, and the fitting slope and moving average are calculated. If the sign of the fitted slope is positive and the moving average is within the tolerance range of the duty cycle of the initial operating point, then the components of the current transmission channel are determined to be in a healthy performance state. If the sign of the fitted slope is positive, but the moving average is not within the tolerance range of the initial operating point duty cycle, then the components of the current transmission channel are determined to be in a state of performance degradation, and an early warning notification is generated.
9. An infrared protection control method based on adaptive power adjustment and attenuation compensation, applied to the system as described in any one of claims 1-8, characterized in that, include: Control the transmission channel to shut down, and measure and record the number of background noise pulses for each receiving channel; Adjust the duty cycle of the transmitting channel until the receiving channel can detect the corresponding pulse signal, capture and record the number of valid pulses until the pulse number threshold is reached, and determine the initial operating point duty cycle and the reference number of valid pulses; According to the preset fixed time window, the transmitting channel generates the corresponding PWM pulse signal according to the initial operating point duty cycle, the receiving channel captures and converts the corresponding current digital pulse signal, and counts the total number of digital pulses in the cycle. The current effective pulse count is calculated based on the total number of digital pulses in the period and the number of background noise pulses. Based on the channel judgment rules and the reference valid pulse count, the current valid digital pulse count is judged to determine the channel status and trigger the corresponding safety response adjustment mechanism.
10. A computer storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in claim 9.