A surface topography simulation method based on GPU acceleration for hybrid turning and milling

CN118673705BActive Publication Date: 2026-08-11SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0010]针对现有车铣复合加工表面形貌仿真技术存在的问题,本发明提供一种基于GPU加速的车铣复合加工表面形貌仿真方法,可以实现对于任意车铣复合加工下条件表面形貌的快捷预测

Benefits of technology

[0047] 1. This invention optimizes the geometric simulation process by placing the steps that account for the majority of computation in geometric simulation, namely the establishment of the tool and workpiece Tri-dexel models and the tool-workpiece Boolean operations, into the GPU. It also significantly reduces the data communication between the CPU and the GPU, making full use of the GPU's computing power and achieving a significant acceleration effect. This improves the efficiency of geometric simulation and provides support for higher-precision geometric simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673705B_ABST
    Figure CN118673705B_ABST
Patent Text Reader

Abstract

A GPU-accelerated simulation method for surface morphology in mill-turn machining includes the following steps: (1) Model preprocessing: including acquiring tool and workpiece STL model data, setting the surface morphology analysis area, and unifying the model information in the world coordinate system of the program; (2) Calculating the workpiece Tri-dexel model in the GPU; (3) Importing and translating the machining CNC code, calculating the tool position point and transmitting it to the GPU; (4) Calculating the tool sweep body in the GPU based on the tool position point, establishing and updating the tool Tri-dexel model, performing Boolean operations with the workpiece model, and gradually updating the workpiece Tri-dexel model; (5) Transmitting the workpiece Tri-dexel model back to the CPU for analysis and visualization of the workpiece surface. This method improves the accuracy and computational efficiency of geometric simulation, enables simulation and analysis of various types of mill-turn machining surface morphology, and realizes rapid prediction of surface morphology under arbitrary mill-turn machining conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of mechanical manufacturing and processing technology, and specifically relates to a method for obtaining surface morphology data of workpieces processed by turning and milling using geometric simulation technology. Background Technology

[0002] Milling-turn machining integrates turning, milling, and drilling processes onto a single machine tool, completing multiple machining steps in a single setup. This significantly improves the machining efficiency and accuracy of rotating parts and is currently widely used in the automotive, rail transportation, shipbuilding, and aircraft manufacturing industries.

[0003] In mill-turn machining, because both the tool and the workpiece rotate simultaneously, the resulting surface morphology differs significantly from traditional machining methods. Mill-turn machining is further divided into orthogonal milling, axial milling, tangential milling, and general milling, each producing different surface morphologies. These varying surface morphologies affect the wear resistance, stability, lubrication performance, fatigue fracture resistance, and corrosion resistance of parts. Selecting appropriate machining parameters to obtain suitable surface morphologies is crucial for improving part lifespan and performance, and increasing the economic benefits of machining.

[0004] Numerical control (NC) machining simulation technology includes physical simulation and geometric simulation. The latter primarily focuses on the relative motion between the tool and the workpiece, simulating the process of material removal by the tool based on the geometric interference between them. In recent years, discrete modeling methods have attracted widespread attention in geometric simulation, including Z-Map, octree, Voxel, and Tri-dexel methods. The Tri-dexel method discretizes the model into a set of three-dimensional line segments, converting the material removal process into Boolean operations between these segments. It offers advantages such as high simulation accuracy and robustness. However, with increasing simulation accuracy, the method's memory usage and computational complexity in the model discretization process are also rapidly increasing.

[0005] The introduction of the GPGPU concept gradually enabled graphics cards to achieve parallelization capabilities for general-purpose computing. Through a Single Instruction Multiple Threads (SIMT) system architecture, thousands of processing units can execute the same instructions and manipulate different data units within any given clock cycle, thus effectively improving geometric simulation efficiency. Currently, the most mainstream GPGPU programming models are NVIDIA's CUDA (Compute Unified Device Architecture) and the cross-platform OpenCL (Open Computing Language). However, to date, algorithms using CUDA and OpenCL to accelerate geometric simulation have not fully realized the computational potential of GPUs.

