Distributed multi-motor cooperative control system
Through the distributed multi-motor collaborative control system, the double-linked list structure, EtherCAT clock and MD5 encryption algorithm are used to solve the problem of network blocking of multiple motor nodes, realize the synchronization and data integrity of motor nodes, and improve the real-time and robustness of the system.
Patent Information
- Application Number
- CN202510679592.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art network blocks when multi-motor nodes use the CAN protocol to send data simultaneously, resulting in the multi-motor operation being out of synchronization.
The distributed multi-motor collaborative control system is adopted, and the information generation module, information transmission module, message processing module and clock synchronization module are used to ensure the synchronization and data transmission efficiency of motor nodes through double-linked list structure, EtherCAT distributed clock and MD5 encryption algorithm.
It improves the data transmission security and real-time nature of the multi-motor collaborative control system, reduces network blockage, ensures the synchronization and data integrity of motor nodes, and meets strict time requirements.
Smart Images

Figure CN120528282A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motor control technology, and in particular to a distributed multi-motor coordinated control system. Background Art
[0002] Freight transportation is an essential component of economic activity, directly impacting the efficient operation of supply chains and, in turn, driving sustained growth in industry, commerce, and the economy. Freight transportation enables the global circulation of raw materials, semi-finished products, and finished goods, providing essential resources for various industries and facilitating production, sales, and consumption. Freight transportation provides essential supplies for daily life, particularly in areas such as food, daily consumer goods, and medical supplies. Whether for urban residents or rural communities, freight transportation ensures a stable supply of goods. With the acceleration of globalization, freight transportation has become a key factor in driving international and regional integration. Cross-border transportation enables goods to quickly cross national borders and enter diverse markets, facilitating the formation and integration of global supply chains.
[0003] Compared with internal combustion engine-driven vehicles, electric-powered low-speed coal transport vehicles have lower energy consumption and operating costs. Especially in long-term, large-scale transportation tasks, electric coal transport vehicles can significantly reduce fuel costs and maintenance costs. Modern electric coal transport vehicles are usually equipped with intelligent control systems that can realize automatic driving, scheduling optimization, intelligent monitoring and other functions, thereby improving transportation efficiency and safety.
[0004] Electric-powered low-speed coal transport vehicles are often equipped with numerous load-bearing wheels, which are driven by electric motors. Multiple motors operate in coordination via the CAN protocol bus to achieve the goal of driving the low-speed coal transport vehicle. The CAN protocol is widely used and mature in electric vehicles, but it also has some limitations and room for improvement. This is especially true in complex multi-motor control and multi-sensor interaction scenarios, particularly in the context of increasing demands for multi-motor control and intelligence. A single CAN protocol may not be able to meet the more stringent latency requirements. The traditional CAN protocol has a maximum data transmission rate of 1Mbps. For motor power systems with a large number of motor nodes, when the data volume is large, multiple nodes sending data simultaneously may cause network congestion, affecting system response time. Summary of the Invention
[0005] The purpose of the present invention is to provide a distributed multi-motor coordinated control system to solve the following technical problems:
[0006] In the prior art, when multiple motor nodes simultaneously use the CAN protocol to send data, the network is blocked and the multiple motors operate asynchronously.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] A distributed multi-motor cooperative control system transmits information based on the CAN bus, including an information generation module, an information transmission module, a message processing module, and a clock synchronization module, wherein:
[0009] The information generation module is used for command distribution of a multi-motor cooperative control system. The number of motors in the system is marked as n. One command is used to control n motors. The command is stored in an independent double-linked list structure. The double-linked list ID is recorded in the head node data field of the double-linked list. The double-linked list includes n non-head nodes corresponding to the motors. The non-head nodes are marked as motor nodes. The information stored in the data field of the motor node includes the motor ID, the double-linked list ID, the motor target speed w, and the motor real-time speed w. n , motor status s, where the status code of s is 0 for normal and -1 for abnormal;
[0010] The information transmission module is used to obtain the double-linked list ID sequence 1, 2, ..., m of the m instructions when sending m instructions continuously, where m is a positive integer, and use the double-linked list ID sequence 1, 2, ..., m as the order for transmitting the double-linked list to the message processing module; when the amount of information required to be transmitted per unit time of any double-linked list is greater than the maximum bandwidth of the CAN bus, obtain the motor node ID sequence 1, 2, ..., n of the double-linked list, first transmit the head node of the double-linked list through the CAN bus, and then transmit the remaining motor nodes in sequence according to the sequence order;
[0011] The clock synchronization module is used to control the operation of each motor node using the distributed clock of the real-time bus EtherCAT. Whenever the message processing module receives a double-linked list, it performs a clock synchronization calibration. After the clock synchronization calibration is completed, the clock synchronization success message is broadcast to the message processing module.
[0012] The message processing module is used to receive the double linked list sent by the information transmission module; after receiving the clock synchronization success message of any double linked list, it sends the information stored in the motor node data field to the motor driver of the corresponding motor according to the motor node ID of the double linked list; after the corresponding motor finishes executing, it records the motor's w n , s value, update the w stored in the corresponding motor node data domain n , s values, and persist the updated motor node data into the database.
[0013] As a further solution of the present invention: in the information generation module, before each instruction is issued, the status of each motor after the last execution is queried from the database. If the status of the motor is -1, the double-linked list structure data of the instruction removes the motor node.
[0014] As a further solution of the present invention: in the information transmission module, the process of CAN bus transmitting double-linked list data is:
[0015] S1: Encapsulate each double-linked list to be sent into a separate CAN frame;
[0016] S2: Identify the priorities between different CAN frames, decide which CAN frame to send first based on the priority arbitration mechanism, calculate the hash value of the CAN frame using the MD5 encryption algorithm, and save the hash value during transmission and storage;
[0017] S3: The CAN frames that pass the priority arbitration mechanism enter the channel for transmission, and other CAN frames to be transmitted monitor the idle status of the channel;
[0018] S4: Wait for the message processing module to verify the data integrity of the CAN frame. When receiving the confirmation message sent by the message processing module, the state of the CAN channel is set to idle.
[0019] As a further solution of the present invention: in the message processing module, the process of verifying the data integrity of the CAN frame is:
[0020] The message processing module uses the MD5 encryption algorithm to recalculate the hash value of the currently received CAN frame and reads the corresponding hash value stored in the current CAN frame stored in the CAN channel; compares the read hash value with the recalculated hash value. If the comparison result is consistent, the currently received CAN frame is retained. If the comparison result is inconsistent, the information transmission module is requested to resend the CAN frame.
[0021] As a further solution of the present invention: in the clock synchronization module, the process of clock synchronization calibration is:
[0022] The time it takes for the doubly linked list to be transmitted to the message processing module via the CAN bus is t. A clock synchronization command is sent to each motor driver. The synchronization command carries the synchronization period, timestamp, and synchronization mode. The synchronization period is t. Each motor driver calculates the difference between the local clock and the master station clock based on the received synchronization command and adjusts the local clock based on the difference.
[0023] As a further solution of the present invention: the message processing module further includes:
[0024] After receiving the double-linked list, if no clock synchronization message is received after a synchronization cycle, the local clock of each motor is checked; when the local clocks of each motor are consistent, the data of each motor node is directly sent to each motor driver without waiting for the clock synchronization success message; when the local clocks of each motor are inconsistent, a message is broadcast to the clock synchronization module to force clock synchronization.
[0025] As a further solution of the present invention: in the message processing module, the database adopts SQL Server database, and SNAPSHOT is used as the isolation level of the SQL Server database; before the updated motor node data is persisted to the database, the data in the database is queried according to the double-linked list ID, and when the data queried from the database is greater than 0; the current motor node data is compared with the data in the queried database in turn, and if the comparison results are the same, the operation of persisting the motor node data to the database is canceled, and the database transaction is forcibly committed.
[0026] As a further solution of the present invention: the process of broadcasting the clock synchronization success message to the message processing module in the clock synchronization module is as follows:
[0027] Receive the local clock synchronization results responded by each motor, obtain the local clock value in the response information of each motor, and compare the consistency of the local clocks of each motor; after confirming that the local clock synchronization of each motor is consistent, broadcast the clock synchronization message to the message processing module; after the clock synchronization message broadcast is completed, enter the waiting state until the message processing module receives any double-linked list or receives a forced clock synchronization instruction, and then start the next clock synchronization.
[0028] Beneficial effects of the present invention:
[0029] (1) The information transmission module of the present invention sends the double-linked list information to the message processing module through the CAN bus. In the information generation module, each double-linked list is encapsulated into a CAN frame, and the MD5 encryption algorithm is used to calculate the hash value of the CAN frame before the CAN frame enters the CAN channel for transmission. The hash value is saved during transmission and storage. After the message processing module receives the CAN frame, the MD5 encryption algorithm is used again to calculate a new hash value. The hash values of the CAN frame before and after transmission are compared, and the packet loss of the CAN frame during transmission can be automatically detected. At the same time, the data integrity verification of the transmitted CAN frame is guaranteed, which greatly improves the security of the double-linked list node information during transmission. By combining the integrity check, it can detect whether data tampering has occurred during transmission, ensuring that the data received by the recipient has not been maliciously modified.
[0030] (2) The present invention abstracts an instruction into a doubly linked list. When the doubly linked list is transmitted over the CAN bus, the doubly linked list's priority is expressed in ascending order of the doubly linked list ID. This ensures that high-priority messages obtain rapid access when the bus is occupied, meeting real-time requirements and reducing the conflict and packet loss problems that may occur in traditional competitive bus protocols. It also expands the CAN bus's ability to transmit large amounts of data or complex protocols, further reducing bus load, avoiding bus overload, and supporting more devices to communicate efficiently on the same network.
[0031] (3) The clock synchronization module of the present invention uses the real-time bus EtherCAT distributed clock to control the operation of each motor node and control the local clock consistency of each motor node; the clock control of each motor includes automatic clock synchronization and forced clock synchronization, ensuring that different nodes use a unified time base, accurately timestamping the sent and received data, and helping to identify the time sequence and priority of the messages, so that the robustness of clock synchronization in the entire multi-motor collaborative control system is enhanced, and the local clock synchronization performance of each motor is greatly improved. When the number of network nodes increases or the load is too high, the response time can meet the strict time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention will be further described below with reference to the accompanying drawings.
[0033] Figure 1 It is a schematic flow diagram of the present invention;
[0034] Figure 2 Schematic diagram of the process of verifying the data integrity of the CAN frame according to the present invention;
[0035] Figure 3 It is a flow chart of the clock synchronization calibration process of the present invention. DETAILED DESCRIPTION
[0036] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0037] See also Figure 1-Figure 3 As shown, the present invention is a distributed multi-motor cooperative control system that transmits information based on the CAN bus, including an information generation module, an information transmission module, a message processing module, and a clock synchronization module, wherein:
[0038] Doubly Linked List is a chain data structure, in which each node contains three parts: data field (Data), predecessor pointer (Prev), and successor pointer (Next). Since each node contains predecessor and successor pointers, the doubly linked list can be traversed in two directions, namely from the beginning to the end and from the end to the beginning; the predecessor pointer can be used to find the previous node from the current node, and the successor pointer can be used to find the next node. Nodes can be dynamically added or deleted as needed without pre-allocating memory, and the time complexity of inserting or deleting nodes at a known location is O(1), which is more flexible than a singly linked list. Doubly Linked List with a Head Node adds a special head node to the doubly linked list, which only exists as an auxiliary node. Doubly Linked List with a Head Node can better protect boundary conditions and is not prone to pointer exceptions caused by operating the first or last node.
[0039] The information generation module is used to issue instructions for the multi-motor cooperative control system. It is responsible for the generation of instructions and the construction of the double-linked list data model. The number of motors in the system is marked as n, and the n motors are controlled by an instruction of a double-linked list structure. The instruction is stored in an independent double-linked list structure; the double-linked list has a total of n+1 nodes, where 1 represents a double-linked list head node and n represents the n motor nodes contained in the double-linked list; the double-linked list head node data field records the double-linked list id, which is the only certificate binding the double-linked list head node to the motor node. Only motor nodes with the same double-linked list id can exist in a double-linked list. The double-linked list includes n non-head nodes corresponding to the motors, and the non-head nodes are marked as motor nodes; the information stored in the data field of the motor node includes the motor id, the double-linked list id, the motor target speed w, and the motor real-time speed w n , motor status s, where the status code of s is,normal 0,and abnormal -1. After the motor completes the execution of the instruction, it will update the corresponding information in the motor node information field and persist the updated double linked list to the database as an execution log and as an information reference before the next instruction is sent;
[0040] A database is a collection of data that is organized, stored, and managed according to a certain data model. It is used to efficiently store, access, and manage large amounts of related data. The core goal of a database is to make data easy to store, query, and modify, and to ensure the integrity, security, and consistency of the data. SQL Server is a relational database management system developed by Microsoft. It supports SQL as a query language for storing and managing structured data. It is efficient, secure, and easy to use, and is widely used in enterprise-level data storage, management, and analysis. It provides multiple functions such as data management, transaction support, analysis services (SSAS), integration services (SSIS), and reporting services (SSRS). It supports optimization functions such as indexes, partitioned tables, stored procedures, and triggers, making it suitable for processing large-scale data. In addition to Windows, the latest version also supports Linux system deployment and distributed architecture. It can run in a stand-alone or cluster environment, meeting the needs of applications from small to enterprise-level.
[0041] Before each instruction is issued, the status of each motor after the last execution is queried from the database. If the status of the motor is -1, the motor node is removed from the double-linked list structure data of the instruction.
[0042] The CAN bus is a serial communication protocol originally designed by Bosch in Germany in 1983 for automotive electronics. It is used to exchange data between various control units. Due to its high reliability and real-time performance, it is widely used in automobiles, industrial control, medical equipment, aerospace and other fields. The CAN bus is a multi-master network. Each node can support multiple nodes to access the bus, which is scalable and has equal access to the bus. The hardware is simple and does not require complex wiring, making it suitable for cost-sensitive applications.
[0043] The information transmission module is used to, when m instructions are sent continuously, the m instructions are sent non-concurrently, and another instruction will be sent only after each instruction is sent. m is a positive integer. The double-linked list ID sequence 1, 2, ..., m of the m instructions is obtained, and the double-linked list ID sequence 1, 2, ..., m is used as the order for transmitting the double-linked list to the message processing module; when the amount of information required to be transmitted per unit time of any double-linked list is greater than the maximum bandwidth of the CAN bus, the double-linked list is segmented and transmitted, and the motor node ID sequence 1, 2, ..., n of the double-linked list is obtained. The head node of the double-linked list is first transmitted through the CAN bus, and then the remaining motor nodes are transmitted in sequence according to the sequence order. The motor node is the smallest unit of transmission; when transmitting the double-linked list, the priority of the double-linked list is arbitrated first and then the priority of the motor is arbitrated;
[0044] MD5 is a widely used cryptographic hash function that produces a 128-bit hash value (also known as a message digest). MD5 is often used to ensure data integrity. By inputting data into the MD5 algorithm, it generates a fixed-length hash value, which acts as a "fingerprint" of the data. Even if the input data is very large, the output hash value always remains a fixed length. MD5 is a one-way function, making it impossible to deduce the original data from the hash value. Even small changes to the input data can result in significant changes to the MD5 hash value.
[0045] In the information transmission module, the specific subdivision of CAN bus transmission of double linked list data is as follows:
[0046] S1: Encapsulate each double-linked list to be sent into a separate CAN frame;
[0047] S2: Identify the priorities between different CAN frames, decide which CAN frame to send first based on the priority arbitration mechanism, calculate the hash value of the CAN frame using the MD5 encryption algorithm, and save the hash value during transmission and storage;
[0048] S3: The CAN frames that pass the priority arbitration mechanism enter the channel for transmission, and other CAN frames to be transmitted monitor the idle status of the channel;
[0049] S4: Wait for the message processing module to verify the data integrity of the CAN frame. When receiving the confirmation message sent by the message processing module, the state of the CAN channel is set to idle;
[0050] S5: If the channel is detected to be idle, repeat steps S2-S4 until there is no CAN frame data to be sent;
[0051] EtherCAT is a real-time Ethernet protocol designed specifically for industrial automation and control systems. Launched in 2003 by Germany's B&R, it aims to provide high-speed, low-latency industrial network communications and is widely used in systems such as robotics, motion control, PLCs (programmable logic controllers), sensors, and actuators. EtherCAT can achieve extremely high data transmission speeds and ensure minimal communication latency through efficient data processing, making it suitable for applications with extremely high real-time requirements. EtherCAT uses "processing within the frame" technology, meaning data does not need to remain at each node, but is processed at each node and then passed directly to the next node, greatly improving communication efficiency.
[0052] The clock synchronization module uses the distributed clocks of the real-time bus EtherCAT to control the operation of each motor node. By controlling the clock consistency of each motor node, it ensures the consistent execution of instructions when the motor is issued. Whenever the message processing module receives a double-linked list, it performs a clock synchronization calibration. After the clock synchronization calibration is completed, the clock synchronization success message is broadcast to the message processing module. If the synchronization rhythm is temporarily lost due to network influence and enters the dormant state, it will be awakened by the forced clock synchronization message.
[0053] In the clock synchronization module, the clock synchronization calibration process is as follows: the time consumed by the double-linked list to be transmitted to the message processing module via the CAN bus is recorded as t, and a clock synchronization command is sent to each motor driver. The synchronization command carries the synchronization period, timestamp, and synchronization mode. The synchronization period is t. Each motor driver calculates the difference between the local clock and the master station clock based on the received synchronization command and adjusts the local clock according to the difference.
[0054] The synchronization module broadcasts the clock synchronization success message to the message processing module in the following process: receiving the local clock synchronization results responded by each motor, obtaining the local clock value in the response information of each motor, and comparing the consistency of the local clocks of each motor; after confirming that the local clocks of each motor are synchronized, the clock synchronization message is broadcast to the message processing module; after the clock synchronization message broadcast is completed, it enters the waiting state until the message processing module receives any double-linked list or receives a forced clock synchronization instruction, and then starts the next clock synchronization;
[0055] The message processing module is used to receive the double linked list sent by the information transmission module; after receiving the clock synchronization success message of any double linked list, it sends the information stored in the motor node data field to the motor driver of the corresponding motor according to the motor node ID of the double linked list; after the corresponding motor finishes executing, it records the motor's w n , s value, update the w stored in the corresponding motor node data domain n , s values, and persist the updated motor node data into the database;
[0056] When verifying data integrity, the sender generates an MD5 hash value for the data and sends the data and the hash value to the receiver. After receiving the data, the receiver generates an MD5 hash value for the received data again and compares it with the hash value sent. If the two hash values are consistent, it means that the data has not been tampered with during transmission and its integrity is guaranteed. If the two hash values are inconsistent, it means that an error may have occurred during the data transmission or it has been maliciously tampered with.
[0057] In the message processing module, the process of verifying the data integrity of the CAN frame is as follows:
[0058] Use the MD5 encryption algorithm to recalculate the hash value of the currently received CAN frame, and read the corresponding hash value stored in the current CAN frame stored in the CAN channel; compare the read hash value with the recalculated hash value. If the comparison result is consistent, the currently received CAN frame is retained. If the comparison result is inconsistent, request the information transmission module to resend the CAN frame;
[0059] Forced clock synchronization can quickly correct clock drift between nodes, ensuring that system time accuracy meets requirements and preventing the gradual accumulation of errors during long-term operation. Time synchronization ensures the consistency of event order in distributed systems, thereby improving reliability. For applications with strict real-time requirements (such as robotic collaboration and industrial automation), time synchronization is indispensable.
[0060] After receiving the double-linked list, if no clock synchronization message is received after a synchronization cycle, the local clock of each motor is checked; when the local clocks of each motor are consistent, the data of each motor node is directly sent to each motor driver without waiting for the clock synchronization success message; when the local clocks of each motor are inconsistent, a message is broadcast to the clock synchronization module to force clock synchronization;
[0061] SNAPSHOT transactions are a transaction isolation level typically used in databases that support multi-version concurrency control mechanisms. In a SNAPSHOT transaction, the view of each transaction operation is based on the snapshot data at the time the transaction starts, rather than the real-time data. SNAPSHOT transactions avoid locking conflicts between read and write operations. Read operations can freely access the snapshot version of the database without waiting for write operations to complete, thereby improving concurrency performance. The data read by each SNAPSHOT transaction is based on the snapshot at the start of the transaction. Even if other transactions update the data, the data seen by the current transaction remains consistent. This consistency avoids dirty reads. Because the view of each transaction is fixed to the snapshot at the start of the transaction, developers can more easily debug and reproduce problems without being affected by updates from other transactions.
[0062] The database uses SQL Server, with SNAPSHOT as the isolation level. Before persisting the updated motor node data to the database, the data in the database is queried based on the double-linked list ID. If the data retrieved from the database is greater than 0, the current motor node data is compared with the queried database data in turn. If the comparison results are the same, the operation of persisting the motor node data to the database is canceled and the database transaction is forced to be committed.
[0063] In the clock synchronization module, the process of broadcasting the clock synchronization success message to the message processing module is as follows:
[0064] Receive the local clock synchronization results responded by each motor, obtain the local clock value in the response information of each motor, and compare the consistency of the local clocks of each motor; after confirming that the local clock synchronization of each motor is consistent, broadcast the clock synchronization message to the message processing module; after the clock synchronization message broadcast is completed, enter the waiting state until the message processing module receives any double-linked list or receives a forced clock synchronization instruction, and then start the next clock synchronization.
[0065] The above is a detailed description of an embodiment of the present invention. However, the content described is only a preferred embodiment of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A distributed multi-motor coordinated control system, based on CAN bus information transmission, characterized in that: It includes information generation module, information transmission module, message processing module and clock synchronization module, among which: The information generation module is used for command distribution of a multi-motor cooperative control system. The number of motors in the system is marked as n. One command is used to control n motors. The command is stored in an independent double-linked list structure. The double-linked list ID is recorded in the head node data field of the double-linked list. The double-linked list includes n non-head nodes corresponding to the motors. The non-head nodes are marked as motor nodes. The information stored in the data field of the motor node includes the motor ID, the double-linked list ID, the motor target speed w, and the motor real-time speed w. n , motor status s, where the status code of s is 0 for normal and -1 for abnormal; The information transmission module is used to obtain the double-linked list ID sequence 1, 2, ..., m of the m instructions when sending m instructions continuously, where m is a positive integer, and use the double-linked list ID sequence 1, 2, ..., m as the order for transmitting the double-linked list to the message processing module; when the amount of information required to be transmitted per unit time of any double-linked list is greater than the maximum bandwidth of the CAN bus, obtain the motor node ID sequence 1, 2, ..., n of the double-linked list, first transmit the head node of the double-linked list through the CAN bus, and then transmit the remaining motor nodes in sequence according to the sequence order; The clock synchronization module is used to control the operation of each motor node using the distributed clock of the real-time bus EtherCAT. Whenever the message processing module receives a double-linked list, it performs a clock synchronization calibration. After the clock synchronization calibration is completed, the clock synchronization success message is broadcast to the message processing module. The message processing module is used to receive the double linked list sent by the information transmission module; after receiving the clock synchronization success message of any double linked list, it sends the information stored in the motor node data field to the motor driver of the corresponding motor according to the motor node ID of the double linked list; after the corresponding motor finishes executing, it records the motor's w n , s value, update the w stored in the corresponding motor node data domain n , s values, and persist the updated motor node data into the database.
2. A distributed multi-motor coordinated control system according to claim 1, characterized in that: In the information generation module, before each instruction is issued, the status of each motor after the last execution is queried from the database. If the status of the motor is -1, the motor node is removed from the double-linked list structure data of the instruction.
3. A distributed multi-motor coordinated control system according to claim 1, characterized in that: In the information transmission module, the process of CAN bus transmitting double linked list data is as follows: S1: Encapsulate each double-linked list to be sent into a separate CAN frame; S2: Identify the priorities between different CAN frames, decide which CAN frame to send first based on the priority arbitration mechanism, calculate the hash value of the CAN frame using the MD5 encryption algorithm, and save the hash value during transmission and storage; S3: The CAN frames that pass the priority arbitration mechanism enter the channel for transmission, and other CAN frames to be transmitted monitor the idle status of the channel; S4: Wait for the message processing module to verify the data integrity of the CAN frame. When receiving the confirmation message sent by the message processing module, the state of the CAN channel is set to idle; S5: If the channel is detected to be idle, repeat steps S2-S4 until there is no CAN frame data to be sent.
4. A distributed multi-motor coordinated control system according to claim 3, characterized in that: In the message processing module, the process of verifying the data integrity of the CAN frame is as follows: The message processing module uses the MD5 encryption algorithm to recalculate the hash value of the currently received CAN frame and reads the corresponding hash value stored in the current CAN frame stored in the CAN channel; Compare the read hash value with the recalculated hash value. If the comparison results are consistent, retain the currently received CAN frame. If the comparison results are inconsistent, request the information transmission module to resend the CAN frame.
5. The distributed multi-motor coordinated control system according to claim 1, characterized in that: In the clock synchronization module, the clock synchronization calibration process is as follows: The time it takes for the doubly linked list to be transmitted to the message processing module via the CAN bus is t. A clock synchronization command is sent to each motor driver. The synchronization command carries the synchronization period, timestamp, and synchronization mode. The synchronization period is t. Each motor driver calculates the difference between the local clock and the master station clock based on the received synchronization command and adjusts the local clock based on the difference.
6. A distributed multi-motor coordinated control system according to claim 1, characterized in that: The message processing module also includes: After receiving the double-linked list, if no clock synchronization message is received after a synchronization cycle, the local clock of each motor is checked; when the local clocks of each motor are consistent, the data of each motor node is directly sent to each motor driver without waiting for the clock synchronization success message; when the local clocks of each motor are inconsistent, a message is broadcast to the clock synchronization module to force clock synchronization.
7. The distributed multi-motor coordinated control system according to claim 1, characterized in that: In the message processing module, the database adopts SQL Server database, and SNAPSHOT is used as the isolation level of the SQL Server database; before the updated motor node data is persisted to the database, the data in the database is queried according to the double-linked list ID. When the data queried from the database is greater than 0, the current motor node data is compared with the data in the queried database in turn. If the comparison results are the same, the operation of persisting the motor node data to the database is canceled, and the database transaction is forcibly committed.
8. The distributed multi-motor coordinated control system according to claim 1, characterized in that: The clock synchronization module broadcasts the clock synchronization success message to the message processing module as follows: Receive the local clock synchronization results responded by each motor, obtain the local clock value in the response information of each motor, and compare the consistency of the local clocks of each motor; after confirming that the local clock synchronization of each motor is consistent, broadcast the clock synchronization message to the message processing module; after the clock synchronization message broadcast is completed, enter the waiting state until the message processing module receives any double-linked list or receives a forced clock synchronization instruction, and then start the next clock synchronization.