Terminal device automatic identification and terminal resistor automatic access method and device

By combining an MCU and a current sampling unit, the automatic identification of terminal devices and the automatic connection of terminating resistors are realized, which solves the problems of cumbersome and costly installation of terminating resistors, and ensures the normal operation of the system and automatic restoration of communication when the cable is disconnected.

CN121233503APending Publication Date: 2025-12-30TIANDI CHANGZHOU AUTOMATION +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511190609.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

The installation of terminating resistors in existing technologies is cumbersome and prone to errors, and existing automatic connection methods require additional connection cables, resulting in high costs and construction difficulties.

Method used

It adopts a combination of MCU, terminating resistor circuit and current sampling unit, and automatically identifies terminal devices and connects them to terminating resistor through current sampling technology. It is suitable for CAN bus and RS485 bus, and realizes distributed decision-making and automatic access.

Benefits of technology

It enables automatic identification of terminal devices and automatic connection of terminating resistors, avoiding the inefficiency and unreliability of manual installation. It can automatically identify and connect terminating resistors during system installation and when cables are disconnected, ensuring normal system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233503A_ABST
    Figure CN121233503A_ABST
Patent Text Reader

Abstract

The invention relates to a terminal device automatic identification and terminal resistor automatic access method and device, the device is arranged at each node of a bus, the device comprises an MCU, a terminal resistor circuit and a current sampling unit, the terminal resistor circuit comprises a switch circuit and a terminal resistor, the terminal resistor circuit and the MCU are accessed to the bus, and the current sampling unit is connected with the MCU. The terminal resistance circuit and the current sampling unit are both in communication connection with the MCU, the current sampling unit is connected to the rear end, relative to a power supply, of the MCU, the current sampling unit is used for high-end current sampling and obtaining the total current of a rear-stage hitching device of a node where the current sampling unit is located, and the MCU controls on-off of a switching circuit in the terminal resistance circuit according to total current data obtained by the current sampling unit. The method comprises the step of performing current sampling through the current sampling unit according to communication conditions. The system is suitable for buses such as a CAN bus and an RS485 bus, the terminal resistor can be automatically connected when the system is installed, the terminal equipment can be timely identified and the terminal resistor can be input when the cable is broken, and the normal operation of the system is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial communication and intelligent device technology, and in particular to a method and apparatus for automatic identification of terminal devices and automatic connection of terminal resistors. Background Technology

[0002] In industrial communication systems, bus technologies such as CAN and RS485 are widely used for data transmission between devices such as sensors, actuators, and controllers. To ensure signal integrity, terminating resistors must be configured at both ends of the bus physical topology to match the characteristic impedance of the transmission line and eliminate signal reflections.

[0003] Currently, terminating resistors are mostly installed manually during system installation by setting DIP switches, jumpers, or adding external resistors on the terminal equipment. This manual method is cumbersome, inconvenient, inefficient, and prone to errors. Existing automatic terminating resistor connection methods are mainly based on the connectors between nodes, using mechanical or electrical means to determine whether it is a terminal device. If it is a terminal device, the terminating resistor is automatically connected via a relay or physical switch.

[0004] Chinese patent application CN118573499A discloses a device and method for automatic identification of terminal equipment and automatic connection of terminal resistors. It determines whether a node is a terminal node by periodically reading the voltage level at the input terminal and controls the opening and closing of a switching circuit. This method requires additional connecting cables between nodes and then reading the voltage, which poses difficulties for cost control and engineering construction. Summary of the Invention

[0005] The technical problem to be solved by the present invention is: In order to overcome the above-mentioned technical problems, the present invention provides a method and apparatus for automatic identification of terminal devices and automatic connection of terminal resistors. Based on current sampling technology, the method and apparatus realize automatic identification of terminal devices and automatic connection of terminal resistors. It is applicable to communication networks such as CAN bus and RS485 bus. It can automatically connect the terminal resistor during system installation and automatically identify the terminal device and connect the terminal resistor when the system encounters problems such as cable disconnection.