[0006] In summary, the main problems with current mill-turn machining surface morphology simulation technology include the following:

[0007] 1. Existing surface topography calculation methods are difficult to handle in mill-turn machining with multiple axes of linkage and varying tool-workpiece relative positions, and cannot make predictions based on the actual shape of the tool;

[0008] 2. The accuracy of the machined surface obtained by using CNC machining simulation technology to construct the machined surface is limited by algorithm design and computer performance;

[0009] 3. Although GPU acceleration technology can significantly improve the efficiency of geometric simulation, its application is not mature and it has not fully accelerated each process of geometric simulation. Summary of the Invention

[0010] To address the problems existing in current mill-turn machining surface morphology simulation technologies, this invention provides a GPU-accelerated mill-turn machining surface morphology simulation method that can quickly predict the surface morphology under any mill-turn machining conditions.

[0011] To achieve the above objectives, the present invention provides a GPU-accelerated surface topography simulation method for mill-turn machining, comprising the following steps:

[0012] (1) Model preprocessing: This includes acquiring STL model data of the tool and workpiece, setting the surface morphology analysis area, and unifying the model information in the world coordinate system of the program.

[0013] (2) Calculate the Tri-dexel model of the workpiece within the GPU;

[0014] (3) Import and translate the CNC machining code, calculate the tool position point and input it into the GPU;

[0015] (4) Calculate the tool sweep body in the GPU based on the tool position point, establish and update the tool Tri-dexel model, perform Boolean operation with the workpiece model, and gradually update the workpiece Tri-dexel model.

[0016] (5) Transfer the Tri-dexel model of the workpiece back to the CPU to analyze and visualize the workpiece surface.

[0017] Furthermore:

[0018] The specific process of step (1) is as follows: input the directions of the imported tool and workpiece axes in the machine tool coordinate system, thereby adjusting the coordinate point positions and transforming the model to the world coordinate system; input the coordinates of two points in the area to be analyzed [x min ,y min ,z min ], [x max ,y max ,z max Extract the cuboids represented by these two points from the imported STL model and use them as the model for surface topography calculation. Record the coordinates of the two points into a one-dimensional array BBox as the bounding box of the workpiece. Analyze the tool model and establish the bounding box BBoxtool of the tool.

[0019] The specific process of step (2) is as follows:

[0020] ① Store the extracted workpiece STL model patch data into a two-dimensional array Model, and obtain the three-dimensional length x of the model. workpiece y workpiece , z workpiece Choose the appropriate separation precision δ, the movement calculation precision θ1, the rotation calculation precision θ2, and the estimated number of dexel segments k;

[0021] ② Use the Numba library to build a Tri-Dexel model of the artifact. Allocate three 3D arrays (Value) within the GPU to store the three-dimensional dexel data. The sizes of the arrays are as follows:

[0022] [math.ceil(x workpiece / δ),math.ceil(y workpiece / δ),k],

[0023] [math.ceil(z workpiece / δ),math.ceil(x workpiece / δ),k],

[0024] [math.ceil(y workpiece / δ),math.ceil(z workpiece / δ),k];

[0025] Three 3D arrays, `Unit`, are allocated within the GPU to store the normal vector data of the facets corresponding to the dexel endpoints. The size of these arrays is consistent with the size of the aforementioned `Value` 3D array. Three 2D arrays, `Count`, are also allocated within the GPU to store intermediate data from the Tri-dexel modeling. The sizes of these arrays are as follows:

[0026] [math.ceil(x workpiece / δ),math.ceil(y workpiece / δ)],

[0027] [math.ceil(z workpiece / δ),math.ceil(x workpiece / δ)],

[0028] [math.ceil(y workpiece / δ),math.ceil(z workpiece / δ)];

[0029] Import the arrays Model and Box into the GPU;

[0030] ③ Set the CUDA block dimension to two dimensions. Each time, allocate several threads to process the data of a face in a centralized manner to obtain a set of intermediate data. After all faces are processed, each thread calculates the dexel endpoints at each position by accessing the intermediate data and puts them into the Value array in atomic operations.

[0031] ④ Count the number of times the endpoints are repeated in the array Value, put the count into Count, sort the dexel according to Count and Unit to obtain the Tri-dexel model of the workpiece.

[0032] The specific process of step (3) is as follows: read motion data from the machining CNC code, convert it to the world coordinate system, calculate the tool position interpolation step number according to the distance of movement and rotation in each direction, take the maximum value as the actual interpolation step number, calculate the tool position point for each step, and transmit a one-dimensional array Motion = [X,Y,Z,A,B,C,R,S] from the CPU to the GPU, where X,Y,Z,A,B,C are the movement and rotation values ​​of the tool in the X,Y,Z directions of the spatial rectangular coordinate system, R is the angle of tool rotation, and S is the angle of workpiece rotation.

[0033] The specific process of step (4) is as follows:

[0034] ① Establish a tool coordinate system with the tool tip as the origin. Use the CPU to perform homogeneous coordinate transformation on the tool bounding box (BBoxtool) coordinate points, and use threads within the GPU to perform right multiplication on each coordinate point of the tool facet using the following matrix:

[0035]

[0036] Then apply the following formula to obtain the updated toolbox:

[0037] v'=cos Rv+(1-cos R)(v·k)k+sinRk×v;

[0038] Where v is the coordinate point vector, k is the tool axis unit vector, and v' is the transformation result of the coordinate point;

[0039] ② Return to the world coordinate system, and then apply the following formula to the tool coordinate points in the GPU to obtain the tool data after motion:

[0040] v”=cos Sv'+(1-cos S)(v'·u)u+sinSu×v';

