A four-axis polishing path planning method for FDM printed parts based on hierarchical scanning method
Patent Information
- Application Number
- CN202610806966.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-08-28
AI Technical Summary
然而,受限于逐层堆积的成型原理,FDM打印件的表面不可避免地存在层纹和阶梯效应,导致打印件的表面粗糙度较高;
[0024]本发明具有如下优点:本发明通过改进在此提供一种基于分层扫描法的FDM打印件四轴打磨路径规划方法,与同类型设备相比,具有如下改进:
Smart Images

Figure CN122653098A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D printing post-processing and CNC machining path planning technology, specifically a four-axis grinding path planning method for FDM printed parts based on layer scanning. Background Technology
[0002] Fused deposition modeling (FDM) is currently the most widely used additive manufacturing technology in the desktop 3D printing field. FDM technology heats thermoplastic filaments to a molten state and then builds them up layer by layer. It has the advantages of low equipment cost, wide availability of materials, and simple operation. It is widely used in the fields of figurine model making, maker education, and industrial prototype verification. However, due to the layer-by-layer deposition molding principle, FDM printed parts inevitably have layer textures and step effects on their surface, resulting in high surface roughness. Currently, the main post-processing methods for FDM printed parts include manual sanding, handheld electric grinders, chemical vapor smoothing, and vibratory grinding. Using CNC automated equipment for surface grinding of FDM printed parts has become a feasible technical route. However, traditional three-axis CNC equipment can only move linearly along the X / Y / Z directions, making it difficult to achieve grinding with the grinding head aligned with the normal direction of the workpiece surface. For FDM printed parts with complex curved shapes, the surface coverage and grinding effect of three-axis equipment are not ideal. In the field of four-axis or five-axis CNC machining, existing path planning methods are mainly designed for metal cutting scenarios, focusing on tool cutting force optimization, machining allowance control, and surface quality prediction. These methods differ significantly from the application scenarios of FDM printed parts grinding: First, FDM printed parts are usually made of thermoplastic materials such as PLA and ABS, and their material properties and processing parameters are completely different from those of metal cutting. Second, the surface characteristics of FDM printed parts are different from those of metal blanks, requiring specialized surface analysis and path optimization strategies. Third, the motion architecture of desktop grinding equipment is different from that of industrial five-axis machine tools, and their inverse kinematics equations and motion constraints are also different. Summary of the Invention
[0003] Therefore, in order to overcome the above-mentioned shortcomings, the present invention provides a four-axis grinding path planning method for FDM printed parts based on layer scanning method.
[0004] This invention is implemented by constructing a four-axis grinding path planning method for FDM printed parts based on layer scanning. The device includes the following steps: Step 1: Model Preprocessing: Obtain the 3D mesh model file of the FDM printed part, perform non-manifold detection and repair processing on the 3D mesh model, and transform the model coordinate system to the machine coordinate system to align the model center with the A-axis rotation center; Step 2, Surface Analysis: Calculate the normal vector and Gaussian curvature for each triangular facet of the three-dimensional mesh model. Classify and label the reachability of the aforementioned triangular facets according to the four-axis motion mechanism, and label the triangular facets as reachable facets, partially reachable facets, or inaccessible facets respectively. Adaptively adjust the feed rate of each path point according to the Gaussian curvature. Step 3, Layered Scanning: Along the Z-axis of the workpiece, at the preset grinding row spacing... D h divides the workpiece surface into several horizontal rings, the height of each horizontal ring being equal to the grinding row spacing. D h; Step 4: Solving the inverse kinematics in four-axis coordinates: For each reachable surface within the horizontal ring, use the normal vector of the surface and the inverse kinematics equations in four-axis coordinates to solve for the X-axis displacement, Z-axis height, and Y-axis swing angle that satisfy the normal contact condition. i Y and A-axis rotation angle i A Target coordinate values of the four motion axes; Step 5, Collision Detection and Path Correction: Construct the geometric model of the envelope of the grinding head and its clamping mechanism, simulate the spatial envelope when the grinding head moves along the planned path, detect whether there is spatial interference between the envelope and the workpiece model and the machine body structure, and adjust the swing angle or skip the marker for the path points with interference. Step 6: G-code instruction generation: The four-axis coordinate sequence after collision detection and path correction is converted into a GRBL-compatible extended G-code instruction sequence, which includes four-axis linkage linear interpolation instructions, spindle control instructions, and feed rate control instructions.
[0005] Preferably, the coordinate system transformation step in step one specifically includes: calculating the geometric center coordinates (c... x ,c y ,c z Translate the model as a whole so that its geometric center coincides with the rotation center of axis A; apply a rotation transformation matrix R to the model according to the workpiece clamping direction so that the major axis of the model is aligned with the rotation axis of axis A.
[0006] Preferably, the normal vector in step two is specifically expressed as follows: For any triangular facet, whose three vertex coordinates are set as V1(x1,y1,z1), V2(x2,y2,z2), and V3(x3,y3,z3), the normal vector n of the facet is calculated using the following formula: ;
[0007] In the formula, × represents the cross product operation of vectors, and ‖·‖ represents the magnitude of the vector.
[0008] Preferably, the reachability classification marker in step two is specifically manifested as follows: for each triangular facet, calculate the angle between its normal vector n and the rotation axis direction vector a of axis A. α : ;
[0009] when α ≥ α min When the time comes, the surface is determined to be a reachable surface, where α min The preset minimum reachable angle threshold; when α min > α ≥ α limit When the surface is determined to be a partially reachable surface, then... α limit The preset limit angle threshold; when α < α limit If the condition is met, the piece of dough is determined to be an unreachable piece of dough.
[0010] Preferably, the grinding row spacing in step three is... D The method for determining h is as follows: ;
[0011] Where D is the effective diameter of the grinding head. or The overlap rate coefficient is a preset value. or The value ranges from 0.3 to 0.7; in coarse grinding mode or A value of 0.7 corresponds to a row spacing of 70% of the grinding head diameter; in fine grinding mode. or Take 0.5, corresponding to a row spacing of 50% of the grinding head diameter; in polishing mode or Take 0.3, which corresponds to a row spacing of 30% of the grinding head diameter.
[0012] Preferably, the inverse kinematics equations of the four-axis coordinates in step four are specifically expressed as follows: For any grinding contact point P on the workpiece surface, its coordinates in the model coordinate system are (px, py, pz), and its normal vector is (nx, ny, nz). Then, the target coordinates of the four-axis motion axes are calculated according to the following steps: First calculate the rotation angle of axis A. i A : ;
[0013] Rotate point P to the working area accessible by the grinding head; calculate the coordinates of point P′ after rotation: ;
[0014] Calculate the X-axis displacement X target : ;
[0015] Where R tool This is the compensation value for the grinding head radius; then the Z-axis height Z is calculated. target : ;
[0016] Where H fixture The fixture height compensation value is calculated; finally, the Y-axis swing angle is calculated. i Y : ;
[0017] Where R A ( i A (representing rotation about axis A) i A The rotation matrix of the angle; the Y-axis swing angle i Y The value range is limited to -90° to +90°.
[0018] Preferably, the collision detection in step five is specifically manifested as follows: simplifying the spatial shape of the grinding head and clamping mechanism into a combined geometry of a cone and a cylinder as the envelope model; for each path point on the planned path, calculating the spatial occupancy of the envelope in that pose based on the position coordinates and attitude angle of the grinding head at that path point; using a spatial interference judgment algorithm based on triangular facets to detect whether there is an intersection between the envelope and each triangular facet of the workpiece mesh model; if interference is detected, the following correction strategy is implemented for the path point: prioritizing the adjustment of the Y-axis swing angle. i Y To avoid collisions, if interference still exists after adjusting the swing angle, the path point is marked as skipped; a safety lifting path is inserted before and after the skipped path point, and the lifting height of the safety lifting path is 1.5 to 2 times the diameter of the grinding head.
[0019] Preferably, in step six, the generation rule for the G-code instruction sequence includes: the format of the four-axis linkage linear interpolation instruction is: G1X{x}Z{z}Y{ i Y}A{ i A}F{feed}; where X and Z are linear axis coordinates, Y is the yaw axis coordinate, A is the rotation axis coordinate, and F is the feed rate.
[0020] Preferably, the adaptive feed rate adjustment step in step two involves adjusting the feed rate based on the Gaussian curvature. kThe feed rate F at each path point is adaptively adjusted: ;
[0021] in k low and k high These are the preset low curvature threshold and high curvature threshold, respectively, F max and F min These are the preset maximum feed rate and minimum feed rate, respectively.
[0022] Preferably, in step three, within each horizontal ring, the rotation along the axis is performed in preset angular steps. Dth Point-by-point scanning, the angle step size Dth The calculation formula is: ;
[0023] Where r avg The average radius of the workpiece cross-section at the current ring belt; when r avg Smaller Dth When it is too large, Dth Limited to no more than the preset maximum angle step size Dth max .
[0024] This invention has the following advantages: This invention provides an improved four-axis grinding path planning method for FDM printed parts based on layered scanning, which has the following improvements compared to similar equipment: This invention discloses a four-axis grinding path planning method for FDM printed parts based on layered scanning. By decomposing the three-dimensional curved surface grinding problem into path planning problems within several horizontal loops using layered scanning, the computational complexity of path planning is reduced, making the path planning time approximately linearly related to the number of model facets. This method is suitable for the real-time path planning requirements of desktop devices. Through solving the inverse kinematics equations of four-axis coordinates, it achieves grinding along the normal direction of the workpiece surface, with a grinding coverage greater than 85%. Envelope collision detection and automatic path correction effectively avoid collisions between the grinding head and the workpiece or machine body, improving the safety and reliability of the grinding process. Adaptive feed rate adjustment automatically reduces the feed rate in high curvature regions and increases it in low curvature regions, balancing grinding efficiency and surface quality. Compatibility with GRBL four-axis extended firmware via G-code instructions allows direct driving of lower-level machines based on low-cost microcontrollers such as Arduino, reducing equipment cost and system complexity. Attached Figure Description
[0025] Figure 1 This is an overall flowchart of the method of the present invention; Figure 2 This is a schematic diagram illustrating the principle of the layered scanning method; Figure 3 A schematic diagram of the geometric relationship for solving the inverse kinematics of four-axis coordinates; Figure 4 This is a schematic diagram of collision detection within the grinding head envelope. Figure 5 Curvature-rate relationship curve for adaptive feed rate adjustment; Figure 6 This is a schematic diagram of the motion axis layout of a four-axis linkage grinding equipment. Detailed Implementation
[0026] The following is in conjunction with the appendix Figure 1~Figure 6 The principles and features of the present invention are described below. The examples given are for illustrative purposes only and are not intended to limit the scope of the invention. The invention is described more specifically in the following paragraphs by way of example with reference to the accompanying drawings. It should be noted that the drawings are in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the invention.
[0027] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0028] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "setting" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances. The embodiments of this invention will now be described according to its overall structure.
[0029] Example 1:
[0030] Please see Figure 1~Figure 6This invention discloses a four-axis grinding path planning method for FDM printed parts based on layered scanning. First, a standard cylindrical workpiece in STL format with a diameter of 80mm and a height of 100mm is imported. This model contains approximately 5000 triangular faces. A mesh repair algorithm is used to detect non-manifolds in the model, identifying and repairing two non-manifold edges and one degenerate face. The geometric center coordinates of the model are calculated to be (40.0, 40.0, 50.0)mm. The model is then translated by (-40.0, -40.0, -50.0)mm so that the geometric center coincides with the rotation center of the A-axis (0,0,0). Since the workpiece is a standard cylinder with its major axis along the axis, no additional rotational transformation is required. Next, calculate the normal vector and Gaussian curvature for each of the 5000 triangular faces of the model; the normal vectors of the lateral faces of the cylinder are all perpendicular to the Z-axis, and the angle between the normal vector and the rotation axis A-axis, i.e., the Z-axis direction, is calculated. α =90°, all are determined to be reachable surfaces; the normal vectors of the top and bottom surfaces of the cylinder are parallel to the Z-axis. α =0°, determined to be an unreachable surface; curvature analysis results show that the Gaussian curvature of the side surface is 0°. k =1 / R=1 / 40=0.025mm⁻¹, which belongs to the low curvature region; Then, a 6mm diameter diamond grinding head was used for fine grinding, and the overlap coefficient was adjusted. or =0.5, then polish the line spacing. D h = 6 × 0.5 = 3 mm; Dividing the 100 mm high cylinder into 3 mm row spacings, a total of 34 horizontal rings are obtained. The principle of layered scanning is as follows: Figure 2 As shown; For each horizontal ring, rotate in angular increments along the axis. Dth =5° point-by-point scanning, each loop generates 72 path points, for a total of 34×72=2448 path points; for the side surface of the cylinder, the A-axis rotation angle is... i A That is, the scanning angle, and the X-axis displacement X. target =40-3=37mm, which means a radius of 40mm is needed minus a grinding head radius compensation of 3mm, and the Z-axis height Z target =k×3mm+H fixture Here, k is the ring number and the Y-axis swing angle. i Y =0°, the side normal vector is horizontal, and the grinding head does not need to swing; the geometric relationship obtained by inverse kinematics solution is as follows: Figure 3 As shown; The grinding head is then simplified into a combined envelope of a cylinder with a diameter of 6mm and a length of 15mm and a cone with a diameter of 12mm and a length of 10mm, such as... Figure 4As shown; collision detection was performed on all 2448 path points. Due to the regular shape of the cylindrical workpiece, no collision points were detected. Finally, a G-code instruction sequence is generated, containing a total of 2448 G1 four-axis linkage instructions; the feed rate is set to 200mm / min according to the fine grinding mode; a G28 zero return instruction and an M3S6000 spindle start instruction are inserted at the beginning of the instruction sequence, and an M5 spindle stop instruction and a G28 zero return instruction are inserted at the end. In this embodiment, the path planning calculation time is about 0.8 seconds, the generated G-code file size is about 120KB, the estimated grinding execution time is about 25 minutes, and the workpiece surface coverage after grinding is about 95%, and the surface roughness is reduced from the initial Ra30μm to Ra6μm.
[0031] Example 2:
[0032] Please see Figure 1~Figure 6 The present invention provides a four-axis grinding path planning method for FDM printed parts based on layered scanning. This method further includes importing an STL format three-dimensional mesh model of a complex curved humanoid figure FDM printed part with a height of 150mm. This model contains approximately 50,000 triangular faces. A mesh repair algorithm detects 15 non-manifold edges, 3 holes, and 5 degenerate faces, and performs edge flipping, hole filling, and face reconstruction processing respectively. The geometric center is calculated, and coordinate system transformation is performed to align the model center to the A-axis rotation center. Based on the standing direction of the figure, the model is rotated around the X-axis so that the feet face down and the head faces up. Then, the normal vectors and Gaussian curvatures of all 50,000 triangular faces were calculated. The classification results were as follows: 38,500 reachable faces, accounting for 77%; 7,500 partially reachable faces, accounting for 15%; and 4,000 inaccessible faces, accounting for 8%. Inaccessible faces were mainly distributed in the grooved areas on the inside of the figure's legs and on the bottom surface of the base. Gaussian curvature analysis showed that the curvature of the figure's face, fingers, and other detailed parts... k =0.2 to 0.5 mm⁻¹, belonging to the high curvature region; the curvature of the torso and limbs k =0.01 to 0.05 mm⁻¹, which belongs to the low curvature region; Then, a 4mm diameter diamond grinding head is used for fine grinding, with an overlap coefficient of [missing information]. or =0.5, polish line spacing D h = 4 × 0.5 = 2 mm; Dividing the 150 mm height of the figure into rows with a 2 mm spacing, a total of 75 horizontal rings are obtained; Then, inverse kinematics solutions were performed on the reachable and partially reachable surfaces within each horizontal ring. Due to the irregular shape of the figure, the cross-sectional shape and area of different rings varied greatly, and the number of path points in each ring ranged from a minimum of 20 to a maximum of 90. A total of approximately 4200 path points were generated for all 75 ring layers. Collision detection was performed on all 4200 path points; 186 collision points were detected, mainly distributed in the concave area where the arm meets the torso; 142 of these collision points were identified by adjusting the Y-axis swing angle. i Y Collisions were successfully avoided; the remaining 44 collision points were marked as skipped due to the limited range of the swing angle adjustment. Safe tool lifting paths were inserted before and after the skipped points, with a tool lifting height of 8mm, which is twice the grinding head diameter of 4mm. After collision correction, there are 4156 effective grinding path points, with a path coverage of approximately 89%. Finally, a G-code instruction sequence is generated, containing 4156 G1 four-axis linkage instructions and 88 safety tool lifting / feeding assistance instructions; the feed rate in high curvature areas, such as the face and fingers, is adaptively adjusted to F80 to F120, and the feed rate in low curvature areas, such as the torso and limbs, is F200 to F250; the generated G-code file is approximately 260KB in size, and the estimated grinding execution time is approximately 45 minutes.
[0033] Example 3:
[0034] Please see Figure 1~Figure 6 The present invention provides a four-axis grinding path planning method for FDM printed parts based on layer scanning method, which also includes curved surface grinding path planning, and imports an irregular curved surface FDM printed part with a size of 120mm×80mm×60mm; First stage: Coarse grinding path planning; selecting a 6mm diameter, 80-mesh coarse-grained diamond grinding head, with an overlap coefficient... or =0.7, polish line spacing D h = 6 × 0.7 = 4.2 mm; spindle speed set to 10000 RPM, maximum feed rate F max =400mm / min; Execute steps one through six to generate a coarse grinding G-code instruction sequence containing 1850 path points, with an estimated execution time of approximately 15 minutes; Second stage: Fine grinding path planning; selecting a 4mm diameter, 320-mesh fine-grained diamond grinding head, with an overlap coefficient... or =0.5, polish line spacing D h = 4 × 0.5 = 2 mm; spindle speed set to 6000 RPM, maximum feed rate F max=200mm / min; Repeat steps one through six to generate a fine grinding G-code instruction sequence containing 3400 path points, with an estimated execution time of approximately 35 minutes; Level 3: Polishing path planning; selecting a 4mm diameter, 1000-grit polishing head with an overlap coefficient. or =0.3, polish line spacing D h = 4 × 0.3 = 1.2 mm; spindle speed set to 4000 RPM, maximum feed rate F max =100mm / min; Repeat steps one through six to generate a polishing G-code instruction sequence containing 5600 path points, with an estimated execution time of approximately 60 minutes; The three-stage progressive grinding process involves a total of 10,850 path points and takes approximately 110 minutes to complete. After completion, the workpiece surface roughness improves from the initial Ra30. m m and above are reduced to Ra5 m Below m.
[0035] Example 4:
[0036] Please see Figure 1~Figure 6 This invention provides a four-axis grinding path planning method for FDM printed parts based on layered scanning, which further includes groove grinding path planning. The method involves importing an FDM printed part with a groove feature of 15mm depth; executing steps one to three of Embodiment One; and then, because the workpiece has a groove feature of 15mm depth and 8mm width; the normal vector of the inner wall surface of the groove points towards the inside of the groove; for the surface at the groove entrance, since the entrance width is greater than the grinding head diameter, the inverse kinematic equations can be used to solve for the effective four-axis coordinates; for the surface at the bottom of the groove, the normal vector direction is almost parallel to the A-axis. α Angles close to 0° are marked as partially reachable or inaccessible surfaces. When the grinding head envelope enters the groove region, which consists of a 4mm diameter cylinder and a 10mm diameter tapered clamping part on the cylinder, the tapered clamping part collides with the sidewall of the groove. The collision detection algorithm identifies a total of 28 collision path points in this region. For 16 of these collision points located near the groove entrance, the Y-axis swing angle is used to detect collisions. i Y Adjusting from 0° to ±15° to ±30° allows the grinding head to enter the groove at an angle, successfully avoiding collisions between the clamping part and the side wall. For the remaining 12 collision points located deep in the groove, since collisions cannot be avoided within the adjustment range of the swing angle, they are marked as skipped, and safe tool lifting paths are inserted before and after these skipped areas. The final generated G-code instructions include a safety lift-up instruction and a tilt feed instruction in the path segment of the groove area to ensure that the grinding head does not collide with the workpiece when entering and exiting the groove; the unreachable area at the bottom of the groove accounts for about 3% of the total surface area of the workpiece and requires manual grinding by the user later.
[0037] This invention provides an improved four-axis grinding path planning method for FDM printed parts based on a layered scanning method. By decomposing the three-dimensional curved surface grinding problem into a path planning problem within several horizontal loops using the layered scanning method, the computational complexity of path planning is reduced, making the path planning time approximately linearly related to the number of model facets. This method is suitable for the real-time path planning requirements of desktop devices. Through solving the inverse kinematics equations of four-axis coordinates, it achieves grinding along the normal direction of the workpiece surface, with a grinding coverage of over 85%. Envelope collision detection and automatic path correction effectively avoid collisions between the grinding head and the workpiece or machine body, improving the safety and reliability of the grinding process. Adaptive feed rate adjustment automatically reduces the feed rate in high curvature regions and increases it in low curvature regions, balancing grinding efficiency and surface quality. Compatibility with GRBL four-axis extended firmware via G-code instructions allows direct driving of lower-level machines based on low-cost microcontrollers such as Arduino, reducing equipment cost and system complexity.
[0038] The above description shows and illustrates the basic principles, main features, and advantages of the present invention. Standard parts used in the present invention can be purchased from the market, and irregular parts can be customized according to the description and drawings. The specific connection methods of each part adopt conventional methods such as bolts, rivets, and welding that are mature in the prior art. The machinery, parts, and equipment adopt conventional models in the prior art, and the circuit connection adopts conventional connection methods in the prior art, which will not be described in detail here.
[0039] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A four-axis grinding path planning method for FDM printed parts based on layered scanning, comprising the following steps: Step 1: Model Preprocessing: Obtain the 3D mesh model file of the FDM printed part, perform non-manifold detection and repair processing on the 3D mesh model, and transform the model coordinate system to the machine coordinate system to align the model center with the A-axis rotation center; Step 2, Surface Analysis: Calculate the normal vector and Gaussian curvature for each triangular facet of the three-dimensional mesh model. Classify and label the reachability of the aforementioned triangular facets according to the four-axis motion mechanism, and label the triangular facets as reachable facets, partially reachable facets, or inaccessible facets respectively. Adaptively adjust the feed rate of each path point according to the Gaussian curvature. Step 3, Layered Scanning: Along the Z-axis of the workpiece, at the preset grinding row spacing... Δ h divides the workpiece surface into several horizontal rings, the height of each horizontal ring being equal to the grinding row spacing. Δ h; Step 4: Solving the inverse kinematics in four-axis coordinates: For each reachable surface within the horizontal ring, use the normal vector of the surface and the inverse kinematics equations in four-axis coordinates to solve for the X-axis displacement, Z-axis height, and Y-axis swing angle that satisfy the normal contact condition. θ Y and A-axis rotation angle θ A Target coordinate values of the four motion axes; Step 5, Collision Detection and Path Correction: Construct the geometric model of the envelope of the grinding head and its clamping mechanism, simulate the spatial envelope when the grinding head moves along the planned path, detect whether there is spatial interference between the envelope and the workpiece model and the machine body structure, and adjust the swing angle or skip the marker for the path points with interference. Step 6: G-code instruction generation: The four-axis coordinate sequence after collision detection and path correction is converted into a GRBL-compatible extended G-code instruction sequence, which includes four-axis linkage linear interpolation instructions, spindle control instructions, and feed rate control instructions.
2. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 1, characterized in that: The coordinate system transformation step in step one specifically includes: calculating the geometric center coordinates (c) of the 3D mesh model. x ,c y ,c z The model is translated as a whole so that its geometric center coincides with the rotation center of axis A; a rotation transformation matrix R is applied to the model according to the workpiece clamping direction so that the major axis of the model is aligned with the rotation axis of axis A.
3. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 2, characterized in that: The normal vector in step two is specifically represented as follows: For any triangular facet, whose three vertex coordinates are set as V1(x1,y1,z1), V2(x2,y2,z2), and V3(x3,y3,z3), the normal vector n of the facet is calculated using the following formula: ; In the formula, × represents the cross product operation of vectors, and ‖·‖ represents the magnitude of the vector.
4. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 3, characterized in that: The reachability classification marker in step two is specifically manifested as follows: for each triangular facet, calculate the angle between its normal vector n and the rotation axis direction vector a of axis A. α : ; when α ≥ α min When the time comes, the surface is determined to be a reachable surface, where α min This is the preset minimum reachable angle threshold; when α min > α ≥ α limit When the surface is determined to be a partially reachable surface, then... α limit This is a preset limit angle threshold; when α < α limit If the condition is met, the piece of dough is determined to be an unreachable piece of dough.
5. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 4, characterized in that: The grinding row spacing in step three Δ The method for determining h is as follows: ; Where D is the effective diameter of the grinding head. η The overlap rate coefficient is a preset value. η The value ranges from 0.3 to 0.7; in coarse grinding mode η A value of 0.7 corresponds to a row spacing of 70% of the grinding head diameter; in fine grinding mode. η Take 0.5, corresponding to a row spacing of 50% of the grinding head diameter; in polishing mode η Take 0.3, which corresponds to a row spacing of 30% of the grinding head diameter.
6. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 5, characterized in that: The inverse kinematics equations for the four-axis coordinates in step four are specifically expressed as follows: For any grinding contact point P on the workpiece surface, its coordinates in the model coordinate system are (px, py, pz), and its normal vector is (nx, ny, nz). Then, the target coordinates of the four-axis motion axes are calculated according to the following steps: First calculate the rotation angle of axis A. θ A : ; Rotate point P to the working area accessible by the grinding head; calculate the coordinates of point P′ after rotation: ; Calculate the X-axis displacement X target : ; Where R tool This is the compensation value for the grinding head radius; then the Z-axis height Z is calculated. target : ; Where H fixture The fixture height compensation value is calculated; finally, the Y-axis swing angle is calculated. θ Y : ; Where R A ( θ A (representing rotation about axis A) θ A The rotation matrix of the angle; the Y-axis swing angle θ Y The value range is limited to -90° to +90°.
7. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 6, characterized in that: The collision detection in step five is specifically manifested as follows: the spatial shape of the grinding head and clamping mechanism is simplified into a combination of cone and cylinder geometry as the envelope model; for each path point on the planned path, the spatial occupancy of the envelope in that pose is calculated based on the position coordinates and attitude angle of the grinding head at that path point; a spatial interference judgment algorithm based on triangular facets is used to detect whether there is an intersection between the envelope and each triangular facet of the workpiece mesh model. If interference is detected, the following correction strategy is applied to the path point: prioritize adjusting the Y-axis swing angle. θ Y To avoid collisions, if interference still exists after adjusting the swing angle, the path point is marked as skipped; a safety lifting path is inserted before and after the skipped path point, and the lifting height of the safety lifting path is 1.5 to 2 times the diameter of the grinding head.
8. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 7, characterized in that: In step six, the generation rules for the G-code instruction sequence include: the format of the four-axis linkage linear interpolation instruction is: G1X{x}Z{z}Y{ θ Y }A{ θ A }F{feed}; where X and Z are linear axis coordinates, Y is the yaw axis coordinate, A is the rotation axis coordinate, and F is the feed rate.
9. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 8, characterized in that: The adaptive feed rate adjustment step in step two: based on Gaussian curvature κ The feed rate F at each path point is adaptively adjusted: ; in κ low and κ high These are the preset low curvature threshold and high curvature threshold, respectively, F max and F min These are the preset maximum feed rate and minimum feed rate, respectively.
10. The method for four-axis grinding path planning of FDM printed parts based on layered scanning as described in claim 9, characterized in that: In step three, within each horizontal ring, rotation is performed along the axis in preset angular increments. Δθ Point-by-point scanning, the angle step size Δθ The calculation formula is: ; Where r avg The average radius of the workpiece cross-section at the current ring belt; when r avg Smaller Δθ When it is too large, Δθ Limited to no more than the preset maximum angle step size Δθ max .