Frequency increasing centerless building block type CAN bus address automatic configuration method
By employing a frequency-incrementing, centerless address auto-configuration method in a modular CAN bus architecture, the node address configuration dependency problem is solved, enabling automatic configuration and flexible master node selection, which is applicable to two-dimensional planar modular CAN bus architectures.
Patent Information
- Application Number
- CN202511588905.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-01-09
AI Technical Summary
In a modular CAN bus architecture, static configuration of node addresses is not applicable, while dynamic configuration requires a fixed master node and consumes communication resources.
The method of automatic address configuration of CAN bus with frequency increment is adopted. By interfacing the CAN bus and input/output pins between adjacent nodes, the address is automatically configured by detecting the node signal frequency, avoiding reliance on external hardware or software support, and expanding the application in a two-dimensional planar modular architecture.
It achieves automatic configuration of node addresses, does not rely on external hardware or software support, does not occupy CAN bus communication resources, and allows for flexible selection of the master node, making it suitable for two-dimensional planar wooden CAN bus architectures.
Smart Images

Figure CN121309548A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of CAN bus communication technology, and in particular relates to a frequency-incrementing, centerless, modular CAN bus address automatic configuration method. Background Technology
[0002] CAN (Controller Area Network) bus communication is one of the most widely used fieldbuses in the world, and is widely used in various fields such as automotive electronics, industrial automation, aerospace and marine, and medical equipment.
[0003] Modular design is a new approach to designing complex systems, and an increasing number of CAN bus applications require nodes to be assembled and spliced in a modular fashion. Taking the active area array of phased array radar as an example, the modular and scalable subarray architecture is a new trend in the development of area arrays.
[0004] The node address of a CAN bus is a unique identifier for each node, ensuring that each node has a unique identity within the CAN bus. A unique node address prevents multiple nodes from using the same identifier, thus avoiding communication conflicts and data corruption on the CAN bus. CAN bus node addresses are generally configured in two ways: statically and dynamically.
[0005] Static configuration involves assigning a fixed address to each node during the design phase of the CAN bus system. This can be achieved by designing a dedicated address configuration circuit on the CAN node's mounting backplane, or by using physical hardware (such as DIP switches, jumpers, and resistor dividers) within each node to set the node address. However, the former relies on external hardware or software support, while the latter can disrupt the consistency of the technical states of each node. Therefore, static node address configuration is not suitable for modular CAN bus architectures.
[0006] Dynamic configuration typically involves the master node dynamically configuring addresses for the remaining slave nodes during system startup using specific algorithms or protocols (such as CANopen, DeviceNet, etc.). The entire address configuration process is managed and controlled by a fixed master node. While distributed address configuration without a master node is currently possible, it often requires the introduction of complex address configuration protocols, resulting in significantly lower system reliability and communication efficiency compared to methods using a fixed master node. Therefore, dynamic node address configuration in modular CAN bus system architectures often necessitates a fixed master node and consumes considerable CAN bus communication resources. Summary of the Invention
[0007] The purpose of this invention is to address the problem that static configuration of node addresses is not suitable for modular CAN bus architecture applications, while dynamic configuration often requires a fixed master node and occupies certain CAN bus communication resources. This invention proposes an automatic node address configuration method suitable for modular CAN bus architecture.
[0008] To achieve the objective of this invention, a frequency-incrementing, centerless, modular CAN bus address automatic configuration method is disclosed, comprising the following steps:
[0009] Step 1: Based on a chain-like modular CAN bus architecture without a central node, each adjacent CAN node is connected by a set of CAN buses and a single input / output pin.
[0010] Step 2: Before the CAN function is activated, all nodes in the chain detect the signal frequency of their input pins, record the frequency value as P, and generate a periodic square wave signal with a frequency of P+M on the output pin to send to the next node. The node address is automatically calculated and configured based on the input pin signal frequency detection value and increment value.
[0011] Step 3: The CAN bus address configuration result of all nodes in the building block chain is fixed. The address of the first node is configured as 0, and the addresses of the remaining nodes are incremented by 1 with the sequence of the building block chain. The address configuration result of each node is determined by the position of the node in the building block chain.
[0012] Step 4: In the CAN configuration program, the input pin signal frequency is detected by cyclic iteration. The P value is based on the latest detection result, and the detection duration is greater than the maximum power-on time among all nodes. The address configuration result is not affected by the node power-on order.
[0013] Step 5: Design the CAN node to be functionally symmetrical after rotating 180 degrees, and extend its application to a two-dimensional planar wooden CAN bus architecture.
[0014] Furthermore, in step 1, a modular CAN bus architecture is constructed, in which the CAN bus is arranged inside each node. After the nodes are assembled, adjacent nodes complete a set of CAN buses and an input / output pin connection to form a chain-like modular structure. All CAN nodes use the same hardware and software, there is no central node, and no fixed master node is set.
[0015] Furthermore, in step 2, the master control unit of all CAN nodes executes the CAN configuration program before the CAN function module runs. The CAN configuration program detects the signal frequency of the input pin of the node, records the frequency value as P, and then generates a periodic square wave signal with a frequency of P+M on the output pin and sends it to the next node. The CAN configuration program configures the address of the node as the ratio of P to M, that is, the configured node address = P / M.
[0016] Furthermore, in step 3, each node automatically calculates and configures its CAN bus address based on the M value and the detected P value. The output pin frequency of adjacent nodes in the block chain increases by M. The input pin of the first node has no signal input and is at a DC level. The detected P value is 0, and the address configuration result is 0. The addresses automatically configured by all nodes are eventually adjusted to increase by 1 with the block chain sequence. The address configuration result is ultimately determined by the position of the node in the block chain, without relying on external hardware or software support, without relying on hardware or software differences between nodes, and without occupying CAN bus communication resources.
[0017] Furthermore, in step 4, after the main control unit is powered on, the CAN configuration program detects the frequency value of the input pin signal, denoted as P. The frequency detection adopts a cyclic iterative detection method, and the P value is based on the latest detection result. It also ensures that the duration of frequency detection is greater than the maximum power-on time among all nodes. That is, after the last node is powered on, the remaining nodes are still executing the frequency detection program, obtaining the latest P value, and adjusting the address configuration result, so that the address configuration result of all nodes is not affected by the power-on order of the nodes.
[0018] Furthermore, after completing the signal frequency detection of the input pin, the CAN configuration program generates a periodic square wave signal with a frequency of P+M on the output pin, and then configures the address of this node as the ratio of P to M; where M is a fixed value, and the value of M is set based on the system's operating clock; after the address is configured, the CAN configuration program selects to configure the node with address x as the master node, and then determines whether this node is the master node. If it is, the CAN function module executes the master node CAN function program; otherwise, the CAN function module executes the slave node CAN function program. The value of x is preset, and by adjusting the value of x, the position of the master node in the modular CAN bus architecture can be flexibly adjusted.
[0019] Furthermore, each node is designed to be rotationally symmetrical, meaning that the function of each node remains unchanged after a 180-degree rotation. In the two-dimensional planar wood-based architecture, each CAN node in the next row is rotated 180 degrees and then spliced together with the CAN node in the previous row. Only one set of signal connection cables between the nodes is set between the two rows, so that the entire two-dimensional planar wood-based architecture is essentially still a set of building blocks. After rotation and splicing, this automatic node address configuration method can be easily extended to the two-dimensional planar wood-based CAN bus architecture.
[0020] Compared with the prior art, the significant progress of the present invention is that the present invention can realize the automatic configuration of node addresses in the modular CAN bus architecture. The address configuration result does not depend on external hardware or software support, does not depend on hardware or software differences between nodes, does not occupy CAN bus communication resources, does not require a fixed master node, and the master node can be flexibly selected and set by the CAN configuration program. Furthermore, the present invention can be easily extended to a two-dimensional planar modular CAN bus architecture.
[0021] To more clearly illustrate the functional characteristics and structural parameters of the present invention, further explanation is provided below in conjunction with the accompanying drawings and specific embodiments. Attached Figure Description
[0022] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0023] Figure 1 This is a block diagram illustrating the internal workings of a single node in the modular CAN bus architecture described in this embodiment of the invention.
[0024] Figure 2 This is a schematic diagram of the automatic node address configuration method of the modular CAN bus architecture described in an embodiment of the present invention;
[0025] Figure 3 This is a flowchart of the CAN configuration procedure according to an embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of the address configuration method described in this embodiment of the invention applied to a two-dimensional planar wooden CAN bus architecture. Detailed Implementation
[0027] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] Figure 1 and Figure 2 This is a schematic diagram of the automatic node address configuration method of the modular CAN bus architecture described in this embodiment of the invention. In addition to the internal CAN function module, each CAN node's master control unit has an additional input pin and an output pin. The CAN bus is arranged inside each node. After the nodes are assembled, adjacent nodes connect a set of CAN buses and a single input / output pin, forming a chain-like modular structure.
[0029] Before the CAN function module runs, the master control unit of each node executes the CAN configuration program. The CAN configuration program cyclically detects the signal frequency of the input pins of this node, records the frequency value as P, and then generates a periodic square wave signal with a frequency of P+M on the output pin and sends it to the next node. The CAN configuration program configures the address of this node as the ratio of P to M, that is:
[0030]
[0031] Each node automatically calculates and configures its CAN bus address based on the M value and the detected P value. The output pin frequencies of adjacent nodes in the chain increase by M. The input pin of the first node has no signal input; the pin signal is at a DC level, meaning the calculated P value for the first node is 0, and therefore its address is configured as 0. Since the calculated P value for the first node is always 0, subsequent nodes calculate their P values based on the output signal of the previous node. The P values of adjacent nodes differ by M, so the automatically configured addresses of all nodes will eventually be adjusted to increment by 1 with the chain sequence. The final address configuration is determined by the node's position in the chain.
[0032] Figure 3 This is a flowchart of the CAN configuration program according to an embodiment of the present invention. After the main control unit powers on, the CAN configuration program detects the frequency value of the input pin signal, denoted as P. The frequency detection adopts a cyclic iterative detection method, and the latest detection result is used as the P value. It is ensured that the duration of frequency detection is greater than the maximum power-on time of all nodes. That is, after the last node powers on, the remaining nodes are still executing the frequency detection program, obtaining the latest P value, and adjusting the address configuration result, so that the address configuration result of all nodes is not affected by the power-on order of the nodes.
[0033] After completing the signal frequency detection of the input pin, the CAN configuration program generates a periodic square wave signal with a frequency of P+M on the output pin, and then configures the address of this node as the ratio of P to M. Here, M is a fixed value that can be set appropriately according to the system's operating clock. After the address is configured, the CAN configuration program can choose to configure the node with address x as the master node, and then determine whether this node is the master node. If it is, the CAN function module executes the master node CAN function program; otherwise, the CAN function module executes the slave node CAN function program. The value of x is preset, and by adjusting the value of x, the position of the master node in the modular CAN bus architecture can be flexibly adjusted.
[0034] Figure 4 This diagram illustrates the application of the address configuration method described in this invention to a two-dimensional modular CAN bus architecture. To extend this automatic node address configuration method to a two-dimensional planar modular CAN bus architecture, each node can be designed as rotationally symmetrical, meaning that the function of each node remains unchanged after a 180-degree rotation. In the two-dimensional planar modular architecture, each CAN node in the next row is rotated 180 degrees and then joined to the CAN node in the previous row. Only one set of signal connection cables is set between the nodes in the two rows, thus making the entire two-dimensional planar modular architecture essentially a chain of building blocks. After rotation and joining, this automatic node address configuration method can be easily extended to a two-dimensional planar modular CAN bus architecture.
[0035] It should be noted that, in this document, relational terms such as "first" and "second" are used only 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 process, method, article, or apparatus.
[0036] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A frequency-incrementing, centerless, modular CAN bus address automatic configuration method, characterized in that, Includes the following steps: Step 1: Based on a chain-like modular CAN bus architecture without a central node, each adjacent CAN node is connected by a set of CAN buses and a single input / output pin. Step 2: Before the CAN function is activated, all nodes in the chain detect the signal frequency of their input pins, record the frequency value as P, and generate a periodic square wave signal with a frequency of P+M on the output pin to send to the next node. The node address is automatically calculated and configured based on the input pin signal frequency detection value and increment value. Step 3: The CAN bus address configuration result of all nodes in the building block chain is fixed. The address of the first node is configured as 0, and the addresses of the remaining nodes are incremented by 1 with the sequence of the building block chain. The address configuration result of each node is determined by the position of the node in the building block chain. Step 4: In the CAN configuration program, the input pin signal frequency is detected by cyclic iteration. The P value is based on the latest detection result, and the detection duration is greater than the maximum power-on time among all nodes. The address configuration result is not affected by the node power-on order. Step 5: Design the CAN node to be functionally symmetrical after rotating 180 degrees, and extend its application to a two-dimensional planar wooden CAN bus architecture.
2. The frequency-incrementing, centerless modular CAN bus address automatic configuration method according to claim 1, characterized in that, In step 1, a modular CAN bus architecture is constructed, in which the CAN bus is arranged inside each node. After the nodes are assembled, adjacent nodes complete a set of CAN buses and an input / output pin to connect, forming a chain-like modular structure. All CAN nodes use the same hardware and software, there is no central node, and no fixed master node is set.
3. The frequency-incrementing, centerless, modular CAN bus address automatic configuration method according to claim 1, characterized in that, In step 2, the master control unit of all CAN nodes executes the CAN configuration program before the CAN function module runs. The CAN configuration program detects the signal frequency of the input pin of the node, records the frequency value as P, and then generates a periodic square wave signal with a frequency of P+M on the output pin and sends it to the next node. The CAN configuration program configures the address of the node as the ratio of P to M, that is, the configured node address = P / M.
4. The frequency-incrementing, centerless modular CAN bus address automatic configuration method according to claim 1, characterized in that, In step 3, each node automatically calculates and configures its CAN bus address based on the M value and the detected P value. The output pin frequency of adjacent nodes in the block chain increases by M. The input pin of the first node has no signal input and is at a DC level. The detected P value is 0, and the address configuration result is 0. The addresses of all nodes are eventually adjusted to increase by 1 with the block chain sequence. The address configuration result is ultimately determined by the position of the node in the block chain. It does not depend on external hardware or software support, does not depend on hardware or software differences between nodes, and does not occupy CAN bus communication resources.
5. The frequency-incrementing, centerless modular CAN bus address automatic configuration method according to claim 1, characterized in that, In step 4, after the main control unit is powered on, the CAN configuration program detects the frequency value of the input pin signal, which is denoted as P. The frequency detection adopts a cyclic iterative detection method, and the P value is based on the latest detection result. It also ensures that the duration of frequency detection is greater than the maximum power-on time among all nodes. That is, after the last node is powered on, the remaining nodes are still executing the frequency detection program, obtaining the latest P value, and adjusting the address configuration result, so that the address configuration result of all nodes is not affected by the power-on order of the nodes.
6. The frequency-incrementing, centerless modular CAN bus address automatic configuration method according to claim 5, characterized in that, After completing the signal frequency detection of the input pin, the CAN configuration program generates a periodic square wave signal with a frequency of P+M on the output pin, and then configures the address of this node as the ratio of P to M; where M is a fixed value based on the system's operating clock. After the address is configured, the CAN configuration program selects the node with address x as the master node, and then determines whether this node is the master node. If it is, the CAN function module executes the master node CAN function program; otherwise, the CAN function module executes the slave node CAN function program. The value of x is preset, and by adjusting the value of x, the position of the master node in the modular CAN bus architecture can be flexibly adjusted.
7. The frequency-incrementing, centerless modular CAN bus address automatic configuration method according to claim 1, characterized in that, In step 5, each node is designed to be rotationally symmetrical, meaning that the function of each node remains unchanged after being rotated 180 degrees. In the two-dimensional planar wood-based architecture, each CAN node in the next row is rotated 180 degrees and then spliced together with the CAN node in the previous row. Only one set of signal connection cables between the nodes is set between the two rows, so that the entire two-dimensional planar wood-based architecture is essentially still a set of building blocks. After rotation and splicing, this automatic node address configuration method can be easily extended to the two-dimensional planar wood-based CAN bus architecture.