[0006] The technical solution adopted by this invention to solve its technical problem is: an automatic terminal device identification and automatic terminal resistor connection device, which is set at each node of the bus. The automatic terminal device identification and automatic terminal resistor connection device includes an MCU (Microcontroller Unit), a terminal resistor circuit, and a current sampling unit. The terminal resistor circuit includes a switching circuit and a terminal resistor. The switching circuit and the terminal resistor are connected in series and then connected to the bus. The MCU is connected to the bus. The terminal resistor circuit and the current sampling unit are both communicatively connected to the MCU. The MCU is connected to a power supply. The current sampling unit is connected to the back end of the MCU relative to the power supply. The current sampling unit is used for high-side current sampling to obtain the total current of the downstream connected devices at its node. The MCU controls the switching circuit in the terminal resistor circuit to open and close based on the total current data obtained by the current sampling unit.

[0007] A controller is connected to the bus, and the node containing the controller is connected to a terminating resistor. That is, the terminating resistor is applied to the node closest to the machine head or power supply. Terminating resistors are generally required at both ends. The node closest to the machine head or power supply is often the controller. Typically, there is only one controller on a bus, and the controller's terminating resistor is usually applied by default. This invention is used to determine which of the numerous sensors and actuators connected to the bus is the terminating device and to automatically connect the terminating resistor.

[0008] When the total current obtained by the current sampling unit is 0, the MCU controls the switching circuit to turn on; when the total current obtained by the current sampling unit is greater than 0, the MCU controls the switching circuit to turn off. The current sampling unit is connected to the MCU's downstream end relative to the power supply. When the node where the current sampling unit is located is a terminal device, the downstream stage is open-circuited, so the current is an absolute zero value. Even if there is a disturbance, the current sampling unit generally has a filter circuit, which filters out the disturbance, and the current value obtained by the MCU is still 0.

[0009] The current sampling unit is used for high-end current sampling to obtain the total current of the devices connected to its node. All nodes are connected to the power supply and share the same power supply. The current sampling unit includes a resistor connected in series with the positive terminal of the power supply. The MCU calculates the total current data by obtaining the voltage across the resistor.

[0010] Preferably, the current sampling unit further includes a current sampling chip, which collects the voltage across the resistor. The MCU collects the voltage through an analog-to-digital converter and then calculates the current value. Of course, discrete components can also be used to build the sampling circuit.

[0011] Preferably, the current sampling chip is an INA282 chip.

[0012] The present invention provides a method for automatic identification of terminal devices and automatic connection of terminal resistors, employing the device described in the present invention, and includes the following steps:

[0013] Step 1: Connect each node equipped with the aforementioned automatic terminal device identification and automatic terminal resistor connection device to the bus;

[0014] Step 2: Perform current sampling through the current sampling unit according to the communication status. The communication status generally refers to whether current sampling is performed based on whether the communication is normal. If the communication is abnormal or fails, current sampling can be started to determine the latest terminal device, automatically identify the terminal device and connect the terminating resistor to restore communication. Current sampling can also be performed according to actual communication needs. For example, in scenarios such as dynamic node changes, special time period protection, and fault prediction, current sampling can be used to determine the terminal device and decide whether to connect the terminating resistor to ensure communication quality.

[0015] Step 3: If the current value sampled in Step 2 is 0, then determine that the node where the current sampling unit is located is a terminal device, and control the switch to connect the terminal resistor; if the current value sampled in Step 2 is greater than 0, then control the switch to disconnect the terminal resistor.

[0016] If the bus does not receive correct data for a period of time, current sampling begins. Current sampling is not performed during normal bus communication. A period without receiving correct data indicates a terminal device malfunction or cable breakage leading to communication failure. Current sampling then begins to identify the latest terminal device, automatically recognizing it as the terminal and connecting a terminating resistor to restore communication. During normal communication, data frames are typically received, each with a start and end point. If only intermittent data is received instead of complete frames, or if the received data frame verification fails, it indicates erroneous data. If normal communication is impossible for an extended period, indicating a problem, current sampling begins.

[0017] After power-on, the current sampling unit performs a current sample once, and then adjusts the sampling frequency of the current sampling unit according to the data communication status. In this way, after the system is installed and powered on, it can automatically identify the terminal device and connect the terminating resistor for normal communication. Adjusting the sampling frequency based on the data communication status means determining whether current sampling is performed based on whether the system is in normal communication: if the system can receive correct data frames during normal communication, current sampling is not required; if correct data frames are not received within a certain period, current sampling is performed. During this sampling period, the current sampling period can be determined according to actual needs; for example, sampling can be performed every 10 seconds or every 1 second.