[0041] Where v' is the tool coordinate point vector, u is the workpiece rotation axis unit vector, and v” is the transformation result of the tool coordinate point;

[0042] ③ Convert the tool data into a two-dimensional array Tool, and obtain the three-dimensional length x of the tool model from the tool bounding box BBoxtool. tool y tool , z tool Establish the Tri-dexel model of the tool (following the process of step (2), specifically the same as ②③④ in step (2), but make the first two dimensions of the arrays Value, Unit, and Count all have a size of P, and the value of P is calculated according to the following formula:

[0043]

[0044] ④ Perform collision detection on the workpiece bounding box (BBox) and the tool bounding box, extract the intersection area between them, perform Boolean subtraction on the Tri-dexel data in the area, update the workpiece Tri-dexel model, and then return to step (3) to continue executing the next line of machining code until all machining CNC code is completed.

[0045] The specific process of step (5) is that the CPU reads the Value array of the workpiece Tri-dexel model from the GPU, determines the dexel involved according to the selected direction and surface, calculates the surface roughness or three-dimensional error, and uses the matplotlib library for visualization.

[0046] This invention uses the Python programming language, combined with GPU acceleration technology and Tri-dexel modeling technology, to analyze the tool movement path based on the machining CNC code, simulate the machining process, and thus obtain the surface morphology of the workpiece. This enables rapid prediction of surface morphology under arbitrary milling and turning machining conditions. Overall, compared with existing technologies, the technical solution conceived in this invention has at least the following beneficial effects:

[0047] 1. This invention optimizes the geometric simulation process by placing the steps that account for the majority of computation in geometric simulation, namely the establishment of the tool and workpiece Tri-dexel models and the tool-workpiece Boolean operations, into the GPU. It also significantly reduces the data communication between the CPU and the GPU, making full use of the GPU's computing power and achieving a significant acceleration effect. This improves the efficiency of geometric simulation and provides support for higher-precision geometric simulation.

[0048] 2. This invention uses the geometric simulation technology of the Tri-dexel modeling method to calculate the machined surface. This method is not limited by the machining conditions, can perform milling and turning composite machining on up to five axes, and can obtain relatively accurate results when setting any tool type and tool-workpiece relative position, which greatly expands the application scenarios.

[0049] 3. This invention can achieve high-precision surface morphology simulation by using a tool model that matches the actual shape, and the Tri-dexel data obtained from the simulation can be easily analyzed to obtain various surface roughnesses and perform three-dimensional visualization. Attached Figure Description

[0050] Figure 1 This is a flowchart of the GPU-accelerated mill-turn machining surface morphology simulation method of the present invention.

[0051] Figure 2 This is the workpiece STL model provided in this invention.

[0052] Figure 3 This is the tool STL model provided in this invention.

[0053] Figure 4 This is a schematic diagram of the tool-workpiece shape and position after pretreatment.

[0054] Figure 5 It is an array related to the Tri-dexel model of the artifact allocated within the GPU.

[0055] Figure 6 This is a flowchart of GPU-accelerated Tri-dexel modeling; where (a) is a flowchart of converting STL model patch data into intermediate data, and (b) is a flowchart of converting intermediate data into dexel endpoint data.

[0056] Figure 7 This is a flowchart illustrating the process of determining dexel endpoints.

[0057] Figure 8 It is a schematic diagram of the motion relationship of each component.

[0058] Figure 9 This is a schematic diagram of the shape and position of the tool and workpiece, as well as the surrounding box, after processing for a period of time.

[0059] Figure 10 It is the simulation result of the surface morphology. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the following is combined with... Figure 1 The specific steps of the GPU-accelerated mill-turn machining surface morphology simulation method of the present invention are described in detail. Figure 1 The thick solid arrows represent data communication between the CPU and the GPU.

[0061] Step 1, Model Preprocessing

[0062] This includes acquiring STL model data of the tool and workpiece, setting the surface topography analysis area, and unifying the model information in the world coordinate system of the program.

[0063] The specific process is as follows: Input the directions of the imported tool and workpiece axes in the machine tool coordinate system to adjust the coordinate point positions and transform the model to the world coordinate system; input the coordinates of two points in the area to be analyzed [x...]. min ,y min ,z min ], [x max ,y max ,z max Extract the cuboids represented by these two points from the imported STL model and use them as the model for surface topography calculation. Record the coordinates of the two points into a one-dimensional array BBox as the bounding box of the workpiece. Analyze the tool model and establish the bounding box BBoxtool of the tool.

[0064] The initial workpiece STL model used is as follows: Figure 2 As shown, it is a cylinder; the initial tool STL model used is as follows. Figure 3 The image shows an end mill. Taking orthogonal milling as an example, with the tool axis set as the y-axis and the workpiece rotation axis set as the z-axis, a rectangular area of ​​2mm*2mm*1.5mm is selected for surface morphology analysis. The shape and position of the model in space are as follows. Figure 4 As shown.

[0065] Step 2: Calculate the Tri-dexel model of the workpiece within the GPU.

[0066] Specifically, the following steps are included:

[0067] Step 2.1: Store the extracted workpiece STL model patch data into a two-dimensional array Model, and obtain the three-dimensional length x of the model. workpiece y workpiece , z workpiece Choose appropriate separation precision δ, movement calculation precision θ1, rotation calculation precision θ2, and estimate the number of dexel segments k; from step 1, we know x workpiece =2mm, y workpiece =1.5mm, z workpiece =2mm, select calculation accuracy δ=0.005mm, movement calculation accuracy θ1=0.002mm, rotation calculation accuracy θ2=0.4° and estimated dexel segment number k=128;

[0068] Step 2.2: Use the Numba library to build a Tri-Dexel model of the artifact. Allocate three 3D arrays (Value) within the GPU to store the three-dimensional dexel data. The sizes of the arrays are as follows:

[0069] [math.ceil(x workpiece / δ),math.ceil(y workpiece / δ),k],

[0070] [math.ceil(z workpiece / δ),math.ceil(x workpiece / δ),k],

[0071] [math.ceil(y workpiece / δ),math.ceil(z workpiece / δ),k];

[0072] Three 3D arrays, `Unit`, are allocated within the GPU to store the normal vector data of the facets corresponding to the dexel endpoints. The size of these arrays is consistent with the size of the aforementioned `Value` 3D array. Three 2D arrays, `Count`, are also allocated within the GPU to store intermediate data from the Tri-dexel modeling. The sizes of these arrays are as follows:

[0073] [math.ceil(x workpiece / δ),math.ceil(y workpiece / δ)],

[0074] [math.ceil(z workpiece / δ),math.ceil(x workpiece / δ)],

[0075] [math.ceil(y workpiece / δ),math.ceil(z workpiece / δ)];

[0076] Import the arrays Model and BBox into the GPU; then the main array imported into the GPU at this time is as follows: Figure 5 As shown.

[0077] Step 2.3: Set the CUDA block dimension to two dimensions. Each time, allocate several threads to process the data of a face in a centralized manner to obtain a set of intermediate data. After all faces are processed, each thread calculates the dexel endpoints of each position by accessing the intermediate data and puts them into the Value array in an atomic operation.

[0078] This step divides the patch data processing into two stages because it distributes the computational load as much as possible across multiple threads, thereby improving computational speed. Figure 6 (a) is the process of processing facet data in a single thread block. A total of k facet data are input, and each group has n threads that calculate the data. The threads within a group calculate different intermediate data for the same facet, which are then stored in n specific arrays within the GPU. Figure 6 (b) For the process of converting intermediate data into dexel endpoints, each thread obtains dexel endpoints by accessing partial elements of each intermediate array. Atomic operations are used to ensure that endpoint data enters the Tri-dexel model in order, preventing access conflicts to the same storage address caused by multiple threads in parallel computing.

[0079] Step 2.4: Count the number of times each endpoint is repeated in the Value array and store the count in the Count array. Then, sort the dexel arrays by removing duplicates based on the Count and Unit arrays to obtain the Tri-dexel model of the workpiece. The deduplication sorting process for the [k,n] position in the Tri-dexel model is as follows: Figure 7 As shown, assuming the value of a candidate endpoint is p, search for all elements with the value p in the Value array. Assuming the number of elements is 3, record the value in Count[k,n]. Access the same position of Unit[k,n] according to the index of the 3 elements in the third dimension of the Value array. Then, the thread determines whether it is a real dexel endpoint. If it is real, modify Value[k,n] and put the value p into the sorted position. Then continue to sort the next endpoint for deduplication. This method allows a thread to process all dexel data on a straight line and simplifies the array element modification operations that the thread needs to perform.

[0080] Step 3: Import and translate the machining CNC code, calculate the tool position point, and transmit it to the GPU. Further, in Step 3, read motion data from the machining CNC code, convert it to the world coordinate system, calculate the tool position point interpolation steps based on the distance of movement and rotation in each direction, take the maximum value as the actual interpolation steps, calculate the tool position point for each step, and transmit a one-dimensional array Motion = [X,Y,Z,A,B,C,R,S] from the CPU to the GPU, where X,Y,Z,A,B,C are the movement and rotation values ​​of the tool in the X, Y,Z directions of the Cartesian coordinate system, R is the angle of tool rotation, and S is the angle of workpiece rotation; for example, in orthogonal milling, such as... Figure 8 As shown, the motion is axial feed, tool rotation and workpiece rotation, so Z, R, S need to be modified. The actual interpolation steps are: Max(math.ceil(Z / θ1),math.ceil(R / θ2)).

[0081] Step 4: Calculate the tool sweep body in the GPU based on the tool position point, establish and update the tool Tri-dexel model, perform Boolean operations with the workpiece model, and gradually update the workpiece Tri-dexel model.

[0082] Specifically, the following steps are included:

[0083] Step 4.1: Establish a tool coordinate system with the tool tip as the origin. Use the CPU to perform a homogeneous coordinate transformation on the tool bounding box (BBoxtool) coordinate points, and use threads within the GPU to perform a right multiplication of each coordinate point on the tool facet using the following matrix:

[0084]

[0085] Then apply the following formula:

[0086] v'=cos Rv+(1-cos R)(v·k)k+sinRk×v;

[0087] Where v is the coordinate point vector, k is the tool axis unit vector, and v' is the transformation result of the coordinate points. This yields the updated tool bounding box.

[0088] Step 4.2, return to the world coordinate system, and then apply the following formula to the tool coordinate points within the GPU:

[0089] v”=cos Sv'+(1-cos S)(v'·u)u+sinSu×v',

