A Large G-Code Data Processing and Transmission Method for an EtherCAT Bus-Type Motion Control System

By independently completing G code compilation and transmission in the EtherCAT bus-type motion control system, large G code data is efficiently processed and transmitted between the upper computer and the main station controller, solving the problem of limited system computing and processing speed and improving the machining accuracy of the workpiece.

CN115576559BActive Publication Date: 2025-05-27HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211105173.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2025-05-27
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

When the existing EtherCAT bus-type motion control system processes and transmits large G-code data, there are problems of limited computing and processing speed, which affects the machining accuracy of the workpiece.

Method used

By independently compiling the G code in the upper computer, a G code intermediate array file is generated, and the SSHTest software is used to transmit the file to the master controller under the SSH2 protocol. The Linux process in the master controller transmits data to the Xenomai process through the XDDP protocol, performs interpolation algorithm operations and saves it in a buffer in a ring queue. The EtherCAT program module obtains data from the buffer and issues it to the servo drive through the EtherCAT protocol.

Benefits of technology

It realizes the independent completion of G code compilation in the upper computer, does not affect the performance of the main site controller, solves the problems of large-scale G code data storage and thread synchronization, and improves the real-time and processing accuracy of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115576559B_ABST
    Figure CN115576559B_ABST
Patent Text Reader

Abstract

A method for processing and transmitting large G-code data in an EtherCAT bus-type motion control system, which relates to the field of automation control. The host computer uses a Windows numerical control system. In this method, the G-code file is imported into the G-code compilation software of the host computer. The G-code compilation software checks and compiles the input G-code file and generates an intermediate array file in a specified format. Then, the SSHTest software transfers the intermediate array file from the host computer to the master controller. After the G-code intermediate array file is transmitted to the master controller, it is parsed, calculated, and transmitted to the EtherCAT program module through software. Semaphores and mutexes are used to manage the access process of a large amount of G-code data in the buffer. The motion data of each axis is transmitted to the servo driver periodically at a high frequency through the EtherCAT protocol. The servo driver supports the EtherCAT protocol, and the motion axis is driven by the servo driver.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automation control, and particularly to large G-code data processing technology. Background Art

[0002] Currently, most domestic high-end equipment uses foreign high-end motion controllers as the core of motion control. Therefore, there is an urgent need for an independent innovative motion control solution in the field of domestic high-end manufacturing equipment technology. EtherCAT bus technology has characteristics such as good real-time performance, high transmission efficiency, short communication cycle, and good synchronization performance, which are suitable for the motion control requirements of high-end machine tool equipment. Therefore, it is of great significance to study the EtherCAT bus-based motion control system.

[0003] For high-end numerical control machine tool equipment, it is usually necessary to process some precision or complex parts. For example, when performing ultra-precision machine tool manufacturing, due to high workpiece precision requirements, complex shapes, large machining surfaces, etc., it is often necessary to write large G-code files to control the movement of each axis of the machine tool. The G-code files can often reach hundreds of megabytes or even dozens of gigabytes in size. However, if there is no appropriate method to manage the processing and transmission of such a large amount of G-code data, it will seriously affect the operation and processing speed in the motion control system, thereby seriously reducing the machining accuracy of the workpiece. Therefore, it is necessary to solve the problem of processing and transmission of large G-code data in the system during the research of the EtherCAT bus-based motion control system. Summary of the Invention

[0004] The present invention is to solve the problem of processing and transmission of large G-code data in the existing EtherCAT bus-based motion control system, and thus provides a method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system.

[0005] A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system, characterized in that: the method includes the following steps:

[0006] Step 1: Import the G-code file into the G-code compilation software of the upper computer. The G-code compilation software automatically checks the format and syntax of the imported G-code. If an error is reported, modify it according to the error content, and then check the format and syntax of the modified G-code file again through the G-code compilation software until no error is reported and then compile to generate a G-code intermediate array file;

