A safety relay capable of automatically identifying input types and an input type automatic identification method

By integrating signal conditioning circuitry and redundancy processing units into safety relays, automatic identification and safety logic configuration of NPN, PNP, and contact-type sensors are achieved, solving the problems of model fragmentation and incorrect selection in existing technologies, improving system security and simplifying integration.

CN123053756APending Publication Date: 2026-11-06SHENZHEN YIPUXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611222808.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing safety relays suffer from numerous models due to the different types of sensors, leading to errors in selection, complex integration, and a lack of automatic compatibility.

Method used

Design a safety relay that integrates signal conditioning circuits for processing NPN, PNP, and contact-type sensors. Through redundant processing units, self-test modules, and cross-comparison diagnostic mechanisms, it can automatically identify the sensor type and automatically configure matching safety logic parameters after identification.

Benefits of technology

It enables a single product model to replace multiple models, reduces inventory costs and management burden, eliminates the risk of human error in selection, improves system security and integrity, and simplifies system integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123053756A_ABST
    Figure CN123053756A_ABST
Patent Text Reader

Abstract

This invention discloses a safety relay capable of automatically identifying input types and a method for automatic input type identification, belonging to the field of industrial safety control technology. To address the problem of numerous existing safety relay models and the ease of error-prone selection, this invention discloses a system comprising: first, second, and third signal conditioning circuits for processing NPN, PNP, and contact-type sensors respectively; a programmable signal selection unit; and a processing unit composed of at least two independent processing cores. Upon power-up, the processing unit executes an automatic type identification algorithm, strictly following the sequence of "contact → PNP → NPN," controlling the selection unit to switch stage by stage and detect circuit characteristics to lock in the sensor type and automatically configure matching safety logic parameters. This disclosure also employs a redundant signal selection architecture, self-testing, and cross-comparison diagnostic mechanisms to ensure a high level of safety, enabling a single model to be compatible with multiple sensor types, eliminating manual selection errors, and reducing inventory costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial safety control technology, specifically to a safety relay and an automatic identification method for its input type. Background Technology

[0002] Safety relays are core components of industrial safety control systems. They receive input signals from safety sensors (such as emergency stop buttons, safety light curtains, and safety door locks) and safely disconnect the power source of downstream load equipment when a dangerous event is detected, thus protecting equipment and personnel. To ensure high reliability, high-level safety relays typically meet safety integrity levels such as Category 4 and PL e as specified in standards like ISO 13849-1. Their designs generally include mechanisms such as dual-channel redundancy, cross-fault detection, and self-diagnosis.

[0003] In industrial settings, safety sensors are primarily categorized into three basic types based on their output circuit structure: NPN (leakage / current absorption), PNP (source / current supply), and contact (passive dry contact). NPN sensors pull the signal line to a low level (0V) when activated, while PNP sensors drive the signal line to a high level (+24V). Contact sensors, on the other hand, change the continuity of the circuit by closing and opening internal mechanical contacts. These three types of sensors differ fundamentally in their signal levels, circuit impedance characteristics, and fault modes.

[0004] Therefore, existing safety relays typically employ a multi-model design approach, meaning that different models of dedicated safety relays are designed and manufactured for different types of sensors. For example, some models are specifically designed for connecting contact-type devices, while others are designed for connecting PNP-type solid-state output devices. This approach leads to significant technical drawbacks: First, the fragmentation of equipment models is severe, requiring end-users and system integrators to stock multiple models of safety relays for different types of sensors. This not only significantly increases inventory costs and supply chain management complexity but also creates difficulties in equipment selection. Second, there is a serious risk of human error in selection. During equipment installation, modification, or repair / replacement, if technicians mistakenly connect a sensor to an incompatible safety relay model, it may directly lead to safety function failure or malfunction. Such hidden dangers are often not easily detected immediately and may cause serious safety accidents during equipment operation. Finally, the system integration complexity is high. When multiple types of sensors exist in a control system, multiple different models of safety relays must be used, which not only increases the space occupied in the control cabinet and wiring complexity but also drives up the overall system cost. Summary of the Invention

[0005] To address the problems of existing safety relays having numerous models, easy selection errors, complex integration, and lack of automatic compatibility due to different sensor types, this invention provides a safety relay capable of automatically identifying input types and an automatic input type identification method.

[0006] In a first aspect, the present invention provides a safety relay capable of automatically identifying input types, comprising at least one safety input channel and a redundant processing unit, the redundant processing unit being composed of at least two physically and electrically independent processing cores. The safety relay further includes: a first signal conditioning circuit configured to convert a low-level active signal compatible with NPN type sensors into a standard logic level signal; a second signal conditioning circuit configured to convert a high-level active signal compatible with PNP type sensors into a standard logic level signal; a third signal conditioning circuit configured to apply an excitation signal to the sensor input line and determine its on / off state based on the impedance characteristics of the line, for processing contact-type sensors; and a programmable signal selection unit, the input terminals of which are respectively connected to the output terminals of the first, second, and third signal conditioning circuits, and configured to select based on... The control command selectively feeds one of its output signals to the processing unit; the redundant signal selection architecture includes at least two independent signal selection paths, each controlled by an independent microcontroller (processing core); a self-test module is configured to periodically verify the functional integrity of the programmable signal selection unit during device operation; a cross-comparison diagnostic mechanism is configured to mutually verify operational data between independent microcontrollers, wherein inconsistencies in the operational data will trigger a safety state; wherein the microcontroller is also configured to: execute an automatic type recognition algorithm, which follows the sequence of "contact → PNP → NPN", controlling the programmable signal selection unit to switch stage by stage and detect line characteristics to lock the sensor type; and automatically configure safety logic parameters matching the type after successfully identifying the sensor type.

[0007] Furthermore, during the PNP mode detection and / or NPN mode detection phases of the automatic type recognition algorithm, the redundant processing unit is also configured to detect the output impedance of the sensor input line by injecting test pulses into the line, and to perform a dual-criteria judgment based on the steady-state level. This dual-criteria mechanism can effectively distinguish between different steady-state states of active sensors and the floating state of the line, greatly improving the accuracy of recognition.