[0018] The beneficial effects of this invention are that the automatic identification of terminal devices and automatic connection of terminating resistors are applicable to various buses that require terminating resistor matching, such as CAN and RS485 buses. Each node is equipped with an MCU, a terminating resistor circuit, and a current sampling unit. The current sampling unit is connected to the back end of the MCU relative to the power supply and is used for high-side current sampling to obtain the total current of the downstream connected devices of its node. The current sampling unit is integrated into each node, rather than being centrally detected, to achieve distributed decision-making. Based on the location of the current sampling unit, a single machine can determine whether it is a terminal device. Without adding connecting cables, automatic identification of terminal devices and automatic connection of terminating resistors are achieved, avoiding the inefficiency and unreliability of manual installation. It can automatically connect terminating resistors during system installation and promptly identify terminal devices and connect terminating resistors when encountering problems such as cable disconnection, ensuring the normal operation of the system. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the automatic identification of terminal devices and automatic connection of terminal resistors of the present invention connecting to various nodes on the bus.

[0020] Figure 2 This is a schematic diagram of the terminal resistor circuit connected to the bus in the automatic identification of terminal devices and automatic connection of terminal resistors of the present invention.

[0021] Figure 3 This is a schematic diagram of the current sampling chip used in the current sampling circuit of the automatic terminal device identification and automatic terminal resistor connection method and device of the present invention. Detailed Implementation

[0022] The invention will now be described in further detail with reference to the accompanying drawings. It should be emphasized that the following description is merely exemplary and not intended to limit the scope or application of the invention.

[0023] Example 1

[0024] like Figure 1 As shown, the present invention discloses an automatic terminal device identification and automatic terminal resistor connection device, which is installed at each node of the bus. The device includes an MCU, a terminal resistor circuit, and a current sampling unit. The terminal resistor circuit includes a switching circuit and a terminal resistor, which are connected in series to the bus. The MCU is connected to the bus. The terminal resistor circuit and the current sampling unit are both communicatively connected to the MCU. The MCU is connected to a power supply. The current sampling unit is connected to the back end of the MCU relative to the power supply. The current sampling unit is used for high-side current sampling to obtain the total current of the downstream connected devices at its node. The MCU controls the switching circuit in the terminal resistor circuit to open and close based on the total current data obtained by the current sampling unit.

[0025] A controller is connected to the bus, and the node containing the controller is connected to a terminating resistor. That is, the terminating resistor is applied to the node closest to the machine head or power supply. Terminating resistors are generally required at both ends. The node closest to the machine head or power supply is often the controller. Typically, there is only one controller on a bus, and the controller's terminating resistor is usually applied by default. This invention is used to determine which of the numerous sensors and actuators connected to the bus is the terminating device and to automatically connect the terminating resistor.

[0026] like Figure 2 The diagram shows the connection of the terminating resistor circuit to the bus in the automatic identification of terminal devices and automatic connection of terminating resistors of the present invention. The switching circuit can be implemented in various ways, as long as it enables the connection and disconnection of the terminating resistor to the bus; details are omitted here. When the total current obtained by the current sampling unit is 0, the MCU controls the switching circuit to turn on; when the total current obtained by the current sampling unit is greater than 0, the MCU controls the switching circuit to turn off. The current sampling unit is connected to the MCU's downstream end relative to the power supply. When the node where the current sampling unit is located is a terminal device, the downstream stage is open-circuited, so the current is an absolute zero value. Even with disturbances, the current sampling unit has a filtering circuit that filters out the disturbances, and the current value obtained by the MCU remains 0.

[0027] like Figure 1 , Figure 3 As shown, the current sampling unit is used for high-side current sampling to obtain the total current of the devices connected to its downstream node. Each node is connected between the power supply V+ and V-. The current sampling unit includes a current sampling chip and a resistor R connected in series with the positive terminal V+ of the power supply. The current sampling chip collects the voltage across the resistor R. The MCU collects the voltage across the resistor R through an analog-to-digital converter and calculates the total current data. The current sampling chip can be an INA282 or similar chip. Alternatively, discrete components can be used to build the voltage sampling circuit across the resistor R. Figure 3 The power module shown is the power supply for the MCU and the current sampling chip.