[0090] Where v' is the tool coordinate point vector, u is the workpiece rotation axis unit vector, and v” is the transformation result of the tool coordinate point. Thus, the tool data after motion is obtained.

[0091] Step 4.3: Convert the tool data into a two-dimensional array Tool, and obtain the three-dimensional length x of the tool model from the tool bounding box BBoxtool. tool y tool , z tool Establish the Tri-dexel model of the tool, following step (2). The specific process is the same as steps 2.2, 2.3, and 2.4, but the first two dimensions of the arrays Value, Unit, and Count are all of size P. The value of P is calculated using the following formula:

[0092]

[0093] Step 4.4: Perform collision detection on the workpiece bounding box (BBox) and the tool bounding box, extract their intersecting region, perform Boolean subtraction on the Tri-dexel data within the region, update the workpiece Tri-dexel model, and then return to step 3 to continue executing the next line of machining code until all machining CNC code is executed; after machining for a period of time, the tool-workpiece shape and position are as follows... Figure 9 As shown. The thick solid line outline outside the workpiece is the workpiece bounding box (BBox), and the thin solid line outline inside the tool is the tool bounding box (BBoxtool), used together with the BBox for collision detection. The thick solid line outline outside is the containment area of ​​the workpiece bounding box Tri-dexel model, with a side length of P, so it can still completely contain the tool after the tool posture is adjusted.