[0008] Furthermore, the automatic type recognition algorithm employs multi-cycle sampling filtering at each detection stage, confirming the detection result only after the sampled values ​​have stabilized for a predetermined number of consecutive times. This scheme effectively filters out transient electromagnetic interference in industrial environments, ensuring the stability of the recognition results.

[0009] Furthermore, the first signal conditioning circuit consists of pull-up resistors and Schmitt triggers; the second signal conditioning circuit consists of a voltage divider resistor network and Schmitt triggers; and the third signal conditioning circuit consists of a constant current source excitation circuit and a voltage comparator. This design provides a reliable hardware signal conversion basis for three types of sensors with different electrical characteristics.

[0010] Optionally, the safety relay also includes a status indication unit. After the redundancy processing unit successfully identifies the sensor type, the status indication unit provides a unique visual indication corresponding to the identified NPN, PNP, or contact operating mode. This provides field maintenance personnel with intuitive and clear equipment status information.

[0011] In one embodiment, the safety relay further includes hardware protection circuitry located at the power input terminal, comprising reverse connection protection, overvoltage protection, and overcurrent protection. This design effectively prevents damage to the relay itself due to incorrect field wiring or power grid fluctuations.

[0012] Secondly, the present invention also provides a method for automatic input type identification in a safety relay. The safety relay includes parallel signal conditioning circuits for processing NPN, PNP, and contact-type sensors, and a redundant processing unit consisting of at least two independent processing cores. The method includes: the redundant processing unit performing an automatic type identification step, which follows the sequence of "contact → PNP → NPN". This step involves controlling a programmable signal selection unit to select different signal conditioning circuits stage by stage and detecting the electrical characteristics of the sensor input lines to determine the connected sensor type. In the automatic type identification step, each independent processing core independently controls a signal selection path through a redundant signal selection architecture. A cross-comparison diagnostic step is performed between the independent processing cores of the redundant processing unit to mutually verify operational data, including sensor type identification results, and triggers a safety state when data inconsistency is detected. During device operation, a functional integrity self-test step is periodically performed on the programmable signal selection unit. After successfully identifying the sensor type, safety logic parameters matching the identified type are automatically configured.

[0013] Furthermore, the automatic type identification step, when detecting PNP and / or NPN modes, further includes: injecting a test pulse into the sensor input line; detecting the change in line output impedance caused by the test pulse; and determining the sensor type using a dual-criteria approach by combining the line's steady-state level with the change in output impedance.

[0014] Furthermore, in each detection stage of the automatic type identification step, the electrical characteristics of the line are sampled multiple times, and the detection result of that stage is confirmed only after the sampled values ​​have stabilized for a predetermined number of consecutive times.

[0015] Optionally, the method further includes: after successfully identifying the sensor type, providing a unique visual indication corresponding to the identified NPN, PNP, or contact operating mode through a status indication unit.

[0016] Compared with existing technologies, the advantages of this invention are as follows: First, it replaces the traditional multiple models with a single model, completely eliminating the fragmentation of equipment models caused by different sensor types, and greatly reducing users' inventory costs and management burden. Second, it achieves fully automatic sensor type identification without any manual judgment or setting, fundamentally eliminating the risk of safety function failure due to manual selection or configuration errors, and significantly improving the inherent safety of the system. Third, through a redundant signal selection architecture, periodic self-testing, and cross-comparison diagnostic mechanism, it effectively solves the single point of failure problem that may be introduced by using general-purpose components in the signal selection path, ensuring that the safety integrity level of the safety relay is maintained at the highest level in all operating modes. Fourth, it simplifies system integration. When there are mixed-type sensors in the system, only one safety relay of this invention is needed for compatible access, reducing the number of required devices, saving control cabinet space, simplifying field wiring, and reducing the overall system cost. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0018] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a system architecture block diagram of a safety relay disclosed in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the three-mode universal input front-end circuit disclosed in an embodiment of the present invention.

[0021] Figure 3 This is a flowchart of the automatic type recognition algorithm disclosed in an embodiment of the present invention.

[0022] Figure 4 This is a schematic diagram of the dual-microcontroller redundancy architecture of the processing unit disclosed in an embodiment of the present invention.

[0023] Figure 5 This is a schematic diagram of the hardware protection circuit disclosed in an embodiment of the present invention.

[0024] Figure 6 This is an application wiring diagram for a single NPN sensor connection disclosed in an embodiment of the present invention.

[0025] Figure 7 This is an application wiring diagram for a single PNP type sensor connection disclosed in an embodiment of the present invention.

[0026] Figure 8 This is an application wiring diagram for a single-contact sensor connection disclosed in an embodiment of the present invention. Detailed Implementation

[0027] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0028] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0029] This disclosure relates to the field of industrial safety control technology, and in particular to a safety relay capable of being compatible with multiple sensor input types and automatically identifying input modes. Traditional safety relays typically design different hardware models for NPN, PNP, or contact-type sensors, leading to severe model fragmentation. This not only increases user inventory and management costs but also introduces the risk of incorrect selection during equipment maintenance or modification, potentially causing safety function failure. Furthermore, existing technologies lack the ability to simultaneously handle different types of sensor inputs on a single device and lack automatic identification and status indication functions without manual intervention. This invention aims to solve the above-mentioned technical problems by providing a universal safety relay capable of being compatible with NPN, PNP, and contact-type sensor inputs on a single hardware platform, automatically identifying the connected sensor type upon power-up without manual intervention, while maintaining a high level of safety integrity. Its core idea lies in achieving universality, ease of use, and high security on a single hardware platform through an integrated three-mode universal input front-end circuit, an automatic type identification algorithm based on a step-by-step elimination method, a system-level redundant safety architecture, and a comprehensive self-testing and cross-diagnostic mechanism.

