A WEDM-CNC System with Offline Interpolation Post-processing Function

At present, the focus of CNC technology is mainly towards open CNC systems and cloud manufacturing. But the motion control of the CNC system is still mainly composed of interpolation and motion execution. In order to improve the accuracy and quality of interpolation, the applied algorithms are becoming more and more complex. When encountering complex trajectories, minor modifications require complex calculations. To solve this problem, a new CNC system architecture is proposed, that is, adding processing functions after interpolation. Put the minor modification of the trajectory after the interpolation. The article first introduces the CNC architecture with offline interpolation post-processing (OIPP). Then the Interpolation Byte Stream (IBS) format used to represent the interpolation data is introduced. Since the IBS format has the dual characteristics of geometry and string, geometric transformation and text processing both can be used in processing operation. On the basis of the software program and the matching motion controller, the WEDM-CNC system with post-interpolation processing function is implemented. The interpolated data transmission in the developed system adopts a dual-pointer structure, which can effectively control the data transmission. Finally, the feasibility of the new CNC system was verified through machining experiments. Experiments show that offline interpolation post-processing can modify the interpolated data with high precision and flexibility.


Introduction
As the CNC technology enters the computer age, there are two ways to process interpolation operations, one is online interpolation and the other is offline interpolation. In the online interpolation mode, interpolation and processing are carried out at the same time, and the obtained data is immediately converted into motor motion. In offline interpolation mode, interpolation and processing are carried out separately, and the toolpath is completely interpolated and then transmitted to the controller.
Online interpolation is also called real-time interpolation, which has been widely studied and applied because it does not need to store a large amount of interpolated data. Offline interpolation needs to store a large amount of data, so it is mainly used for the inspection and simulation of the interpolation method.
Many scholars have explored and improved the structure of the CNC system. Suh and Cheon [1] present a conceptual framework for designing and implementing an intelligent CNC system. Yang and Park [2] had a study on an open WEDM-CNC system with a consideration of the differences between WEDM and NC cutting machines. Han et al [3] developed a PC-based open software-CNC system.  [4] proposed a new model of WEDM-CNC system with digitizer/player architecture. In recent years, the research focus of scholars has shifted to cyber-physical systems [5,6] and cloud manufacturing [7,8]. These literatures mainly research on the overall architecture of the CNC system, and the changes to a single CNC system are not large. They still follow the traditional framework of trajectory planning, interpolation and machining.
With the increase in machining requirements, the complexity of the interpolation algorithm is getting higher and higher. Yeh and Hsu [9] proposed adaptive-feedrate interpolation for parametric curves with a confined chord error. Timar et al [10] presented algorithms for time-optimal control of CNC machines. Zhao et al [11] used a real-time look-ahead interpolation methodology to deal with curvature-continuous B-spline transition scheme. Atmosudiro [12] introduced an interpolation concept for linear blending based on cornu spiral.
These interpolation methods are computationally intensive, and sometimes the CNC developers have to choose between the real-time and the accuracy of the interpolation algorithm. Offline interpolation has the advantage of not needing to consider the real-time of interpolation, so it is more suitable for CNC systems with complex algorithms. In addition, these interpolation methods have higher accuracy for specific objects, and the results of interpolation for other objects are not satisfactory. At the same time, because offline interpolation can get a complete interpolation data result, it also provides the possibility to modify the interpolation result. The modification of the interpolated data is called the offline interpolation post-process (OIPP).  The rest of this papar is arranged as follows. Section 2 introduces the content and process of OIPP. Section 3 mainly describes the implementment of the new WEDM-CNC system model. Section 4 demonstrates the feasibility of the new CNC system with a machining example.

Format of Interpolated data
The interpolated data contains every movement of the motor during machining, so it is hundreds of times the trajectory information. As the storage space of the current microcomputer continues to grow, more and more interpolated data can be stored. In order to adapt to the offline interpolation system, the interpolation data format must meet certain conditions: • Accurate exercise information.
• Readability and modifiability. Interpolation byte stream (IBS) is a format that meets the above conditions. IBS takes the interpolation byte as the unit, and an interpolation byte unit can contain one or more bytes. The number of bytes is determined by the number and group of axes in the CNC system.
Axis movement steps,0 is still, 1 is feed As we all know, the result of interpolation is a single-step movement of each axis. Therefore, one interpolation byte contains the relative movement of each axis. The movement of one axis in the interpolation byte is represented by two bits. One bit indicates the direction of movement, and one bit indicates the number of feed steps. This form of expression refers to the content of literature [4]. After the movement of each axis is arranged in the agreed order, it is converted into byte format, and finally displayed in the form of hexadecimal string on the host computer.
Taking a 4-axis WEDM machine as an example, one byte can contain the information of 4 axes, as shown in figure 2 and table 1. The four axes X/Y/U/V are arranged in one byte in order. In this 4-axis system, one byte unit contains one byte. The hexadecimal string 07h indicates that the UV axes does not move, the Y-axis goes one step forward, and the X-axis reverses one step.
The IBS format can accurately express motion information, and is more concise than the coordinate representation, and has obvious readability and editability. In fact the interpolation format can have multiple representations, as long as the three conditions mentioned above are met.

Visual editing
The data after interpolation is saved in the computer in the form of IBS string. To modify the data, it must be visualized. The general CNC system usually has a simulation module before machining to check the feasibility of the program and possible interference problems, but it does not provide the function of modifying the local trajectory. The post-interpolation processing provides exactly partial modification function.
For the IBS format, only the starting point coordinates need to be provided, and the movement of each motor can be obtained according to the movement information of each byte unit, and converted into the coordinates of the tool or the platform.
For machine tool operators, visual verification is required when generating and modifying trajectories. This is because although the motor movement corresponding to a single byte is very simple in the post-interpolation processing, the number of interpolation bytes is very large, and visualization tools must be used.

