Path planning method based on enhanced heat transfer method and image convolution
Through the path planning method based on enhanced heat transfer method and image convolution, the traditional method is solved, and the problem of cumbersome operation and slow calculation speed when dealing with mixed projects of multiple data types is achieved, which achieves higher processing accuracy and efficiency, ensuring the safety of processing operations.
Patent Information
- Application Number
- CN202510181711.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-06
AI Technical Summary
Traditional path planning methods are cumbersome when dealing with projects mixed with multiple data types, and the calculation speed is slow, making it difficult to achieve smooth transition and optimization of tool paths, resulting in reduced machining accuracy and poor surface quality.
The path planning method based on enhanced heat transfer method and image convolution is adopted. By obtaining projectable CAD form data, a single-value image is projected to generate, a thermal diffusion model is constructed, the thermal diffusion process is simulated, the tool path is generated using the thermal diffusion results, and collision detection is performed.
The processing accuracy is improved, the generated tool path is more reasonable, meets the requirements of machining accuracy and efficiency, has fast calculation speed and high stability, and can effectively simulate the thermal diffusion process to ensure the safety of machining operations.
Smart Images

Figure CN120107359A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer-aided manufacturing technology, and in particular to a path planning method based on enhanced heat transfer method and image convolution. Background Art
[0002] In terms of machining path planning, traditional methods have many limitations. For example, for different CAD format data (such as point clouds, triangular meshes, B-rep models, etc.), traditional methods often need to adopt different data processing methods and lack versatility, which makes the operation cumbersome and error-prone when dealing with projects with mixed data types. In terms of computational efficiency and stability, traditional methods often face problems such as slow calculation speed and unstable results when dealing with complex surfaces or large-scale data, which increases the time cost of machining path planning and even affects the entire production cycle. Moreover, when machining across multiple surfaces, traditional methods find it difficult to achieve smooth transition and optimization of tool paths, and are prone to problems such as reduced machining accuracy and poor surface quality. Summary of the invention
[0003] The embodiments of this specification provide a path planning method based on enhanced heat transfer method and image convolution to improve processing accuracy.
[0004] To solve the above technical problems, the embodiments of this specification are implemented as follows:
[0005] The present invention provides a path planning method based on an enhanced heat transfer method and image convolution, comprising:
[0006] S1. Acquire projectable CAD data, wherein the CAD data includes data in the form of point cloud, triangular mesh, and B-rep model; select a tool axis direction and a plane to be projected, and project the CAD data along the tool axis direction onto the plane to be projected to generate a single-value image; classify each grid point in the single-value image, wherein the classification results include boundary points, external points, and internal points;
[0007] S2. For each grid point in the single-valued image, the neighborhood points of each grid point are used as heat exchange objects, and the Laplace operator in the heat conduction equation is approximated by graph convolution, and the convolution kernel is customized according to the local bandwidth of each grid point to construct a heat diffusion model;
[0008] S3. Based on the constructed heat diffusion model, simulate the process of heat diffusion at equal residual height, and obtain the heat diffusion result through iterative calculation;
[0009] S4. Generate tool path, including:
[0010] The tool path is generated by using the isothermal line of the heat diffusion result. Specifically, the tool path set is gradually generated by calculating the path interval and extracting the isothermal line operation.
[0011] S5. Perform collision detection, including:
[0012] An image-based z-buffer algorithm is used for collision detection to construct a distance image; the distance from the tool space point to the projection plane and the corresponding cell are calculated; the distance is compared with the cell storage value, the collision tool position point is deleted, and a collision-free tool path is output.
[0013] In an optional embodiment, the image size of the single-value image is (u max -u min )×(v max -v min );
[0014] Among them, the symbol u max It represents the maximum value of the projection point in the u direction of the projection plane; symbol u min Indicates the minimum value of the projection point in the u direction of the plane to be projected; symbol v max It represents the maximum value of the projection point in the v direction of the projection plane, symbol v min represents the minimum value of the projection point in the v direction of the plane to be projected;
[0015] The classification of each grid point in the single-value image, wherein the classification results include boundary points, external points and internal points, specifically include:
[0016] Determine the size of each pixel grid according to the processing accuracy;
[0017] For each point on the single-valued image, its image value is set to be the spatial distance from the point to the original image point; wherein, for a point in the single-valued image without an original image, its image value is the set maximum value;
[0018] The sobel operator is used to extract and classify the edges of each grid point in the single-valued image to obtain boundary points, external points and internal points; wherein, for each grid point in the single-valued image, the grid points whose convolution results exceed a predetermined threshold after sobel convolution calculation are marked as boundary points, the image values in the single-valued image that are the set maximum values are marked as external points, and the grid points in the single-valued image other than the boundary points and the external points are marked as internal points.
[0019] In an optional embodiment, the process of constructing the thermal diffusion model specifically includes:
[0020] For any grid point in the single-value image, take the eight adjacent points around it as heat exchange objects; for the heat conduction equation The Laplacian operator in is approximated by graph convolution;
[0021] Determine the convolution kernel corresponding to each grid point according to the bandwidth of each grid point in each direction, specifically including: for each point q in the 1-neighborhood of the grid point p i , i=1,2,...,8, calculate the path interval d between two points i , let c i = dis(p,q i ) / d i , set the weight w of the convolution kernel i =c i / ∑ i c i , and obtain the convolution kernel for enhanced heat transfer
[0022] In an optional embodiment, the heat diffusion model constructed based on the simulation of the process of heat diffusion at equal residual height and the heat diffusion result obtained by iterative calculation specifically include:
[0023] According to the convolution kernel given in the thermal diffusion model, the Laplace operator is simulated according to the formula H(t+Δt,p)=Δt(H(t,p)×L * p )+H(t,p) performs iterative heat diffusion calculation on the internal points in the single-valued image until the temperatures of all the internal points in the single-valued image are greater than 0, thereby obtaining a heat diffusion result; wherein the initial conditions of the iterative heat diffusion calculation are: the temperatures of all boundary points in the single-valued image are 100, and the temperatures of all internal points and external points in the single-valued image are 0; the symbol t represents time, and the symbol Δt represents time interval;
[0024] In an optional embodiment, when extracting the tool path, an image I used to represent the thermal diffusion result and a temperature distribution H(T, p) thereon are input, an isotherm with a temperature of 100 on I is extracted, a path set is inserted and set as the current path, and the current temperature is set to 100; the path interval on the current path is calculated point by point, and the temperature of the path interval position point is recorded; among all the recorded temperatures, the temperature H with the smallest difference from the current temperature is found; the isotherm L with a temperature of H is extracted and incorporated into the path set; the current temperature is set to H and the current path to L; the above operations are repeated until the current temperature reaches the minimum value of the temperature distribution H(T, p), and then the path set is output.
[0025] In an optional implementation, the Z-buffer collision detection algorithm includes:
[0026] Construct a distance image. For each pixel cell on the image, calculate the distance between all points on the model that are projected into the cell and the image, and store the minimum distance.
[0027] For each tool position point in the path, the local spatial point where the tool may contact the surface is calculated based on the tool's geometric model;
[0028] For each spatial point given by the tool position point, calculate its distance to the projection plane and the corresponding cell on the image. If these distances are not less than the storage value of the cell, it is considered that the tool position point has no collision, otherwise the tool position point has a collision;
[0029] Delete all tool positions where collision occurs and output the remaining path.
[0030] One embodiment of this specification can achieve at least the following beneficial effects:
[0031] 1. Generate tool paths based on isotherms of thermal diffusion results. After calculating path intervals and extracting isotherms, the tool paths are made more reasonable and meet the requirements of machining accuracy and efficiency.
[0032] 2. When constructing the heat diffusion model, each grid point takes the eight surrounding neighborhood points as the heat exchange object, uses graph convolution to approximate the Laplace operator in the heat conduction equation, and customizes the convolution kernel according to the local bandwidth. Compared with the traditional method of solving the heat transfer equation on the triangular mesh, this model is not affected by the quality of the triangular mesh, and has a faster and more stable calculation speed when processing complex data. It can effectively simulate the heat diffusion process according to the equal residual height, providing a guarantee for accurate planning of the tool path.
[0033] 3. Use the image-based z-buffer algorithm for collision detection, construct a distance image, calculate the distance from the tool space point to the projection plane and the corresponding cell, compare the distance with the cell storage value, delete the collision tool position point and output a collision-free tool path. This method can effectively prevent the tool from colliding with the workpiece model during the machining process, ensure the safety of the machining operation, protect the tool and workpiece, and avoid tool damage caused by collision. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0035] Figure 1It is a schematic diagram of the positions of the tool contact point and the tool position point of a ball-end tool in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0036] Figure 2 It is a schematic diagram of residual height in a path planning method based on enhanced heat transfer method and image convolution provided by the present invention;
[0037] Figure 3 The path spacing of knife contact points on three different curved surfaces in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0038] Figure 4 A schematic diagram of bow height error in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0039] Figure 5 A schematic diagram of an image construction algorithm in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0040] Figure 6 A schematic diagram of a heat diffusion model in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0041] Figure 7 A schematic diagram of a heat diffusion process in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0042] Figure 8 An algorithm flow chart of a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0043] Fig. 9 An algorithm example of a path planning method based on enhanced heat transfer method and image convolution provided by the present invention;
[0044] Fig.10 A schematic diagram of constructing a distance image in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention;
[0045] Fig.11 The present invention provides a geometric model for selecting spatial points in a path planning method based on an enhanced heat transfer method and image convolution;
[0046] Fig.12 A schematic diagram comparing the effects before and after using a z-buffer in a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of one or more embodiments of this specification.
[0048] It should be understood that although the terms first, second, third, etc. may be used in this application document to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
[0049] Next, a path planning method based on enhanced heat transfer method and image convolution provided in the embodiment of the specification will be specifically described in conjunction with the accompanying drawings. In order to make the technical scheme of the present application easy to understand, some basic concepts and theories used in the technical scheme of the present application will be explained below. These basic concepts include: tool contact point, tool position point, residual height and bow height error. The basic theories include heat transfer theory and image convolution.
[0050] Cutter Contact Point: In free-form surface multi-axis CNC machining, the point where the cutting surface of the cutter head contacts the machined surface is usually called the cutter contact point. The cutter contact point is directly related to the cutting position of the cutter on the workpiece and is the key contact point where the cutter and the workpiece actually interact. For example, when machining a complex mold surface, the position of the cutter contact point determines the specific position of the material removed each time, which has a direct impact on the final shape and precision of the mold.
[0051] Cutter Location Point: Cutter Location Point refers to the positioning reference point of the tool. For a ball-end cutter, its cutter location point is the center of the ball head. In actual processing, the control system indirectly controls the movement of the tool by controlling the movement of the cutter location point. There is a specific conversion relationship between the cutter location point and the cutter contact point of a ball-end cutter. The cutter location point can be obtained by offsetting the cutter contact point along the surface normal vector by the distance of the ball head radius. When processing a surface with a certain curvature, by determining the position of the cutter contact point, the coordinates of the cutter location point can be accurately calculated according to the offset rule, thereby providing a basis for the precise positioning of the tool. For a flat-bottom cutter, the cutter location point of a flat-bottom cutter is the center point of the bottom surface of the cutter. The conversion method between the cutter contact point and the cutter location point is as follows: the cutter location point can be obtained by offsetting the cutter contact point along the direction perpendicular to the cutter axis by the distance of the bottom surface circle radius.
[0052] The tool contact point determines the actual cutting position, and the tool position point provides a reference for the positioning of the tool. During the processing, the position of the tool position point needs to be adjusted continuously according to the position change of the tool contact point to ensure that the tool is always in the correct cutting position. Figure 1 The position of the tool contact point and tool position of the ball end tool is shown in Figure 1 It can be seen intuitively that the tool contact point of the ball-end tool is on the machining surface, while the tool position point is located at the center of the ball end. The connection between the two can be established through the offset relationship, laying the foundation for subsequent tool path planning and machining control.
[0053] Scallop Height: Scallop height is referred to as residual height. When the surface is processed, traces of tool cutting will be left on its surface, forming a "wavy" surface, which is the intuitive expression of residual height. During the cutting process, due to the characteristics of the tool's motion trajectory and cutting method, the workpiece surface cannot be absolutely smooth and flat. There will be a certain height difference between adjacent cutting paths, and these height differences constitute the residual height. When using a ball-end tool for surface processing, the trajectory left by the cutting edge of the ball-end tool on the surface is a series of arcs, and the parts between adjacent arcs will form undulating "waves". The tool contact path interval is closely related to the residual height, such as Figure 2 As shown, the smaller the knife contact path interval is, the denser the knife path is, and the smaller the residual height is, because a denser knife path means that the tool has a higher degree of coverage on the surface, and the height difference between adjacent cutting paths will be smaller, so that the workpiece surface is smoother and the residual height is lower. But at the same time, the reduction of the knife contact path interval will lead to an increase in the overall length of the path, because in the same processing area, more knife paths are required to cover, which will prolong the processing time and reduce the processing efficiency. In view of this contradictory relationship between the residual height and the processing efficiency, an acceptable limit must be set for the residual height in the actual processing process, that is, the residual height constraint. When the residual height does not exceed the limit, the knife contact path interval should be increased as much as possible, so that the total path length can be reduced while ensuring a certain processing accuracy (controlling the residual height within an acceptable range) and improving the processing efficiency. For example, in the processing of automotive parts, a suitable residual height constraint value can be set according to the use requirements and design standards of the parts, and the knife contact path interval can be optimized on the premise of meeting the surface quality requirements of the parts, thereby improving the processing efficiency and reducing the production cost. Here, the technical solution of this application calculates the path interval according to the maximum residual height constraint. As the tool moves along the tool path trajectory, the stub height appears on the machined surface. The distance between the path trajectories is the tool contact path interval, such as Figure 3As shown. The calculation of path spacing is related to the concavity of the surface. The path spacing depends on the local curvature radius R of the surface, the feed direction, the tool radius r and the height h of the residual on the surface. Usually, the maximum residual height constrained is much smaller than the tool radius r, so the technical solution of this application can simplify the calculation of path spacing by an approximate method. When using a ball-end tool for machining, the tool contact path spacing l on the plane flat , the knife contact path spacing on the convex surface l convex , the knife contact path spacing on the concave surface l concave It can be approximated by the following equation:
[0054]
[0055] Chord Error: Figure 4 As shown, when along the curve r c During machining, the machine tool cuts in the form of interpolation points (broken line segments), that is, the broken line segment AB is the actual path of the tool cutting, not on the parametric curve. Distance from broken line segment AB to the parametric curve | P c Q c |It is called bow height error. Bow height error describes the geometric appearance error of the workpiece, which directly affects the processing accuracy and quality, so it must be restricted, that is, bow height error constraint. In the figure, ρ is the point P c The curvature radius at this time. c Q c |It can be calculated by the following formula:
[0056]
[0057] Heat Diffusion Theory: The process of heat transfer on a curved surface can be described by the heat conduction equation:
[0058]
[0059] Where p is any point on the surface, t is time, and h is the temperature function about p and t. represents the Laplace operator, which means that the temperature change per unit time at point p is the Laplace operator of its local temperature function. Considering that heat diffuses on the surface according to the geodesic distance, extracting the isotherms of the heat transfer results as tool paths is a planning method that is very consistent with the processing characteristics. However, the traditional thermal method needs to solve the heat transfer equation on the triangular mesh, which involves the problem of computational solution stability and puts high demands on the quality of the triangular mesh.
[0060] Image convolution is a process of achieving various effects by applying a small matrix (called filter kernel, convolution kernel) to each pixel of the image and its neighborhood. This small matrix slides on the image, multiplying and summing the image pixels in the window with the corresponding elements of the convolution kernel each time it slides, and then using the result as the pixel value of the corresponding position in the output image.
[0061] From a mathematical point of view, for a discrete two-dimensional image I(x,y) and a filter kernel H(i,j), the convolution operation can be defined as:
[0062] (I*H)(x,y)=Σ i Σ j I(xi,yj)·H(i,j)
[0063] Where I(x,y) is the pixel value of the input image at position (x,y), H(i,j) is the weight of the filter kernel at position (i,j), and (I*H)(x,y) is the new pixel value of the convolution result at position (x,y). In the technical solution of this application, a 3×3 convolution kernel is considered.
[0064] Projectable area: If there is a certain projection direction and a plane perpendicular to it, so that the projection mapping of the area to the plane is a single shot, it is called a projectable area, that is, there are no points on the area that are projected to repeated positions. This feature ensures that the image information obtained after projection is unique and accurate, and avoids confusion and overlap of information. In the technical solution of the present application, the projectable area is input, the image is constructed, and the tool path is generated. The projectable area determines which areas of data can be effectively projected to construct a single-value image for subsequent path planning. For example, in a simple three-dimensional model, if projected from a specific tool axis direction, each point on the model has a unique corresponding position on the projection plane, and there will be no situation where two or more points overlap at the same projection position, then the area occupied by this three-dimensional model can be regarded as a projectable area. In the technical solution of the present application, only when the projectable area is determined can its related CAD data (such as point cloud, triangular mesh, B-rep model) be projected onto the plane along a specific direction to generate a single-value image. The scope and shape of the projectable area determine the size and outline of the single-value image, which in turn affects the subsequent construction of the heat diffusion model and the generation of the tool path. If the area cannot be projected, then points will overlap during the projection process, causing the generated image to fail to accurately reflect the actual situation of the processing area. Subsequent operations such as heat diffusion simulation, tool path planning, and collision detection based on the image will lose accuracy and reliability.
[0065] After introducing the basic concepts and basic theories used in the technical solution of this application, the content of a path planning method based on an enhanced heat transfer method and image convolution provided by the present invention is described below. The solution includes:
[0066] S1. Acquire projectable CAD data, wherein the CAD data includes data in the form of point cloud, triangular mesh, and B-rep model; select a tool axis direction and a plane to be projected, and project the CAD data along the tool axis direction onto the plane to be projected to generate a single-value image; classify each grid point in the single-value image, wherein the classification results include boundary points, external points, and internal points;
[0067] The input data is in a projectable CAD format, including point clouds, triangular meshes, and B-rep models. These different forms of data are all geometric descriptions of the processing object, covering a variety of expressions from discrete point sets (point clouds), meshes composed of triangular patches (triangular meshes), to surfaces based on boundary representation (B-rep models). After obtaining these data, we must first select the appropriate tool axis direction and the plane to be projected, and then project the CAD data along the selected tool axis direction onto the plane to be projected to generate a single-value image. The tool axis direction here is related to the direction of tool movement in the subsequent processing process, and the selection of the projection plane determines on which two-dimensional plane the CAD data is converted, and the generated single-value image will serve as the basic object for subsequent processing. At the same time, the two perpendicular parameter directions of the plane are recorded as u and v directions, which provides a reference for parameter dimensions for subsequent operations such as determining the size of the image.
[0068] Specific details of image construction: 1. Determination of image size: By traversing the u and v values of the projection points, record the maximum and minimum parameter ranges, i.e. u max 、u min 、v max 、v min Then, an image is generated based on this parameter range, and its size is (u max -u min )×(v max -v min ). This method of determining the image size is based on the distribution range of the projection points in the u and v directions. It can ensure that the generated image can completely contain the information of all projection points, provide a suitable spatial range for subsequent precise processing, and ensure that important geometric information will not be missed.
[0069] 2. Setting the pixel size: The pixel size is determined based on the required processing accuracy. If there are no special requirements, the side length of each pixel grid will be set to 0.01mm, and after experimental verification, this size can meet the requirements of processing accuracy. The setting of the pixel size has a direct impact on the resolution of the image and the accuracy of subsequent processing. The appropriate pixel size can not only ensure that the image has sufficient resolution to accurately reflect the geometric characteristics of the processing area, but also achieve a good balance in terms of calculation and storage, avoiding excessive calculation and storage requirements due to too small pixels, or failure to meet the requirements of processing accuracy due to too large pixels.
[0070] 3. Image value rules: For each point on the image, its value is the spatial distance from the point to the original image point, that is, the projection distance from the point on the surface to the point on the image. This way of value selection gives the points on the image a specific numerical meaning, reflecting the spatial relationship between the point and the corresponding point on the original three-dimensional model. For those points on the image that do not have an original image, their value will be set to a maximum value. The purpose of setting the maximum value is to easily distinguish these points from points with original images in subsequent processing. For example, when performing edge extraction and classification operations, these special points can be identified and processed based on this value feature. The following is an explanation of the meaning of the "original image point" mentioned above. When constructing a single-valued image, it is necessary to project CAD data such as point cloud, triangular mesh, B-rep model, etc. along the selected tool axis direction onto the plane to be projected. In this projection process, each point on the CAD model will form a corresponding projection point on the projection plane. These points on the CAD model are the "original image points" of the corresponding projection points on the image.
[0071] The following is a description of the specific content of the classification of grid points on a single-value image. In this step, the Sobel operator is used to extract and classify the edges of each grid point on the image. The classification results include:
[0072] 1. Boundary points: After the Sobel convolution calculation, those points that exceed the threshold are defined as boundary points. The Sobel operator is a commonly used edge detection operator that identifies edges by calculating the gradient of each pixel in the image. When processing grid points on a single-value image, the Sobel operator calculates the gradient changes of each grid point in the horizontal and vertical directions. If the gradient value at a grid point exceeds the preset threshold, then the grid point is determined to be a boundary point. The threshold setting can be adjusted according to the characteristics of the image and processing requirements. For example, when processing some images with rich details, the threshold may be appropriately lowered to capture edge information more comprehensively; when processing simple graphics, a higher threshold can more accurately screen out obvious boundaries.
[0073] When the result of a point after Sobel convolution calculation exceeds the preset threshold, it means that the grayscale or other features of the image at that point have undergone a more drastic change, which meets the characteristics of the boundary points. Usually these points correspond to the boundary position of the processing area and play an important role in determining the contour of the processing area.
[0074] The determination of boundary points helps to clarify the boundary range of the processing area. After constructing the single-value image, by identifying the boundary points, the outline of the processing area can be clearly defined, providing an important reference for the subsequent construction of the heat diffusion model and tool path planning. When constructing the heat diffusion model, the temperature of the boundary point is set to 100 (in the heat diffusion iteration algorithm). This setting allows the heat diffusion to start from the boundary, and the fixed temperature of the boundary point helps to simulate the diffusion of heat in the processing area. In the tool path extraction stage, the area defined by the boundary points affects the planning of the tool path, ensuring that the tool moves within a reasonable area and avoiding unnecessary processing losses or safety issues caused by exceeding the processing range.
[0075] 2. External points: Points whose image values are set to maximum values are classified as external points. Since these points have no corresponding original image points, they are assigned maximum values when taking values, and this way of taking values distinguishes them from other points. From the perspective of the processing area, these points usually represent the parts outside the processing area. In subsequent operations such as path planning, the interference of these points can be excluded according to this classification. External points define the effective range of the tool path to a certain extent. Because the area where the external points are located may not be the actual processing area, when generating the tool path, the tool path usually does not extend to the area where the external points are located. This helps to ensure that the tool moves within a reasonable processing area, avoids the tool from exceeding the effective processing range, and improves the safety and accuracy of the processing. When planning the tool path, by identifying external points, it is possible to clarify the area that the tool should not enter, thereby optimizing the planning of the tool path, reducing unnecessary tool movement, and improving processing efficiency.
[0076] 3. Internal points: The remaining points except boundary points and external points are defined as internal points. Internal points are located inside the processing area. Their characteristics are different from those of boundary points and external points. Different strategies may be adopted in subsequent processing. For example, in the process of building the heat diffusion model and generating the tool path, the processing method of internal points may be different from that of boundary points to better adapt to the internal geometric characteristics and processing requirements of the processing area. The heat diffusion results of internal points directly affect the generation of tool paths. When using the isotherms of the heat diffusion results to generate tool paths, the temperature changes of the internal points determine the shape and distribution of the isotherms. By extracting isotherms of different temperatures to gradually generate a set of tool paths, the more accurate the simulation of the heat diffusion process of the internal points is, the more the generated tool paths can meet the requirements of processing accuracy and efficiency. The accuracy of the heat diffusion simulation of internal points can help determine the reasonable path spacing, avoid paths that are too dense or too sparse, and improve processing efficiency while ensuring processing accuracy (controlling residual height).
[0077] Through the above detailed image construction algorithm, the input CAD data is converted into a single-value image with specific size, pixel size, value rules and grid classification. The single-value image is the basis for a series of subsequent operations. For example, in the construction of the thermal diffusion model, the grid points on the image become the basic unit for simulating thermal diffusion; when extracting the tool path, the isotherm is extracted based on the temperature distribution on the image (thermal diffusion results) to generate the tool path; in the collision detection link, it is also necessary to use the single-value image to construct the distance image, etc.
[0078] S2. For each grid point in the single-valued image, the neighborhood points of each grid point are used as heat exchange objects, and the Laplace operator in the heat conduction equation is approximated by graph convolution. The convolution kernel is customized according to the local bandwidth of each grid point to construct a heat diffusion model.
[0079] In order to simulate the heat diffusion process, this step constructs a heat diffusion model for each grid point in the single-value image obtained in step S1. For each grid point, first take the surrounding 8 adjacent points (1-neighborhood) as the objects of heat exchange. For the heat conduction equation: The Laplace operator in the present application is approximated by a graph convolution. In the traditional approximation method, the Laplace convolution kernel is:
[0080]
[0081] Taking into account the requirements of processing characteristics, the technical solution of this application customizes a convolution kernel according to the local bandwidth in various directions of the point, and is therefore called enhanced heat transfer.
[0082] For each point q in the 1-neighborhood of point p i(i=1,2,...,8), calculate the path interval d between the two points using the formula given in the basic concept i . Let c i = dis(p,q i ) / d i , where dis(p,q i ) represents p and q i The spatial distance, c i The meaning of p and q i The number of path intervals.
[0083] The weight of the convolution kernel is: w i =c i / ∑ i c i , and give the image convolution kernel with enhanced heat transfer:
[0084]
[0085] In the technical solution of this application, the enhanced heat transfer convolution corresponding to each grid point is used to simulate the local heat exchange, such as Figure 6 shown.
[0086] S3. Based on the constructed thermal diffusion model, the process of heat diffusion at equal residual height is simulated, and the thermal diffusion result is obtained through iterative calculation.
[0087] In this step, the convolution kernel given in the thermal diffusion model simulates the Laplace operator and sets the diffusion formula within each unit time interval Δt: H(t+Δtp)=Δt(H(t,p)×L * p )+H(t,p). Among them, H(t+Δt,p) represents the temperature at point p at time t+Δt, Δt is the set unit time interval, which determines the time step of each iterative calculation, and H(t,p) is the temperature at point p at time t. L * p is the image convolution kernel for enhanced heat transfer corresponding to point p. This formula describes how the temperature of each point is updated based on the current temperature and the convolution kernel as time goes by, reflecting the exchange and diffusion of heat between different times and locations.
[0088] The specific content of the iterative calculation is described below:
[0089] 1. Initial condition setting: Given the initial temperature, the temperature of all boundary points is set to 100, and the temperature of the remaining points (internal points) is 0. At the same time, a smaller time interval Δt is determined. The setting of the boundary point temperature provides a starting heat source for the heat diffusion process, and the initial temperature of the internal points is 0, which means that they have not received heat at the initial moment. The smaller Δt ensures that the time change of each iteration is small, making the calculation more accurate.
[0090] 2. Internal point calculation: For all internal points, input the time interval Δt, and use the above diffusion formula to calculate the result after the heat exchange. In this step, the temperature change of each internal point after a time interval Δt is calculated by the formula, and the temperature change reflects the diffusion process of heat from the boundary point to the internal point.
[0091] 3. Iteration termination condition: Repeat the iteration process in step 2 until the temperature of all internal points is greater than 0, then output the result. This termination condition ensures that the heat diffusion process stops when all internal points receive enough heat (temperature greater than 0). The temperature distribution results obtained at this time can be used for subsequent tool path planning and other operations.
[0092] The stopping time in the traditional method is given by empirical values, which lacks theoretical guarantee. Too long diffusion time may lead to excessive heat diffusion, affecting the accuracy and quality of the subsequent tool path; too short diffusion time may cause the internal points to not receive enough heat, which also affects the subsequent processing. The convolution simulation method given in the technical solution of this application can accurately give the diffusion time that just stops, which is a significant advantage over the traditional method. It improves the controllability of the heat diffusion process and the reliability of the calculation results, and thus provides a more stable and accurate foundation for subsequent operations based on heat diffusion results (such as tool path planning).
[0093] S4. Generate tool path, including:
[0094] The tool path is generated by using the isothermal lines of the heat diffusion results. Specifically, a tool path set is gradually generated by calculating the path interval and extracting the isothermal lines.
[0095] The following is an explanation of the tool path extraction algorithm. After obtaining the results of the heat diffusion process, the tool path is generated using the isotherms of H(T,p). The specific process is as follows:
[0096] Input: Image I (i.e. Figure 7 The image corresponding to the “heat diffusion result” in Figure 1) and the temperature distribution H(T,p) on it.
[0097] 1. Initial path: Extract the isotherm with a temperature of 100 on I, insert it into the path set, set it as the current path, and set the current temperature to 100.
[0098] 2. Path interval calculation: Calculate the path interval point by point on the current path and record the temperature of the path interval position points.
[0099] 3. Temperature calculation: Among all the temperatures recorded in 2, find the temperature H that is the smallest different from the current temperature.
[0100] 4. Isotherm extraction: Extract the isotherm L with temperature H and merge it into the path set.
[0101] 5. Parameter setting: Update the current temperature to H and set the current path to L.
[0102] 6. Stop condition: Repeat steps 2-5 until the current temperature reaches the minimum value of the temperature distribution H(T, p).
[0103] Output: A collection of paths (isotherms).
[0104] S5. Perform collision detection, including:
[0105] An image-based z-buffer algorithm is used for collision detection to construct a distance image; the distance from the tool space point to the projection plane and the corresponding cell are calculated; the distance is compared with the cell storage value, the collision tool position point is deleted, and a collision-free tool path is output.
[0106] The following is an explanation of the content of the image-based collision detection z-buffer algorithm.
[0107] To ensure the safety of machining operations, it is necessary to prevent unexpected tool collisions during the operation process. When a three-axis machine tool is used to perform machining tasks, the tool follows the preset tool axis direction and moves along the tool path, which poses a risk of potential collision with the workpiece model. In order to avoid such collisions, it is necessary to optimize the generated tool path, and specific measures include eliminating those path segments that are located in the potential collision area. To achieve this goal, the technical solution of this application draws on the concept of the Z-buffer algorithm in the field of computer graphics to implement effective deletion operations on path points. The specific process is as follows:
[0108] 1. Construct a distance image: For each pixel cell on the image, calculate the distance between all points on the model that are projected into the cell and the image, and store the minimum distance.
[0109] 2. For each tool position in the path, calculate the local spatial point where the tool may contact the surface based on the tool's geometric model.
[0110] For ball-end cutters, select spatial points evenly on the ball-end surface; for flat-bottom cutters, select spatial points evenly on the circular surface of the bottom surface; for end mills with rounded tips, select spatial points evenly on the circle with the larger radius and on the circular surface of the bottom surface.
[0111] 3. For each spatial point given by the tool position point, calculate its distance to the projection plane and the corresponding cell on the image. If these distances are not less than the storage value of the cell, it is considered that the tool position point has no collision, otherwise the tool position point has a collision.
[0112] 4. Delete all tool positions where collision occurs, and the remaining output is the path.
[0113] Fig.12 The result of path reduction using the Z-buffer algorithm is shown, where the tool axis direction is the Z axis direction, which is the blue axis in the figure.
[0114] For the problem of machining path planning, the technical solution of this application proposes a new path planning method based on enhanced heat transfer method and graph convolution. The area to be processed is projected onto a plane, an image is constructed, and then the process of heat diffusion at equal residual height is simulated through graph convolution. Finally, the tool path is generated using the isothermal line of the diffusion result. Compared with the traditional method, it has the advantages of universal CAD format, high-speed and stable calculation, and the ability to process across multiple surfaces. The algorithm flow diagram is shown below. Figure 8 The following is an example to illustrate the algorithm of the technical solution of this application: for three different CAD forms of the same area: point cloud, triangular mesh, and spliced B-rep model, the algorithm proposed in the technical solution of this application uniformly projects them into images, calculates the tool path, and meets the residual high precision requirements. The results are as follows Fig. 9 shown.
[0115] In the technical solution of this application, the tool path is generated based on the isotherms of the heat diffusion results. After calculating the path interval and extracting the isotherms, the tool path is made more reasonable and meets the requirements of processing accuracy and efficiency. When constructing the heat diffusion model, each grid point takes the 8 surrounding neighborhood points as the heat exchange object, and uses the graph convolution to approximate the Laplace operator in the heat conduction equation, and customizes the convolution kernel according to the local bandwidth. Compared with the traditional method of solving the heat transfer equation on the triangular mesh, this model is not affected by the quality of the triangular mesh, and the calculation is faster and more stable when processing complex data. It can effectively simulate the heat diffusion process according to the equal residual height, and provide a guarantee for accurate planning of the tool path. Finally, the image-based z-buffer algorithm is used for collision detection, the distance image is constructed, the distance from the tool space point to the projection plane and the corresponding cell are calculated, the distance is compared with the cell storage value, and the collision tool position point is deleted to output a collision-free tool path. This method can effectively prevent the tool from colliding with the workpiece model during the processing process, ensure the safety of the processing operation, protect the tool and the workpiece, and avoid tool damage caused by collision.
[0116] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0117] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A path planning method based on enhanced heat transfer method and image convolution, characterized in that: The following steps are involved: S1. Acquire projectable CAD data, wherein the CAD data includes data in the form of point cloud, triangular mesh, and B-rep model; select a tool axis direction and a plane to be projected, and project the CAD data along the tool axis direction onto the plane to be projected to generate a single-value image; classify each grid point in the single-value image, wherein the classification results include boundary points, external points, and internal points; S2. For each grid point in the single-valued image, the neighborhood points of each grid point are used as heat exchange objects, and the Laplace operator in the heat conduction equation is approximated by graph convolution, and the convolution kernel is customized according to the local bandwidth of each grid point to construct a heat diffusion model; S3. Based on the constructed heat diffusion model, simulate the process of heat diffusion at equal residual height, and obtain the heat diffusion result through iterative calculation; S4. Generate tool path, including: The tool path is generated by using the isothermal line of the heat diffusion result. Specifically, the tool path set is gradually generated by calculating the path interval and extracting the isothermal line operation. S5. Perform collision detection, including: An image-based z-buffer algorithm is used for collision detection to construct a distance image; the distance from the tool space point to the projection plane and the corresponding cell are calculated; the distance is compared with the cell storage value, the collision tool position point is deleted, and a collision-free tool path is output.
2. The path planning method based on enhanced heat transfer method and image convolution according to claim 1, characterized in that: The image size of the single-value image is (u max -u min )×(v max -v min ); Among them, the symbol u max It represents the maximum value of the projection point in the u direction of the projection plane; symbol u min Indicates the minimum value of the projection point in the u direction of the plane to be projected; symbol v max It represents the maximum value of the projection point in the v direction of the projection plane, symbol v min represents the minimum value of the projection point in the v direction of the plane to be projected; The classification of each grid point in the single-value image, wherein the classification results include boundary points, external points and internal points, specifically include: Determine the size of each pixel grid according to the processing accuracy; For each point on the single-valued image, its image value is set to be the spatial distance from the point to the original image point; wherein, for a point in the single-valued image without an original image, its image value is the set maximum value; The sobel operator is used to extract and classify the edges of each grid point in the single-valued image to obtain boundary points, external points and internal points; wherein, for each grid point in the single-valued image, the grid points whose convolution results exceed a predetermined threshold after sobel convolution calculation are marked as boundary points, the image values in the single-valued image that are the set maximum values are marked as external points, and the grid points in the single-valued image other than the boundary points and the external points are marked as internal points.
3. The path planning method based on enhanced heat transfer method and image convolution according to claim 1, characterized in that: The construction process of the thermal diffusion model specifically includes: For any grid point in the single-value image, take the eight adjacent points around it as heat exchange objects; for the heat conduction equation The Laplacian operator in is approximated by graph convolution; Determine the convolution kernel corresponding to each grid point according to the bandwidth of each grid point in each direction, specifically including: for each point q in the 1-neighborhood of the grid point p i , i=1,2,...,8, calculate the path interval d between two points i , let c i = dis(p,q i ) / d i , set the weight w of the convolution kernel i =c i / ∑ i c i , and obtain the convolution kernel for enhanced heat transfer 4. The path planning method based on enhanced heat transfer method and image convolution according to claim 3, characterized in that: The constructed heat diffusion model simulates the process of heat diffusion at equal residual height, and obtains the heat diffusion results through iterative calculation, specifically including: According to the convolution kernel given in the thermal diffusion model, the Laplace operator is simulated according to the formula H(t+Δt,p)=Δt(H(t,p)×L * )+H(t,p) performs iterative heat diffusion calculation on the internal points in the single-valued image until the temperatures of all internal points in the single-valued image are greater than 0, thereby obtaining a heat diffusion result; wherein, the initial conditions of the iterative heat diffusion calculation are: the temperatures of all boundary points in the single-valued image are 100, and the temperatures of all internal points and external points in the single-valued image are 0; the symbol t represents time, and the symbol Δt represents time interval.
5. The path planning method based on enhanced heat transfer method and image convolution according to claim 4, characterized in that: When extracting the tool path, input an image I for representing the thermal diffusion result and the temperature distribution H(T, p) thereon, extract the isotherm with a temperature of 100 on I, insert it into the path set and set it as the current path, and set the current temperature to 100; calculate the path interval point by point on the current path, and record the temperature of the path interval position point; among all the recorded temperatures, find the temperature H with the smallest difference from the current temperature; extract the isotherm L with a temperature of H and merge it into the path set; set the current temperature to H and the current path to L; repeat the above operation until the current temperature reaches the minimum value of the temperature distribution H(T, p), and then output the path set.
6. The CNC machining path planning method according to claim 1, characterized in that: The Z-buffer collision detection algorithm includes: Construct a distance image. For each pixel cell on the image, calculate the distance between all points on the model that are projected into the cell and the image, and store the minimum distance. For each tool position point in the path, the local spatial point where the tool may contact the surface is calculated based on the tool's geometric model; For each spatial point given by the tool position point, calculate its distance to the projection plane and the corresponding cell on the image. If these distances are not less than the storage value of the cell, it is considered that the tool position point has no collision, otherwise the tool position point has a collision; Delete all tool positions where collision occurs and output the remaining path.