[0030] This safety relay integrates first, second, and third signal conditioning circuits for processing NPN, PNP, and contact-type sensors, respectively, as well as a programmable signal selection unit. High safety is ensured through a redundant signal selection architecture, a self-test module, and a cross-comparison diagnostic mechanism. The redundant processing unit, consisting of at least two independent processing cores, executes an automatic type recognition algorithm, strictly following the sequence of "contact → PNP → NPN." It controls the programmable signal selection unit to switch stages and detect line characteristics to lock in the sensor type and automatically configure matching safety logic parameters.

[0031] The following is an illustrative description with reference to the accompanying drawings.

[0032] like Figure 1 As shown, this invention provides a system architecture for a safety relay capable of automatically identifying input types. The overall system architecture includes a three-mode universal input front-end circuit 100, an automatic type recognition module 200 implemented in software to represent the automatic type recognition algorithm, a redundancy processing unit 300, a safety output drive unit 400, a status indication unit (mode indication and alarm unit 500), and a hardware protection circuit (three-level power protection circuit 600). The safety relay has one or more safety input channels, such as safety input channel one and safety input channel two, each channel independently configured with a complete processing link from signal input to processing. The three-mode universal input front-end circuit 100 is responsible for receiving external sensor signals and performing preliminary conditioning. The automatic type recognition algorithm is a software function executed by the redundancy processing unit 300, responsible for implementing the core recognition logic. The redundancy processing unit 300 is the control core of the entire system, consisting of at least two independent processing cores that jointly perform control, calculation, and diagnostic functions. The safety output drive unit 400 safely controls the on / off state of downstream loads according to the instructions of the redundancy processing unit 300. The status indicator unit is used to visually display the current operating mode or fault status of the device to the user. The hardware protection circuit (three-level power protection circuit 600) is located at the power input terminal to protect the relay itself from electrical damage.

[0033] In one aspect of the invention, a safety relay capable of automatically identifying input types is provided. The relay comprises three core signal conditioning circuits: a first signal conditioning circuit, a second signal conditioning circuit, and a third signal conditioning circuit, optimized for processing signals from NPN, PNP, and contact type sensors, respectively. This parallel dedicated circuit design provides a reliable physical basis for subsequent automatic identification, ensuring accurate acquisition of signals from different sensor types. A programmable signal selection unit is connected to the output of these three conditioning circuits, functioning similarly to a software-controlled switch, allowing the redundant processing unit to select one signal for analysis as needed. This design is key to achieving step-by-step detection and elimination-based identification, enabling the processing unit to "probe" the type of externally connected sensor within different time windows using the most suitable circuitry.

[0034] To meet the highest level of industrial safety requirements, this invention employs comprehensive redundancy and diagnostic design. The redundant processing unit consists of at least two independent processing cores, such as... Figure 4 The microcontrollers A (MCU_A) and B (MCU_B) shown are physically and electrically isolated, each independently running the same safety logic algorithm. The programmable signal selection unit also employs a redundant signal selection architecture, containing at least two independent signal selection paths controllable by different processing cores. This design ensures that the failure of any single component (whether a processing core or the signal selection unit) will not lead to the loss of the entire safety function. Furthermore, a self-test module is configured to periodically perform functional integrity verification on the programmable signal selection unit during device operation to detect potential faults such as sticking or disconnection. Simultaneously, a cross-comparison diagnostic mechanism enables real-time cross-verification of critical operational data between the two independent processing cores. Upon detecting any inconsistency, the system immediately enters a preset safety state. Through this system-level redundancy, self-test, and cross-diagnostic strategy, even when using non-safety-certified general-purpose components, the overall system safety level is maintained, meeting the requirement of high diagnostic coverage.

[0035] This invention also provides a method for automatic input type identification in a safety relay. The core of this method is the automatic type identification step, which strictly follows a fixed and optimized detection sequence of "contact → PNP → NPN". For example... Figure 3As shown, the sequence is divided into three stages: contact mode detection (T1), PNP mode detection (T2), and NPN mode detection (T3). This sequence is based on a deep understanding of the electrical characteristics of the three types of sensors: contact-type sensors are detected first because they are passive devices, requiring only a weak current excitation during detection, minimizing impact on external circuits, and their impedance characteristics are clear and not easily confused with other types. If active PNP or NPN types were detected first, their output levels might interfere with the impedance detection of passive contacts. After ruling out the possibility of contact-type sensors, PNP and NPN types are detected sequentially. The entire identification process is performed after the device is powered on and the safety output is forcibly blocked, ensuring that the identification process itself does not trigger any dangerous actions.

[0036] Throughout the method's execution, a safety mechanism is implemented. A redundant signal selection architecture ensures that each independent processing core controls a separate signal selection path, achieving redundancy at the control level. Cross-comparison diagnostic steps are continuously executed between the independent processing cores, cross-verifying all critical operational data, including sensor type identification results. Any data inconsistency immediately triggers a safety state, preventing system failure due to calculation errors in a single processing core. Simultaneously, during device operation, a functional integrity self-check is periodically performed on the programmable signal selection unit, ensuring the physical reliability of the signal selection path. Upon successful sensor type identification, the method automatically configures safety logic parameters matching that type, such as the definition of effective voltage levels and fault detection strategies, enabling the safety relay to monitor the connected sensor in an optimized manner.

[0037] Furthermore, to address the potential identification ambiguity arising from relying solely on steady-state voltage levels (for example, when an NPN sensor is inactive, its input is pulled high by an internal pull-up resistor, resulting in a voltage level similar to that of a PNP sensor in its active state), this invention employs a dual-criteria judgment method during the PNP and / or NPN mode detection phase. This method detects the output impedance of the sensor input line by injecting a weak test pulse, and then combines this with a comprehensive judgment based on the steady-state voltage level. Specifically, after detecting a certain steady-state voltage level, the redundant processing unit injects a test pulse with a duration in the microsecond (μs) range and a current in the microampere (μA) range into the input line through a dedicated I / O port. This test pulse is extremely weak and will not interfere with the normal operation of the sensor. By measuring the voltage response of the line after the pulse is injected, the current output impedance of the line can be inferred. Sensors with active output (such as those in the PNP active state) exhibit low impedance characteristics, while the voltage level formed by passive pull-up / pull-down resistors exhibits high impedance characteristics. By using this dual-dimensional criterion of level and impedance, the accuracy of identification can be greatly improved, effectively distinguishing between active output and passive level, thus solving the key technical problem in the identification process.