[0007] Step 2: The upper computer transmits the G-code intermediate array file generated in Step 1 to the master controller through the SSHTest software embedded in it under the SSH2 protocol;

[0008] Step 3: The Linux process in the master station controller obtains the content in the intermediate array file transmitted by the host computer and transmits it to the Xenomai process through the XDDP protocol provided by the Xenomai kernel;

[0009] Step 4: The Xenomai process extracts data line by line from the content in the received intermediate array file, and performs operations on the extracted data using an interpolation algorithm in the data transfer controller; to obtain the axis data in the intermediate array file;

[0010] Step 5: Save the axis data in the intermediate array file obtained in Step 4 in a buffer in the form of a circular queue, and the EtherCAT program module obtains the specific data of each axis from the buffer;

[0011] Step 6: In the EtherCAT program in the EtherCAT program module, use the mechanism of semaphores and mutexes to maintain the data in the buffer, ensuring that the data in the buffer can be stored and retrieved quickly and safely;

[0012] Step 7: The EtherCAT program sends the data to each axis servo driver through the EtherCAT protocol at a set communication cycle of 250 μs;

[0013] Step 8: After receiving the data, each servo driver drives each axis to move according to the content of the G-code file, completing the processing and transmission of large G-code data in an EtherCAT bus-type motion control system.

[0014] The beneficial effects obtained by the present invention are as follows:

[0015] (1) The present invention can independently complete the compilation of G-code in the host computer, and then the SSHTest software transmits the compiled G-code intermediate array file to the master station controller. The compilation of G-code and the arithmetic processing of the master station controller are carried out on different devices, and the compilation process of the host computer G-code compilation software will not affect the performance of the master station controller;

[0016] (2) The present invention solves the problem of data storage of large G-code in the research process of EtherCAT bus-type motion control systems, uses a smaller memory space in the master station controller to store G-code data during the operation process, and reduces the hardware performance requirements for the master station controller;

[0017] (3) The present invention solves the thread synchronization problem of two G-code processing threads in the master station controller. The two threads can operate the data buffer reasonably and orderly when processing large G-code data volumes, ensuring the safety and stability of the program operation.

[0018] (4) The present invention makes a real-time extension to the controller operating system by using the Xenomai real-time extension kernel. Its hard real-time feature can ensure the stable operation of real-time programs in the controller and reduce the errors caused by system task scheduling delays in processing.

[0019] (5) The present invention uses the EtherCAT bus protocol to implement communication between the controller and the servo drive, which can ensure the real-time and synchronization of communication and greatly improve the processing accuracy of the motion control system from the aspect of communication. Description of the Drawings

[0020] Figure 1 is a schematic diagram of the large G-code data processing and transmission process of the ultra-precision numerical control system based on the EtherCAT bus of the present invention;

[0021] Figure 2 is a schematic diagram of the design flow of the G-code compilation software of the present invention;

[0022] Figure 3 is a schematic diagram of the software interface of the G-code compiler of the present invention;

[0023] Figure 4 is a schematic diagram of the compilation information prompt interface of the G-code compiler of the present invention;

[0024] Figure 5 is a schematic diagram of the software interface of the SSHTest of the present invention;

[0025] Figure 6 is a schematic diagram of the XDDP cross-domain communication principle of the present invention;

[0026] Figure 7 is a schematic diagram of the structural principle of the buffer of the present invention;

[0027] Figure 8 is a schematic diagram of the production and consumption relationship of G-code interpolation data of the present invention;

[0028] Figure 9 is a schematic diagram of the priority setting of G-code data processing tasks of the present invention;

[0029] Figure 10 is a schematic diagram of the process of synchronously processing G-code data with dual real-time tasks of the present invention; Detailed Embodiments

[0030] Detailed Embodiment 1. The following further describes this embodiment and this application in terms of patents with reference to the attached Figures 1-10 to further explain this embodiment and this application:

[0031] The present invention discloses a method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system. The method includes the following steps:

[0032] Step 1: Import the G-code file into the G-code compilation software of the host computer. The G-code compilation software automatically checks the format and syntax of the imported G-code. If an error is reported, modify it according to the error content, and then check the format and syntax of the modified G-code file again through the G-code compilation software until there is no error, and then compile and generate a G-code intermediate array file;

[0033] Step 2: The host computer uses the SSHTest software embedded in it to transmit the G-code intermediate array file generated in Step 1 to the master station controller under the SSH2 protocol;

[0034] Step 3: The Linux process in the master station controller obtains the content in the intermediate array file transmitted by the host computer and transmits it to the Xenomai process through the XDDP protocol provided by the Xenomai kernel;

[0035] Step 4: The Xenomai process extracts data line by line from the content in the received intermediate array file, and uses the interpolation algorithm to perform operations on the extracted data in the data transfer controller; obtain the axis data in the intermediate array file;

[0036] Step 5: Save the axis data in the intermediate array file obtained in Step 4 in a buffer in the form of a circular queue. The EtherCAT program module obtains the specific data of each axis from the buffer;

[0037] Step 6: In the EtherCAT program in the EtherCAT program module, use the mechanisms of semaphores and mutexes to maintain the data in the buffer, ensuring that the data in the buffer can be stored and retrieved quickly and safely;

[0038] Step 7: The EtherCAT program sends the data to each axis servo driver through the EtherCAT protocol with a set communication cycle of 250 μs;

[0039] Step 8: After receiving the data, each servo driver drives each axis to move according to the content of the G-code file, completing the large-scale G-code data processing and transmission of an EtherCAT bus-type motion control system.

[0040] Preferably, when the G-code compilation software in Step 1 compiles a large G-code file, the G-code compilation software has an automatic error detection and reporting function, which is convenient for users to find and correct errors in the G-code according to the prompts. At the same time, the G-code compilation software can save files, and the generated G-code intermediate array file can be automatically named according to preset rules and saved in a specified location.

[0041] Preferably, the function of the SSHTest software in step two is: for the communication between the host computer and the master station controller during the data transmission process of the motion control system, it is used to transmit the G-code intermediate array file to the specified path of the master station controller with a preset file name.

[0042] Preferably, in the said step three, the XDDP protocol is: a cross-domain communication method between Linux and Xenomai processes provided in the Xenomai real-time extension kernel. To ensure the real-time performance of tasks in the Xenomai process, the content of the G-code intermediate array file is read through the Linux process, and then the read strings are sent to the Xenomai process line by line through the XDDP protocol.

[0043] Preferably, to ensure that the data volume in the Xenomai process can meet the data processing speed at the rear and the communication speed of the EtherCAT bus with a 250 μs cycle, the XDDP protocol communication cycle is set to 1 μs, that is, one line of G-code content can be received every 1 μs.

[0044] Preferably, in the said step five, since the data transmission speed before and during interpolation is fast and the EtherCAT communication speed is relatively slow, a data buffer is established; since the data transmission in the G-code needs to meet the requirement of first-in first-out, the data access and storage are implemented using a queue; and since the G-code data volume is very large, the buffer data storage is implemented using a circular queue.

[0045] Preferably, in the said steps four to five, an interpolation thread is written in the Xenomai process to perform interpolation operations after receiving the data transmitted from the Linux side, and a set of data obtained from the operations is inserted into the buffer; another EtherCAT thread is written in the Xenomai process to retrieve data from the buffer and transmit the data content from the master station controller to the driver through the EtherCAT protocol; the interpolation thread and the EtherCAT thread are in a synchronous running state.

[0046] Preferably, in the said step five, 10,000 groups of data spaces are established in the buffer. Each group of spaces can store the data for one cycle of EtherCAT communication. The total space occupied by the entire buffer is less than 2 MB, and it can cyclically access an infinite number of groups of G-code data.

