CNC machine tools are the product of modern high-tech development. Each time a batch of parts begins to be processed, a large number of inspections must be performed, including tightening and aligning fasteners and parts, determining the programming origin of the parts, inspecting the first part and process In-process inspection and processing completion inspection, etc. Currently, the main ways to carry out these inspections are manual inspection, offline inspection and online inspection. Online detection, also called real-time detection, is to detect the tool in real time during the machining process and carry out corresponding processing according to the detection results. Online detection is a detection technology based on computer automatic control, and the detection process is controlled by CNC program. The advantages of closed-loop online detection are: it can ensure the accuracy of CNC machine tools, expand the functions of CNC machine tools, improve the performance of CNC machine tools, and increase the efficiency of machine tools. CNC tools.
1. Composition of online detection system of CNC machine tools
There are two types of CNC machine tool online inspection systems. One is to call the basic macro program directly without computer assistance; the other is to develop the macro program library yourself and use the computer-aided programming system to generate inspection programs at any time. then transfer them into the CNC system. The online detection system of CNC machine tools consists of software and hardware.
The hardware part generally consists of the following elements:
(1) Machine tool body The machine tool body provides the basis for processing and inspection. Its working parts are the parts that perform the basic movements required. The precision of its transmission parts directly affects the accuracy of processing and inspection.
(2) CNC system Currently, CNC machine tools generally use CNC CNC systems, the main characteristics of which are that input storage, CNC machining, interpolation operations and various machine tool control functions are all implemented through programs. The computer and other devices can be connected via interface devices. When the control object or function changes, only the software and interface need to be changed. CNC systems typically consist of a central processing memory and input and output interfaces. The central processing unit is composed of memory, arithmetic units, controllers and buses.
(3) Servo system Servo system is an important part of CNC machine tool. It is used to realize the feed position servo and the speed (or position) servo of the spindle of the CNC machine tool. The performance of the servo system is the main factor that determines the machining accuracy, measurement accuracy, surface quality and production efficiency of the machine tool.
(4) Measuring system The measuring system consists of a contact trigger probe, a signal transmission system and a data acquisition system. It is a key part of the online detection system of CNC machine tools and directly affects the accuracy of online detection. The key component is the probe, which can be used to measure dimensions during processing. The processing program can be automatically changed according to the measurement results to improve the processing accuracy, making the CNC machine tool both a processing equipment and a measuring machine.
The currently commonly used Renishaw probes are products of the British company Renishaw. They are used on most CNC machine tools such as CNC lathes, machining centers, CNC grinding machines and special machines. Probes can be divided into workpiece detection probes and tool probes according to their functions; they can be divided into wired, inductive, optical and wireless according to their signal transmission methods; they can be divided into contact measurement and non-contact measurement; to their contact forms. Users can choose the appropriate configuration according to the specific machine tool model.
(5) Computer system The online detection system uses computers to collect and process measurement data, generate detection CNC programs, simulate the detection process, and communicate with CNC machine tools. In order to run the currently popular Windows and CAD/CAM/CAPP/CAM and VC++ software, as well as reduce the analysis and calculation time of measurement results, online detection systems generally use Pentium-level computers or higher.
2. Working principle of online detection of CNC machine tools When implementing online detection of CNC machine tools, the main detection program should be automatically generated on the computer-aided programming system, and the main detection program is transmitted to the CNC machine tool through the communication interface, and the G31 jump command is used to make the probe move according to the path specified by the program. When the measuring ball comes into contact with the workpiece, a trigger signal is sent to the converter via the special interface. between the probe and the CNC system. The trigger signal is converted and transmitted to the machine tool control system, and the point coordinates are recorded. After the signal is received, the machine tool stops moving and the coordinates of the measuring point are sent back to the computer through the communication interface, and then the next measuring action is performed. By monitoring the measurement values returned by the CNC system, the host computer can perform various data processing tasks such as calculation, compensation and visualization of the system measurement results.
The steps for detecting paths when measuring typical geometries are:
(1) Determine the geometric elements of the shape characteristics of the part to be measured;
(2) Determine the precision characteristics of the parts to be measured;
(3) Determine the number and distribution of detection points based on the measured shape characteristics, geometric elements and precision characteristics;
(4) Establish mathematical calculation formulas based on the number of measurement points and their distribution patterns;
(5) Determine the workpiece coordinate system of the inspection part;
(6) Determine the detection path according to the detection conditions.
3. Online inspection and programming of CNC machine tools The key to online inspection technology is mainly reflected in the preparation of inspection programs. The quality of inspection programs directly affects inspection results. Currently, detection software includes commercial software and self-developed software. Commercial software such as the new version of PowerInspect from the British company DELCAM is open inspection software that is not limited by measuring equipment and can be used for both online and offline inspections. It not only provides the online inspection function, but also can program the inspection path according to the CAD model read before inspection and perform inspection simulation. The prepared program can then be transferred to the CNC inspection equipment for automatic inspection. Another example is Renishaw’s OMV (Machine Verification) on-machine inspection software. This software is specially written for CNC machine tool systems. It is mainly used to detect samples, complex parts and large-scale parts based on original CAD data. . Parts, multi-process parts and molds.
The programming methods of self-developed software include: online detection programming based on C, C++, VC++, VB, Delphi development platform and online detection programming based on CAD development platform .
The functions of the main modules of the detection part are as follows:
(1) Automatic generation module of the main measurement program: mainly completes the entry of information on the part to be tested and generates the main detection program.
(2) Error compensation module: compensates for errors generated during the measurement process to improve measurement accuracy.
(3) Communication module: completes sending the main program and called macro program and receiving the coordinate information of the measuring point.
(4) Measurement macro program module: carries out the management and internal calling of macro programs. The main module is responsible for operations such as searching, adding, modifying and deleting macro programs.
(5) Data processing module: compensate the coordinates of measuring points and perform various size and precision calculations. By opening the measurement results data file, the coordinate information of the measurement point is obtained, and the measured value is finally obtained through the corresponding calculation process. Online detection automatic programming based on CAD development platform uses AutoCAD as the system integration development platform and ObjectARY as the secondary development tool. The development of this system can compensate for the missing functions of the CAD/CAM system and realize the graphic preparation. of the detection program, i.e. CAD/online inspection.
4. Simulation of online detection system of CNC machine tool
At present, the development ideas of online inspection of CNC machine tools are based on CAD/CAM technology, and corresponding online inspection simulation systems can be developed. The simulation system graphically reproduces the online inspection process of CNC machine tools, can visually check the inspection path planning, and detect macro programming errors in advance to avoid damage to the inspection system online during the actual inspection process. Using VC++ as a system development tool and OpenGL as a three-dimensional scene development tool, the process of developing a CNC machine tool online inspection simulation system in accordance with the ideas of object-oriented programming is as follows:
(1) The virtual detection environment is established using the OpenGL standard for graphics processing. OpenGL is a software interface for graphics hardware. It can be used to perform various operations such as geometric modeling, graphics transformation, rendering, lighting, materials, etc. Most of the underlying graphics processing work is handled by certain specialized functions.
(2) Extraction of detection information The online detection simulation system must faithfully reflect each instruction of the measurement macro program during the simulation process, that is, use the measurement macro program to drive the detection simulation process. Therefore, the simulation system must have comprehensive detection information extraction capabilities, be able to perform syntactic verification of the measurement program, be able to perform calculations and associated judgments, and, most importantly, be capable of extracting the movement trajectory of the probe to be controlled. simulation of probe detection.
(3) The online detection system driven by the virtual probe uses the collision between the probe and the object to be measured to determine the position information of the contact point. Therefore, the detection simulation must reproduce this process realistically, which is also the core. question of the entire simulation system. In order to ensure that the probe reliably touches the object to be measured, the farthest stroke of the probe’s sensing movement should be greater than the distance between the probe and the actual contact point, i.e. say that the actual contact point is between the starting point of the measurement. point and the travel point farthest from the probe on the right segment.
5. Conclusion
Integrating sensing technology into CNC machining content and using online measurements can allow operators to quickly discover part issues and provide feedback to the CNC system. According to a sample survey, the current economic losses caused by product quality problems in my country, such as waste, defective products, repaired products, etc., account for about 10-15% of the production value when online measurement technology is applied. for CNC systems, its most direct economic impact is. The advantage lies in saving labor hours and improving measurement accuracy. In addition, through the use of the CNC system function of the machine tool, the CNC system can obtain the feedback information of the detection system in time, so that the system error and random error can be corrected in time to change the movement parameters of the machine tool, better guarantee the processing quality, and promote the development of measurement integration. It can be predicted that the application of online measurement technology in CNC machine tools has very broad prospects in the future, and the sooner you use it, the sooner you will benefit from it.
Daguang focuses on providing solutions such as precision CNC machining services (3-axis, 4-axis, 5-axis machining), CNC milling, 3D printing and rapid prototyping services.


