[0038] In a preferred implementation, during the PNP and / or NPN mode detection phase of the automatic type recognition algorithm, the redundant processing unit is also configured to detect the output impedance of the sensor input line by injecting a test pulse. For example, a test pulse with a duration of 10 μs and a maximum current of 20 μA can be injected. By detecting the response of the line, its output impedance can be calculated. By setting a high impedance threshold (e.g., ≥100kΩ) and a low impedance threshold (e.g., ≤500Ω), active drive states and passive floating or pull-up / pull-down states can be effectively distinguished when the detected impedance falls within different ranges. A dual-criteria judgment is performed using the steady-state level; for example, a high-level signal accompanied by low impedance characteristics can be identified as a PNP active output, while a similar high level accompanied by high impedance characteristics may simply be an inactive state of the NPN sensor. This design significantly improves the accuracy and reliability of the identification.

[0039] To ensure stable and reliable identification results and avoid transient electromagnetic interference common in industrial environments, the automatic type identification algorithm of this invention employs multi-cycle sampling filtering in each detection stage. Specifically, the redundant processing unit continuously samples the input signal at a fixed sampling period, such as 10ms. The algorithm requires that a valid sensor feature is only confirmed as detected when the sampled values ​​for a predetermined number of consecutive times (e.g., 10 times) are consistently within a preset feature threshold range. This strategy is equivalent to adding a time-dimensional confirmation mechanism, effectively filtering out samples with a duration shorter than the total sampling window duration (e.g., 10ms). This scheme mitigates pulse interference or signal jitter (10 = 100ms). It significantly enhances the algorithm's anti-interference capability and robustness, ensuring reliable sensor type identification even in complex industrial environments.

[0040] like Figure 2 As shown, the specific implementation of the three signal conditioning circuits in this invention can be designed as follows. The first signal conditioning circuit 110, i.e., the NPN conditioning branch, has its safety input terminal S11 connected to a +24V power supply through a pull-up resistor R1 (typically 10kΩ), and simultaneously connected to the input terminal of a Schmitt trigger after passing through a current-limiting resistor. This design can clearly convert the low-level active signal output by the NPN sensor into a standard logic level. The second signal conditioning circuit 120, i.e., the PNP conditioning branch, has its safety input terminal S11 connected to a voltage divider resistor network composed of resistors R3 (typically 22kΩ) and R4 (typically 10kΩ) to divide the input voltage, which may be as high as +24V, and safely convert it into a low-voltage logic level that the processing core can handle. The third signal conditioning circuit 130, i.e., the contact conditioning branch, has a constant current source CC1 (typically 5mA output) at its core. This constant current source provides excitation to the external contacts, and a voltage comparator detects changes in the line voltage to determine their on / off state. The outputs of these three conditioning branches are connected to a programmable signal selection unit 140, which can preferably be implemented using a multi-channel analog switch chip (such as 74HC4052) with good isolation and switching speed.

[0041] To provide on-site maintenance personnel with intuitive and clear equipment status information, the safety relay of this invention also includes a status indication unit. After the redundancy processing unit 300 successfully identifies the sensor type, it controls the status indication unit to provide a unique visual indication corresponding to the identified NPN, PNP, or contact operating mode. For example, different colored LEDs can be used to distinguish them: green for NPN mode, yellow for PNP mode, and blue for contact mode. When any fault is detected, such as a broken circuit, short circuit, or identification failure, the status indication unit will display a unique fault indication, such as a flashing red LED. This one-to-one correspondence indication method allows users to quickly understand the operating status and health condition of the equipment without any professional tools, greatly improving the maintainability of the system and the user-friendliness of the human-machine interface.

[0042] To enhance the durability and reliability of the equipment in harsh industrial environments, the safety relay of this invention also includes a hardware protection circuit located at the power input terminal. For example... Figure 5As shown, the hardware protection circuit preferably features a three-level protection design, including reverse connection protection, overvoltage protection, and overcurrent protection. The reverse connection protection circuit is typically implemented using a diode D1 connected in series with the positive terminal of the power supply. It effectively prevents internal circuit burnout caused by reversed power supply polarity. The overvoltage protection circuit can use a transient voltage suppressor diode (overvoltage protection TVS diode D2) connected in parallel with the power input. When a surge or voltage spike occurs in the power grid, the overvoltage protection TVS diode D2 will quickly conduct, clamping the excessive voltage to a safe level, thus protecting the downstream circuitry. The overcurrent protection circuit can use a series-connected overcurrent protection resettable fuse F1. When a short circuit occurs or the load is too large, causing an abnormal increase in current, this fuse will overheat and trip, cutting off the current. Once the fault is cleared and the temperature drops, it will automatically resume conduction. This three-level protection design effectively prevents permanent damage to the relay itself caused by incorrect field wiring or power grid fluctuations.

[0043] Reference Figure 3 The algorithm first enters the contact mode detection stage T1. The redundancy processing unit 300 controls the programmable signal selection unit 140 to select the third signal conditioning circuit 130 and applies an excitation signal. Because an NPN sensor is connected instead of a contact, the impedance characteristics of the line are mismatched, and therefore, contact characteristics cannot be identified within a detection window of approximately 100ms, resulting in detection failure at this stage. Next, the algorithm automatically enters the PNP mode detection stage T2, where the redundancy processing unit 300 controls the programmable signal selection unit 140 to switch to the second signal conditioning circuit 120. Similarly, due to sensor type mismatch, a stable PNP level characteristic cannot be detected, and detection at this stage also fails. Finally, the algorithm enters the NPN mode detection stage T3, where the redundancy processing unit 300 controls the programmable signal selection unit 140 to switch to the first signal conditioning circuit 110. At this point, through this conditioning circuit, the redundancy processing unit 300 can detect stable NPN signal characteristics. After confirming the stability of this characteristic for several consecutive sampling cycles, the redundancy processing unit 300 locks the identification result as "NPN mode".