[0047] Preferably, in the said step six, two semaphores are set, which are respectively used to manage the interpolation thread and the EtherCAT thread. The two semaphores can control the insertion and retrieval of data in the buffer according to the state of the space in the buffer. The buffer state is divided into three types: empty, normal, and full; the mutex lock can prevent the two threads from operating on the buffer simultaneously and causing the program to crash, ensuring that the two threads operate on the buffer orderly during the synchronous running process.

[0048] Preferably, in the seventh step, the EtherCAT bus supports the use of an object dictionary. The EtherCAT program can retrieve the data in the buffer and assign it to a data object, and this data can be transmitted via the network cable to the corresponding object of a specific driver.

[0049] Preferably, in the eighth step, the servo driver used in the present invention should be a driver that supports the EtherCAT bus protocol.

[0050] Working principle: The processing and transmission process of G-code data in the developed numerical control is as Figure 1 shown in the figure. A G-code compilation software is developed in the host computer to compile the imported G-code file and generate an intermediate array file. At the same time, an SSHTest software is developed in the host computer to transmit the compiled intermediate array file to the controller using the SSH protocol. The Linux process parses the content of the intermediate array file and transfers the data in the Linux domain to the Xenomai domain through the XDDP protocol. A real-time thread is created in the Xenomai domain to process the received data. The G-code data is transmitted to the Xenomai domain in the form of a string. The string processing function parses the data in the string line by line and inserts it into a temporary structure for the interpolation function to call for interpolation operations. The interpolation function inserts the data generated after the operation into the buffer in sequence. The buffer, the interpolation function for inserting data, and the EtherCAT program for retrieving data are maintained through a mutex lock and a semaphore. After detecting that there is data in the buffer, the EtherCAT program starts data transmission. The G-code data corresponding to each axis is transmitted to the slave drive device through the EtherCAT protocol at a communication frequency of 250 μs, and the drive can drive each axis to start executing tasks according to the data in the G-code.

[0051] The working process of the G-code compilation software is as Figure 2 shown in the figure. First, obtain the content of the G-code file, and then perform simple processing on the obtained string; call a function to perform line processing on each line of the code; call a function to perform syntax processing and checking to check whether there are syntax conflicts of function words in the data structure storing values in units of lines; insert the data in each line into the intermediate code array by calling a function; handle error and warning data.

[0052] The software interface of the G-code compilation software is as Figure 3As shown in the figure, the software has file management functions, online display and editing functions of G-code, and G-code compilation functions. When compiling a certain G-code file, first click the open button to enter the file management interface, find the location where the file is saved on the computer, and click OK to see the specific path of the file in the text box on the software interface. At the same time, the software can read the content of the file and display the content in the G-code editing box on the right side of the software interface. You can view the content of the G-code file in the G-code editing box or directly modify the content in the editing box. After modification, click Save to synchronize the modified content to the G-code file. After checking that the code is correct, click the compile button to compile the G-code.

[0053] After clicking Compile, the software automatically pops up a program compilation information interface, which mainly gives the error information of G-code compilation. When there is a problem with the G-code content, the popped-up information interface is as Figure 4 shown. The interface gives the name of the G-code file, the line number where the error or warning is located, the code of the error or warning, the prompt message of the error or warning, as well as the number of errors and warnings in the program. When the G-code content is correct, it is prompted that there are 0 errors and 0 warnings in the program, indicating that the G-code compilation is successful.

[0054] The G-code compilation software of the present invention sets its own set of file saving schemes. The intermediate array file output after the software compilation is automatically saved in the preset file path, and the folder name where the file is located is composed of "year-month-day" at the time of compilation completion. To avoid the problem of the same file name being saved, the name of the intermediate array file is set to be composed of "hour-minute-second" at the time of compilation completion in the program. After completing a G-code compilation, the user can go to the specified path and find the intermediate array text file at the corresponding time in the corresponding date folder.

