Numerical control operation control device and method based on EtherCAT
The EtherCAT-based CNC operation control device solves the problem of poor scalability of traditional matrix operation panels, achieves flexible function expansion, reduces hardware replacement costs, and improves operation efficiency and system stability.
Patent Information
- Application Number
- CN202510802781.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-09-16
AI Technical Summary
Traditional matrix operation panels have poor scalability and are unable to quickly and flexibly adapt to the diverse needs of industrial automation technology, resulting in high upgrade costs and low production efficiency for enterprises.
It uses an EtherCAT-based CNC operation control device, including an FPGA module, matrix buttons, STM32 module, ESC controller and RJ45 interface. New functions can be added through software upgrades to avoid hardware replacement, and it supports EtherCAT networks with various topologies.
It improves operational convenience and efficiency, reduces hardware replacement costs and time costs, supports flexible expansion and diversified functional requirements, and enhances system reliability and stability.
Smart Images

Figure CN120652876A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of numerical control operation control, and more particularly to an EtherCAT-based numerical control operation control device and method thereof. Background Art
[0002] In modern manufacturing, industrial automation technology is booming at an unprecedented rate. CNC machine tools and automated equipment are increasingly widely used, becoming a key force driving the transformation and upgrading of the manufacturing industry, improving production efficiency and product quality. To meet the market's urgent demand for high-efficiency, low-cost, and high-quality products, CNC operation panels, as the core components for interaction between CNC machine tools and automated equipment and operators, face higher requirements for performance and functionality. Currently, most mainstream machine tool operation panels on the market use a matrix communication method. Matrix operation panels utilize a key matrix format, rationally distributing various control functions across the panel. Each key has a specific function, and the operator interacts with the machine tool by pressing the corresponding key, such as starting, stopping, and adjusting parameters. While this traditional matrix operation panel meets basic operational needs to a certain extent, it also has several significant drawbacks.
[0003] In terms of scalability, each button and corresponding circuit on a matrix operation panel requires independent wiring. This design approach results in extremely poor panel scalability. Adding new functions or control items often requires a complete redesign of the entire panel. This not only increases design costs and time, but can also cause production line downtime, resulting in significant financial losses for the company. At the same time, with the continuous advancement of industrial automation technology, market demands for CNC operation panels are becoming increasingly diverse and complex. Due to the limitations of their hardware structure, traditional matrix operation panels struggle to adapt quickly and flexibly to these changes. To maintain competitiveness, companies must continuously invest significant manpower, material, and financial resources in panel upgrades, which undoubtedly increases operating costs.
[0004] To address these challenges, the industrial automation sector has been seeking a more efficient, flexible, and scalable communication and control technology. This is where EtherCAT, a real-time industrial Ethernet technology developed by Beckhoff, Germany, comes in. EtherCAT utilizes a standard Ethernet frame structure and offers numerous advantages, including high performance, simple wiring, and low cost. It supports a variety of topologies, including linear, star, and tree, adapting flexibly to diverse industrial automation application scenarios. Due to its outstanding performance and flexibility, EtherCAT has been widely adopted in various automation control systems, bringing new development opportunities to the industrial automation sector.
[0005] Given these challenges, it's necessary to propose an EtherCAT-based CNC operation control method. This control method fully leverages the advantages of EtherCAT technology and, compared to traditional CNC operation panels, is easily expandable. New functions can be added through software upgrades without requiring large-scale hardware replacements, effectively reducing enterprise upgrade costs, improving production efficiency, and meeting the ever-changing demands of modern manufacturing for CNC operation panels. Summary of the Invention
[0006] The purpose of the present invention is to overcome the defects of the prior art and provide a numerical control operation control device and method based on EtherCAT.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] An EtherCAT-based numerical control operation control device includes: an FPGA module, a matrix button, an STM32 module, an ESC controller and an RJ45 interface; the matrix button is connected to the FPGA module, the FPGA module is connected to the STM32 module, the STM32 module and the RJ45 interface are both connected to the ESC controller, and the ESC controller includes an EtherCAT communication module.
[0009] A further technical solution is: the FPGA module is also connected to an I / O interface.
[0010] A further technical solution is: the FPGA module is further connected to a handwheel module.
[0011] Its further technical solution is: the RJ45 interface includes an RJ45 input interface and an RJ45 output interface.
[0012] The present invention also provides a numerical control operation control method based on EtherCAT, comprising:
[0013] Get the operation instructions input by the user;
[0014] Preprocessing the operation instruction to obtain a preprocessing result;
[0015] Parsing the preprocessing result to obtain a parsing result;
[0016] Control the execution of corresponding actions based on the analysis results.
[0017] A further technical solution thereof is: before obtaining the operation instruction input by the user, the method further includes:
[0018] Perform initialization operations.
[0019] A further technical solution is: the step of obtaining the operation instruction input by the user includes:
[0020] Collecting user input signals and identifying and determining the signal operation type to form an operation signal;
[0021] According to the preset mapping relationship or logic rules, the operation signal is generated into a corresponding operation instruction.
[0022] A further technical solution is: the preprocessing of the operation instruction to obtain a preprocessing result includes:
[0023] De-noising and filtering are performed on the operation instructions to obtain preliminary processing results;
[0024] Performing format conversion on the preliminary processing result to obtain a conversion result;
[0025] The conversion results are encapsulated to obtain the preprocessing results.
[0026] A further technical solution is: parsing the preprocessing result to obtain the parsing result includes:
[0027] Read the header information of the preprocessing result;
[0028] Based on the header information, locate and extract the operation content of the instruction;
[0029] Performing semantic analysis on the operation content to obtain analysis content;
[0030] Perform parameter parsing on the analysis content to obtain the analysis results.
[0031] A further technical solution is: the control of executing corresponding actions according to the analysis results includes:
[0032] Based on the analysis results, plan the action sequence to be executed;
[0033] According to the action sequence, control instructions are sent to the actuator and the corresponding actions are started.
[0034] The advantages of the present invention compared with the existing technology are: by defining the function of each button through software, users can flexibly configure the function of the button according to actual needs and operating habits, thereby improving the convenience and efficiency of operation; in addition, all function definitions can be completed at the software level without the need to change the hardware, reducing the cost and time cost of hardware replacement.
[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 A schematic block diagram of an EtherCAT-based CNC operation control device provided in an embodiment of the present invention;
[0038] Figure 2 Schematic diagram of an application scenario of EtherCAT connection provided by an embodiment of the present invention;
[0039] Figure 3 A flow chart of a numerical control operation control method based on EtherCAT provided in an embodiment of the present invention.
[0040] Reference numerals:
[0041] FPGA module 10 , matrix button 20 , STM32 module 30 , ESC controller 40 , RJ45 input interface 51 , RJ45 output interface 52 , I / O interface 60 , handwheel module 70 . DETAILED DESCRIPTION
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0043] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0044] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0045] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0046] See also Figure 1 In the specific embodiment shown, the present invention discloses a CNC operation control device based on EtherCAT, including: an FPGA module 10, a matrix button 20, an STM32 module 30, an ESC controller 40 and an RJ45 interface; the matrix button 20 is connected to the FPGA module 10, the FPGA module 10 is connected to the STM32 module 30, the STM32 module 30 and the RJ45 interface are both connected to the ESC controller 40, and the ESC controller 40 includes an EtherCAT communication module.
[0047] Specifically, the FPGA module 10 serves as the core for data processing and logical operations. It communicates with the STM32 module 30 via the FSMC interface, enabling high-speed data read and write operations. The FPGA module 10 is responsible for receiving control signals from the STM32 module 30, performing complex logical operations and data processing, and returning the processing results to the STM32 module 30. The matrix keypad 20 is connected to the FPGA module 10, and users input commands by pressing keys. The clever layout design of the matrix keypad 20 saves I / O pins, thereby conserving system resources. The STM32 module 30 serves as the control and management center of the system. It communicates with the FPGA module 10 via the FSMC interface, receiving and processing data from the FPGA module 10. Simultaneously, the STM32 module 30 is also connected to the ESC controller 40, responsible for controlling and coordinating the entire system. The ESC controller 40 is the core of EtherCAT communication and includes an EtherCAT communication module (such as a PHY Ethernet chip) for Ethernet communication with external devices. The LAN9252 is a good choice for ESC controller 40 because it integrates the Ethernet physical layer (PHY), facilitating rapid development and deployment. The ET1100 is also an option, but requires an external PHY chip and is suitable for applications requiring highly customized designs. The RJ45 port on the ESC controller 40 provides an Ethernet connection to the external network. Choosing an RJ45 port with a built-in transformer simplifies the hardware circuitry and improves system reliability and stability.
[0048] When a user inputs a command via the matrix keypad 20, the command is received and processed by the FPGA module 10. The FPGA module 10 sends the processed command to the STM32 module 30 via the FSMC interface. After receiving the command, the STM32 module 30 performs further processing and control, and then sends the control signal to the ESC controller 40. The ESC controller 40 converts the control signal into an Ethernet data frame via the EtherCAT communication module and sends it to an external device via the RJ45 interface. After receiving the data frame, the external device performs the corresponding processing and returns the result. The ESC controller 40 receives the returned result and feeds it back to the user via the STM32 module 30 and FPGA module 10.
[0049] In other words, the high flexibility and programmability of the FPGA module 10 enable the system to complete complex logical operations and data processing tasks, improving the system's data processing capabilities and response speed. The high performance and rich peripheral interfaces of the STM32 module 30 enable the system to be easily controlled and coordinated, improving the control and management efficiency of the system. The layout design of the matrix button 20 can save I / O pin usage, thereby saving system resources. At the same time, the selection of an ESC controller 40 with an integrated PHY Ethernet chip can simplify the hardware circuit and reduce system costs. The design of the RJ45 interface with its own transformer simplifies the hardware circuit and improves the reliability and stability of the system. In addition, the EtherCAT-based CNC operation control device can add new functions through software upgrades without the need for large-scale hardware replacement. This scalability and flexibility enable the system to adapt to changing production needs and technology upgrade requirements.
[0050] In one embodiment, the FPGA module 10 is further connected to an I / O interface 60 .
[0051] Specifically, the FPGA module 10 is connected to the I / O interface 60 through a specific pin or interface circuit. These I / O interfaces 60 can be digital input / output (DIO), analog input / output (AIO) or other types of interfaces, depending on the application requirements. The I / O interface 60 is used to connect other devices as needed, such as sensors, actuators, indicator lights, etc. For example, a temperature sensor can be connected to monitor the operating temperature of a machine tool, an actuator can be connected to control a certain moving part of a machine tool, or an indicator light can be connected to display the operating status of the system. In addition, the FPGA module 10 transmits signals with other devices through the I / O interface 60, receives input signals from other devices, and after necessary processing, sends the results to the STM32 module 30 or other control system components via the EtherCAT bus or other communication methods. At the same time, the FPGA module 10 can also receive instructions from the STM32 module 30 or other control systems and control the actions of other devices through the I / O interface 60.
[0052] In other words, by connecting to the I / O interface 60, the FPGA module 10 can conveniently connect and communicate with other devices, allowing the system to be flexibly configured and expanded according to actual needs. Whether adding new sensors to monitor more parameters or connecting more actuators to control more moving parts, this can be achieved through the I / O interface 60. Furthermore, the introduction of the I / O interface 60 opens up the possibility of expanding system functionality. For example, by connecting specific sensors or actuators, new functions such as automatic detection, automatic adjustment, and fault alarms can be implemented. These added functions do not require large-scale hardware replacement or modification; they can be implemented simply through software configuration and programming. Furthermore, by connecting to other devices through the I / O interface 60, multiple dispersed devices or systems can be integrated into a unified control platform, enabling centralized data processing and sharing. This not only improves the system's operational efficiency and management level, but also reduces the system's maintenance costs and complexity. Furthermore, the design of the I / O interface 60 generally takes into account protective measures such as electrical isolation, lightning protection, and anti-static protection to ensure reliability and safety when connecting to other devices. At the same time, the FPGA module 10 has been carefully designed and optimized for processing input signals and controlling output signals to further improve the stability and reliability of the system.
[0053] In one embodiment, the FPGA module 10 is further connected to a handwheel module 70 .
[0054] Specifically, the FPGA module 10 is connected to the handwheel module 70 through a specific hardware interface. The handwheel module 70 serves as an input device, and its output end is connected to the input pin of the FPGA module 10. Since the handwheel module 70 outputs a 5V pulse signal, and the operating voltage of the FPGA module 10 is 3.3V, a direct connection may cause voltage mismatch and damage the FPGA module 10. Therefore, an optocoupler isolation circuit is introduced between the two. The input end of the optocoupler is connected to the output signal line of the handwheel module 70, and the output end of the optocoupler is connected to the input pin of the FPGA module 10, and electrical isolation between different voltages is achieved through the optocoupler.
[0055] When the operator turns the handwheel, the handwheel module 70 generates a corresponding 5V pulse signal. These pulse signals are transmitted to the FPGA module 10 via an optocoupler isolation circuit. The optocoupler isolation circuit acts as an isolation and buffer during signal transmission. It converts the 5V pulse signal output by the handwheel module 70 into a signal format suitable for reception by the FPGA module 10, while ensuring signal integrity and stability. After receiving the optocoupler-isolated pulse signal, the FPGA module 10 counts and processes it. Based on the number and frequency of the pulses, the FPGA module 10 can calculate the direction and amount of rotation of the handwheel, thereby achieving precise control of the operation. The internal program of the FPGA module 10 requires configuration of the input signal of the handwheel module 70. For example, the counting method and counting range of the pulse signal, as well as the mapping relationship between the pulse signal and the control operation, can be set. Through software programming, the FPGA module 10 can generate corresponding control instructions based on the input signal of the handwheel module 70 and send these instructions to the STM32 module 30 via the FSMC interface, thereby achieving precise control of the entire CNC system.
[0056] In other words, the 5V pulse signal generated by the handwheel module 70 has high precision and resolution, accurately reflecting the operator's rotation intentions. By counting and processing these pulse signals, the FPGA module 10 can achieve fine control of the CNC system, such as precisely adjusting the machine tool's processing position, speed, and other parameters, thereby improving processing accuracy and quality. Furthermore, the use of an optocoupler isolation circuit effectively isolates the different voltages between the handwheel module 70 and the FPGA module 10, avoiding signal distortion, interference, and even hardware damage caused by voltage mismatch. Furthermore, the optocoupler isolation circuit also offers advantages such as strong anti-interference capabilities and fast transmission speeds, ensuring signal integrity and stability during transmission and improving system reliability and security. Furthermore, the optocoupler isolation circuit achieves electrical isolation between different voltages, allowing the handwheel module 70 and the FPGA module 10 to independently select a voltage level suitable for their respective operating conditions, thereby improving system compatibility. Furthermore, this design approach facilitates system expansion. If the handwheel module 70 or FPGA module 10 needs to be replaced, simply ensure that the signal interface of the new module is compatible with the optocoupler isolation circuit, eliminating the need for large-scale modifications to the entire system.
[0057] In one embodiment, the RJ45 interface includes an RJ45 input interface 51 and an RJ45 output interface 52 .
[0058] Specifically, two independent interfaces are provided, namely an RJ45 input interface 51 and an RJ45 output interface 52. These two interfaces are usually located at specific positions of the device in the hardware layout, which is convenient for connection with external network devices. The RJ45 input interface 51 is mainly used to receive data signals from external devices (such as upper-level controllers, other numerical control devices or network nodes). It is connected to the external device via a standard Ethernet cable to realize the physical layer transmission of data. The RJ45 output interface 52 is used to send data signals to the external device. Similarly, it also establishes a connection with the target device via an Ethernet cable and transmits the processed data to the corresponding device.
[0059] When an external device sends data to the numerical control operation control device via the RJ45 input interface 51, the data is first processed by the Ethernet physical layer (PHY) chip, the physical layer signal is converted into a digital signal, and then transmitted to the ESC controller 40. The ESC controller 40 parses and processes the received data, and identifies, extracts, and forwards the data frame according to the EtherCAT protocol. The processed data is then transmitted to the FPGA module 10 and the STM32 module 30 via the internal bus for further processing and control. When the numerical control operation control device needs to send data to an external device, the data is first generated by the FPGA module 10 or the STM32 module 30, and then transmitted to the ESC controller 40. The ESC controller 40 encapsulates the data according to the EtherCAT protocol, generates an Ethernet data frame, and sends it to the external device via the RJ45 output interface 52. In the EtherCAT network, the use of the RJ45 input interface 51 and the RJ45 output interface 52 enables the numerical control operation control device to serve as a node in the network and communicate with other nodes. Through a reasonable network topology design, collaborative work and data sharing between multiple numerical control devices can be achieved. The CNC operation control device can receive instructions and parameter settings from the upper controller through the RJ45 input interface 51, and at the same time feed back its own status information, processing data, etc. to the upper controller or other related equipment through the RJ45 output interface 52.
[0060] In other words, the independent configuration of the RJ45 input interface 51 and the RJ45 output interface 52 allows data input and output to proceed simultaneously without interfering with each other, improving data transmission efficiency. Ethernet technology inherently offers high reliability and stability. Data transmission via the RJ45 interface ensures data accuracy and integrity, reducing the possibility of data loss and errors. Furthermore, the independent RJ45 input interface 51 and RJ45 output interface 52 allow the CNC operation control device to be easily connected to different EtherCAT networks, enabling communication and collaboration with other devices. This design improves system scalability, allowing companies to flexibly increase or decrease the number of CNC devices based on actual needs. Furthermore, through software configuration and adjustments to the network topology, personalized control and data exchange can be achieved for different devices, enhancing system flexibility. Furthermore, using the RJ45 interface for network connection simplifies and standardizes network wiring. Standard Ethernet cables and interfaces reduce wiring costs and facilitate subsequent maintenance and replacement. In the event of a network failure, the fault point can be quickly located by checking the connection status of the RJ45 interface, signal indicators, and other information, improving troubleshooting efficiency. In addition, the design of the RJ45 input interface 51 and the RJ45 output interface 52 enables the CNC operation control device to support a variety of EtherCAT network topologies, such as linear, star, and tree. This flexibility allows enterprises to select the most suitable network topology based on actual site layout and equipment distribution, thereby optimizing network performance.
[0061] See also Figure 2 The schematic diagram of the application scenario of EtherCAT connection shown in the figure can theoretically connect 65535 slave stations. Among them, the X86 core board is the master station, the operation panel is the slave station, and other devices such as servo motors and IO modules can also be mounted as slave stations at the same time. They together constitute the EtherCAT communication network. Logically, the arrangement of slave devices in the EtherCAT network segment constitutes an open ring bus. At one end of the opening, the master station device transmits Ethernet data frames directly or through a standard Ethernet switch, and receives processed data frames at the other end. All data frames are forwarded by the first slave station device to subsequent nodes, and the last slave station device returns the data frame to the master station.
[0062] See also Figure 3 , the present invention provides a flow chart of the EtherCAT-based numerical control operation control method. Figure 3 As shown, the method includes the following steps S110 to S140.
[0063] S110, obtaining an operation instruction input by a user;
[0064] Specifically, a CNC operation control system includes various input devices, such as a CNC operation panel (including a matrix keypad and handwheel module), a touch screen, and an external computer. These devices are connected to the system via corresponding interfaces (e.g., the matrix keypad and handwheel module interfaces connected to the FPGA module, or serial or network interfaces for communicating with the external computer). As a user operates an input device, the system monitors the state changes of the input device in real time. For example, when a user presses a key on the operation panel or turns a handwheel, the key closure or handwheel-generated pulse signal is captured by the corresponding hardware module (e.g., the FPGA module). The captured raw signals (e.g., key level signals, handwheel pulse signals) undergo preliminary processing by the hardware module and are converted into digital signals or data in a specific format for subsequent processing. For example, the FPGA module counts and processes the 5V pulse signals generated by the handwheel module, converting them into information about the handwheel's rotation direction and amount.
[0065] S120, preprocessing the operation instruction to obtain a preprocessing result;
[0066] Specifically, the collected operation instruction data is first verified to check its integrity and correctness. For example, methods such as checksums and cyclic redundancy checks (CRCs) are used to detect errors during data transmission. If a data error is detected, the system can require the user to re-enter the instruction or take other error handling measures. Secondly, the operation instruction data is converted into a unified format within the system. Different input devices may generate data in different formats, and the preprocessing process requires format conversion of this data to ensure that it meets the processing requirements within the system. For example, the pulse signal data generated by the handwheel module is converted into a displacement control instruction format that the system can recognize. Finally, the operation instruction data is filtered and denoised to remove interference signals and noise from the data, resulting in the preprocessing results. For example, digital filtering algorithms (such as mean filtering and median filtering) are used to process key signals to eliminate interference signals generated by key jitter and ensure the accuracy of the instructions.
[0067] S130, parsing the preprocessing result to obtain a parsing result;
[0068] Specifically, first, the pre-processed operation instructions are identified according to the system's preset instruction set to determine the type and function of the instruction. For example, it is identified that the user input is a start instruction, a stop instruction, a processing parameter setting instruction, etc. Secondly, for operation instructions containing parameters, the parameter values in the instruction are extracted. For example, if the user inputs a processing parameter setting instruction, the system needs to extract parameter values such as processing speed, feed rate, and cutting depth. Finally, the operation instruction is semantically analyzed to understand the actual intention of the instruction and obtain the parsing result. For example, based on the type and parameter value of the instruction, combined with the current state and context information of the system, the specific execution method and target of the instruction are determined.
[0069] S140: Control and execute corresponding actions according to the analysis result.
[0070] Specifically, first, based on the analysis results, the specific action sequence that needs to be executed is planned. For example, if the user inputs a start-up processing instruction, the system needs to plan the start-up sequence of the machine tool, the motion trajectory of each axis, the switching of the tool, and other actions. Secondly, the planned action instructions are distributed to the corresponding execution units, such as servo motor drivers, spindle drivers, tool library controllers, etc. These execution units are connected to the system through specific interfaces (such as EtherCAT bus) to receive and execute the corresponding instructions. Finally, during the execution of the action, the system monitors the status of the execution unit and the execution of the action in real time. The feedback information of the execution unit is collected through sensors (such as position sensors, speed sensors, force sensors, etc.) and compared with the expected execution results. If execution deviations or abnormalities are found, the system will make timely adjustments or take corresponding measures to ensure the accurate execution of the action.
[0071] In other words, it supports multiple input devices, allowing users to choose the appropriate input method based on their preferences and operating scenarios, improving operational convenience. The ability to capture and process user input commands in real time allows users to quickly control and adjust the CNC system, enhancing operational flexibility. Furthermore, preprocessing steps such as data verification, format conversion, filtering, and denoising ensure the accuracy and integrity of command data, reducing system failures caused by data errors. Detailed parsing of command data, including command recognition, parameter extraction, and semantic analysis, accurately understands user intent and avoids operational errors caused by command misunderstandings. Furthermore, action planning and command distribution based on the parsing results enable precise control of the actions of each execution unit, achieving high-precision machining and operation. Real-time monitoring and feedback mechanisms promptly detect and correct deviations during execution, ensuring that actions are executed as expected, improving machining quality and production efficiency. Furthermore, the EtherCAT-based communication method offers excellent scalability, allowing for the easy addition of new execution units and input devices to meet the needs of CNC systems of varying scale and complexity. The use of standardized instruction sets and communication protocols enables the system to be compatible and integrated with other CNC equipment and automation systems, improving the system's versatility and interoperability.
[0072] In one embodiment, before obtaining the operation instruction input by the user, the method further includes:
[0073] Perform initialization operations.
[0074] Specifically, the initialization operation includes hardware initialization and software initialization; wherein, hardware initialization includes:
[0075] FPGA module initialization: After the system is powered on, the FPGA module first performs its own initial configuration. This includes loading a pre-programmed configuration file, setting initial values for internal registers, and configuring the functions and directions of I / O pins. For example, I / O pins connected to the matrix keypad and handwheel modules are configured as input mode to facilitate subsequent user input. The FSMC interface that communicates with the STM32 module is initialized, and communication parameters (such as clock frequency and data width) are set to ensure normal data exchange between the two modules.
[0076] STM32 module initialization: After the STM32 module starts, it performs a series of initialization operations. This includes initializing the system clock, configuring peripheral clocks (such as the clocks for serial ports, timers, SPI, and other peripherals), and enabling required peripheral functions. For example, it initializes the interface for communicating with the ESC controller (such as the SPI or parallel interface), setting the communication protocol and parameters; initializing the memory area used for data storage, and allocating initial addresses for variables and buffers.
[0077] ESC controller initialization: As the core component of EtherCAT communication, the ESC controller requires specialized initialization. This includes setting EtherCAT communication parameters such as node address, synchronization period, and data transmission rate; initializing internal registers and buffers to prepare for subsequent data transmission and processing; and checking the connection status with the FPGA module, STM32 module, and RJ45 interface to ensure normal communication links.
[0078] Sensor and actuator initialization: If the system has sensors (such as temperature sensors and position sensors) and actuators (such as servo motors and solenoid valves), they also need to be initialized. For sensors, initialization may include setting the sampling frequency and calibrating measurement values. For actuators, initialization may include setting the initial position, resetting the state, and enabling the drive signal.
[0079] Software initialization:
[0080] Operating system initialization: The CNC control system runs on an operating system, which is initialized when the system starts. This includes loading the operating system's kernel files, initializing system resource management modules (such as memory management, process management, and file systems), and starting necessary system services and daemons.
[0081] Application initialization: The CNC operation control application begins initialization after the operating system starts. This includes loading the application configuration file, setting initial parameters (such as machining parameters and user permissions), initializing data structures and variables, establishing communication connections with hardware devices (such as FPGA modules and ESC controllers), and loading the user interface.
[0082] Communication protocol initialization: In addition to initializing the hardware communication interface, the communication protocol also needs to be initialized. For example, initializing the EtherCAT communication protocol stack, setting the communication frame format and content, and configuring the data transmission synchronization mechanism. If the system also involves other communication protocols (such as Modbus, CAN, etc.), corresponding initialization operations are also required.
[0083] During initialization, the system performs a hardware self-test. This includes checking the operating status of various hardware modules, such as the FPGA module, STM32 module, ESC controller, sensors, and actuators, to ensure they are booting and operating normally. It also checks hardware connections, such as whether cables are properly plugged in and connectors are loose. It also performs functional tests on key hardware, such as testing whether matrix buttons respond properly and whether the handwheel module generates correct pulse signals. Software self-tests primarily verify the functioning of various application modules. For example, they check whether data processing algorithms are correct, whether the user interface displays properly, and whether the communication protocol processing logic is correct. System resource usage, such as sufficient memory and disk space, is also checked.
[0084] In other words, hardware initialization ensures that all hardware modules are in normal working order, correctly configuring parameters and connections, and preventing system instability or non-operational issues caused by hardware failures or configuration errors. Software initialization and system self-tests can promptly detect and resolve software-level issues such as program errors and resource conflicts, ensuring that applications can load and run correctly, thereby improving system reliability and stability. Furthermore, the communication parameters and protocol stacks set during initialization ensure system compatibility and communication with other devices or systems. For example, EtherCAT communication initialization enables a CNC control system to easily connect to an EtherCAT network, exchanging data and collaborating with other EtherCAT devices. Well-designed initialization also facilitates system expansion. Adding new hardware devices or functional modules requires only the corresponding configuration and expansion during initialization, eliminating the need for large-scale modifications to the entire system. Furthermore, initialization allows for the rational allocation and optimization of system resources. For example, by setting appropriate clock frequencies and memory allocation strategies based on hardware performance and system requirements, system efficiency and responsiveness can be improved. Self-checks can identify potential performance bottlenecks or issues in advance, allowing for timely adjustments and optimizations to ensure continued system performance. Furthermore, hardware and software self-checks during initialization ensure the system is in a safe state before normal operation. For example, they can monitor the operating status of sensors and actuators to avoid safety incidents caused by equipment failures. They can also check user permissions and security policies to ensure only authorized users can perform operations, thus ensuring system security.
[0085] In one embodiment, obtaining an operation instruction input by a user includes:
[0086] Collecting user input signals and identifying and determining the signal operation type to form an operation signal;
[0087] Specifically, CNC control systems are equipped with a variety of hardware devices for collecting user input signals, such as matrix buttons, handwheel modules, and touch screens on the operation panel. These devices are connected to the system's core processing modules (such as FPGA modules and STM32 modules) through corresponding interfaces. When a user performs an operation, the hardware devices generate corresponding electrical signals. For example, when a user presses a matrix button, the closing of the button generates a level signal; when a user rotates the handwheel, the handwheel module generates a pulse signal. These signals are captured in real time by the signal acquisition circuit connected to the hardware devices. The collected raw signals may contain noise or interference and require preprocessing. For example, hardware filtering circuits can be used to remove jitter interference for key signals; and for handwheel pulse signals, counters can be used to count and shape them to ensure signal accuracy and stability.
[0088] The collected preprocessed signals are analyzed and identified based on preset signal characteristics and recognition algorithms. For example, for matrix key signals, the pressed key is determined by detecting changes in the corresponding pin level. For handwheel pulse signals, the handwheel's rotation direction and amount are determined by analyzing the number and frequency of pulses. Based on the signal recognition results, the corresponding operation type is determined. For example, after identifying a key press, the corresponding operation is determined to be start, stop, pause, parameter setting, etc.; after identifying the handwheel's rotation direction and amount, the corresponding operation is determined to be forward or reverse movement of the machine tool axis and the distance moved. The identified operation type information is encapsulated into an operation signal. The operation signal typically contains information such as the operation type identifier and operation parameters (such as the key number and handwheel rotation amount) so that subsequent processing modules can accurately understand and execute it.
[0089] According to the preset mapping relationship or logic rules, the operation signal is generated into a corresponding operation instruction.
[0090] Specifically, the system predefines mapping relationships or logical rules between operation signals and operation instructions. These mapping relationships or logical rules can be flexibly configured based on the CNC system's functionality and user needs. For example, pressing a certain key might generate a start-of-processing instruction, while rotating the handwheel a certain amount clockwise might generate a forward movement instruction for the machine tool's X-axis. Based on the operation type identifier and operation parameters in the operation signal, the system queries the pre-set mapping relationship or logical rules to generate the corresponding operation instruction. Operation instructions typically use a specific format and encoding method to ensure that the actuator can correctly parse and execute them. For example, the generated instruction may contain information such as the instruction type, target device address, and operation parameters.
[0091] In other words, through signal acquisition and preprocessing, user input signals can be accurately acquired, noise and interference removed, and signal quality ensured. The signal recognition algorithm and operation type determination process accurately identify the user's operation intention, avoiding operational errors caused by signal misjudgment or incorrect operation type identification. Preset mapping relationships or logical rules clearly define the correspondence between operation signals and operation instructions, reducing errors and ambiguity in instruction generation and improving the accuracy and reliability of operation instructions. Furthermore, these preset mapping relationships or logical rules can be flexibly configured and modified to suit different CNC system functions and user needs. For example, when the system needs to add new functions or adjust operation methods, only the mapping relationships or logical rules need to be modified without requiring large-scale hardware modifications, thus enhancing the system's flexibility and customizability. Supporting a variety of user input devices and operation methods, users can choose the appropriate input method based on their preferences and operating scenarios, further enhancing the system's flexibility and user experience. Furthermore, the modular design of the operation signal acquisition, recognition, and instruction generation processes makes system development clearer and more efficient. Developers can focus on implementing the functions of each module without having to worry too much about the complex interactions between them. When a system failure occurs or requires maintenance, it can be quickly located and troubleshooted based on the generation process of operation signals and operation instructions. For example, by checking whether signal acquisition is normal, signal recognition is accurate, and mapping relationships or logical rules are correct, the problem can be quickly found and repaired, reducing the difficulty and cost of system maintenance.
[0092] In one embodiment, preprocessing the operation instruction to obtain a preprocessing result includes:
[0093] De-noising and filtering are performed on the operation instructions to obtain preliminary processing results;
[0094] Specifically, during the signal acquisition phase, hardware circuits are used for preliminary denoising. For example, a capacitor filter circuit is added to the key signal acquisition circuit of the operation panel to eliminate the spike pulse noise generated by key jitter. For the pulse signal generated by the handwheel module, a Schmitt trigger is used to shape the signal to remove noise interference and make the pulse signal more stable. In the system software, digital filtering algorithms are used to further denoise the operation command signal. Common digital filtering algorithms include mean filtering and median filtering. Taking mean filtering as an example, the average of multiple continuously collected operation command signal values is calculated as the current valid signal value, thereby eliminating the influence of random noise.
[0095] If the command signal contains high-frequency interference, a low-pass filter can be used to address it. By setting an appropriate cutoff frequency, only signals below the cutoff frequency are allowed to pass, filtering out high-frequency noise. For example, when processing handwheel pulse signals, a low-pass filter can remove high-frequency interference pulses caused by mechanical vibrations. If the command signal is concentrated within a specific frequency range, a band-pass filter can be used to pass only signals within that frequency range, further removing interference signals at other frequencies.
[0096] Performing format conversion on the preliminary processing result to obtain a conversion result;
[0097] Specifically, the target format of the operation instructions is determined based on the system's subsequent processing requirements. For example, if the subsequent processing module needs to store the operation instructions in a database, the instructions may need to be converted into a specific data structure format; if network transmission is required, the instructions may need to be converted into a format that complies with the communication protocol. First, the data type in the preliminary processing results is converted into the data type required by the target format. For example, the key number is converted from an integer type to a string type for display on the user interface; the handwheel rotation amount is converted from a floating-point type to a fixed-point type to improve processing efficiency. Secondly, the data in the preliminary processing results is reorganized and arranged to form a data structure that conforms to the target format. For example, multiple related operation instruction parameters are combined into a structure or array to facilitate unified processing by the subsequent processing module.
[0098] The conversion results are encapsulated to obtain the preprocessing results.
[0099] Specifically, a suitable encapsulation protocol is selected based on the system's communication architecture and the interaction method between modules. Common encapsulation protocols include custom protocols and standard communication protocols (such as Modbus, CANopen, etc.). For example, the encapsulation method specified by the EtherCAT protocol can be used to encapsulate operation instructions. Header information is added in front of the conversion result, including instruction type identification, instruction length, source address, destination address, etc. This header information is used by subsequent processing modules to identify and parse instructions. To ensure the accuracy of data transmission, verification information such as checksum and cyclic redundancy check (CRC) is added during the encapsulation process. The receiver can use the verification information to detect whether any errors occurred during data transmission. Finally, the header information, conversion result, and verification information are combined to form a complete data packet as the preprocessing result.
[0100] In other words, denoising and filtering effectively remove noise and interference from command signals, reducing command errors caused by signal distortion. For example, removing key jitter noise prevents erroneous commands caused by misjudgment of key presses. Filtering eliminates the impact of high-frequency interference on handwheel pulse signals, ensuring accurate measurement of handwheel rotation. Adding checksum information during format conversion and encapsulation detects errors during data transmission, allowing timely identification and correction of command transmission errors, thereby improving the reliability of command signals. Furthermore, format conversion allows command signals to adapt to the requirements of different subsequent processing modules, enhancing system compatibility. For example, converting command signals into a variety of formats facilitates interaction with databases, graphical interfaces, network communication modules, and more. The choice and flexibility of encapsulation protocols facilitates system integration and expansion with other devices or systems. Adding new functional modules or communicating with other systems requires simply adjusting the encapsulation protocol and format conversion rules to meet the new requirements, without requiring major modifications to the system's core processing logic. Furthermore, appropriate denoising and filtering algorithms can reduce data processing volume and improve system processing speed. For example, employing efficient digital filtering algorithms can effectively remove noise interference without significantly increasing computational overhead. The format conversion and encapsulation process organizes and optimizes data, enabling subsequent processing modules to more efficiently process operational instructions. For example, encapsulating operational instructions into a standard data packet format facilitates network transmission and rapid parsing between modules, improving the overall operational efficiency of the system.
[0101] In one embodiment, parsing the preprocessing result to obtain the parsing result includes:
[0102] Read the header information of the preprocessing result;
[0103] Specifically, in a CNC operation control system, when the preprocessing result (usually an encapsulated data packet) arrives at the parsing module, the parsing module first reads the header information from the starting position of the data packet according to the predefined encapsulation protocol. For example, if an encapsulation method similar to the EtherCAT protocol is adopted, the parsing module will read the header field containing key information such as the instruction type identifier, instruction length, source address, and destination address. After reading the header information, the checksum information contained therein (such as checksum, CRC checksum) is verified. By comparing with the pre-calculated or agreed checksum value, it is ensured that there is no error in the header information during transmission. If the check fails, the parsing module will trigger the corresponding error handling mechanism, such as requesting the resending of the data packet or recording an error log.
[0104] Based on the header information, locate and extract the operation content of the instruction;
[0105] Specifically, the starting and ending positions of the operation content in the data packet are determined based on the instruction length field in the header information. For example, if the instruction length is N bytes and the header information occupies M bytes, then the starting position of the operation content is the M+1th byte and the ending position is the M+Nth byte. Based on the determined position information, the operation content is extracted from the data packet. The operation content is usually an instruction parameter or operation command encoded in a specific data format (such as binary, ASCII code, etc.).
[0106] Performing semantic analysis on the operation content to obtain analysis content;
[0107] Specifically, a series of semantic rules are pre-stored through the parsing module, which define the actual operational meanings represented by different operation contents. The parsing module matches the extracted operation content with the semantic rules to determine the specific operation type of the instruction. For example, if the operation content is a specific binary code, by comparing it with the semantic rules, it is determined that the code corresponds to the "start processing" operation. Taking into account the complexity and continuity of the CNC operation control system, the parsing module will further analyze the operation content in combination with the context information of the current system (such as system status, previous operations, etc.). For example, if the system is currently in a paused state, and the received operation content corresponds to "continue processing", then the parsing module will combine this context information to accurately understand the actual intention of the instruction.
[0108] Perform parameter parsing on the analysis content to obtain the analysis results.
[0109] Specifically, first, based on the operation type determined by semantic analysis, the parsing module identifies the specific parameters contained in the operation content. For example, for the "set processing speed" instruction, the speed value parameter needs to be identified; for the "move axis to the specified position" instruction, the axis number and target position parameters need to be identified. Secondly, the identified parameters are converted from the original data format to the data format used within the system, and the legitimacy is verified. For example, the speed value is converted from a string format to a floating-point format, and it is checked whether the value is within the range allowed by the system. If the parameter verification fails, the parsing module will generate a corresponding error message. Finally, the operation type and parameter information after parameter conversion and verification are combined into a parsing result for use by the subsequent control module.
[0110] In other words, by reading and verifying the header information, the integrity and correctness of the preprocessing results are ensured, avoiding instruction parsing errors caused by data transmission errors. The semantic analysis and parameter parsing process combines semantic rules and contextual information to accurately understand the actual meaning and parameters of the instructions, reducing system failures caused by instruction ambiguity or parameter errors. In addition, semantic rules and parameter parsing rules can be flexibly configured and modified according to different CNC operation requirements. When the system needs to add new instruction types or parameters, only the rule base in the parsing module needs to be updated, without making large-scale changes to the entire parsing algorithm, which improves the scalability of the system.
[0111] In one embodiment, controlling the execution of corresponding actions according to the analysis results includes:
[0112] Based on the analysis results, plan the action sequence to be executed;
[0113] Specifically, a dedicated motion planning algorithm can be built into the CNC operation control system. This algorithm will perform a comprehensive analysis based on the operation type (such as start, stop, move, processing, etc.) and parameters (such as moving distance, speed, processing parameters, etc.) contained in the analysis results, combined with the current state of the system (such as the position, speed, acceleration limit of each axis, tool status, etc.). For example, when the analysis result is "move the machine tool X-axis to position X1, speed is V1", the motion planning algorithm will consider the current position of the X-axis, maximum acceleration and deceleration parameters, and plan a smooth motion trajectory that conforms to the mechanical characteristics, including the distance and time distribution of the acceleration stage, uniform speed stage and deceleration stage.
[0114] Considering that the CNC system may need to process multiple operation instructions at the same time, the motion planning module will prioritize the actions corresponding to different instructions. For example, the emergency stop instruction has the highest priority. Once this instruction is received, the currently executing action sequence will be immediately interrupted and the stop operation will be executed first. Some non-urgent parameter setting instructions have a relatively low priority and will be processed after the current action sequence is completed. Based on the action planning algorithm and the priority processing results, a specific action sequence is generated. The action sequence is usually stored in the form of a list or queue, and each element contains information such as the action type, parameters, and execution time. For example, the action sequence may be "[Action 1: X-axis accelerates to V1, time t1; Action 2: X-axis moves to X1 at a constant speed of V1, time t2; Action 3: X-axis decelerates to 0, time t3]".
[0115] According to the action sequence, control instructions are sent to the actuator and the corresponding actions are started.
[0116] Specifically, a corresponding control instruction is generated for each action in the action sequence. The format and content of the control instruction are designed based on the actuator type and interface requirements. For example, for a servo motor drive, a control instruction may include parameters such as an enable signal, target position, velocity, and acceleration; for a solenoid valve, a control instruction may simply be a simple on / off signal. Control instructions are sent to the corresponding actuators via the system's communication interface (such as EtherCAT or CAN) in the order of the action sequence. During this transmission process, instruction synchronization must be considered to ensure coordinated and consistent movements among multiple actuators. For example, in multi-axis machining, the motion of each axis must be precisely coordinated in time and space to achieve complex machining trajectories. Synchronous instruction transmission can be achieved through hardware synchronization signals or software synchronization algorithms. After the actuator receives the control instruction and begins executing the action, the system monitors the actuator's status and execution in real time. Sensors (such as position sensors, velocity sensors, and force sensors) collect feedback information from the actuator, such as actual position, velocity, and load. The feedback information is compared with the expected target value in the action sequence. If the deviation is found to exceed the allowable range, the system will adjust the control instructions in time and correct the actuator to ensure that the action is accurately executed according to the predetermined sequence and requirements.
[0117] In other words, the motion planning algorithm comprehensively considers multiple factors and can generate motion sequences that meet machine characteristics and processing requirements, avoiding mechanical shock, vibration, and processing errors caused by inappropriate motion planning. For example, through appropriate acceleration and deceleration planning, the inertia effect of the machine tool during startup and shutdown can be reduced, improving processing accuracy. Real-time monitoring and feedback mechanisms can promptly detect and correct deviations during motion execution, ensuring that the actuators operate according to the predetermined trajectory and parameters, further improving motion execution accuracy. In addition, motion priority processing ensures rapid response in emergency situations, enabling the machine tool to be immediately stopped when danger occurs, protecting the safety of operators and equipment. Real-time monitoring and feedback of actuator status can promptly detect equipment failures and abnormal conditions, such as motor overload and sensor failure, and take appropriate measures to address them, improving system reliability and stability. Furthermore, appropriate motion sequence planning can reduce motion execution time and energy consumption. For example, by optimizing motion trajectories and avoiding unnecessary acceleration and deceleration, the machine tool's motion efficiency can be improved and the processing cycle shortened. Synchronous control of motion execution makes multi-axis machining more precise and efficient, meeting the processing requirements of complex parts and improving overall system performance.
[0118] In order to facilitate understanding of the technical solution, the following specific embodiments are provided:
[0119] The polling mode of the EtherCAT bus communication slave is a data transmission mode for the aforementioned operation panel. During the programming phase of the CNC operation panel (EtherCAT slave device), it is explicitly set to operate in free-running mode (polling mode). By configuring relevant registers or program flags, the slave program runs according to the polling mode workflow. In the main function of the slave program, an interrupt mechanism is not used to handle output events. Instead, a loop structure is set up in which the free_run() function is periodically called. The free_run() function is responsible for processing periodic data. It performs operations such as data reading, processing, and sending at preset time intervals (e.g., every few milliseconds). For example, in each loop, sensor data is read, processed, packaged, and then sent to the master via the EtherCAT bus.
[0120] The EtherCAT slave is centered around an EtherCAT slave controller (ESC) chip, which implements the EtherCAT data link layer protocol. In hardware design, the ESC chip is connected to the microprocessor, sensors, actuators, and other components to ensure proper data transmission. After the slave is powered on, the microprocessor first performs initialization operations. This includes setting the microprocessor's clock frequency, configuring I / O ports, and initializing memory. Communication variables are also initialized, such as the size and initial value of the communication buffer. The microprocessor communicates with the ESC chip through a specific interface (such as SPI or a parallel interface) and initializes the ESC chip's registers. For example, the ESC chip's operating mode, communication parameters (such as data transmission rate and frame format), and interrupt mask registers are set.
[0121] The slave program periodically queries the master's status control register to understand the master's communication status and instructions. For example, by reading specific bits in the status control register, it can determine whether the master has sent a request to start or stop the slave. The slave reads the relevant configuration registers to obtain the parameters configured by the master for the slave, such as the communication cycle and data mapping relationship. These parameters are crucial for the normal communication and data transmission of the slave. When the slave detects the start request sent by the master, it initializes the communication service. This includes establishing a communication connection with the master, allocating communication resources (such as buffers and interrupt vectors), and starting data transmission. When a stop request is detected, the slave stops the communication service and releases related resources, such as closing the communication interface and releasing memory.
[0122] The slave station reads real-time sensor data through interfaces connected to the sensors (such as ADC interfaces, digital input interfaces, etc.). For example, it reads data from temperature sensors, position sensors, force sensors, etc. The read sensor data is processed as necessary, such as filtering to remove noise interference and verification to ensure data accuracy and integrity. For example, a mean filtering algorithm is used to process temperature data to calculate the average temperature value over a period of time. The processed data is packaged according to the format specified by the EtherCAT protocol. For example, data from multiple sensors is combined into a data frame, and corresponding header information (such as data type, length, source address, destination address, etc.) and verification information (such as CRC checksum) are added. The packaged data is sent to the EtherCAT bus through the ESC chip and transmitted to the master station. The ESC chip is responsible for encapsulating the data into EtherCAT data frames and transmitting them according to the protocol requirements.
[0123] The slave executes control logic based on sensor data and user input (such as keystrokes on the operator panel). For example, it controls motor motion based on position sensor data and adjusts machining parameters based on user commands. It monitors system status, including hardware status (such as whether sensors are functioning properly and actuators are responding) and software status (such as whether communication is normal and whether data processing has errors). It promptly detects abnormalities by setting status flags or regularly checking relevant registers. When an abnormality is detected, the slave initiates an alarm. For example, it notifies the operator by lighting an alarm indicator, sending an alarm message to the master, or triggering a buzzer. The slave also records the alarm information for subsequent analysis and processing. Finally, it records important system events and data, such as changes in communication status, sensor data exceeding limits, and control command execution. Logging can be stored in files or output to external devices via serial ports, facilitating troubleshooting and system optimization for developers and maintenance personnel.
[0124] In other words, polling mode doesn't use interrupts, resulting in relatively simple program logic and ease of development and maintenance. Developers don't need to deal with complex interrupt service routines, reducing the potential for program errors. It also avoids system instability issues that can arise from interrupt handling, such as nested interrupts and interrupt priority conflicts. In polling mode, program execution is more controllable, ensuring stable system operation. Polling mode allows for adjustment of the polling cycle based on actual needs. When data processing isn't frequent, the polling cycle can be appropriately extended, thereby reducing system power consumption. Furthermore, through initialization of the microprocessor and ESC chip, as well as processing in the communication state machine, the slaves can establish a stable communication connection with the master and transmit data according to protocol requirements. Proper communication parameter configuration and data mapping improve data transmission efficiency and reduce communication latency. The master controls the start and stop of the slaves, allowing the system to flexibly adjust their operating status based on actual needs, enhancing system scalability and adaptability. Furthermore, through data reading, processing, and packaging, the data sent from the slaves to the master is accurate and reliable. Filtering and verification effectively eliminate noise interference, improving data quality. Periodic data processing and transmission ensures that the master station receives real-time data from the slave stations, meeting the real-time requirements of the CNC system. Furthermore, executing control logic based on sensor data and user input enables precise control of the CNC system, improving machining accuracy and quality. Condition monitoring and alarm handling mechanisms promptly detect system anomalies and take appropriate action to prevent accidents and ensure safe system operation. Logging records important system events and data, providing developers and maintenance personnel with detailed troubleshooting and system optimization information.
[0125] The above-mentioned EtherCAT-based CNC operation control method defines the function of each button through software. Users can flexibly configure the function of the button according to actual needs and operating habits, improving the convenience and efficiency of operation. In addition, all function definitions can be completed at the software level without changing the hardware, reducing the cost and time cost of hardware replacement.
[0126] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. EtherCAT-based CNC operation control device, characterized in that: include: FPGA module, matrix button, STM32 module, ESC controller and RJ45 interface; the matrix button is connected to the FPGA module, the FPGA module is connected to the STM32 module, the STM32 module and the RJ45 interface are both connected to the ESC controller, and the ESC controller includes an EtherCAT communication module.
2. The EtherCAT-based CNC operation control device according to claim 1, characterized in that: The FPGA module is also connected to an I / O interface.
3. The EtherCAT-based CNC operation control device according to claim 1, characterized in that: The FPGA module is also connected to a handwheel module.
4. The EtherCAT-based CNC operation control device according to claim 1, characterized in that: The RJ45 interface includes an RJ45 input interface and an RJ45 output interface.
5. The CNC operation control method based on EtherCAT is characterized in that: include: Get the operation instructions input by the user; Preprocessing the operation instruction to obtain a preprocessing result; Parsing the preprocessing result to obtain a parsing result; Control the execution of corresponding actions based on the analysis results.
6. The EtherCAT-based numerical control operation control method according to claim 5, characterized in that: Before obtaining the operation instruction input by the user, the method further includes: Perform initialization operations.
7. The EtherCAT-based numerical control operation control method according to claim 5, characterized in that: The step of obtaining an operation instruction input by a user includes: Collecting user input signals and identifying and determining the signal operation type to form an operation signal; According to the preset mapping relationship or logic rules, the operation signal is generated into a corresponding operation instruction.
8. The EtherCAT-based numerical control operation control method according to claim 5, characterized in that: The preprocessing of the operation instruction to obtain a preprocessing result includes: De-noising and filtering are performed on the operation instructions to obtain preliminary processing results; Performing format conversion on the preliminary processing result to obtain a conversion result; The conversion results are encapsulated to obtain the preprocessing results.
9. The EtherCAT-based numerical control operation control method according to claim 5, characterized in that: The parsing of the preprocessing result to obtain the parsing result includes: Read the header information of the preprocessing result; Based on the header information, locate and extract the operation content of the instruction; Performing semantic analysis on the operation content to obtain analysis content; Perform parameter parsing on the analysis content to obtain the analysis results.
10. The EtherCAT-based numerical control operation control method according to claim 5, characterized in that: The control of executing corresponding actions according to the analysis results includes: Based on the analysis results, plan the action sequence to be executed; According to the action sequence, control instructions are sent to the actuator and the corresponding actions are started.