[0044] After mode locking, the redundancy processing unit 300 automatically loads the safety logic parameters specifically configured for NPN mode from its internal memory. For example, it defines the effective safety state as a low input level and sets corresponding fault detection strategies, such as monitoring whether an open circuit or a short circuit to the +24V power supply occurs. Simultaneously, the status indicator unit is driven to illuminate the green indicator light representing NPN mode. After all parameters are configured and the input signal is in a safe state, the redundancy processing unit 300 drives the two safety output relays (forced-guided relays K1 and K2) to close, thereby releasing the safety output and allowing the safety relays to enter normal operation and monitoring status. Throughout the identification and operation process, the two processing cores continuously compare each other's status information and detection results through a cross-comparison diagnostic mechanism and periodically check the integrity of the hardware using a self-test module, ensuring the high safety and reliability of the system.

[0045] In one application scenario of this embodiment, a dual-channel safety relay is used. One safety input channel is used to connect to an NPN-type output safety light curtain, while the other safety input channel is used to connect to a PNP-type output emergency stop button. This mixed-access scenario is difficult to handle in traditional solutions, but it is perfectly compatible with this invention.

[0046] Once the safety relay is powered on, the identification algorithms for the two channels will execute in parallel and independently. For channel one, its redundant processing unit will perform detection in the order of "contact → PNP → NPN," ultimately successfully identifying the characteristics of the NPN type safety light curtain in the third stage and locking the operating mode of channel one to NPN mode. Simultaneously, for channel two, its redundant processing unit will also execute the identification process, successfully identifying the characteristics of the PNP type emergency stop button in the second stage and locking the operating mode of channel two to PNP mode. The entire process is fully automatic, taking no more than 500ms, and requires no manual intervention.

[0047] After mode locking, the redundant processing unit 300 configures completely different safety logic and fault detection strategies for the two channels. For channel one, which connects to the NPN grating, the processing unit defines its effective safety signal as low and initiates specific fault detection for the NPN circuit, i.e., real-time monitoring for open circuits or short circuits to the +24V power supply. For channel two, which connects to the PNP emergency stop button, the processing unit defines its effective safety signal as high and initiates monitoring for open circuits or short circuits to ground. This adaptive configuration ensures the most effective and comprehensive protection for different types of sensors. The status indicator unit may clearly indicate that the device is currently processing two different types of sensor inputs simultaneously by flashing different colors alternately.

[0048] During normal operation, the two processing cores MCU_A and MCU_B of the redundant processing unit 300 cross-compare and diagnostic mechanism to mutually verify six categories of key operational data, including sensor status, control commands, and self-test results, at a 1ms cycle. Simultaneously, the self-test module performs functional integrity verification on all channels of the programmable signal selection unit 140 at a 1s cycle. If a fault scenario is simulated, such as an accidental short circuit to the power supply on the signal line of channel 1, the fault detection logic in NPN mode will immediately identify this anomaly. The redundant processing unit 300 will immediately block the safety output drive unit 400, cut off power to downstream devices, and provide a clear fault indication through the status indicator unit (e.g., a flashing red LED indicating a channel 1 fault). This complete functional embodiment fully demonstrates how the present invention can simultaneously, independently, and automatically process and monitor signals from different types of safety sensors through a single device, while maintaining the highest level of functional safety throughout the process, showcasing significant technological advancements and immense application value.

[0049] This invention also provides an automatic input type identification method for a safety relay. This method is executed on a safety relay hardware platform to achieve automatic identification and configuration of the connected sensor types. For example... Figure 3 As shown, the method's process design is ingenious, ensuring accuracy, efficiency, and safety in the identification process. After the safety relay is powered on or reset, the method first enters the initialization phase. The most crucial step is to forcibly block the safety output drive unit 400, ensuring that both forced-guide relays K1 and K2 are in the open state. This guarantees that downstream load devices will never be accidentally started during the entire identification process. This safety prerequisite is the foundation for all subsequent operations.

[0050] The identification process of this method is performed in stages and sequentially. The first stage is the contact pattern detection stage T1, which lasts for approximately 100 milliseconds. During this period, the processing unit controls the programmable signal selection unit to switch to the third signal conditioning circuit, on which a constant current source (e.g., 5mA) begins to provide excitation to the external circuit. The processing unit determines the contact pattern by monitoring the voltage characteristics of the safety input terminal S11. If the typical contact characteristics of a low voltage when the circuit is closed and a high resistance state when the circuit is open are detected, the connected sensor is determined to be a contact-type sensor, the mode is immediately locked, and the process jumps to the final configuration step. The contact pattern is prioritized for detection because it is a passive detection method, which can effectively avoid interference from the level of active sensors (PNP / NPN) in the judgment. This is a key strategy for achieving accurate identification.

[0051] If the contact characteristics are not identified in the first stage, the method will automatically enter the second stage, namely the PNP mode detection stage T2, which also lasts for approximately 100 milliseconds. The processing unit will control the programmable signal selection unit to switch to the second signal conditioning circuit. Subsequently, the processing unit will continuously sample the input signal at a fixed sampling period (e.g., 10 ms). If, during this period, a level characteristic corresponding to the steady state of the PNP sensor (e.g., +24V high level in the active state or 0V low level in the inactive state) is detected for N consecutive sampling periods, it is determined to be a PNP type sensor, the mode is locked, and the process jumps to the final configuration step. This continuous multiple sampling design is intended to filter out possible transient interference and ensure the stability of the judgment.