[0055] The interface of the SSHTest software is as Figure 5 shown. On the premise that the remote login connection is successful, click the transfer button to open the file management interface of the host computer, find the G-code compiled file to be transferred from the host computer, and after confirmation, the specific location of the file can be obtained in the path editing bar on the software interface. Click the file transfer button, and the program starts a file transfer thread. In order to make it more convenient and fast for the controller to automatically find the location of the file after receiving the file, the SSHTest software sets the specific path and file name where the file is saved in the master station controller.

[0056] For the intermediate array file transmitted from the host computer, the master station controller needs to perform file operations on it to obtain the file content. The controller has dual kernels of Linux and Xenomai. If the Xenomai real-time task is directly called to process the file, the real-time performance of the real-time task itself will be damaged. Xenomai provides the XDDP cross-domain communication protocol. In the present invention, the file content is obtained through a Linux non-real-time process and transmitted to the Xenomai real-time process in the form of a string through XDDP.

[0057] The schematic diagram of XDDP cross-domain communication is as Figure 6 shown. The Linux process opens the intermediate array file, obtains each line of content in turn, saves it into a string, and then sends it to the Xenomai process through the bound XDDP communication device port. There are two real-time threads in the Xenomai process, namely the interpolation thread and the EtherCAT thread. In the interpolation thread, the string is received in a loop, and the loop period is set to 1 μs. Then, the string received each time is parsed, and the parsed G-code data is stored in a temporary structure. The real-time interpolation program calls the data in the structure to perform interpolation operations.

[0058] Since the speed of generating data by the interpolation operation is faster than the speed of data distribution by the EtherCAT bus, it is necessary to set up a buffer to store the redundant axis data. To meet the principle of first in first out and the storage of a large amount of G-code data, the present invention uses a circular queue as the buffer. 10,000 units are set in the buffer, and the structural principle of the buffer is as Figure 7 shown.

[0059] After the buffer is established, it is necessary to determine whether the buffer is empty or full, and what should be done in case of emptiness or fullness. The buffer designed in this article is used to produce data by the interpolation task and consume data by the EtherCAT task. Therefore, such problems belong to the producer and consumer problems, and their relationship is as Figure 8 shown. The present invention uses semaphores to handle this problem. Semaphores are used for task synchronization of multiple threads. It can be realized that when a certain thread completes a certain specific action, it tells other threads to enable other threads to perform other tasks.

[0060] Two semaphores are established for two real-time threads of the operation buffer, namely the producer semaphore psem and the consumer semaphore csem. For the producer, it needs space in the buffer to produce data. Therefore, the resource of psem is the space of the buffer, and the number of resources is set to 10,000 when initializing psem. For the consumer, it needs data in the buffer to execute its own tasks. Therefore, the resource of csem is the data in the buffer, and the number of its resources is set to 0 when initializing csem. When the resource of a certain semaphore is zero, the semaphore function will block the thread corresponding to the semaphore. When the semaphore regains the resource, the thread block is cancelled. At the beginning of the program running, the buffer is in a state without data, that is, the resource number of psem is 10,000, and the producer thread will continue to produce interpolation data, while the resource number of csem is 0, and the consumer thread will be temporarily blocked in the initial stage due to lack of resources. When the producer generates a data, the resource number of psem is decreased by 1, and psem will give a signal to csem to increase its resource number by one, thus waking up the consumer thread. Since the producer's production speed is faster than the consumer's consumption speed, the buffer will be filled with data after a period of time. At this time, the resource number of psem is 0, and the producer thread is temporarily blocked and cannot produce data, while the resource number of csem is 1,000, and the EtherCAT task can continuously consume data. When the consumer consumes a data, the resource number of csem is decreased by 1, and csem gives a signal to psem to increase its resource number by one, thus waking up the producer thread, and the producer starts to continue producing data. In this way, the data access of the entire buffer is realized in a loop.