Post-processing
The OIPP function is the operation after the interpolation. It is the same as trajectory planning in that both are operations on trajectories. The difference is that the trajectory planning faces the machining size requirements of the workpiece, and the OIPP faces the interpolated data. The OIPP faces many linear segments. Therefore, almost geometric operations on linear segments can be applied to post-processing. At the same time, because it is a string format, some file operations can also be performed.
The geometric transformation includes functions such as rotation, mirroring and zoom, as shown in figure 3. Rotation and mirroring operations are common operations in machining. The rotation operation needs to regenerate the IBS according to the rotated coordinates, but if the rotation angle is a multiple of 90°, it can be directly replaced according to the corresponding byte unit. The most commonly used processing is the mirroring operation of the relative axis, which can be directly processed according to the text. The zoom operation can be used when the accuracy allows.
The text editing operation has functions such as cutting, pasting and arraying, as shown in figure 4. The cutting operation divides the IBS into two sections at the specified position. The obtained two line segments can be used to combine with other line segments. The pasting operation is to combine two IBS segments into one. Array operation is to copy one IBS into multiple and combine into one. Text editing operations can handle IBS more flexibly.
In machining, when the operator encounters a certain position of the trajectory that needs slight modification, or adds certain features, the text editing operation can be used. In fact, OIPP is to provide operators with a way to directly access the final motion. After mastering the principle of OIPP, the operator can fully manipulate the movement of all motors.

Implementation with the new model
The interpolated data modified by OIPP is different from the original toolpath information and cannot be converted to toolpath information for storage, so it must be sent to the motion controller in the suitable format to execute the movement. The IBS format is in bytes, so it is very easy to transmit and decode. In this section, an IBS-based WEDM-CNC system is implemented to prove the feasibility of the new architecture.

Basic structure of the controller
The amount of data after interpolation is very large, and the controller resources are limited and it is impossible to download completely at one time. In order to meet the real-time processing, a buffer module must be set in the controller. FIFO memory has unique first-in first-out characteristics, suitable for storing and reading processing data. The signal interface of the FIFO memory is shown in figure 5. FIFO memory is used as a data buffer module, receiving interpolation data and sending it to the subsequent execution module according to the signals. The almost_full and almost_empty signals of the FIFO are sent to the parameter control module to transmit the status of the FIFO. The data is stored in the FIFO and read as needed. The read data is converted into motor motion control signal. The other functional modules are similar to the existing controller functions and will IOP Publishing doi:10.1088/1757-899X/1102/1/012013 5 not be detailed one by one. The main modules of the controller is shown in figure 6. In addition to the interpolation data sending module, there are also position feedback and parameter control modules.
The position feedback module sends the position signal of the motors or gratings to the computer after processing. The parameter control module includes a parameter controller and a speed controller. The parameter controller receives the parameters and sends them to the corresponding interface. The speed controller adjusts the feed speed according to the speed control information of the parameter controller and the machining state of the machine tool.
WEDM-CNC belongs to low-speed machining. In order to maintain the gap of spark discharge, it is necessary to receive gap status information and adjust the speed at any time. The current CNC system usually contains a speed control module. This article implements an adjustable speed control module for FIFO memory.

The interpolated data flow structure
The large amount of interpolated data is stored in Industrial Personal Computer (IPC), and the IPC software adopts a dual pointer structure, including sending pointer (SP) and receiving pointer (RP). The sending pointer points to the position after sending the buffer block, and the receiving pointer points to the feedback after the motor moves. The dual pointer method can not only send forward, but also send in reverse when the discharge gap is short-circuited.
The interpolated data flow of the new WEDM-CNC system is shown in figure 7. The IBS module sends data to the controller in the form of a fixed-length buffer block each time it sends data. The data length when receiving is subject to the actual number of feed steps. At the same time, the status signal of the FIFO is checked regularly, and the next set of buffer blocks is sent when the data in the FIFO is IOP Publishing doi:10.1088/1757-899X/1102/1/012013 6 almost empty. The dual pointer structure can send forward and reverse data streams, implementing forward or reverse machining.
The other parts of the CNC system in the figure are consistent with the existing system.

Applications
In order to verify the feasibility of the new WEDM-CNC system model, the computer software and new controller of the new CNC system were developed and installed on the existing WEDM machine tools for processing experiments. The experimental equipment is shown in figure 8. The controller adopts FPGA chip, and the hardware program design is compiled and loaded into the chip. The machine tool is a high-speed wire cutting machine, and the movement is driven by stepper motors. The machining accuracy is 1μm.  Figure 10 shows the trajectory with two redundant parts after interpolation, resulting in corresponding defects during machining. After using the cutting method in OIPP, the redundant parts are removed and the machining results are also improved.

Control Cabinet
New Controller . Curve processed by OIPP and its machined workpieces The CNC system developed in section 3 is used for machining, and the machined workpieces are consistent with the graphics displayed by the software. Data transmission is timely during machining, and the machining efficiency is equivalent to that of the original machine.

Conclusions
A WEDM-CNC system with OIPP function was proposed and implemented in WEDM machine tools. The feasibility of OIPP has been verified. The interpolation data format can also be optimized to achieve better storage and transmission characteristics. OIPP is to perform surgical processing on the interpolated data, which can be modified according to the conditions of the machine tool to achieve micron-level or sub-micron-level accuracy. OIPP has great application prospects for high-precision nonlinear machining.
The OIPP is applied to the CNC system of offline interpolation, so that the offline interpolation is not limited to the inspection and simulation of the interpolation method, but the CNC system architecture with huge advantages.