[0052] If the sensor type is not successfully identified in the first two stages, the method proceeds to the third stage, NPN mode detection stage T3, which also lasts approximately 100 milliseconds. The processing unit controls the programmable signal selection unit to switch to the first signal conditioning circuit. Similar to the second stage, the processing unit continuously samples the input signal at a period of 10ms. If a level characteristic corresponding to the steady state of the NPN sensor (e.g., a 0V low-level characteristic in the active state or a high level in the inactive state) is detected for N consecutive cycles, the sensor is identified as an NPN type and the mode is locked. If no valid sensor type is identified after all three detection stages, the system will determine a fault state, such as sensor not connected, open or short circuit, or sensor damage. In this case, the safety output will remain blocked, and a fault alarm will be issued via the mode indicator and alarm unit 500, for example, by flashing a red LED.

[0053] Once the sensor type is successfully identified, the method enters the automatic configuration and operation phase. The processing unit writes the identified type result (NPN, PNP, or contact) into its internal non-volatile memory, eliminating the need for re-identification even after a power outage and restart, thus speeding up the startup process. Simultaneously, the processing unit drives the mode indicator and alarm unit 500 to display the corresponding status, such as a green light for NPN mode and a yellow light for PNP mode. Crucially, the processing unit automatically loads and configures matching safety logic parameters based on the identified type, such as the definition of active voltage levels (active low for NPN, active high for PNP) and fault detection strategies (e.g., monitoring for open circuits and short circuits to +24V in NPN mode). Only after all parameters are configured will the method release the blockade on the safety output, allowing the safety relay to enter normal safety monitoring operation. Throughout the entire method execution, redundancy selection, periodic self-testing, and cross-diagnostics, among other safety mechanisms, operate in parallel, providing a high level of safety assurance at every step of the method.

[0054] The above solution will be described below with reference to a specific embodiment. This embodiment describes a basic safety relay whose hardware configuration includes a safety input channel. The front end of this channel integrates a three-mode universal input front-end circuit 100, which internally contains functionally independent first signal conditioning circuits, second signal conditioning circuits, and third signal conditioning circuits. The subsequent stage connects to a redundant control system consisting of two independent analog switch chips and two independent microcontrollers, MCU_A and MCU_B. This system simultaneously implements the functions of a programmable signal selection unit, a processing unit, a self-test module, and a cross-comparison diagnostic mechanism.

[0055] When the safety relay is powered on, its safety output drive unit 400 remains in a blocked state, ensuring that the externally connected load device is in a safe stopped state. At this time, the two microcontrollers, MCU_A and MCU_B, work together to begin executing the automatic type recognition algorithm in parallel. According to the preset fixed sequence of "contact → PNP → NPN", the two microcontrollers first simultaneously command the analog switches they control to switch to the path connected to the third signal conditioning circuit. This circuit applies a weak constant current source excitation to the input terminal and detects the impedance characteristics of the line.

[0056] During algorithm execution, if the microcontroller does not detect an impedance change characteristic matching that of a contact-type sensor within a preset 100ms detection window, it determines that the currently connected sensor is not a contact-type sensor. Subsequently, both microcontrollers simultaneously command their analog switches to switch to the path connecting to the second signal conditioning circuit, entering the PNP mode detection phase. During this phase, they continuously sample the input level. If a stable PNP level characteristic is still not detected during this phase, they will switch back to the path connecting to the first signal conditioning circuit, entering the NPN mode detection phase.

[0057] In this embodiment, assuming an NPN type security sensor is connected to the security input channel, when the algorithm reaches the third stage (NPN mode detection), the microcontroller will detect a stable NPN signal characteristic (e.g., the input is pulled to 0V when the sensor is activated) through the first signal conditioning circuit. After confirming the stability of this characteristic for several consecutive sampling cycles, the two microcontrollers, MCU_A and MCU_B, will simultaneously lock the identification result as "NPN mode".

[0058] After mode locking, the two microcontrollers load safety logic parameters specifically configured for NPN mode from their internal memory. For example, they define a valid safety state as a low input level and set corresponding fault detection strategies, such as monitoring for open circuits or short circuits to the +24V power supply. Once the parameters are configured, if the input signal is in a safe state, the two microcontrollers will drive the two safety output relays (forced-guided relays K1 and K2) to close, releasing the safety output and allowing the safety relays to enter normal operation monitoring. Throughout the identification and operation process, the two microcontrollers continuously compare each other's control commands, status information, and detection results through a cross-comparison diagnostic mechanism, and periodically check the functionality of the analog switches using a self-test module. Any inconsistency or detected hardware fault will immediately cause the safety output to be blocked and trigger an alarm, thus ensuring the system's high safety and reliability.

[0059] Based on the above embodiments, this embodiment further specifies some circuit and algorithm details. For example... Figure 2 As shown, the specific implementation of the three-mode universal input front-end circuit 100 can be designed as follows. The first signal conditioning circuit 110, i.e., the NPN conditioning branch, has its safety input terminal S11 connected to a +24V power supply via a pull-up resistor R1 (typically 10kΩ), and simultaneously connected to the input of a Schmitt trigger U1 (e.g., 74HC14) via a current-limiting resistor R2 (typically 1kΩ). When an external NPN sensor is activated, pulling the safety input terminal S11 low to 0V, the input level of U1 is below its low threshold (e.g., 0.8V), and the output is high. When the sensor is not activated, the safety input terminal S11 is pulled up by R1, the input level of U1 is above its high threshold (e.g., 2.0V), and the output is low. This design can clearly convert NPN signals to standard logic levels.

[0060] The second signal conditioning circuit 120, the PNP conditioning branch, uses a voltage divider network consisting of resistors R3 (typically 22kΩ) and R4 (typically 10kΩ) to divide an input voltage that can be as high as +24V. The midpoint of the voltage divider is connected to the input of another Schmitt trigger U2. When an external PNP sensor activates and outputs +24V, the voltage after the divider is much higher than the high threshold of U2, causing it to output a high level; when the sensor outputs 0V, the voltage at the voltage divider point is close to 0V, and U2 outputs a low level. This design safely converts the industrial 24V level to a low-voltage logic level that can be processed by the microcontroller. The third signal conditioning circuit 130, the contact conditioning branch, is centered on a constant current source CC1 (typically 5mA output). This constant current source provides excitation to the external contacts through the safety input S11. A comparator U3 is used to detect the change in line voltage before and after the contacts are closed, thereby determining their on / off state. The outputs of these three conditioning branches are connected to the programmable signal selection unit 140, which is a multi-channel analog switch matrix. This unit can preferably be implemented using the 74HC4052 chip, which has good isolation and switching speed.