[0061] Both the interpolation program and the EtherCAT communication program have high real-time requirements. Xenomai provides a dedicated real-time task management interface for them, and the two programs can be respectively put into two created real-time tasks for execution. In the invention, two real-time tasks, Task A and Task B, are created. Among them, Task A is used to execute the interpolation task, and Task B is used to execute the EtherCAT task. When creating a task, the priority can be set for the task according to needs, as Figure 9 shown, in the text, the priority of Task A is set to 98, and the priority of Task B is set to 99.

[0062] When the tasks are running, the task with a higher priority will preempt the resources required for task execution first. Since the EtherCAT task needs to ensure the stability of the communication cycle, the highest priority is set for it; the interpolation task needs to ensure that it has a high interpolation operation speed to meet the data consumption of the EtherCAT task, so the second highest priority is set for it; if other ordinary tasks have resource conflicts with high-priority tasks, they need to wait until the high-priority tasks release the resources they need before they can execute.

[0063] During the synchronous execution of Task A and Task B, it is set that the interpolation operation and EtherCAT communication are carried out simultaneously. However, since the two tasks share the data resources of the buffer, it is inevitable that while the interpolation task is operating on the buffer, the EtherCAT communication task is also operating on the buffer, which will cause data chaos and lead to program operation errors. Therefore, it is necessary to ensure that the two tasks are synchronized as a whole. However, specifically at each time point, the two tasks operate on the buffer data in sequence.

[0064] Mutex is a common method for thread synchronization. When a thread locks a code block, other threads will be blocked when encountering this mutex. Only after the locking thread executes the unlocking operation can other threads preempt the mutex to execute the code. Here, the mutex can also be used to achieve the orderly access of two tasks to the shared space. The processing process of Task A and Task B for the interpolation data is as Figure 10 shown. In Task A, the interpolation algorithm continuously generates interpolation data, then encapsulates the generated interpolation data and inserts it into the pre-established buffer. Before the insertion operation, Task will lock the buffer. At this time, Task B cannot take out data from the buffer. Since the speed of inserting data is very fast, the impact of locking the buffer on the EtherCAT cycle is extremely small. After Task A inserts the data, it unlocks the buffer. Then Task B can lock the buffer to take out the data. At this time, Task A cannot operate on the buffer. After Task B unlocks, it will first unpack the data and then enter an EtherCAT cycle interval. During the interval, Task A has been operating on the buffer. Once Task B reaches the next cycle time point, due to its higher priority, Task B in the unlocked state will preempt the mutex to operate on the buffer first. Such a cycle realizes the entire processing process of the interpolation data.

[0065] The EtherCAT program sequentially takes out the data of each axis from the buffer and assigns it to the corresponding data object of the slave device, and then issues it to the servo driver in real time with a cycle of 250 μs. The servo driver supports the EtherCAT protocol and can drive the motion axis to execute corresponding actions according to the data sent by the master station.

[0066] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for processing and transmitting large G-code data in an EtherCAT bus-based motion control system, characterized in that: The method includes the following steps: Step 1: Import the G-code file into the G-code compilation software of the host computer. The G-code compilation software automatically checks the format and syntax of the imported G-code. If an error is reported, modify it according to the error content, and then check the format and syntax of the modified G-code file again through the G-code compilation software until no error is reported, and then compile and generate a G-code intermediate array file; Step 2: The host computer uses the SSHTest software embedded in it to transmit the G-code intermediate array file generated in Step 1 to the master controller under the SSH2 protocol; Step 3: The Linux process in the master controller obtains the content in the intermediate array file transmitted by the host computer and transmits it to the Xenomai process through the XDDP protocol provided by the Xenomai kernel; Step 4: The Xenomai process extracts data line by line from the content in the received intermediate array file, and performs operations on the extracted data using an interpolation algorithm in the data transmission controller; obtain the axis data in the intermediate array file; Step 5: Save the axis data in the intermediate array file obtained in Step 4 in the buffer, and the EtherCAT program module obtains the specific data of each axis from the buffer; Step 6: In the EtherCAT program in the EtherCAT program module, use the mechanism of semaphore and mutex to maintain the data in the buffer to ensure that the data in the buffer can be stored and retrieved quickly and safely; Step 7: The EtherCAT program issues data to each axis servo driver through the EtherCAT protocol with a set communication cycle of 250 μs; Step 8: After receiving the data, each servo driver drives each axis to move according to the content of the G-code file, completing the processing and transmission of large G-code data in an EtherCAT bus-based motion control system.