[0094] Step 5: Transfer the Tri-dexel model of the workpiece back to the CPU for analysis and visualization of the workpiece surface.

[0095] The CPU reads the Value array of the workpiece Tri-dexel model from the GPU, determines the dexel involved according to the selected direction and surface, calculates the surface roughness or three-dimensional error, and uses the matplotlib library for visualization.

[0096] The obtained orthogonal milling surface morphology is as follows Figure 10 As shown, the surface undulations are more pronounced in the Y direction. By selecting this direction for analysis, the surface undulations in the Z-axis direction caused by the tool offset angle and the surface undulations in the X-axis direction caused by the machining principle can be clearly observed.

Claims

1. A GPU-accelerated method for simulating the surface morphology of mill-turn machining, characterized in that, Includes the following steps: (1) Model preprocessing: This includes acquiring STL model data of the tool and workpiece, setting the surface topography analysis area, and unifying the model information in the world coordinate system of the program; (2) Calculate the Tri-dexel model of the workpiece within the GPU; (3) Import and translate the machining CNC code, calculate the tool position point and input it into the GPU; (4) Calculate the tool sweep body in the GPU based on the tool position point, establish and update the tool Tri-dexel model, perform Boolean operation with the workpiece model, and gradually update the workpiece Tri-dexel model. (5) Transfer the Tri-dexel model of the workpiece back to the CPU to analyze and visualize the workpiece surface; The specific process of step (2) is as follows: ① Store the extracted workpiece STL model patch data into a two-dimensional array Model, and obtain the three-dimensional length x of the model. workpiece y workpiece , z workpiece Choose the appropriate separation precision δ, the movement calculation precision θ1, the rotation calculation precision θ2, and the estimated number of dexel segments k; ② Use the Numba library to build a Tri-Dexel model of the artifact. Allocate three 3D arrays (Value) within the GPU to store the three-dimensional dexel data. The sizes of the arrays are as follows: [math.ceil(x workpiece / δ),math.ceil(y workpiece / δ),k], [math.ceil(z workpiece / δ),math.ceil(x workpiece / δ),k], [math.ceil(y workpiece / δ),math.ceil(z workpiece / δ),k]; Three 3D arrays, `Unit`, are allocated within the GPU to store the normal vector data of the facets corresponding to the dexel endpoints. The size of these arrays is consistent with the size of the aforementioned `Value` 3D array. Three 2D arrays, `Count`, are also allocated within the GPU to store intermediate data from the Tri-dexel modeling. The sizes of these arrays are as follows: [math.ceil(x workpiece / δ),math.ceil(y workpiece / δ)], [math.ceil(z workpiece / δ),math.ceil(x workpiece / δ)], [math.ceil(y workpiece / δ),math.ceil(z workpiece / δ)]; Import the arrays Model and Box into the GPU; ③ Set the CUDA block dimension to two dimensions. Each time, allocate several threads to process the data of a face in a centralized manner to obtain a set of intermediate data. After all faces are processed, each thread calculates the dexel endpoints of each position by accessing the intermediate data and puts them into the Value array in atomic operations. ④ Count the number of times the endpoints are repeated in the array Value, put the count into Count, sort the dexel according to Count and Unit to obtain the Tri-dexel model of the workpiece; The specific process of step (4) is as follows: ① Establish a tool coordinate system with the tool tip as the origin. Use the CPU to perform homogeneous coordinate transformation on the tool bounding box (BBoxtool) coordinate points, and use threads within the GPU to perform right multiplication on each coordinate point of the tool facet using the following matrix: ; Then apply the following formula to obtain the updated toolbox: ; Where v is the coordinate point vector and k is the tool axis unit vector. The result of the coordinate transformation; ② Return to the world coordinate system, and then apply the following formula to the tool coordinate points in the GPU to obtain the tool data after motion: ; Where v' is the tool coordinate point vector, and u is the workpiece rotation axis unit vector. 'This represents the transformation result of the tool coordinate points; ③ Convert the tool data into a two-dimensional array Tool, and obtain the three-dimensional length x of the tool model from the tool bounding box BBoxtool. tool y tool , z tool Create a Tri-dexel model of the cutting tool, but make the first two dimensions of the arrays Value, Unit, and Count all have a size of P, and calculate the value of P using the following formula: ; ④ Perform collision detection on the workpiece bounding box (BBox) and the tool bounding box, extract the intersection area between them, perform Boolean subtraction on the Tri-dexel data in the area, update the workpiece Tri-dexel model, and then return to step (3) to continue executing the next line of machining code until all machining CNC code is completed.