[0061] This embodiment further elaborates on the implementation of the dual-criteria method. When performing PNP or NPN mode detection, to address the potential identification ambiguity caused by relying solely on steady-state voltage levels (for example, when an NPN sensor is inactive, its input is pulled high by an internal pull-up resistor, resulting in a voltage level similar to that of a PNP sensor in its active state), this invention employs a dual-criteria method combining steady-state voltage level and line impedance. Specifically, after detecting a certain steady-state voltage level, the processing unit injects an extremely weak and brief test pulse into the input line through a dedicated I / O port. The duration of this test pulse is on the order of microseconds (μs), and the current is on the order of microamps (μA), thus causing no interference to the normal operation of the sensor. By measuring the line voltage response after the pulse is injected, the processing unit can infer the current line's output impedance. Active output sensors (such as those in the PNP active state) exhibit low impedance characteristics, while the voltage level formed by passive pull-up / pull-down resistors exhibits high impedance characteristics. By using this dual-dimensional criterion of level and impedance, the accuracy of identification can be greatly improved, effectively distinguishing between active output and passive level, thus solving the key technical problem in the identification process.

[0062] Furthermore, this embodiment explicitly defines the sampling parameters in the algorithm. In each detection stage of the automatic type recognition algorithm, the signal sampling period of the processing unit is set to 10ms. To ensure the stability and reliability of the recognition results and avoid transient electromagnetic interference common in industrial environments, the algorithm requires that a valid sensor feature is detected only when the sample values ​​of 10 consecutive samples (or other preset number, such as 5-10 samples) are all stable within the preset feature threshold range. This multi-period sampling and filtering strategy is equivalent to adding a time-dimensional confirmation mechanism, greatly enhancing the algorithm's anti-interference capability and robustness, ensuring reliable sensor type recognition even in complex industrial environments.

[0063] To more comprehensively demonstrate the technical effects of the present invention, a fully functional embodiment is described below. The safety relay in this embodiment possesses all the aforementioned hardware and software features, including three specific signal conditioning circuits, a complete redundancy and diagnostic system composed of two 74HC4052 chips and two independent microcontrollers, and as... Figure 5 The diagram shows a three-level hardware protection circuit. This circuit consists of a reverse polarity protection diode D1 connected in series at the power input, an overvoltage protection TVS diode D2 connected in parallel, and an overcurrent protection resettable fuse F1 connected in series, ensuring the safety of the device in the event of wiring errors or power abnormalities. Additionally, the device is equipped with a status indicator unit that displays different operating states via dual-color LEDs.

[0064] In a specific application scenario of this embodiment, the safety relay is provided with two completely independent input channels. For example, safety input channel one is used to connect to an NPN type output safety light curtain, while safety input channel two is used to connect to a PNP type output emergency stop button.

[0065] Once the safety relay is powered on, the identification algorithms for the two channels will execute in parallel and independently. For channel one, its processing unit will perform detection in the order of "contact → PNP → NPN," ultimately successfully identifying the characteristics of the NPN type safety light curtain in the third stage and locking the operating mode of channel one to NPN mode. For channel two, its processing unit will perform the same identification process, successfully identifying the characteristics of the PNP type emergency stop button in the second stage and locking the operating mode of channel two to PNP mode. The entire process is fully automatic and requires no manual intervention.

[0066] After mode locking, the processing unit configures different safety logic and fault detection strategies for the two channels. For channel one, which connects to the NPN grating, the processing unit defines its effective safety signal as low and initiates specific fault detection for the NPN circuit, i.e., real-time monitoring for open circuits or short circuits to the +24V power supply. For channel two, which connects to the PNP emergency stop button, the processing unit defines its effective safety signal as high and initiates monitoring for open circuits or short circuits to ground. This adaptive configuration ensures the most effective and comprehensive protection for different types of sensors.

[0067] Meanwhile, to provide on-site personnel with intuitive equipment status information, the status indicator unit will display a specific combination of lights based on the recognition results. For example, in NPN mode, the LED may be solid green; in PNP mode, it may be solid yellow. In the mixed mode of this embodiment, the LED may clearly indicate that the device is currently processing two different types of sensor inputs simultaneously by flashing green and yellow alternately. When a wiring error occurs, such as reverse power connection, the three-level hardware protection circuit will activate. The reverse connection protection diode D1 prevents reverse current from damaging the internal circuitry, ensuring the robustness of the device itself.

[0068] This complete functional embodiment fully demonstrates how the present invention can simultaneously, independently, and automatically process and monitor signals from different types of safety sensors using a single device, while maintaining the highest level of functional safety throughout the process. This solution not only completely eliminates the fragmentation problem caused by different sensor types, but also greatly simplifies the complexity of system integration and field maintenance, reduces safety risks caused by manual selection or incorrect settings, and demonstrates significant technological advancements and immense application value.

[0069] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0070] To better understand the application of this invention, several specific application scenarios will be described below in conjunction with the accompanying drawings.

[0071] In an application scenario, such as Figure 6 As shown, an NPN-type output safety light curtain is connected to an input channel of a safety relay. Upon power-up, the device automatically executes the power-on automatic type recognition algorithm. Due to the characteristics of the NPN sensor, the algorithm fails in both the first stage (contact detection) and the second stage (PNP detection), but successfully identifies the sensor in the third stage (NPN detection). After successful identification, the processor locks the mode to NPN and controls the mode indicator and the LED display of the alarm unit 500 to be constantly lit green. The device then enters normal safety monitoring mode.