[0028] Example 2

[0029] The present invention provides a method for automatic identification of terminal devices and automatic connection of terminal resistors, employing the device described in the present invention, and includes the following steps:

[0030] Step 1: Connect each node equipped with an automatic terminal device identification and automatic terminal resistor connection device to the bus;

[0031] Step 2: Perform current sampling using the current sampling unit based on the communication status;

[0032] Step 3: If the current value sampled in Step 2 is 0, then determine that the node where the current sampling unit is located is a terminal device, and control the switch to connect the terminal resistor; if the current value sampled in Step 2 is greater than 0, then control the switch to disconnect the terminal resistor.

[0033] A current sample can be taken after the system is installed and powered on. The sampling frequency can then be adjusted based on data communication. If no correct data is received on the bus for a period of time, such as 10 seconds, then current sampling should be performed again. The sampling period of the current sampling unit can be set to 1 second. The sampled value is then used to determine whether it is a terminal device and to connect a terminating resistor. Current sampling is not required during normal bus communication.

[0034] With the above settings, the system will automatically identify the terminal and connect the resistor after installation and power-on, enabling normal communication. If communication fails due to terminal device malfunction or cable disconnection, the newest terminal device will be automatically identified as the terminal device within 11 seconds and connected to the terminal resistor, restoring communication.

[0035] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A terminal device automatic identification and terminal resistance automatic access device, characterized in that, The terminal device automatic identification and terminal resistance automatic access device is arranged at each node of a bus, and comprises an MCU, a terminal resistance circuit and a current sampling unit.

2. The terminal equipment automatic identification and terminal resistance automatic access device according to claim 1, wherein, A controller is connected to the bus, and a terminal resistance is connected to the node where the controller is located.

3. The terminal equipment automatic identification and terminal resistance automatic access device according to claim 1, wherein, When the total current obtained by the current sampling unit is 0, the MCU controls the switch circuit to be connected; when the total current obtained by the current sampling unit is greater than 0, the MCU controls the switch circuit to be disconnected.

4. The terminal equipment automatic identification and terminal resistance automatic access device according to claim 3, wherein, The current sampling unit is provided with a filter circuit.

5. The terminal equipment automatic identification and terminal resistance automatic access device of claim 1, wherein, Each node is connected to a power supply and shares the same power supply, and the current sampling unit comprises a resistance connected in series to the positive electrode of the power supply.

6. The terminal equipment automatic identification and terminal resistance automatic access device according to claim 5, wherein, The current sampling unit further comprises a current sampling chip, which collects the voltage across the resistance, and the MCU collects the voltage through an analog-to-digital converter.

7. The terminal equipment automatic identification and terminal resistance automatic access device according to claim 6, wherein, The current sampling chip is an INA282 chip.

8. A terminal device automatic identification and terminal resistance automatic access method, characterized in that, The terminal device automatic identification and terminal resistance automatic access device comprises the following steps: Step 1: connecting each node provided with the terminal device automatic identification and terminal resistance automatic access device to a bus; Step 2: sampling current through the current sampling unit according to communication conditions; Step 3: if the current value sampled in step 2 is 0, it is determined that the node where the current sampling unit is located is a terminal device, and the switch is controlled to connect the terminal resistance; if the current value sampled in step 2 is greater than 0, the switch is controlled to disconnect the terminal resistance.

9. The method of claim 8, wherein the terminal device automatically identifies and the terminal resistance automatically accesses, and If the bus does not receive correct data within a period of time, current sampling is started, and current sampling is not performed when the bus normally communicates.

10. The method of claim 8, wherein the terminal device automatically identifies and the terminal resistance automatically accesses, and After power-on, the current sampling unit performs current sampling once, and then adjusts the sampling frequency of the current sampling unit according to data communication conditions.

Citation Information

Patent Citations

  • Device and method for automatically identifying terminal equipment and automatically accessing terminal resistor

    CN118573499A