This paper analyzes the machining method of line contact machining. The CNC system is a Windows-based, fully software-based CNC system, including multiple software control modules. By controlling the effective tool movement of the milling cutter, it completes the machining of the entire developable ruled surface in a single pass using the side edge of the milling cutter. Furthermore, the system has a graphical automatic programming function, ensuring the automation of the machine tool machining process. In traditional milling, surface machining often uses point contact machining. This method is simple in tool position calculation but has low machining efficiency and accuracy. Therefore, line contact milling has emerged in recent years. Line contact machining utilizes the side edge of the milling cutter to contact the contour surface of the workpiece in a straight line. Because it increases the contact length between the tool and the workpiece, it is a surface-based machining method. By appropriately modifying the machining method, the side edge of the milling cutter can complete the machining of the entire curved surface in a single pass. This not only improves machining efficiency but also avoids approximation errors and nonlinear errors, thereby improving machining accuracy. This machining method is suitable for developable ruled surfaces such as spatial planes, cylindrical surfaces, conical surfaces, and functional surfaces suitable for line contact machining. In the CNC codes specified by the International Organization for Standardization and the extended CNC codes by various CNC and machine tool manufacturers, there are generally no surface machining instructions. Therefore, there is currently no CNC system specifically for surface machining. 1 Overall Structure of the CNC System 1.1 Hardware Composition of the CNC System This CNC system is a fully software-based CNC system under the WINDOWS environment. Therefore, its hardware part mainly consists of the system control output interface. In addition, since the WINDOWS operating system is a non-real-time operating system, in order to solve the real-time problem of the line contact machining CNC system, we introduce an external real-time clock to solve the real-time problem of the WINDOWS operating system. The hardware structure diagram of the CNC system is shown in Figure 1. The control output of the PC is connected to the external I/O interface via the ISA bus to send control pulse signals to the motor. The I/O output logic unit and the real-time clock are implemented using CPLD programmable logic devices. 1.2 Software Part of the CNC System The software of the line contact machining CNC system mainly includes two parts: the line contact machining machine tool control part and the graphic automatic programming system. 1.2.1 Control section of line contact machining machine tool This CNC system is a fully software CNC system under WINDOWS environment. The control of the machine tool is all done in software. (1) WINDOWS operating system has powerful functions and a user-friendly human-machine interface, but it is a non-real-time operating system. It is difficult to meet the requirements of strong real-time performance in CNC system by using the various real-time measures provided by WINDOWS system. Here, we use both hardware and software to solve the real-time clock problem on the Windows platform. On the hardware side, we make an ISA interface card and use CPLD to generate the required real-time clock interrupt signal, which is transmitted to the PC through the ISA bus on the interface card. On the software side, we respond to the clock interrupt by writing a device driver. Here we use VC++6.0+DDK+DriverStudio to develop the driver for the ISA board. (2) This line contact machining CNC system uses C++ Builder6.0 programming tool to complete the decoding, preprocessing module, tool compensation module, interpolation module, speed control, position control and other functions. (3) The CNC system must read and write to the ISA port to send control commands to the servo system and other peripherals. This is the fundamental reason why the CNC system can perform its functions. These operations can be performed directly under the DOS operating system. However, since the WINDOWS NT operating system completely shields users from I/O operations, WINDOWS NT adopts a layered I/O system. There are a series of system components between user mode and kernel mode. The main ones include the I/O manager, device drivers, Hardware Abstraction Layer (HAL), and registry database. Figure 2 shows the I/O request flowchart. [IMG=Figure 1 Hardware Structure Diagram of CNC System]/uploadpic/THESIS/2007/11/200711141429427109624.jpg[/IMG] Figure 1 Hardware Structure Diagram of CNC System [IMG=Figure 2 I/O Request Flow]/uploadpic/THESIS/2007/11/2007111414342631662K.jpg[/IMG] Figure 2 I/O Request Flow In the Windows environment, corresponding I/O drivers need to be developed to complete I/O operations. I/O control output is achieved through communication between the driver and the application. The communication process between the application and the WDM driver is as follows: the application first uses the CreateFile function to open the device, then uses Device IoControl to communicate with the WDM, and can also use ReadFile to read data from the WDM or WriteFile to write data to the WDM. When the application exits, CloseHand is used to close the device. Communication between driver and application: Communication between driver and application can be completed asynchronously using DeviceIoControl, or by using WIN32 event notification. Alternatively, a named event can be created for use by both driver and application, but this method is only applicable to communication between NT driver and application. 1.2.2 Automatic programming system for line contact machining graphics This part exists mainly because of the characteristics of line contact machining. Line contact machining uses the side edge of the milling cutter to complete the machining of the entire space developable ruled surface in one pass. It is a surface-based machining method. The CNC program for surface machining is very complicated to use manually. Here we use an automatic programming system, inputting feature graphics, and finally using a CNC code to complete the machining of developable ruled surfaces and some feature curves. The following are the main components of the automatic programming system for line contact machining graphics and the implementation methods of each part: (1) Graphic input part of the part. Here we will use the feature graphics input method and store the data using a surface-based data structure. It can realize the graphic input of general two-dimensional graphics, spatial planes and spatial rotating surfaces, ruled surfaces or other three-dimensional curved surfaces. (2) Acquisition of graphic data. The feature region method is adopted, and the feature data of the graphic is found by activating the graphic with the mouse. According to the input feature graphic, the data information of the feature graphic is obtained, and then it is saved in a certain data format to lay the foundation for subsequent data processing. (3) Generate tool position file. When performing tool position trajectory calculation, tool interference processing is performed first, and then the workpiece graphic is calculated by using equidistant straight lines according to the cutting depth and other parameters given by the cutting process, so as to determine the entry point and exit point of the tool at each step; other joint points can be obtained according to the data points of the feature graphic and the process requirements. (4) Generation of CNC code. After the tool position compensation calculation, CNC code is generated. The definition of surface machining CNC code is to use the reserved part of the ISO code set and the extended G code. According to the CNC machine tool feature file, the tool position data file is translated into CNC code file that can be used for machining. When the post-processing command is executed, the required CNC code file will be automatically output according to the content defined in the design file. (5) Dynamic simulation part. By dynamically simulating the tool path and the tool's posture throughout the entire operation, the conformity with the set standards and requirements of the tool path is verified; the correctness of the acquired data is checked during the tool path. 2 Conclusion Applying the line contact machining method, this paper studies a line contact machining CNC system. This system, by controlling the effective posture of the milling cutter, can achieve the machining of the entire developable ruled surface in a single continuous tool path using the side edge of the milling cutter. The CNC code for this machining method is simple, and it avoids approximation errors and nonlinear errors, making it a novel and efficient CNC machining method. This CNC system, used for machine tool machining control, can greatly improve machining accuracy and increase machining efficiency. (Proceedings of the 2nd Servo and Motion Control Forum, Proceedings of the 3rd Servo and Motion Control Forum)