[0072] In another application scenario, such as Figure 7 As shown, a PNP-type output emergency stop button is connected to the input channel of a safety relay. Upon power-up, the automatic power-on type recognition algorithm is activated. If the first stage (contact detection) fails, it enters the second stage (PNP detection). Using a dual criterion of steady-state level and injected test pulse detection line impedance, the system accurately identifies the low-impedance active output characteristics of the PNP sensor. Upon successful identification, the mode is locked to PNP, the LED displays a solid yellow light, and the device immediately begins monitoring the status of the emergency stop button.

[0073] In yet another application scenario, such as Figure 8 As shown, a safety door lock with passive contacts is connected to the input channel of a safety relay. Upon power-up, the automatic type recognition algorithm detects a clear change in line impedance as the door lock opens and closes during the first stage (contact detection) via constant current source excitation. Therefore, the system immediately locks the mode to passive contact type and controls the LED to flash green slowly (e.g., 1Hz), indicating that the device has entered contact monitoring mode.

[0074] The safety relay of this invention also supports connecting different types of sensors to different input channels, enabling mixed applications. For example, a safety relay has two independent input channels, one connected to an NPN-type safety light curtain and the other connected to a PNP-type emergency stop button. After the device is powered on, the processor of each channel independently executes a power-on automatic type recognition algorithm for its connected sensor. Ultimately, channel one is identified as NPN mode, and channel two is identified as PNP mode. In this mixed mode, the processor can control the LED to flash in a special way, such as alternating green and yellow, to inform the user that the device is operating in mixed input mode. This flexibility greatly expands the applicability of the device.

[0075] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A safety relay capable of automatically identifying input type, comprising a power input terminal, characterized in that, The safety relay also includes: The first signal conditioning circuit is configured to convert a low-level active signal compatible with an NPN sensor into a standard logic level signal. The second signal conditioning circuit is configured to convert a high-level active signal compatible with a PNP type sensor into a standard logic level signal. The third signal conditioning circuit is configured to apply an excitation signal to the sensor input line and determine its on / off state based on the impedance characteristics of the line in order to process contact type sensors. A programmable signal selection unit, the input of which is connected to the output of the first signal conditioning circuit, the second signal conditioning circuit and the third signal conditioning circuit respectively; A redundant processing unit, comprising at least two independent processing cores; A redundant signal selection architecture includes at least two independent signal selection paths, each controlled by an independent processing core. The programmable signal selection unit is part of the redundant signal selection architecture and is configured to selectively feed one of its output signals to the processing core according to the control instructions of the processing core. A cross-compare diagnostic mechanism is configured to cross-verify operational data between independent processing cores, wherein inconsistencies in the operational data will trigger a security state. The self-test module is configured to periodically verify the functional integrity of the programmable signal selection unit during device operation. The redundancy processing unit is configured to execute an automatic type recognition algorithm that follows the sequence of "contact → PNP → NPN". The algorithm controls the programmable signal selection unit to switch and detect line characteristics in stages to lock the sensor type. Furthermore, the redundancy processing unit is also configured to automatically configure security logic parameters that match the sensor type after successfully identifying it.

2. The safety relay according to claim 1, characterized in that, When the redundant processing unit performs the PNP and / or NPN mode detection phase of the automatic type recognition algorithm, it is also configured to detect the output impedance of the sensor input line by injecting test pulses into the sensor input line, and to make a dual-criteria judgment in combination with the steady-state level to determine the sensor type.

3. The safety relay according to claim 2, characterized in that, The redundant processing unit employs multi-cycle sampling filtering at each detection stage of the automatic type recognition algorithm, and confirms the detection result only after the sampled values ​​have stabilized for a predetermined number of consecutive times.

4. The safety relay according to claim 1, characterized in that, The first signal conditioning circuit mainly consists of pull-up resistors and Schmitt triggers; the second signal conditioning circuit mainly consists of a voltage divider resistor network and Schmitt triggers; and the third signal conditioning circuit mainly consists of a constant current source excitation circuit and a voltage comparator.

5. The safety relay according to claim 1, characterized in that, It also includes a status indication unit, which, after successfully identifying the sensor type, controls the status indication unit to provide a unique visual indication corresponding to the identified NPN, PNP or contact operating mode.

6. The safety relay according to claim 1, characterized in that, It also includes a hardware protection circuit located at the power input terminal, which includes a reverse connection protection circuit, an overvoltage protection circuit, and an overcurrent protection circuit.

7. A method for automatic input type identification in a safety relay, characterized in that, The safety relay to which this method is applied has parallel signal conditioning circuitry for processing NPN, PNP, and contact-type sensors, and a redundant processing unit consisting of at least two independent processing cores. The method includes: the redundant processing unit performing an automatic power-on type identification step, which follows the sequence "contact → PNP → NPN," selecting different signal conditioning circuits stage by stage by controlling a programmable signal selection unit, and detecting the electrical characteristics of the sensor input lines to determine the type of the connected sensor; in the automatic type identification step, each independent processing core independently controls a signal selection path through a redundant signal selection architecture; a cross-comparison diagnostic step is performed between the independent processing cores of the redundant processing unit to mutually verify the operational data, including the sensor type identification result, and triggering a safety state when data inconsistency is detected; during device operation, a functional integrity self-test step is periodically performed on the programmable signal selection unit; after successfully identifying the sensor type, safety logic parameters matching the identified type are automatically configured.

8. The method according to claim 7, characterized in that, In the automatic type identification step, when detecting PNP and / or NPN modes, the method further includes: injecting a test pulse into the sensor input line; detecting the change in line output impedance caused by the test pulse; and determining the sensor type using a dual-criteria approach by combining the steady-state level of the line with the change in output impedance.

9. The method according to claim 8, characterized in that, In each detection stage of the automatic type identification step, the electrical characteristics of the line are sampled multiple times, and the detection result of that stage is confirmed only after the sampled values ​​have stabilized for a predetermined number of consecutive times.

10. The method according to claim 7, characterized in that, The method further includes: after successfully identifying the sensor type, providing a unique visual indication corresponding to the identified NPN, PNP or contact operating mode through a status indication unit.