Embedded numerical control system and method based on ZYNQ multi-axis machine tool motion control
Through the dual-core architecture and proprietary interrupt mechanism of the ZYNQ chip, the communication between FPGA and ARM is optimized, the development difficulty and resource idle problems of multi-axis linkage control in the CNC system are solved, and efficient and low-cost six-axis control is achieved.
Patent Information
- Application Number
- CN202411224772.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-03
AI Technical Summary
In the multi-axis linkage control of existing CNC systems, the communication method between FPGA and ARM is complex, which makes it difficult to develop. The external interrupt processing between cores is not uniform enough under bus communication, resulting in idle resources and low efficiency.
Using the dual-core architecture of ZYNQ chip, the OCM segmented address and DDR data interaction between the CPU0 display control unit and the CPU1 logical distribution unit can realize efficient communication between ARM and FPGA, and the proprietary interrupt mechanism is used to optimize the six-axis control unit and Data transmission between CPUs reduces hardware development costs.
It improves the stability and data accuracy of the CNC system, reduces the complexity and cost of hardware development, realizes efficient control of six-axis linkage, and meets the needs of multi-channel precise control and rapid response.
Smart Images

Figure CN119065321A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of numerical control system communication and acceleration, and in particular relates to an embedded numerical control system and method based on ZYNQ multi-axis machine tool motion control. Background Art
[0002] CNC machine tool processing technology is the foundation of advanced manufacturing technology. In the field of CNC systems, in order to realize complex motion control calculations such as speed planning, speed loop and position loop closure, the CNC system software needs to adapt to the bus servo, which requires a lot of work and even requires the redesign of the software architecture, greatly increasing the development cost. The present invention is an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control, which can control the CNC system of six-axis linkage composite processing equipment. The system is based on the ZYNQ7000 series chip and the CPU is based on the ARM CONTEX A9 dual-core. It has the advantages of stable operating performance, strong real-time performance, and is in line with the development direction of low cost and open system.
[0003] With the rapid development of science and technology and the improvement of the automation industry, ZYNQ chip technology has been widely used in automation control, military equipment, biomedicine and other fields, and there are higher requirements for future multi-channel, precise control and fast response communication methods. Most of the existing communication methods are CPU0 processing interrupts, and the operating system Linux hardware driver layer is required in the middle, which brings great difficulty to development. The modular coordinated communication system design between hardware acceleration on the FPGA side and ARM, and the dual-core running Linux and SDK separately can solve this problem.
[0004] In current technology, bus communication is generally used between FPGA and ARM. With the increase in the number of external interrupts, it is difficult for the external PL interrupt interface driver to respond accurately at the same time. Using only CPU0 to display the control unit is an idle waste of CPU processing resources. Fully utilizing the dual-core performance advantages and FPGA logic advantages to process a large amount of protocol data with different segments requires complex framing and deframing, which greatly improves the actual CNC system development and methods. Summary of the invention
[0005] The present invention proposes an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control, which is used to solve the problem that the existing PL-side interface transmits multiple different data to the PL core data communication is not unified, and also optimizes the efficiency of the six-axis linkage when each is parallel. At the same time, ARM and FPGA are in one chip, and there is no need to design FPGA pulse control circuit and ARM control circuit separately, which reduces the hardware development cost.
[0006] The present invention proposes an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control, the method comprising a CPU0 display control unit, a CPU1 logic distribution unit, a PL six-axis control unit, an external 5x6 key input to a PS peripheral and an LVDS differential handwheel input to a PL peripheral.
[0007] In an embedded numerical control system and method based on ZYNQ multi-axis machine tool motion control of the present invention, different segment addresses of OCM are used between the ARM-side CPU0 display control unit and the CPU1 logic distribution unit to indicate the read and write flag bits between the CPU1 logic distribution unit and the CPU0 display control unit. The OCM is used to interact with the interactive protocol packets between the CPU0 display control unit and the CPU1 logic distribution unit. DDR is used to interact with specific data to be sent, and DDR is used to interact with different types of data.
[0008] In an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control of the present invention, the PL six-axis control unit sends a PL proprietary interrupt signal to the CPU1 logic distribution unit. Unlike conventional embedded interrupts, the proprietary interrupt here refers to the GPIO level being pulled high and the interrupt notification being responded to at the same time, which is considered to be an external interrupt. The CPU1 logic distribution unit sends a proprietary interrupt to the PL six-axis control unit. Unlike conventional embedded systems, when CPU1 needs to pull up the GPIO first, CPU1 generates an interrupt signal to the PL, and the exclusive interrupt signal of the CNC system is valid.
[0008] In an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control of the present invention, the PL six-axis control unit does not directly transmit data to the CPU0 display control unit, but the PL six-axis control unit sends data to the CPU1 logic distribution unit, which then transmits the data to the CPU0 display control unit.
[0009] In an embedded numerical control system and method based on ZYNQ multi-axis machine tool motion control of the present invention, a PL six-axis control unit is externally connected to 20 IO inputs and 18 IO outputs, and the control of six motors is realized by means of Verilog underlying hardware description language.
[0010] The CPU0 display control unit is the human-machine interaction part of the entire embedded CNC system. The peripheral buttons USB, network port / WIFI interface, etherCAT interface, DDR, frambuffer part, memory and serial port are designed based on this part; the CPU0 display unit is responsible for communicating with the external U disk, USB buttons, LCD display equipment, handwheel and keyboard to complete the user interaction function during the processing; it is also responsible for protocol transmission with the CPU1 logic distribution unit to indirectly realize the communication control of the six axes;
[0011] The CPU1 logic distribution unit is responsible for 16-way data interaction with the CPU0 display control unit, and performs protocol parsing, transmitting the six-axis motor control signal data to the PL through the AXI_GP0 bus. At the same time, it transmits data with the PL through the 16-way segmented BRAM address and interacts with the protocol content.
[0012] The PL six-axis control unit is responsible for splitting the control commands of the CPU1 logic distribution unit and controlling the six-axis motors with different pulse frequencies. At the same time, it performs filtering algorithms to ensure normal IO signal transmission and ensure that the six-way motors can run smoothly. The signal transmission between the CPU0 display control unit and the machine tool, including the tool cutting fluid switch, positioning information, mechanical coordinate zero point, workpiece coordinate zero point information, limit information and air pressure switch, are all controlled by the PL six-axis control unit.
[0013] This CNC adopts dual-core CPU mode. The main chip is based on dual-core ARM CONTEX A9 main controller. The PL six-axis control unit constrains the hardware pins of the LCD. The CPU0 display control unit is responsible for the frambuffer drive of the LCD human-machine display module. The QT program is run on the LCD for user interaction. The CPU0 display control unit completes the main functions of CNC program editing input, keyboard input, six-axis motor coordinate change record, NC program interpreter, interpolation control algorithm, NC program trajectory planning, motor acceleration planning, machining tool path display, user file management, etc.; the CPU1 logic distribution unit is only responsible for data protocol processing and returning the data status of the PL six-axis control unit to the CPU0 display control unit, so that the ZYNQ CNC system controller can have resources to respond to USB keyboard input, program interpreter, LCD function and rough interpolation during the movement. In order to reduce the communication time, the data communication between the CPU0 display control unit and the CPU1 logic distribution unit adopts the method of interaction of OCM and DDR fixed 16-way address.
[0014] In order to improve the stability and data accuracy of the fast CNC system, this CNC system combines the ARM human-computer interaction part and FPGA pulse control into one, uses the interface of the ARM human-computer interaction part to process the system flow, and uses the FPGA pulse control part to control the parallel six-axis motor and 38-way input and output IO, avoiding inaccurate data caused by external wiring data interference transmission.
[0015] The CPU0 display control unit and the CPU1 logic distribution unit are two cores inside the ARM CONTEX A9, which mainly complete the Linux system, bare metal system boot, memory initialization, internal machine tool motion control algorithm, etc. The PL six-axis control unit is responsible for completing the specific pulse input and output work of different frequencies and waveforms.
[0016] The keyboard adopts a 5x6 matrix format and works in a cyclic scanning mode. The keyboard has up to 30 keys, which can meet the needs of CNC system users for simple and convenient keystrokes.
[0017] The interface between the handwheel and the CNC system uses LVDS differential input and is equipped with a ratio selection switch, which can determine the direction of handwheel rotation and is suitable for handwheel debugging and processing needs.
[0018] The touch version of the LCD uses 1024x768 and adopts RGB565 input method. The hardware pin constraints of the display part are added to the PL six-axis control unit. The touch part adopts IIC input method, and the touch hardware circuit pin constraints are added to the PL six-axis control unit.
[0019] The advantages of the present invention are
[0020] It adopts dual-core processor architecture, CPU adopts dual-core ARM CONTEX A9 core processor, and internally integrates xc7z020clg484-2 FPGA chip, which can realize all functions required for CNC operation, greatly reducing the area of chip circuit and the complexity of separate system design, so as to reduce the total hardware cost. CPU0 motion control unit is mainly responsible for interpolation, LCD display, CNC program editing input, keyboard input, six-axis motor coordinate change record, NC program interpreter, interpolation control algorithm, NC program trajectory planning, motor acceleration planning, processing tool path display, user file management and other functions. It can control six servo axes and realize multi-axis linkage function. It has broad application prospects in the field of low-cost economical CNC machine tools with moderate processing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 The embedded CNC system architecture of ZYNQ multi-axis machine tool motion control is shown.
[0022] Figure 2 A principle block diagram of an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control is shown.
[0023] Figure 3 The 16 address segments of data interaction between the CPU0 display control unit and the CPU1 logic distribution unit of the embedded system of ZYNQ multi-axis machine tool motion control are shown;
[0024] Figure 4 An embedded CNC system and method based on ZYNQ multi-axis machine tool motion control are shown to interrupt an effective way.
[0025] Figure 5Shows three types of external devices supported by the embedded system control of ZYNQ multi-axis machine tool motion. DETAILED DESCRIPTION
[0026] Figure 1 As shown, in an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control, the CPU0 display control unit runs the Linux operating system, the CPU1 logic distribution unit runs the bare metal system, and the ZYNQ work board runs in AMP mode; the CPU0 display control unit and the CPU1 logic distribution unit system core are run simultaneously on the ARM side, wherein the BRAM drive, LCD display drive, and VDMA are implemented between the PL six-axis control unit and the CPU1 logic distribution unit. IP driver, 38-way IO read / write driver, interrupt UIO driver, GP bus driver and HP bus driver interfaces, CPU1 logic distribution unit and CPU0 display control unit core mutually access protocol data in OCM / DDR memory, CPU1 logic distribution unit system continuously reads data from these underlying interfaces through AXI bus; on the ARM side, CPU0 display control unit runs Linux system, responsible for underlying memory driver, serial port driver, network port / WIFI driver, etherCAT driver, frambuffer driver, indicator driver and USB driver; at the same time, CPU0 display control unit system performs multi-threaded task work, and exclusive threads communicate with each other; bare metal system core and LINUX operating system core and FPGA part have high-speed data communication, and system layer CPU0 display control unit and CPU1 logic distribution unit interact with exclusive 16 address segment data; application layer runs various data transmissions, and displays data to users through the interface of CPU0 display control unit, which can solve the inflexibility problem when using bare metal system development alone and the high power consumption and low rate problem when using operating system development alone.
[0027] like Figure 2 As shown, in an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control, when the PL six-axis control unit and the CPU1 logic distribution unit send data, they are notified through 16 dedicated interrupts, and then use 4 BRAM address segments for data transmission, and the addresses are fixed to 0x43B00000, 0x43C00000, 0x43E00000, and 0x43F00000. When the CPU1 logic distribution unit sends interactive control commands to the PL, the fixed address of 0x83C00000 is used. Each dedicated interrupt corresponds to a data transmission address, and each BRAM channel has an independent address, and the channels do not interfere with each other.
[0028] like Figure 3As shown, in an embedded numerical control system and method based on ZYNQ multi-axis machine tool motion control of the present invention, the CPU1 logic distribution unit and the CPU0 display control unit use the OCM flag bit to mutually notify each other when reading and writing flag bits, and the OCM low-order segments respectively store 8 flag bits in a fixed manner. Before the CPU1 logic distribution unit writes specific data to the CPU0 display control unit, the flag bit data is written into 8 OCM fixed addresses, and the 8-way fixed flag bit addresses are 0x0000_0000, 0x0000_4000, 0x0000_8000, 0x0000_B000, 0x0001_0000, 0x0001_4000, 0x0001_8000, 0x0000_B000. Here, the addresses of the 8 low-order OCM flag bits are fixed addresses that are only available at the same time. When the CPU1 logic distribution unit writes data to the CPU0 display control unit, one of the flag bits will be set high. The CPU0 display control unit cyclically detects the flag bits of the 8 channels. When a flag bit is detected to be set to 1, it starts to read the specific data in the corresponding 8-channel DDR, which are 0x1FFF0000-0x1FFF0200, 0x1FFF0200-0x1FFF0400, 0x1FFF0400-0x1FFF0600, 0x1FFF0600-0x1FFF0800, 0x1FFF0A00-0x1FFF0C00, 0x1FFF0E00-0x2FFF0000. After CPU0 finishes reading the data in the corresponding 8-channel DDR, it sets the address value of the 8-channel OCM flag bits to 0, indicating that the CPU0 display control unit notifies the CPU1 logic distribution unit that it has finished reading the data. The 16-channel OCM stores the protocol for framing specific data content, the interface data type, data length, and transmission direction contained in the frame content.
[0029] like Figure 3As shown, in an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control, the read and write flags between the CPU1 logic distribution unit and the CPU0 display control unit use the OCM flags, and the OCM segments store 8 fixed flags respectively. Before the CPU0 display control unit writes specific data to the CPU1 logic distribution unit, the 8 fixed flag storage addresses are 0x00020000, 0x00024000, 0x00028000, 0x0002B000, 0xFFFF0000, 0xFFFF4000, 0xFFFF8000 and 0xFFFFB000. These 8 high-order OCM flag addresses are all fixed addresses that are only available at the same time. When the CPU0 display control unit writes data to the CPU1 logic distribution unit, one of the above OCM flag addresses will be set to 1. The CPU1 logic distribution unit cyclically detects the flag bits of the 8 channels. When it detects that a certain flag bit is written to 1, it starts to read the specific data in the corresponding 8-channel DDR, which are 0x2FFF0000-0x2FFF0200, 0x2FFF0200-0x2FFF0400, 0x2FFF0400-0x2FFF0600, 0x2FFF0600-0x2FFF0800, 0x2FFF0800-0x2FFF0A00, 0x2FFF0A00-0x2FFF0C00, 0x2FFF0C00-0x2FFF0E00, and 0x2FFF0E00-0x3FFF0000. After the CPU1 logic distribution unit finishes reading the data in the corresponding 8 DDR channels, it sets the address values of the 8 OCM flag bits to 0, indicating that CPU1 notifies CPU0 that it has finished reading the data.
[0030] like Figure 3As shown, in an embedded numerical control system and method based on ZYNQ multi-axis machine tool motion control of the present invention, the CPU0 display control unit and the CPU1 logic distribution unit use DDR to exchange specific data to be sent, and a total of 16 fixed DDR inter-core communication interaction addresses are 0x1FFF0000-0x1FFF0200, 0x1FFF0200-0x1FFF0400, 0x1FFF0400-0x1FFF0600, 0x1FFF0600-0x1FFF0800, 0x1FFF0A00-0x1FFF0C00, 0x1FFF0E00-0x2FFF0000, 0x2FFF0000-0x2FFF0200, 0x2FFF0200-0x2FFF0400, 0x2FFF0400-0x2FFF0600, 0x2FFF0800 0600-0x2FFF0800,0x2FFF0800-0x2FFF0A00,0x2FFF0A00-0x2FFF0C00,0x2FFF0C00-0x2FFF0E00,0x2FFF0E00-0x3FFF0000.
[0031] like Figure 4 As shown, an embedded CNC system and method based on ZYNQ multi-axis machine tool motion control interrupts effectively. The PL six-axis control unit sends a PL proprietary interrupt signal to the CPU1 logic distribution unit. Unlike conventional external interrupts, the proprietary interrupt here refers to the GPIO level being pulled high and the interrupt notification being responded to at the same time, which is considered an external interrupt. The CPU1 logic distribution unit sends a proprietary interrupt to the PL six-axis control unit. Unlike conventional embedded systems, when CPU1 needs to pull up the GPIO first, CPU1 will generate an interrupt signal to the PL, and the exclusive interrupt signal of the CNC system will be effective.
[0032] like Figure 5 As shown in the figure, the embedded system control of ZYNQ multi-axis machine tool motion supports three types of external devices, which can be connected to the external USB interface 5x6 key controller, the touch screen LCD external controller, or the MPG handwheel controller. After the data is sent to the CPU0 display control unit, the CPU1 logic distribution unit transmits it to the PL six-axis control unit through BRAM or AXI_GP0 or dedicated interrupt to control the 38-way input and output IO and the six-axis motor.
[0033] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention can be made by ordinary technicians in this technical field without departing from the technical principles of the present invention. Several improvements and deformations can also be made, and these improvements and deformations should also be regarded as the scope of protection of the present invention.
Claims
1. An embedded CNC system and method based on ZYNQ multi-axis machine tool motion control, characterized in that: CPU0 display control unit, CPU1 logic distribution unit, PL six-axis control unit, external 5x6 button input to PS peripheral and LVDS differential handwheel input to PL peripheral.
2. The bus type numerical control system and method according to claim 1, characterized in that: On the ARM side, different segment addresses of OCM are used between the CPU0 display control unit and the CPU1 logic distribution unit to indicate the read and write flags between the CPU1 logic distribution unit and the CPU0 display control unit. OCM is used to exchange protocol packets between the CPU0 display control unit and the CPU1 logic distribution unit. DDR is used to exchange specific data to be sent. DDR is used to exchange different types of data.
3. The bus type numerical control system and method according to claim 2, characterized in that: The PL six-axis control unit sends a PL proprietary interrupt signal to the CPU1 logic distribution unit. Unlike conventional embedded interrupts, the proprietary interrupt here refers to the GPIO level being pulled high and the interrupt notification being responded to at the same time, which is considered an external interrupt. The CPU1 logic distribution unit sends a proprietary interrupt to the PL six-axis control unit. Unlike conventional embedded systems, when CPU1 needs to pull up the GPIO first, CPU1 will generate an interrupt signal to the PL, and the exclusive interrupt signal of the CNC system will be valid.
4. The bus type numerical control system and method according to claim 3, characterized in that: The PL six-axis control unit does not transmit data directly to the CPU0 display control unit. Instead, the PL six-axis control unit sends data to the CPU1 logic distribution unit, which then transmits data to the CPU0 display control unit.
5. The bus type numerical control system and method according to claim 1, characterized in that: The PL six-axis control unit has 20 external IO inputs and 18 IO outputs, and controls six motors through the Verilog underlying hardware description language.
6. The bus type numerical control system and method according to claim 5, characterized in that: The PL six-axis control unit is responsible for splitting the control commands of the CPU1 logic distribution unit and controlling the six-axis motors with different pulse frequencies. At the same time, it performs filtering algorithms to ensure normal IO signal transmission and ensure that the six-way motors can run smoothly. The signal transmission between the CPU0 display control unit and the machine tool, including the tool cutting fluid switch, positioning information, mechanical coordinate zero point, workpiece coordinate zero point information, limit information and air pressure switch, are all controlled by the PL six-axis control unit.
7. The bus type numerical control system and method according to claim 4, characterized in that: The CPU0 display control unit and the CPU1 logic distribution unit are two cores inside the ARM CONTEX A9, which mainly complete the Linux system, bare metal system boot, memory initialization, internal machine tool motion control algorithm, etc. The PL six-axis control unit is responsible for completing the specific pulse input and output work of different frequencies and waveforms.
8. The bus type numerical control system and method according to claim 4, characterized in that: This CNC system combines the ARM human-computer interaction part and FPGA pulse control into one, uses the interface of the ARM human-computer interaction part to process the system flow, and uses the FPGA pulse control part to control the parallel six-axis motor and 38-way input and output IO, avoiding inaccurate data caused by external wiring data interference transmission.
9. The bus type numerical control system and method according to claim 1, characterized in that: The CPU uses a dual-core ARMCONTEX A9 processor, and the internal integrated FPGA chip is xc7z020clg484-2, which can realize all the functions required for CNC operation, greatly reducing the area of the chip circuit and the complexity of the separate system design. The CPU0 motion control unit is mainly responsible for interpolation, LCD display, CNC program editing input, keyboard input, six-axis motor coordinate change record, NC program interpreter, interpolation control algorithm, NC program trajectory planning, motor acceleration planning, processing tool path display, user file management and other functions. It can control six servo axes and realize multi-axis linkage function.
