Multi-motor synchronization control method based on TSN and ethercat heterogeneous network
Patent Information
- Application Number
- CN202311430186.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-10-31
AI Technical Summary
虽然以太网技术和实时通信协议在实现实时同步控制方面提供了支持,但目前尚未提出解决多电机同步控制实时通信需求的有效方法
[0052]1、高性能实时同步控制:一个TSN网络可以连接到多个子EtherCAT网络,从而实现各种工业自动化应用中的高性能、高实时性和高同步性的通信。TSN网络提供了高精度的时钟同步和流量调度机制,确保了整个网络中的实时通信。结合EtherCAT的实时以太网协议,可以实现高性能的数据传输和控制计算,提升多电机系统的实时性能;
Smart Images

Figure CN117499175B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation control technology, and in particular to a multi-motor synchronous control method based on heterogeneous networks of TSN (Time-Sensitive Networking) and EtherCAT (Ethernet for Control Automation Technology). Background Technology
[0002] In modern industrial automation and control systems, multi-motor synchronous control is a crucial task. It aims to ensure that multiple motors operate at consistent speeds, positions, or motion patterns, thereby improving the overall system performance and accuracy. Synchronous control relies heavily on efficient and reliable real-time communication technology. Real-time data exchange and control command transmission are required between sensors and actuators to ensure synchronization among multiple motors. Traditional communication methods cannot meet the demands of real-time performance and synchronization, necessitating more advanced communication technologies. In recent years, Ethernet technology has been widely adopted in industrial automation. With the development of Ethernet technology and real-time communication protocols such as EtherCAT, these advancements have significantly improved data transmission speeds and precise synchronization capabilities between multi-motor systems, providing effective technical support for achieving real-time synchronous control.
[0003] Due to the complexity of multi-motor systems and their mutual influences, real-time synchronous control needs to address the following main issues:
[0004] (1) Communication delay: Communication delay refers to the time delay between the transmission of control commands and the execution of actual actions. In a multi-motor system, the control commands for each motor need to be transmitted through a communication network to the corresponding slave device for execution by the driver. Communication delay causes a time difference in the arrival of control commands at the motors, affecting the synchronization performance of the motors;
[0005] (2) Data Synchronization: In a multi-motor system, the data (such as position and speed) of each motor needs to be kept consistent during real-time synchronous control. Data synchronization issues include clock synchronization, data transmission synchronization, and control calculation synchronization. Poor synchronization can lead to problems such as uncoordinated motor movements and error accumulation.
[0006] While Ethernet and real-time communication protocols provide a solid technical foundation, real-time synchronous control of multiple motors still faces challenges. The goal of real-time synchronous control of multiple motors is to achieve collaborative operation among multiple motors and improve the overall system performance. Complex distributed and collaborative control strategies are affected by factors such as model uncertainty and parameter sensitivity, which impact synchronization accuracy and system reliability. Furthermore, the transition from dual-motor synchronous control to multi-motor synchronous control, and even the control of larger-scale motor clusters and large-span collaborative systems, requires a combination of appropriate control structures and real-time communication methods to achieve effective control. Although Ethernet technology and real-time communication protocols provide support for achieving real-time synchronous control, no effective method has yet been proposed to address the real-time communication requirements of multi-motor synchronous control. Summary of the Invention
[0007] Based on the above analysis, the present invention aims to provide a multi-motor synchronous control method based on TSN and EtherCAT heterogeneous networks to solve the technical problem of real-time synchronous communication of multiple motors in the prior art.
[0008] To address the aforementioned technical problems, this invention provides a multi-motor synchronous control method based on a heterogeneous network of TSN and EtherCAT, comprising:
[0009] Establish communication between the computer PC, TSN switch and multiple motor controllers, set the clock synchronization period and time difference threshold, and perform clock synchronization initialization;
[0010] Within one clock synchronization cycle, the computer PC sends control command data packets to each of the motor controllers via the TSN switch. Each motor controller parses the control command data packets into pulse signals and sends them to the first motor driver in the corresponding sub-EtherCAT network. The remaining motor drivers in the sub-network are cascaded to receive the pulse signals. Each motor driver transmits the motion status of the corresponding servo motor back to the computer PC. When the computer PC detects that the motion status of the servo motor does not match the control command, it performs fault repair on the servo motor and triggers clock synchronization initialization. Alternatively, when the computer PC detects that the total delay in the execution of the control command is greater than the time difference threshold, it triggers clock synchronization initialization.
[0011] When the clock synchronization cycle ends, clock synchronization initialization is triggered again.
[0012] Furthermore, establishing communication between the computer PC, the TSN switch, and multiple motor controllers includes:
[0013] Configure the computer PC, motor controller, and TSN switch to be in the same network segment of the same TSN domain;
[0014] The computer PC acts as the server, creating a server socket;
[0015] Configure the server connection to be multi-threaded and perform polling and listening.
[0016] Each of the motor controllers is connected to the server via a TSN switch, acting as a client.
[0017] When the server obtains a connection from a new client through polling, it creates a sub-thread to communicate with that client.
[0018] Furthermore, the clock synchronization initialization includes:
[0019] In the TSN domain, the gPTP synchronization method is used to align the hardware timestamps of the computer PC with those of each motor controller.
[0020] In each sub-EtherCAT network, a distributed clock synchronization mechanism is adopted, with each motor controller as the master reference clock of each sub-EtherCAT network. The link propagation delay and initial clock offset from the master reference clock to the first motor driver in each corresponding slave station are calculated.
[0021] The first motor driver calculates the local clock error based on the master station reference clock, link propagation delay and initial clock offset, and adjusts the local system time of the first motor driver to the calibration clock of the first motor driver based on the local clock error.
[0022] The cascaded motor drivers are based on the calibration clock of the previous motor driver, with a micro-clock drift added sequentially to obtain the calibration clock of each cascaded motor driver; wherein, the micro-clock drift is obtained by the computer PC sending a synchronization command in advance and by calculating the link transmission delay between the second motor driver and the first motor driver in each sub-EtherCAT network.
[0023] Furthermore, the first motor driver calculates the local clock error based on the master station reference clock, link propagation delay, and initial clock offset. Adjusting the local system time of the first motor driver to a calibration clock based on this local clock error includes:
[0024] Using the hardware timestamps of each motor controller as the master station reference clock, the link propagation delay and initial clock offset from the reference clock to the corresponding first motor driver are calculated.
[0025] The first motor driver calculates the local clock error based on the master station reference clock, link propagation delay, and initial clock offset;
[0026] Wherein, the initial clock offset refers to the time difference between the master reference clock of the motor controller and the local clock of the first motor driver when the clock synchronization initialization process begins; the link propagation delay is the transmission delay between the motor controller and the first motor driver;
[0027] The local clock error of the first motor driver is calculated as follows:
[0028] E1 = C i -T i -T refi
[0029] Where E1 is the local clock error of the first motor driver corresponding to motor controller i, and C i T is the local clock for the first motor driver corresponding to motor controller i. i T is the link propagation delay for the first motor driver corresponding to motor controller i. refi This is the reference clock for motor controller i;
[0030] The first motor driver obtains a calibrated clock based on the local system time and the local clock error.
[0031] Furthermore, the control instruction data packet includes a sending timestamp;
[0032] The motor controller in each sub-EtherCAT network receives the control command data packet, parses it into a pulse signal, and sends it to the first motor driver in the sub-EtherCAT network;
[0033] The first motor driver extracts its corresponding instruction based on the address and transmits the remaining instructions to the next motor driver via the EtherCAT bus, and so on, with the remaining motor drivers cascading in sequence to receive pulse signals.
[0034] Each motor driver receives the pulse signal to drive the corresponding servo motor to move, and at the same time records the timestamp of the received pulse signal and uploads it to the computer PC.
[0035] The total delay in executing the control command is obtained based on the timestamp of the received pulse signal and the timestamp of the transmitted signal.
[0036] Furthermore, when the computer PC detects that the motion state of the servo motor does not match the control command, the servo motor fault repair includes:
[0037] Each motor driver will record the corresponding servo motor motion state data and return it sequentially to the cascaded previous motor driver until the first motor driver, and then transmit it back to the computer PC via the motor controller and the TSN switch;
[0038] The computer (PC) determines whether the motion state of the servo motor meets the requirements of the control command.
[0039] If it does not meet the requirements, the servo motor fault repair will be performed.
[0040] Furthermore, the step of performing servo motor fault repair if the condition is not met includes:
[0041] The first step is for the computer PC to determine the sub-EtherCAT network where the malfunctioning servo motor is located based on the servo motor's operating status data, and then determine the corresponding motor driver and motor controller.
[0042] The second step is to determine the severity of the servo motor failure based on the operating status data.
[0043] The third step, based on the severity of the fault, is to stop the system, stop / disable the faulty servo motor, or replace the servo motor online.
[0044] Furthermore, based on the severity of the fault, actions such as stopping the system, stopping or disabling the faulty servo motor, or replacing the servo motor online include:
[0045] If the severity of the fault poses a safety risk, immediately stop the machine and perform fault repair.
[0046] If the problem is related to the position or speed of the servo motor, an electrical fault, a mechanical fault, or a bearing fault, and the servo motor cannot accurately sense the position and speed, the computer PC will send a stop / disable servo motor command to stop / disable the faulty servo motor.
[0047] If there is an abnormal temperature or a lost communication data packet, the servo motor will be replaced online.
[0048] Furthermore, the motor controller, motor driver, and servo motor are located in an EtherCAT network and are connected via an EtherCAT interface and bus.
[0049] Each sub-EtherCAT network consists of a motor controller, multiple motor drivers, and corresponding servo motors. The motor controller is the master station, and the motor drivers are the slave stations.
[0050] Furthermore, the servo motor operating status data includes: the servo motor's current position, speed, acceleration, power, temperature, current, voltage, fault codes, alarm information, operating log, and event record information.
[0051] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0052] 1. High-performance real-time synchronous control: A single TSN network can connect to multiple sub-EtherCAT networks, enabling high-performance, high-real-time, and high-synchronization communication in various industrial automation applications. The TSN network provides high-precision clock synchronization and flow scheduling mechanisms, ensuring real-time communication throughout the network. Combined with EtherCAT's real-time Ethernet protocol, high-performance data transmission and control calculations can be achieved, improving the real-time performance of multi-motor systems.
[0053] 2. Improved Synchronization: The clock synchronization mechanism in the TSN network ensures that the clocks of each node remain synchronized, avoiding the accumulation of time errors between servo motors. Combined with the synchronization mechanism in EtherCAT, high-precision synchronous control between multiple servo motors can be achieved, ensuring coordinated operation and motion accuracy of the motors.
[0054] 3. Advantages of heterogeneous networks: By integrating two different communication technologies, TSN and EtherCAT, the advantages of each can be fully utilized. TSN provides time synchronization and predictable latency, while EtherCAT provides real-time data transmission and synchronous control capabilities. This heterogeneous network combines the advantages of both, enabling higher-performance control in complex multi-motor synchronous control systems.
[0055] 4. Enhanced network reliability: The TSN network improves data transmission reliability through a fault recovery mechanism, ensuring the stable operation of multi-motor systems;
[0056] 5. Flexibility and Scalability: By combining TSN with EtherCAT, heterogeneous network architectures can be achieved, allowing for flexible deployment and expansion of multi-motor systems. The TSN network supports distributed nodes and segmented configurations, enabling synchronous control of larger-scale servo motor clusters, and can adapt to the needs of multi-motor control systems of different sizes and complexities.
[0057] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0058] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0059] Figure 1 The flowchart shows a multi-motor synchronous control method based on TSN and EtherCAT heterogeneous networks.
[0060] Figure 2 This is a block diagram of the topology of a multi-motor real-time synchronous control system based on TSN and EtherCAT heterogeneous networks. Detailed Implementation
[0061] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0062] In this solution, the real-time clock synchronization and data transmission mechanism of the TSN network ensures that all nodes perform data transmission and control operations at the same time. The EtherCAT network is used for real-time data transmission and control calculations, guaranteeing high-precision synchronous control between the various servo motors.
[0063] TSN is a technology for real-time communication and synchronization over Ethernet, enabling Ethernet networks to provide predictable latency and high-precision synchronization. TSN can be used in industrial automation, automotive, and aerospace fields to support applications with high real-time requirements. EtherCAT is a high-performance, real-time Ethernet communication protocol used in industrial automation. Based on the Ethernet physical layer, it achieves low-latency and high-precision real-time communication.
[0064] EtherCAT, as a real-time Ethernet protocol, can transmit data in milliseconds or sub-milliseconds, providing high-performance data transmission and synchronous control. EtherCAT supports distributed control architectures, where multiple devices can be physically connected via Ethernet cables, reducing network cabling complexity and improving scalability. One TSN network can connect to multiple EtherCAT networks.
[0065] The heterogeneous network of TSN and EtherCAT combines two different communication technologies, TSN and EtherCAT, to form a comprehensive network architecture. The goal of this heterogeneous network is to integrate the time synchronization of TSN with the real-time data transmission and synchronous control capabilities of EtherCAT. This combination enables higher-performance and more reliable real-time communication and synchronous control in complex control systems, especially in multi-motor synchronous control applications. The heterogeneous network of TSN and EtherCAT combines two different but complementary communication technologies to meet the real-time and reliability requirements of multi-motor synchronous control.
[0066] In one specific embodiment of the present invention, a multi-motor synchronous control method based on a heterogeneous network of TSN and EtherCAT is disclosed. A computer (PC) communicates in real time with the motor controller through a TSN switch in the TSN network, enabling real-time synchronization, remote control, and motion adjustment of the multi-motor system. Figure 1 As shown, it includes:
[0067] Establish communication between the computer PC, TSN switch and multiple motor controllers, set the clock synchronization period and time difference threshold, and perform clock synchronization initialization;
[0068] Within one clock synchronization cycle, the computer PC sends control command data packets to each of the motor controllers via the TSN switch. Each motor controller parses the control command data packets into pulse signals and sends them to the first motor driver in the corresponding sub-EtherCAT network. The remaining motor drivers in the sub-network are cascaded to receive the pulse signals. Each motor driver transmits the motion status of the corresponding servo motor back to the computer PC. When the computer PC detects that the motion status of the servo motor does not match the control command, it performs fault repair on the servo motor and triggers clock synchronization initialization. Alternatively, when the computer PC detects that the total delay in the execution of the control command is greater than the time difference threshold, it triggers clock synchronization initialization.
[0069] When the clock synchronization cycle ends, clock synchronization initialization is triggered again.
[0070] Furthermore, establishing communication between the computer PC, the TSN switch, and multiple motor controllers includes:
[0071] Configure the computer PC, motor controller, and TSN switch to be in the same network segment of the same TSN domain;
[0072] The computer PC acts as the server, creating a server socket;
[0073] Configure the server connection to be multi-threaded and perform polling and listening.
[0074] Each of the motor controllers is connected to the server via a TSN switch, acting as a client.
[0075] When the server obtains a connection from a new client through polling, it creates a sub-thread to communicate with that client.
[0076] Configure the computer PC, motor controller, and TSN switch to be within the same TSN domain and the same network segment; connect them via Ethernet. Ensure that the computer PC, motor controller, and TSN switch are all within the same TSN domain and the same network segment, and that they can communicate with each other.
[0077] The server socket is used to listen for connection requests from the motor controller; this is the starting point for communication, and the computer PC will wait for the motor controller to connect.
[0078] By configuring the computer PC's connection to be multi-threaded, the PC can simultaneously listen for connection requests from multiple motor controllers. This concurrent processing method ensures that the PC can communicate with multiple motor controllers at the same time.
[0079] The motor controller acts as a client and connects to the computer PC. The motor controller sends a connection request to the computer PC to establish a communication connection.
[0080] A single computer PC can connect to one or more clients. The PC handles multiple connections simultaneously, with each sub-thread responsible for communicating with the motor controller in each sub-EtherCAT network.
[0081] The sub-EtherCAT network includes one motor controller, multiple motor drivers, and corresponding servo motors. The motor controller, motor drivers, and servo motors support EtherCAT interfaces and are connected via an EtherCAT bus. The motor controller is the master station of the sub-EtherCAT network, and the motor drivers are the slave stations of the sub-EtherCAT network.
[0082] Furthermore, the clock synchronization initialization includes:
[0083] In the TSN domain, the gPTP (generalized precise time synchronization protocol) synchronization method is used to align the hardware timestamps of the computer PC with those of each motor controller.
[0084] In each sub-EtherCAT network, a distributed clock synchronization mechanism is adopted, with each motor controller as the master reference clock of each sub-EtherCAT network, and the link propagation delay and initial clock offset from the master reference clock to the first motor driver of each corresponding slave station are calculated.
[0085] The first motor driver calculates the local clock error based on the master station reference clock, link propagation delay and initial clock offset, and adjusts the local system time of the first motor driver to the calibration clock of the first motor driver based on the local clock error.
[0086] The cascaded motor drivers are based on the calibration clock of the previous motor driver, with a micro-clock drift added sequentially to obtain the calibration clock of each cascaded motor driver; wherein, the micro-clock drift is obtained by the computer PC sending a motor driver clock synchronization command in advance, and by calculating the link transmission delay between the second motor driver and the first motor driver in each sub-EtherCAT network;
[0087] The cascaded motor drivers are sequentially increased by a micro-clock drift to obtain the calibration clock for each cascaded motor driver.
[0088] In the TSN domain, gPTP synchronization is used to align the computer PC with the hardware timestamps of each motor controller.
[0089] The gPTP protocol provides precise clock synchronization, ensuring all devices operate on the same time base. Through gPTP, the hardware timestamps of the computer PC and multiple motor controllers are aligned. This means their time bases become consistent, ensuring they all operate under the same time standard. Multi-motor systems require a high degree of time synchronization to ensure coordinated movement.
[0090] In each sub-EtherCAT network, a distributed clock (DC, Distributive Computing) synchronization mechanism is used.
[0091] In this step, establishing a clock synchronization cycle ensures that all devices in the multi-motor synchronization system (including the computer PC, motor controller, and motor driver) maintain highly accurate time synchronization. Periodically synchronizing the clocks within a certain time interval maintains the synchronization between the device's local clock and the reference clock, achieving time synchronization and correcting clock drift.
[0092] The clock synchronization period is set according to specific practical needs. Multi-motor synchronous control is closely related to clock synchronization accuracy. In actual implementation, due to hardware limitations, the slave clock may not perfectly follow the master clock. Over time, due to factors such as clock drift, the synchronization error between the slave clock and the master clock increases. Therefore, a clock synchronization period is set to periodically resynchronize the clock. When the TSN time delay is large, clock synchronization is first performed in the TSN domain to align the hardware timestamps of the computer PC and each motor controller. Then, within each EtherCAT network, using each motor controller as a reference clock, the link propagation delay and initial clock offset from the reference clock to each driver are recalculated for DC synchronization. This ensures that all devices in the TSN and EtherCAT heterogeneous network use the same system time, enabling synchronized control of each servo motor task.
[0093] The time difference threshold is a setting used to determine whether clock synchronization is possible. It is typically used to determine the maximum permissible difference between the timestamp of the computer PC control command data packet transmission and the timestamp of the motor driver receiving the pulse signal. This time difference threshold helps determine when to trigger clock synchronization to ensure that the time of each device remains within a consistent range. For example, the time difference threshold can be set to 10 microseconds.
[0094] The specific value set for the time difference threshold varies depending on the requirements of the application. Time difference thresholds are typically measured in microseconds (μs) or nanoseconds (ns). Below are some example time difference thresholds:
[0095] (1) For applications that require high-precision synchronization, the time difference threshold is set to be very small, such as 1 microsecond (μs) or less;
[0096] (2) In some real-time control systems, a slightly larger time difference can be tolerated, usually set between a few microseconds or tens of microseconds;
[0097] (3) For general applications, the time difference threshold is further relaxed to allow larger values, such as hundreds of microseconds or more.
[0098] (4) In some industrial automation applications, even millisecond-level time differences are acceptable, which is generally not suitable for multi-motor control systems that require high synchronization.
[0099] The choice of time difference threshold must balance system performance requirements and acceptable complexity. A smaller time difference threshold requires stricter clock synchronization and higher lightness, which requires higher performance hardware and complex software to implement. The specific time difference threshold is determined by a trade-off based on the application scenario, performance requirements and available technologies.
[0100] Furthermore, the first motor driver calculates the local clock error based on the master station reference clock, link propagation delay, and initial clock offset. Adjusting the local system time of the first motor driver to a calibration clock based on this local clock error includes:
[0101] Using the hardware timestamps of each motor controller as the master station reference clock, the link propagation delay and initial clock offset from the reference clock to the corresponding first motor driver are calculated.
[0102] The first motor driver calculates the local clock error based on the master station reference clock, link propagation delay, and initial clock offset;
[0103] Wherein, the initial clock offset refers to the time difference between the master reference clock of the motor controller and the local clock of the first motor driver when the clock synchronization initialization process begins; the link propagation delay is the transmission delay between the motor controller and the first motor driver;
[0104] The local clock error of the first motor driver is calculated as follows:
[0105] E1 = C i -T i -T refi
[0106] Where E1 is the local clock error of the first motor driver corresponding to motor controller i, and C i T is the local clock for the first motor driver corresponding to motor controller i. i T is the link propagation delay for the first motor driver corresponding to motor controller i. refi This is the reference clock for motor controller i;
[0107] The first motor driver obtains a calibrated clock based on the local system time and the local clock error.
[0108] Furthermore, the control instruction data packet includes a sending timestamp;
[0109] Each motor controller in each sub-EtherCAT network receives the control command data packet, parses it into a pulse signal, and sends it to the first motor driver in the sub-EtherCAT network;
[0110] The first motor driver extracts its corresponding instruction based on the address and transmits the remaining instructions to the next motor driver via the EtherCAT bus, and so on, with the remaining motor drivers cascading in sequence to receive pulse signals.
[0111] Each motor driver receives the pulse signal to drive the corresponding servo motor to move, and at the same time records the timestamp of the received pulse signal and uploads it to the computer PC.
[0112] The total delay in executing the control command is obtained based on the timestamp of the received pulse signal and the timestamp of the transmitted signal.
[0113] The data command transmission between the computer PC and the motor controller is implemented based on the Modbus TCP protocol.
[0114] The computer PC sends synchronization control command data packets to the motor controller through the TSN switch. The control command data packets include: setting the target position, speed, acceleration, and current parameters of the servo motor, or executing specific control operations.
[0115] After receiving the control command data packet from the computer PC, the motor controller parses and processes the control command data packet, and sends the control commands to each motor driver in real time through the EtherCAT bus to ensure high-precision synchronous control between the motors.
[0116] Each motor controller controls the corresponding servo motor to run; each motor controller records the running status data of the corresponding servo motor.
[0117] Servo motor operating status data includes: servo motor current position, speed, acceleration, power, temperature, current, fault codes, alarm information, operation log, and event record information.
[0118] like Figure 2 As shown, motor controller 1 sends pulse signals to motor driver 1, motor controller 2 cascades to motor controller 1 to receive pulse signals, motor controller 2 sends pulse signals to motor driver 3, and motor controller 4 cascades to motor controller 3 to receive pulse signals.
[0119] Furthermore, when the computer PC detects that the motion state of the servo motor does not match the control command, the servo motor fault repair includes:
[0120] Each motor driver will record the corresponding servo motor motion state data and return it sequentially to the cascaded previous motor driver until the first motor driver, and then transmit it back to the computer PC via the motor controller and the TSN switch;
[0121] The computer (PC) determines whether the motion state of the servo motor meets the requirements of the control command.
[0122] If it does not meet the requirements, the aforementioned servo motor fault repair will be performed.
[0123] Furthermore, the step of performing servo motor fault repair if the condition is not met includes:
[0124] The first step is for the computer PC to determine the sub-EtherCAT network where the malfunctioning servo motor is located based on the servo motor's operating status data, and then determine the corresponding motor driver and motor controller.
[0125] The second step is to determine the severity of the servo motor failure based on the operating status data.
[0126] The third step, based on the severity of the fault, is to stop the system, stop / disable the faulty servo motor, or replace the servo motor online.
[0127] Furthermore, based on the severity of the fault, actions such as stopping the system, stopping or disabling the faulty servo motor, or replacing the servo motor online include:
[0128] If the severity of the fault poses a safety risk, immediately stop the machine and perform fault repair.
[0129] If the problem is related to the position or speed of the servo motor, an electrical fault, a mechanical fault, or a bearing fault, and the servo motor cannot accurately sense the position and speed, the computer PC will send a stop / disable servo motor command to stop / disable the faulty servo motor.
[0130] If there is an abnormal temperature or a lost communication data packet, the servo motor will be replaced online.
[0131] Furthermore, the motor controller, motor driver, and servo motor are located in an EtherCAT network and are connected via an EtherCAT interface and bus.
[0132] Each sub-EtherCAT network consists of a motor controller, multiple motor drivers, and corresponding servo motors. The motor controller is the master station, and the motor drivers are the slave stations.
[0133] Furthermore, the servo motor operating status data includes: the servo motor's current position, speed, acceleration, power, temperature, current, voltage, fault codes, alarm information, operating log, and event record information.
[0134] like Figure 2 As shown, the hardware devices involved in this method include:
[0135] (1) PC (Talker): PC (Talker) is the device that sends instructions. Through the TSN switch, it is responsible for sending control instruction data packets to each motor controller and has TSN time synchronization function.
[0136] Alternatively, depending on the scale of the multi-motor synchronous control system required by the actual needs, a PC (Personal Computer) or a server can be selected; if the system is large and requires a high-performance computer, a server should be selected, otherwise a PC should be selected.
[0137] (2) TSN switch: It is a device specifically designed to support real-time and high-reliability communication requirements, ensuring that the transmission delay of instructions and data in the network is predictable and controllable. The TSN switch is a key device for real-time communication and synchronization control within the TSN domain.
[0138] A TSN domain is a logical network area defined within a TSN network. Devices and TSN switches within this domain adhere to the same time synchronization and communication rules. The purpose of a TSN domain is to create a controllable and predictable communication environment to support real-time communication and synchronous control applications. Within a TSN domain, all devices follow the same time base and are controlled and scheduled via TSN switches.
[0139] TSN switches play a crucial role in multi-motor synchronous control systems. They serve as a bridge for bidirectional communication between a computer PC and multiple motor controllers in a sub-EtherCAT network. By providing high-precision clock synchronization, flow scheduling, and predictive data transmission, they help achieve high-performance real-time synchronous control between multiple motors, thereby improving the performance and reliability of the entire system.
[0140] The computer PC and the TSN switch are located on the same network segment of the same local area network (LAN), which is a TSN domain LAN.
[0141] (3) Motor Controllers: The computer PC sends control command data packets to multiple motor controllers (Listeners) in the sub-EtherCAT network via the TSN switch. The computer PC, the TSN switch, and the multiple motor controllers in the sub-EtherCAT network are connected via Ethernet.
[0142] There can be one or more motor controllers, depending on the actual needs. The motor controller acts as a device for receiving control command data packets. Each motor controller is the master station of its sub-EtherCAT network, has TSN time synchronization function, supports EtherCAT interface, receives control command data packets sent from Talker, parses and processes the control command data packets into pulse signals, and sends pulse signals to the first motor driver in its sub-EtherCAT network in real time.
[0143] The computer (PC) and the motor controller have a one-to-many relationship. The division and collaboration of the Talker and Listener roles are crucial for realizing a multi-motor synchronous control system.
[0144] (4) Motor driver: The motor driver is a slave station of the sub-EtherCAT network. The first motor driver is connected to the master station through the EtherCAT interface and bus. The second motor driver is cascaded to the first motor driver, and so on. Each motor driver supports EtherCAT interface communication through EtherCAT bus.
[0145] A sub-EtherCAT network consists of one master station (motor controller) and multiple slave stations (motor drivers). In a sub-EtherCAT network, the motor controller and multiple motor drivers are typically physically connected via cascading. This connection method is commonly referred to as a "cascaded connection" or "series connection." The basic steps are as follows:
[0146] First, the motor controller and the first motor driver are physically connected in the sub-EtherCAT network:
[0147] Next, starting with the first motor driver, connect its output to the input of the next motor driver using an EtherCAT cable. In this way, commands from the motor controller travel along the EtherCAT cable to the next motor driver, and so on.
[0148] Repeated cascading: This process can continue until all motor drivers are connected to the same EtherCAT bus. Each motor driver is connected to the previous motor driver, thus forming a cascade chain. The motor controller sends control pulse signals to all motor drivers through this cascade chain.
[0149] This cascaded or series connection method simplifies wiring, reduces the number of hardware devices, and ensures high performance and real-time capabilities. Such wiring is typically suitable for applications requiring synchronous control of multiple motors, such as industrial automation, robot control, and automated production lines. This topology ensures that control commands and data can be transmitted and synchronized efficiently.
[0150] The motor controller receives control command data packets from the computer PC, parses and converts them into pulse signals, and transmits them to the first motor driver in the EtherCAT sub-network. The remaining motor drivers are cascaded to receive the pulse signals, and each motor driver drives the corresponding servo motor to rotate or move.
[0151] The first step involves the motor controller in the sub-EtherCAT network generating pulse signals (such as motion commands, speed settings, position settings, etc.) to the first motor driver based on the control command data packets sent by the computer PC.
[0152] The second step is that after the first motor driver receives the pulse signal, it executes the relevant servo motor operation, that is, controls the corresponding first servo motor.
[0153] Thirdly, at the same time, the first motor driver continues to transmit the pulse signal to the next cascaded second motor driver;
[0154] Fourth, after receiving the pulse signal from the first motor driver, the second motor driver executes the corresponding servo motor operation, that is, controls the second servo motor.
[0155] This cascading process can continue, sequentially transmitting pulse signals to each cascaded motor driver to synchronously control multiple servo motors.
[0156] This cascading approach allows for coordinated motion control of multiple servo motors, where the movements of different servo motors are synchronized. Typically, each motor driver in the cascading chain has a unique address or identifier to ensure that commands are correctly delivered to the specific servo motor.
[0157] In summary, cascaded motor drivers work together by passing commands in a cascade chain to ensure that multiple servo motors move synchronously in the desired manner. This is crucial for applications that require coordinating multiple servo motors to perform complex tasks simultaneously.
[0158] The motor driver receives pulse signals from the motor controller to control the movement and behavior of the servo motor, and can control the position and speed of the servo motor.
[0159] (5) Servo motors: When multiple servo motors are used as devices to execute commands, real-time synchronous control is necessary when multiple servo motors perform corresponding actions at the same time.
[0160] like Figure 2 As shown in the illustration, two motor controllers are connected to the TSN switch, and one motor controller is connected to two drivers. In this solution, there can be multiple motor controllers; there is no fixed maximum limit to the number of motor controllers. The specific number depends on the application requirements and system design. The following factors need to be considered to determine the exact number of motor controllers:
[0161] (1) System Scale: System scale is one of the main factors determining the number of motor controllers required. Large-scale industrial automation systems require multiple motor controllers to correspond to different motor drivers and servo motors, while small-scale applications only require a few motor controllers;
[0162] (2) Number of motors: The number of servo motors is also a major factor in determining how many motor controllers are needed;
[0163] (3) System complexity: The complexity of the system will also affect the number of motor controllers. If the system requires highly complex control strategies and multiple servo motors to work together, more motor controllers are needed to achieve this.
[0164] (4) Performance requirements: If the system has high requirements for real-time performance, accuracy and synchronization, more motor controllers are needed to ensure the control performance of each servo motor;
[0165] (5) Reserved capacity: When designing the system, it is necessary to reserve some additional capacity so that the system can be expanded in the future.
[0166] In summary, this solution does not impose a hard limit on the number of motor controllers. The number of motor controllers depends on the system requirements and design strategy. During the system design phase, the system's scale, complexity, performance requirements, and potential future expansion are comprehensively considered to determine an appropriate number of motor controllers.
[0167] Meanwhile, within a sub-EtherCAT network, one motor controller can correspond to multiple motor drivers, with a 1:1 relationship between motor drivers and servo motors. The number of motor drivers (i.e., the number of servo motors) corresponding to one motor controller needs to consider the following factors:
[0168] (1) Motor controller performance: The performance of the motor controller will directly affect the number of drivers and servo motors it can control;
[0169] (2) Communication bandwidth: Communication between the motor controller and the driver requires a certain bandwidth. A larger communication bandwidth can support more drivers and servo motors.
[0170] (3) Control strategy: If the system application requires highly coordinated multi-motor motion control, more motor controller resources are needed;
[0171] (4) Real-time performance and synchronization: If the system application has high requirements for real-time performance and application performance, the motor controller will need more resources to ensure synchronization between multiple servo motors.
[0172] Although a single motor controller can control multiple motor drivers and servo motors, a system-level performance evaluation and testing verification must be conducted in advance when determining the specific number to ensure that each servo motor receives sufficient control resources.
[0173] The benefits of the multi-motor synchronous control method based on TSN and EtherCAT heterogeneous networks are as follows:
[0174] 1. High-performance real-time synchronous control: A single TSN network can connect to multiple sub-EtherCAT networks, enabling high-performance, high-real-time, and high-synchronization communication in various industrial automation applications. The TSN network provides high-precision clock synchronization and flow scheduling mechanisms, ensuring real-time communication throughout the network. Combined with EtherCAT's real-time Ethernet protocol, high-performance data transmission and control calculations can be achieved, improving the real-time performance of multi-motor systems.
[0175] 2. Improved Synchronization: The clock synchronization mechanism in the TSN network ensures that the clocks of each node remain synchronized, avoiding the accumulation of time errors between servo motors. Combined with the synchronization mechanism in EtherCAT, high-precision synchronous control between multiple servo motors can be achieved, ensuring coordinated operation and motion accuracy of the motors.
[0176] 3. Advantages of heterogeneous networks: By integrating two different communication technologies, TSN and EtherCAT, the advantages of each can be fully utilized. TSN provides time synchronization and predictable latency, while EtherCAT provides real-time data transmission and synchronous control capabilities. This heterogeneous network combines the advantages of both, enabling higher-performance control in complex multi-motor synchronous control systems.
[0177] 4. Enhanced network reliability: The TSN network improves data transmission reliability through a fault recovery mechanism, ensuring the stable operation of multi-motor systems;
[0178] 5. Flexibility and Scalability: By combining TSN with EtherCAT, heterogeneous network architectures can be achieved, allowing for flexible deployment and expansion of multi-motor systems. The TSN network supports distributed nodes and segmented configurations, enabling synchronous control of larger-scale servo motor clusters, and can adapt to the needs of multi-motor control systems of different sizes and complexities.
[0179] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0180] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A multi-motor synchronous control method based on TSN and EtherCAT heterogeneous networks, characterized in that, include: Configure the computer PC, motor controller, and TSN switch to be in the same network segment of the same TSN domain; Establish communication between the computer PC, TSN switch and multiple motor controllers, set the clock synchronization period and time difference threshold, and perform clock synchronization initialization; The clock synchronization initialization includes: In the TSN domain, the gPTP synchronization method is used to align the hardware timestamps of the computer PC with those of each motor controller. In each sub-EtherCAT network, a distributed clock synchronization mechanism is adopted, with each motor controller as the master reference clock of each sub-EtherCAT network. The link propagation delay and initial clock offset from the master reference clock to the first motor driver in each corresponding slave station are calculated. The first motor driver calculates the local clock error based on the master station reference clock, link propagation delay, and initial clock offset. Based on this local clock error, the local system time of the first motor driver is adjusted to its calibration clock, including: Using the hardware timestamps of each motor controller as the master station reference clock, the link propagation delay and initial clock offset from the reference clock to the corresponding first motor driver are calculated. The first motor driver calculates the local clock error based on the master station reference clock, link propagation delay, and initial clock offset; Wherein, the initial clock offset refers to the time difference between the master reference clock of the motor controller and the local clock of the first motor driver when the clock synchronization initialization process begins; the link propagation delay is the transmission delay between the motor controller and the first motor driver; The local clock error of the first motor driver is calculated as follows: E1=C i -T i -T refi Where E1 is the local clock error of the first motor driver corresponding to motor controller i, and C i T is the local clock for the first motor driver corresponding to motor controller i. i T is the link propagation delay for the first motor driver corresponding to motor controller i. refi This is the reference clock for motor controller i; The first motor driver adjusts the calibrated clock based on the local system time and the local clock error; The cascaded motor drivers are based on the calibration clock of the previous motor driver, with a micro-clock drift added sequentially to obtain the calibration clock of each cascaded motor driver; wherein, the micro-clock drift is obtained by the computer PC sending a synchronization command in advance and by calculating the link transmission delay between the second motor driver and the first motor driver in each sub-EtherCAT network; Within one clock synchronization cycle, the computer PC sends control command data packets to each of the motor controllers via the TSN switch. Each motor controller parses the control command data packets into pulse signals and sends them to the first motor driver in the corresponding sub-EtherCAT network. The remaining motor drivers in the sub-network are cascaded to receive the pulse signals. Each motor driver transmits the motion status of its corresponding servo motor back to the computer PC. When the computer PC detects that the motion status of the servo motor does not match the control command, it performs fault repair on the servo motor and triggers clock synchronization initialization. Alternatively, when the computer PC detects that the total delay in the execution of the control command is greater than the time difference threshold, it triggers clock synchronization initialization. The time difference threshold is the maximum allowable difference between the timestamp of the computer PC sending the control command data packets and the timestamp of the motor drivers receiving the pulse signals. The clock synchronization is periodically resynchronized based on the clock synchronization cycle; when the clock synchronization cycle ends, clock synchronization initialization is triggered again.
2. The method according to claim 1, characterized in that, The establishment of communication between the computer PC, TSN switch, and multiple motor controllers includes: The computer PC acts as the server, creating a server socket; Configure the server connection to be multi-threaded and perform polling and listening. Each of the motor controllers is connected to the server via a TSN switch, acting as a client. When the server obtains a connection from a new client through polling, it creates a sub-thread to communicate with that client.
3. The method according to claim 1, characterized in that, The control command data packet contains a sending timestamp; The motor controller in each sub-EtherCAT network receives the control command data packet, parses it into a pulse signal, and sends it to the first motor driver in the sub-EtherCAT network; The first motor driver extracts its corresponding instruction based on the address and transmits the remaining instructions to the next motor driver via the EtherCAT bus, and so on, with the remaining motor drivers cascading in sequence to receive pulse signals. Each motor driver receives the pulse signal to drive the corresponding servo motor to move, and at the same time records the timestamp of the received pulse signal and uploads it to the computer PC. The total delay in executing the control command is obtained based on the timestamp of the received pulse signal and the timestamp of the transmitted signal.
4. The method according to claim 3, characterized in that, When the computer PC detects that the motion state of the servo motor does not match the control command, the servo motor fault repair includes: Each motor driver will record the corresponding servo motor motion state data and return it sequentially to the cascaded previous motor driver until the first motor driver, and then transmit it back to the computer PC via the motor controller and the TSN switch; The computer (PC) determines whether the motion state of the servo motor meets the requirements of the control command. If it does not meet the requirements, the servo motor fault repair will be performed.
5. The method according to claim 4, characterized in that, The step of performing servo motor fault repair if the condition is not met includes: The first step is for the computer PC to determine the sub-EtherCAT network where the malfunctioning servo motor is located based on the servo motor's operating status data, and then determine the corresponding motor driver and motor controller. The second step is to determine the severity of the servo motor failure based on the operating status data. The third step, based on the severity of the fault, is to stop the system, stop / disable the faulty servo motor, or replace the servo motor online.
6. The method according to claim 5, characterized in that, Based on the severity of the fault, actions such as shutting down the system, stopping or disabling the faulty servo motor, or replacing the servo motor online include: If the severity of the fault poses a safety risk, immediately stop the machine and perform fault repair. If the problem is related to the position or speed of the servo motor, an electrical fault, a mechanical fault, or a bearing fault, and the servo motor cannot accurately sense the position and speed, the computer PC will send a stop / disable servo motor command to stop / disable the faulty servo motor. If there is an abnormal temperature or a lost communication data packet, the servo motor will be replaced online.
7. The method according to any one of claims 1-6, characterized in that, include: The motor controller, motor driver, and servo motor are located in an EtherCAT network and are connected via an EtherCAT interface and bus. Each sub-EtherCAT network consists of a motor controller, multiple motor drivers, and corresponding servo motors. The motor controller is the master station, and the motor drivers are the slave stations.
8. The method according to any one of claims 1-6, characterized in that, The servo motor operating status data includes: the servo motor's current position, speed, acceleration, power, temperature, current, voltage, fault codes, alarm information, operating log, and event record information.
Citation Information
Patent Citations
Method for multi-machine frequency converter generating synchronization signal, and multi-machine frequency converter
CN105612465A
Multi-robot control synchronization system and method based on distributed clocks
CN107196724A
Robot servo system, fault debugging method and device thereof and electronic equipment
CN111338329A
Service robot control system based on industrial Ethernet
CN113110364A
Robot control system integrating industrial bus and TSN real-time network
CN115847402A