Optimization method and device for contour detection in numerical control machining simulation and storage medium
By using Boolean calculation method for contour comparison in CNC machining simulation, the problem of inaccurate detection of overcut or undercut problems in the prior art is solved, and more accurate detection and machining parameter adjustment is achieved, and processing quality and accuracy are improved.
Patent Information
- Application Number
- CN202411910143.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-01
AI Technical Summary
When existing CNC machining simulation technologies detect overcut or undercut problems, there are problems such as inaccurate and specificity in the detection.
The Boolean calculation method is used to compare the processed contour with the designed contour, and the overcut or undercut problems are detected through the difference set operation, and the processing parameters are adaptively adjusted according to the analysis results.
It realizes more accurate and specific detection of overcut or undercut problems, provides intuitive and accurate problem diagnosis methods through Boolean operations, and improves processing quality and accuracy.
Smart Images

Figure CN119739104A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of numerical control machining, and in particular to an optimization method, device and storage medium for contour detection in numerical control machining simulation. Background Art
[0002] CNC machining is a technology that uses computer programming to control machine tools for machining. It uses digital codes to control the movement and machining process of machine tools to achieve high-precision and high-efficiency production of workpieces. CNC machining technology is widely used in aviation, aerospace, automobiles, molds, precision instruments and other fields.
[0003] In the CNC machining process, overcutting and undercutting are two common problems, which refer to:
[0004] Overcutting: refers to the cutting tool cutting into the workpiece beyond the predetermined processing path during the machining process, resulting in the workpiece size being out of tolerance or the shape being damaged;
[0005] Undercutting: refers to the failure of the tool to completely remove the material during the machining process, resulting in unmachined parts of the workpiece, affecting the quality and performance of the workpiece.
[0006] With the continuous development of CNC machining technology, CNC machine tools are more and more widely used in the manufacturing industry. However, in the actual machining process, due to various reasons, such as tool wear, machine tool accuracy, programming errors, etc., it is easy to cause overcutting or undercutting, affecting the machining quality and accuracy. At present, CNC machining simulation technology can predict and avoid these problems to a certain extent. By comparing the processed contour with the designed contour, the difference between the two can be found, so as to determine whether there is overcutting or undercutting.
[0007] The contour comparison algorithm is mainly used to detect the difference between the contour of the processed workpiece and the designed contour to determine whether there is overcutting or undercutting. The following are some commonly used contour comparison algorithms: point set matching algorithm, curve fitting algorithm, geometric distance algorithm, shape descriptor comparison. However, each of these existing algorithms has its own shortcomings and cannot detect overcutting or undercutting problems well, so a method to solve this problem is urgently needed. Summary of the invention
[0008] The purpose of the present invention is to solve the deficiencies of the prior art and provide a processing method for detecting overcutting or undercutting problems in numerical control machining simulation, so that the detection of overcutting or undercutting problems is more accurate and specific.
[0009] To achieve the above object, the present invention provides an optimization method for contour detection in numerical control machining simulation, and the specific steps are as follows:
[0010] S1. In the cutting simulation software, set the working parameters, generate the contour of the workpiece after processing, and define it as the processing contour;
[0011] S2. Align and compare the machined contour with the designed contour;
[0012] S3. Perform Boolean operation on the machining contour and the design contour, and mark the problems existing in the current contour;
[0013] S4. Analyze the results of the Boolean operation in the above steps;
[0014] S5. Adaptively adjust the processing parameters according to the analysis results in step S4.
[0015] Preferably, the method further comprises step S6, wherein the specific details of step S6 are as follows:
[0016] S6. According to the adjusted working parameters in step S5, re-processing simulation is performed on the current workpiece to verify the effect of the adjusted working parameters.
[0017] Preferably, the working parameters in step S1 include the processing environment of the machine tool, fixture and tool, and the clamping position of the blank.
[0018] Preferably, the alignment in step S2 specifically refers to comparing the machining contour and the design contour in the same coordinate system.
[0019] Preferably, the step S3 includes step S31, and the step S31 is specifically as follows:
[0020] S31. Subtract the designed contour from the processed contour to obtain the difference set of Boolean operation, check whether the difference set is empty, and if the difference set is not empty, record the difference set area and mark the current workpiece as having an under-cut problem.
[0021] Preferably, the step S3 includes step S32, and the step S32 is specifically as follows:
[0022] S32. Subtract the processed contour from the design contour of the current workpiece to obtain the difference set of the Boolean operation, check whether the difference set is empty, and if the difference set is not empty, record the difference set area and mark the current workpiece as having an overcut problem.
[0023] The present invention also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0024] The present invention also provides a computer-readable storage medium on which a computer program is stored, characterized in that the program implements the steps of the above method when executed by a processor.
[0025] Compared with the prior art, the technical solution proposed in the present application has the following beneficial effects: the present invention adopts the Boolean operation method to determine whether there is overlap, gap or difference between the processed contour and the designed contour, and uses difference operation on the two contours to detect overcutting or undercutting problems; if the Boolean operation difference set of the processed contour minus the designed contour is not empty, there is an undercutting problem; if the Boolean operation difference set of the designed contour minus the processed contour is not empty, there is an overcutting problem; the Boolean operation result of overcutting or undercutting is a closed entity, and by analyzing the shape and size of the difference area, the cause or severity of the overcutting or undercutting can be further determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0027] Figure 1 It is a schematic diagram of the method of the present invention. DETAILED DESCRIPTION
[0028] The following will clearly and completely describe and discuss the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings of the present invention. Obviously, what is described here is only a part of the examples of the present invention, not all the examples. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0029] It should be noted that when a component is referred to as being "fixed to" another component, it may be directly on the other component or there may also be a component centered. When a component is considered to be "connected to" another component, it may be directly connected to the other component or there may also be a component centered. When a component is considered to be "set on" another component, it may be directly set on the other component or there may also be a component centered. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0031] Example 1
[0032] In this embodiment, some existing algorithms are first introduced and analyzed, as follows:
[0033] 1. Point set matching algorithm:
[0034] Closest point pair algorithm: This algorithm determines the deviation between each point on the processed contour and the nearest point on the designed contour by calculating the distance between the two. If the distances of all points are within the allowable tolerance range,
[0035] If the cut is correct, the contour is considered matched; otherwise, it is considered to be overcut or undercut.
[0036] Iterative Closest Point Algorithm: The ICP algorithm minimizes the distance between two point sets through an iterative process to find the best match. It is often used for contour alignment and matching and can effectively detect contour differences.
[0037] 2. Curve fitting algorithm:
[0038] Least Squares Method: Fits a curve by minimizing the sum of squares of errors. In contour comparison, the processed point set can be fitted into a curve and then compared with the design curve.
[0039] B-spline fitting: B-spline is a commonly used curve fitting method that can generate smooth curves. By comparing the processed point set with the B-spline curve, the difference in contour can be detected.
[0040] 3. Geometric distance calculation:
[0041] Hausdorff distance: Hausdorff distance is a measure of the difference between two point sets. It is defined as the distance from the farthest point in one point set to the other point set. In contour comparison, Hausdorff distance can be used to quantify the maximum deviation between the machined contour and the designed contour.
[0042] Average distance: Calculate the average distance from all points on the processed contour to the designed contour. If the average distance exceeds the preset tolerance, it is considered that overcutting or undercutting exists.
[0043] 4. Shape Descriptor Comparison:
[0044] Fourier Descriptor: By converting the contour line into a set of Fourier coefficients, the shape of the contour can be described. Comparing the Fourier descriptors of the machined contour and the designed contour, the difference in shape can be detected.
[0045] The above methods all have their own shortcomings, as follows:
[0046] 1. Closest point pair algorithm
[0047] shortcoming:
[0048] Lack of global information: It only provides local difference information and cannot reflect the overall matching degree of the contour.
[0049] Sensitive to noise: Noise or outliers on the contour may lead to erroneous matching results.
[0050] Unable to handle complex shapes: The algorithm may not work effectively for self-intersecting or highly complex contours.
[0051] 2. Hausdorff distance
[0052] shortcoming:
[0053] Computationally expensive: For a large number of data points, computing the Hausdorff distance can be very time-consuming.
[0054] Sensitive to noise: Extreme values (such as outliers) may greatly affect the calculation of distance.
[0055] Asymmetry: Forward and reverse Hausdorff distances may be different and need to be calculated separately.
[0056] 3. Frechet distance
[0057] shortcoming:
[0058] Computational complexity: The algorithm complexity is high, especially for complex contours.
[0059] Sensitive to noise: Noise and outliers may affect the calculation results.
[0060] High resource consumption: The calculation process requires large amounts of memory and computing resources.
[0061] 4. Shape Context
[0062] shortcoming:
[0063] Computational cost: It is necessary to calculate the distance matrix between point sets, which has a high computational cost.
[0064] Parameter selection: Appropriate parameters (such as the number of bins) need to be selected to obtain the best results.
[0065] Local description: mainly provides local feature description and may require additional global matching strategies.
[0066] 5. Point set alignment algorithm
[0067] shortcoming:
[0068] Computational complexity: Especially when the point set is large, computing the optimal transformation can be very complex.
[0069] Sensitivity to initial values: The performance of the algorithm may depend on the choice of initial transformation.
[0070] Not suitable for complex shapes: For complex shapes with multiple correspondences, the algorithm may not be able to find the correct match.
[0071] According to the above analysis, see Figure 1 This embodiment provides an optimization method for contour detection in CNC machining simulation, which uses Boolean operations to determine whether there is overlap, gap or difference between the processed contour and the designed contour, and uses difference operations on the two contours to detect overcutting or undercutting problems.
[0072] The specific idea is: if the Boolean difference set of the processed contour minus the designed contour is not empty, there is an under-cut problem; if the Boolean difference set of the designed contour minus the processed contour is not empty, there is an over-cut problem.
[0073] The implementation steps are as follows:
[0074] Step 1. Cutting simulation
[0075] In cutting simulation, the processing environment including machine tools, fixtures, and tools is set, the blank is clamped in place, and the solid cutting simulation is performed according to the NC code to generate the contour of the workpiece after processing.
[0076] Step 2. Align the outline
[0077] Place the design part in the clamping position for cutting simulation to align the machined contour with the design contour and ensure that they are compared in the same coordinate system.
[0078] Step 3. Boolean operations
[0079] Perform a Boolean difference operation on the processed contour minus the designed contour, check whether the difference is empty, if not, record the difference area and mark it as an undercut problem; perform a Boolean difference operation on the designed contour minus the processed contour, check whether the difference is empty, if not, record the difference area and mark it as an overcut problem;
[0080] Step 4. Analyze the Boolean operation results
[0081] Output the results of Boolean operations in the form of graphics and reports, visually displaying the specific location and range of overcut or undercut, and providing detailed information on the difference area, such as volume, location, etc.
[0082] Step 5. Optimize processing parameters
[0083] In the overcut or undercut areas, adjust the machining parameters, such as tool path, feed rate, cutting depth, etc. Re-simulate the machining to verify the effect of the adjusted parameters.
[0084] Through the above steps, the present invention can effectively detect overcutting or undercutting problems in numerical control machining, and provides an intuitive and accurate problem diagnosis method through Boolean operations.
[0085] Compared with the Boolean operation method for contour comparison, the disadvantages of other algorithms are:
[0086] 1. Accuracy: An algorithm cannot provide accurate geometric difference information;
[0087] 2. Intuitiveness: The results of some algorithms may not be as intuitive as Boolean operations and require additional explanation and analysis;
[0088] 3. Scope of application: Some algorithms may only be applicable to certain types of contours or specific problems;
[0089] 4. Parameter Tuning: Some algorithms may require tuning multiple parameters to achieve optimal results, which may lead to complexity in use.
[0090] Advantages of the Boolean operation method adopted by the present invention:
[0091] 1. Accuracy: Boolean operations can accurately determine the geometric relationship between two contours, including overlaps, gaps, and differences.
[0092] 2. Intuitiveness: The results of Boolean operations are usually intuitive and easy to understand. For example, intersection, difference and union can directly show the relationship between contours, and thus directly show the shape and size of overcut or undercut parts.
[0093] Applicability: Boolean operations are applicable to many types of contours, whether simple geometric shapes or complex contours.
[0094] Example 2
[0095] The present embodiment provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. The computer device of the present embodiment includes at least but is not limited to: a memory and a processor that can communicate with each other through a system bus.
[0096] In this embodiment, the memory (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Of course, the memory may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory is generally used to store the operating system and various application software installed on the computer device. In addition, the memory may also be used to temporarily store various types of data that have been output or are to be output.
[0097] The processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 22 is generally used to control the overall operation of the computer device. In this embodiment, the processor is used to run the program code stored in the memory or process data.
[0098] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the corresponding function is realized when the program is executed by a processor.
[0099] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and one or more of the above embodiments are combined into one embodiment. Those skilled in the art can make various changes or modifications or combinations within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other at will.
Claims
1. An optimization method for contour detection in numerical control machining simulation, characterized in that: The specific steps are as follows: S1. In the cutting simulation software, set the working parameters, generate the contour of the workpiece after processing, and define it as the processing contour; S2. Align and compare the machined contour with the designed contour; S3. Perform Boolean operation on the machining contour and the design contour, and mark the problems existing in the current contour; S4. Analyze the results of the Boolean operation in the above steps; S5. Adaptively adjust the processing parameters according to the analysis results in step S4.
2. The optimization method for contour detection in numerical control machining simulation according to claim 1, characterized in that: The step S6 is further included, and the specific details of the step S6 are as follows: S6. According to the adjusted working parameters in step S5, re-processing simulation is performed on the current workpiece to verify the effect of the adjusted working parameters.
3. The optimization method for contour detection in numerical control machining simulation according to claim 1, characterized in that: The working parameters in step S1 include the processing environment of the machine tool, fixture and tool, and the clamping position of the blank.
4. The optimization method for contour detection in numerical control machining simulation according to claim 3 is characterized in that: The alignment in step S2 specifically refers to placing the machining contour and the design contour in the same coordinate system for comparison.
5. The optimization method for contour detection in numerical control machining simulation according to claim 4, characterized in that: The step S3 includes step S31, and the step S31 is specifically as follows: S31. Subtract the designed contour from the processed contour to obtain the difference set of Boolean operation, check whether the difference set is empty, and if the difference set is not empty, record the difference set area and mark the current workpiece as having an under-cut problem.
6. The optimization method for contour detection in numerical control machining simulation according to claim 5, characterized in that: The step S3 includes step S32, and the step S32 is specifically as follows: S32. Subtract the processed contour from the design contour of the current workpiece to obtain the difference set of the Boolean operation, check whether the difference set is empty, and if the difference set is not empty, record the difference set area and mark the current workpiece as having an overcut problem.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Cutter radius compensation method capable of avoiding overcut
CN106774151A
UG-based propeller overall numerical control machining method
CN108829037A
Integral annular casing numerical control machining optimization method based on surface roughness control
CN112034786A
NC code detection method and device based on collision and overcut prevention and intelligent terminal
CN114282376A
Aircraft integrated structure assembly method without jig or with few jigs
CN115108042A