2. The method for processing and transmitting large G-code data in an EtherCAT bus-based motion control system according to claim 1, characterized in that: When the G-code compilation software in Step 1 compiles a large G-code file, the G-code compilation software has an automatic error detection and reporting function, which is convenient for users to find and correct errors in the G-code according to the prompts. At the same time, the G-code compilation software can save files, and the generated G-code intermediate array file can be automatically named according to a preset rule and saved in a specified location.

3. The method for processing and transmitting large G-code data in an EtherCAT bus-based motion control system according to claim 1, characterized in that: The function of the SSHTest software in Step 2 is: for the communication between the host computer and the master controller during the data transmission process of the motion control system, and is used to transmit the G-code intermediate array file to the specified path of the master controller with a preset file name.

4. A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system according to claim 1, characterized in that: In the third step, the XDDP protocol is a cross-domain communication method between Linux and Xenomai processes provided in the Xenomai real-time extension kernel. To ensure the real-time performance of tasks in the Xenomai process, the content of the G-code intermediate array file is read by the Linux process, and then the read strings are sent line by line to the Xenomai process through the XDDP protocol.

5. A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system according to claim 1, characterized in that: In the fifth step, since the data transmission speed before and during interpolation is fast and the EtherCAT communication speed is relatively slow, a data buffer is established; since the data transmission in G-code needs to meet the requirement of first-in-first-out, the data access is implemented using a queue; and since the amount of G-code data is very large, the data storage is implemented using a circular queue.

6. A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system according to claim 1, characterized in that: In the fourth to fifth steps, an interpolation thread is written in the Xenomai process to perform interpolation operations after receiving the data transmitted from the Linux side, and a set of calculated data is inserted into the buffer; another EtherCAT thread is written in the Xenomai process to retrieve data from the buffer and transmit the data content from the master controller to the driver through the EtherCAT protocol; the interpolation thread and the EtherCAT thread are in a synchronous running state.

7. A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system according to claim 1, characterized in that: In the fifth step, 10,000 groups of data spaces are established in the buffer. Each group of spaces can store the data for one cycle of EtherCAT communication. The total space occupied by the entire buffer is less than 2MB, and an infinite number of groups of G-code data can be accessed cyclically.

8. A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system according to claim 1, characterized in that: In the sixth step, two semaphores are set to manage the interpolation thread and the EtherCAT thread respectively. The two semaphores can control the insertion and retrieval of data in the buffer according to the status of the space in the buffer. The buffer status is divided into three types: empty, normal, and full; the mutex lock can prevent the two threads from operating on the buffer simultaneously and causing the program to crash, ensuring that the two threads operate on the buffer in an orderly manner during the synchronous running process.

9. A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system according to claim 1, characterized in that: In the seventh step, the EtherCAT bus supports the use of an object dictionary. The EtherCAT program can retrieve the data in the circular queue and assign it to the data object, and this data can be transmitted through the network cable to the corresponding object of a specific driver.

10. A method for processing and transmitting large G-code data of an EtherCAT bus-based motion control system according to claim 1, characterized in that: in the eighth step, the servo driver used in the present invention should be a driver that supports the EtherCAT bus protocol.