2. The GPU-accelerated mill-turn composite machining surface morphology simulation method according to claim 1, characterized in that, The specific process of step (1) is as follows: input the directions of the imported tool and workpiece axes in the machine tool coordinate system, thereby adjusting the coordinate point positions and transforming the model to the world coordinate system; input the coordinates of two points in the area to be analyzed [x min ,y min ,z min ], [x max ,y max ,z max Extract the cuboids represented by these two points from the imported STL model and use them as the model for surface topography calculation. Record the coordinates of the two points into a one-dimensional array BBox as the bounding box of the workpiece. Analyze the tool model and establish the bounding box BBoxtool of the tool.

3. The GPU-accelerated mill-turn composite machining surface morphology simulation method according to claim 1, characterized in that, The specific process of step (3) is as follows: read motion data from the machining CNC code, convert it to the world coordinate system, calculate the tool position interpolation step number according to the distance of movement and rotation in each direction, take the maximum value as the actual interpolation step number, calculate the tool position point for each step, and transmit a one-dimensional array Motion=[X,Y,Z,A,B,C,R,S] from the CPU to the GPU, where X,Y,Z,A,B,C are the movement and rotation values ​​of the tool in the X,Y,Z directions of the spatial rectangular coordinate system, R is the angle of tool rotation, and S is the angle of workpiece rotation.

4. The GPU-accelerated mill-turn composite machining surface morphology simulation method according to claim 1, characterized in that, The specific process of step (5) is that the CPU reads the Value array of the workpiece Tri-dexel model from the GPU, determines the dexel involved according to the selected direction and surface, calculates the surface roughness or three-dimensional error, and uses the matplotlib library for visualization.

Citation Information

Patent Citations

  • Simulation of the machining of a workpiece

    CA2794149A1

  • Workpiece three-dimensional surface topography simulating method based on ball head milling

    CN102490081A