A method and system for autonomous generation of machining path of cavity based on medial axis transformation
By introducing cavity boundary information and a dynamic reward mechanism for the central axis into cavity machining, the reinforcement learning algorithm is improved, which solves the problem of low efficiency in cavity machining path generation in the existing technology and realizes efficient autonomous planning and machining.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-04-14
AI Technical Summary
Existing reinforcement learning-based cavity machining methods fail to incorporate overall cavity boundary information into the state input, and the reward mechanism fails to design guiding rewards related to boundary features. As a result, the agent cannot autonomously adjust the machining strategy and it is difficult to generate an effective path that fits the boundary contour, which is particularly inefficient in complex asymmetric cavity machining.
By incorporating cavity boundary information into the state space, radar vectors are generated using radar scanning detection, and a central axis dynamic reward mechanism is constructed. The reinforcement learning algorithm is improved to generate a machining path that fits the boundary, guiding the agent to autonomously adjust the cutting direction.
It enables the intelligent agent to efficiently perceive and autonomously plan the cavity boundary, generating the optimal machining path that fits the boundary contour and meets the requirements of the central axis cutting, significantly improving the machining efficiency and quality of complex cavities.
Smart Images

Figure CN121578756B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent learning for cavity machining, and in particular to a method and system for autonomous generation of cavity machining paths based on central axis transformation through reinforcement learning. Background Technology
[0002] Existing reinforcement learning-based autonomous process planning frameworks suffer from fundamental flaws in cavity machining. Their state inputs only include local tool information and workpiece geometry, failing to incorporate overall cavity boundary information into the observation space. This results in the agent lacking global perception of the cavity structure. Simultaneously, the reward mechanism focuses only on geometric integrity and basic physical constraints, neglecting to design guiding rewards related to cavity boundary features. This prevents the agent from dynamically adjusting its machining strategy based on the actual cavity structure. This dual deficiency in both the state and reward systems prevents reinforcement learning algorithms from effectively identifying and utilizing cavity boundary features during process planning. They are forced to adopt a fixed helical milling strategy starting from the cavity center, heavily relying on the cavity's geometric symmetry. Consequently, when faced with complex, asymmetrical, non-circular cavities, the algorithm cannot generate effective machining paths that conform to the boundary contours. This makes it difficult for reinforcement learning algorithms to leverage their autonomous planning advantages in real-world cavity machining scenarios. The resulting paths are significantly less efficient than existing CAM planning methods, failing to effectively adapt to and efficiently machine complex cavity structures.
[0003] CAM systems are widely used in modern manufacturing, but their core limitation lies in the fact that existing CAM systems, when generating machining paths, primarily focus on the workpiece's geometry, neglecting the collaborative optimization of physical factors such as material properties, cutting force distribution, and machine tool dynamic response, as well as control parameters like feed rate and spindle speed. This one-dimensional planning approach necessitates multiple trial cuts and verifications during machining, requiring repeated parameter adjustments to achieve the desired results. This leads to extended process preparation cycles, increased material waste, and reduced machining efficiency, failing to meet the demands of modern manufacturing for efficient, precise, and sustainable machining. In contrast, reinforcement learning-based autonomous process planning methods organically integrate geometric features, physical characteristics, and control parameters into the reward function design, achieving collaborative planning across geometry, physics, and control. This effectively optimizes global parameters, significantly reducing process planning costs and improving machining efficiency and quality consistency.
[0004] However, existing reinforcement learning-based process planning methods face significant limitations in the field of cavity machining. The state input of existing frameworks only includes local tool information and local workpiece geometric features, failing to incorporate the overall boundary structure information of the cavity, resulting in the agent lacking a global understanding of the workpiece morphology; at the same time, the reward mechanism only focuses on basic geometric integrity and physical constraints, without establishing a dynamic guidance mechanism related to boundary features.
[0005] To address these issues, there is an urgent need for a reinforcement learning-based autonomous generation method and system for cavity machining paths based on central axis transformation. Summary of the Invention
[0006] To address the aforementioned issues, this application proposes a reinforcement learning-based autonomous generation method for cavity machining paths based on central axis transformation, comprising the following steps:
[0007] S1. Obtain a two-dimensional contour by orthogonally projecting the bottom surface of the curved cavity.
[0008] S2. Based on the two-dimensional contour, radar scanning detection is used to perform boundary sampling to obtain the radar vector of the cavity boundary;
[0009] S3. Construct a central axis dynamic reward mechanism to improve the reinforcement learning algorithm by configuring the central axis dynamic reward mechanism.
[0010] S4. An improved reinforcement learning algorithm is used to process the radar vector to obtain the cavity processing path.
[0011] Furthermore, the specific details of obtaining the two-dimensional contour by orthogonally projecting the bottom surface of the curved cavity in S1 include:
[0012] Establish a two-dimensional reference plane perpendicular to the tool axis;
[0013] Define the neighborhood of the current tool position;
[0014] The two-dimensional profile is obtained by orthogonally projecting the bottom surface of the curved cavity within the neighborhood of the current position onto the two-dimensional reference plane.
[0015] Furthermore, the specific content of obtaining the radar vector of the cavity boundary based on the two-dimensional contour using radar scanning detection in S2 includes:
[0016] The cutting tool moves along a two-dimensional contour;
[0017] S201, The cutting tool performs machining motion;
[0018] S202, with the current tool center as the origin of the coordinate system;
[0019] S203, Machining direction using tool S201 As an axis, it emits several rays uniformly. Scan the left and right sides of the axis An angular sector region, in which rays With axis The angle formed is ;
[0020] S204, radiation The target distance between the cutting tool and the cavity boundary contour will be detected and calculated sequentially. This forms a set of radar vectors centered on the cutting tool and pointing towards the boundary points. .
[0021] Furthermore, the dynamic reward mechanism along the central axis in S3 includes:
[0022] Step 1: Define the radar vector as the cavity boundary;
[0023] Step 2: Use a discrete point cloud containing normal information to define the cavity boundary. Characterization, The coordinates of a point in a discrete point cloud. The normal vector of a point in a discrete point cloud;
[0024] Step 3: Observe the normal direction of each point in the sampling tool's observation space. Obtain the set of normal directions Note that the criterion for determining whether a point is within the tool's observation space is: for any point in the point cloud... The distance to the center point of the tool, i.e., the sampling center Less than the maximum observation distance This means that within the observation space, the number of points that meet the conditions is denoted as . There are, therefore there are ;
[0025] Step 4: Calculate the global central axis guiding vector by performing a weighted average of the normals in the normal direction set. .
[0026] Furthermore, the global central axis guiding vector reflects the overall geometric features and central axis trend of the cavity.
[0027] Furthermore, an improved reinforcement learning algorithm is used to process the radar vector to obtain the angle between the current path direction and the central axis guide vector in real time during the cavity machining path.
[0028] If the included angle is small (less than 5°), a positive reward is given, and cutting continues along the central axis.
[0029] If the included angle is large (greater than 30°), a negative reward is given, and the path is adjusted to make the path direction closer to the central axis for cutting.
[0030] A cavity machining path reinforcement learning-based autonomous generation system based on central axis transformation includes:
[0031] Contour generation module: Orthogonally projects the bottom surface of the curved cavity to obtain a two-dimensional contour;
[0032] Boundary generation module: Based on the two-dimensional contour, radar scanning detection is used to sample the boundary and obtain the radar vector of the cavity boundary;
[0033] Mechanism Configuration Module: Constructs a central axis dynamic reward mechanism, and improves the reinforcement learning algorithm by configuring the central axis dynamic reward mechanism;
[0034] Path generation module: An improved reinforcement learning algorithm is used to process radar vectors to generate the cavity machining path.
[0035] In summary, the present invention provides a reinforcement learning-based autonomous generation method and system for cavity machining paths based on central axis transformation. Compared with traditional technologies, this invention successfully transforms the path generation mode from "central spiral" to "boundary adaptability" by integrating central axis characteristics into the reward system. The agent is no longer limited to a fixed spiral path starting from the cavity center, but can dynamically adjust the cutting direction according to the cavity boundary characteristics and adaptively handle various complex boundary structures. This reward mechanism not only solves the problem of poor adaptability of traditional reinforcement learning methods to asymmetric cavities, but also enables the agent to generate optimal machining paths that both conform to the boundary contour and meet the requirements of central axis cutting, significantly improving the efficiency and quality of complex cavity machining and opening up new paths for the application of reinforcement learning in cavity process planning.
[0036] The technical method of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0037] Figure 1 This is a schematic diagram illustrating the steps of a cavity machining path reinforcement learning autonomous generation method based on central axis transformation according to the present invention.
[0038] Figure 2 This is a schematic diagram of the dynamic sensing mechanism of radar scanning in this invention;
[0039] Figure 3 Generate a schematic diagram for the traditional path. Figure 3 (a) in the diagram is a schematic of path generation in the corner area. Figure 3 (b) in the diagram is a schematic diagram of non-near-circle feature path generation;
[0040] Figure 4 This is a schematic diagram illustrating the calculation of the central axis reward according to the present invention;
[0041] Figure 5 A reinforcement learning path planning diagram for a square cavity;
[0042] Figure 6 A reinforcement learning path planning diagram for a rectangular cavity. Detailed Implementation
[0043] The technical method of the present invention will be further described below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of this application.
[0044] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.
[0045] Techniques, systems, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the instruction manual.
[0046] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0047] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.
[0048] Example 1
[0049] This invention addresses the shortcomings of existing reinforcement learning frameworks for cavity machining planning by systematically improving the design of the state input and reward system. This enables the agent to achieve efficient autonomous planning of non-circular cavities. Specifically, it focuses on incorporating cavity boundary information into the state space and introducing the concept of central axis transformation into the reward mechanism. This constructs a dual-drive method of "boundary awareness-central axis guidance," namely, a reinforcement learning-based autonomous generation method for cavity machining paths based on central axis transformation. Figure 1 As shown, the specific content is as follows:
[0050] First, in terms of state input, this invention breaks through the limitations of traditional local tool information and workpiece geometric features. By integrating the overall contour data of the cavity, a global observation space containing a three-dimensional matrix is constructed, enabling the intelligent agent to perceive the complete geometric structure of the cavity in real time and indirectly infer the central axis features.
[0051] This invention first requires constructing a state capable of effectively perceiving the geometric features of the cavity boundary contour. During cavity machining, the size and shape of the cavity vary greatly, and the distance of its boundary from the current position of the tool is also uncertain. If a fixed-range local sampling method is used, it is easy for the sampling area to fail to cover the key boundary, or for the sampling range to be too large, introducing redundant information, thus failing to provide the intelligent agent with stable and effective boundary contour perception.
[0052] In a five-axis machining scenario, the bottom surface of the cavity to be machined may be a complex freeform surface. At this time, the concepts of ray and "boundary" become blurred. A ray may have multiple intersection points with the complex surface, or due to its arbitrary orientation in three-dimensional space, there may be no intersection points in the traditional sense, resulting in radar scanning failure.
[0053] To ensure that the state construction method proposed in this invention can be adapted to a wider range of five-axis machining scenarios, for such complex curved cavities, before boundary sampling, S1, the bottom surface of the curved cavity is orthogonally projected to obtain a two-dimensional contour;
[0054] Furthermore, the specific details of obtaining the two-dimensional contour by orthogonally projecting the bottom surface of the curved cavity in S1 include:
[0055] Establish a two-dimensional reference plane perpendicular to the tool axis;
[0056] Define the neighborhood of the current tool position;
[0057] The two-dimensional profile is obtained by orthogonally projecting the bottom surface of the curved cavity within the neighborhood of the current position onto the two-dimensional reference plane.
[0058] Through this projection transformation, the complex surface boundary in three-dimensional space is simplified into a clear outline on a two-dimensional plane, and then the aforementioned radar ray intersection calculation can be performed on this two-dimensional projection plane.
[0059] S2. Based on the two-dimensional contour, radar scanning detection is used to sample the boundary to obtain the radar vector of the cavity boundary. The intersection of the ray and the boundary contour on the two-dimensional plane is mathematically deterministic and efficient. The radar image sampling method in S2 is simple to calculate and effective for the machining of classic 2.5-axis cavities with a flat bottom and vertical sidewalls.
[0060] Furthermore, this invention employs a dynamic sensing mechanism based on radar scanning, such as... Figure 2 As shown, the cutting tool moves along a two-dimensional contour;
[0061] S201, The cutting tool performs machining motion;
[0062] S202, with the current tool center as the origin of the coordinate system;
[0063] S203, Machining direction using tool S201 As an axis, it emits several rays uniformly. Scan the left and right sides of the axis An angular sector region, in which rays With axis The angle formed is ;
[0064] S204, radiation The target distance between the tool and the cavity boundary contour will be detected and calculated in a sequential loop. This forms a set of radar vectors centered on the cutting tool and pointing towards the boundary points. ;
[0065] This set of vectors clearly depicts the distance and orientation relationship between the tool and the cavity boundary in its current pose, forming a key part of the state space that represents the global geometry of the environment.
[0066] Although the obtained radar vector is calculated on a two-dimensional projection plane, it faithfully reflects the approximation degree and orientation relationship of the tool relative to the cavity boundary contour in three-dimensional space. This enables the boundary perception mechanism applicable to 2.5-axis machining to be effectively extended to five-axis cavity machining scenarios with complex curved bottom surfaces, providing a stable and unified global state input for the intelligent agent.
[0067] Secondly, in terms of reward design, based on the original geometric integrity and physical constraints, a guiding reward item based on the central axis transformation is incorporated to dynamically incentivize the agent to prioritize the influence of the boundary contour in path planning, thereby avoiding the inherent pattern of fixed helical milling.
[0068] The performance of reinforcement learning algorithms is highly dependent on the design of the reward function. Only through precise reward guidance can an agent effectively learn the desired optimal behavioral strategy.
[0069] In cavity machining, if the agent is to be guided to generate a path according to the central axis cutting method, a guiding reward mechanism that matches the characteristics of the central axis must be designed; otherwise, the agent will not be able to recognize and adapt to the geometric requirements of central axis cutting.
[0070] The core idea of spindle cutting is to ensure that the thickness of the formed area along the normal direction to the cavity boundary remains uniform at any cutting moment. This characteristic is key to ensuring the material removal efficiency of non-near-circular cavities, and its necessity is reflected in the following two aspects:
[0071] 1) such as Figure 3 As shown in (a), when the machining path passes through a corner region, milling along a spiral path results in a significantly greater material removal thickness in that region compared to other regions. This necessitates returning to the corner region to remove the excess material, drastically reducing machining efficiency. However, if a central axis guide is applied to the agent's cutting process, the path can be appropriately extended towards the corner to remove excess material, maintaining overall thickness uniformity and thus ensuring machining efficiency. The reinforcement learning-planned path for a square cavity is shown below. Figure 5 As shown;
[0072] 2) such as Figure 3As shown in (b), when the overall contour of the cavity is not nearly circular, milling along a spiral path will result in more residue on the long axis than on the short axis. This necessitates additional paths to remove the excess material on the long axis, significantly reducing machining efficiency. To address this, the central axis can guide the agent to first cut the central axis shape of the material at its center, avoiding the difference in material residue between the long and short axes and thus greatly improving machining efficiency. This corner path extension strategy and the extraction of the central axis shape for non-circular cavities are essential requirements for central axis cutting and key aspects that traditional reinforcement learning methods struggle to achieve. The reinforcement learning path planning for a rectangular cavity is as follows: Figure 6 As shown, the circle represents the cutting tool.
[0073] To transform this central axis property into a guiding reward for reinforcement learning, this invention proposes a dynamic reward mechanism based on boundary normal averaging, as follows:
[0074] S3. Construct a central axis dynamic reward mechanism to improve the reinforcement learning algorithm.
[0075] like Figure 4 The diagram illustrates how the present invention calculates the centerline reward. The thin solid line represents the centerline vector calculated at different tool positions, the thick solid line represents the tool path guided by the centerline vector, and the thick dashed line represents the smooth final tool path obtained after other reward constraints.
[0076] Furthermore, the dynamic reward mechanism along the central axis in S3 includes:
[0077] Step 1: Define the radar vector as the cavity boundary;
[0078] Step 2: Use a discrete point cloud containing normal information to define the cavity boundary. Characterization, The coordinates of a point in a discrete point cloud. The normal vector of a point in a discrete point cloud;
[0079] Step 3: Observe the normal direction of each point in the sampling tool's observation space. Obtain the set of normal directions Note that the criterion for determining whether a point is within the tool's observation space is: for any point in the point cloud... The distance to the center point of the tool, i.e., the sampling center Less than the maximum observation distance This means that within the observation space, the number of points that meet the conditions is denoted as . There are, therefore there are ;
[0080] Step 4: Calculate the global central axis guiding vector by performing a weighted average of the normals in the normal direction set. .
[0081] Furthermore, the global central axis guiding vector reflects the overall geometric features and central axis trend of the cavity.
[0082] S4. An improved reinforcement learning algorithm is used to process the radar vector to obtain the cavity processing path.
[0083] Furthermore, an improved reinforcement learning algorithm is used to process the radar vector to obtain the angle between the current path direction and the central axis guide vector in real time during the cavity machining path.
[0084] If the included angle is small (less than 5°), a positive reward is given, and cutting continues along the central axis.
[0085] If the included angle is large (greater than 30°), a negative reward is given, and the path is adjusted to make the path direction closer to the central axis for cutting.
[0086] This reward mechanism based on boundary normal averaging enables the agent to automatically identify and adapt to the geometric features of the cavity through the learning process. Especially in corner regions, the system uses negative rewards to encourage the agent to actively extend the path inward, ensuring that the thickness of this region remains consistent with other regions. The specific reinforcement learning environment algorithm is shown below:
[0087]
[0088] Example 2
[0089] A cavity machining path reinforcement learning-based autonomous generation system based on central axis transformation includes:
[0090] Contour generation module: Orthogonally projects the bottom surface of the curved cavity to obtain a two-dimensional contour;
[0091] Boundary generation module: Based on the two-dimensional contour, radar scanning detection is used to sample the boundary and obtain the radar vector of the cavity boundary;
[0092] Mechanism Configuration Module: Constructs a central axis dynamic reward mechanism, and improves the reinforcement learning algorithm by configuring the central axis dynamic reward mechanism;
[0093] Path generation module: An improved reinforcement learning algorithm is used to process radar vectors to generate the cavity machining path.
[0094] By integrating the central axis-related states and reward elements into the existing state and reward system of reinforcement learning, this invention can guide the agent to autonomously evolve an efficient machining strategy that fits the cavity boundary during iterative learning, and finally train a process planning agent with central axis cutting capability, which significantly improves the adaptability and machining efficiency of complex asymmetric cavities and overcomes the limitations of traditional methods in path generation.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical methods of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical methods of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical methods to deviate from the spirit and scope of the technical methods of the present invention.
Claims
1. A method for autonomous generation of cavity machining paths based on central axis transformation through reinforcement learning, characterized in that, Includes the following steps: S1. Obtain a two-dimensional contour by orthogonally projecting the bottom surface of the curved cavity. S2. Based on the two-dimensional contour, radar scanning detection is used to perform boundary sampling to obtain the radar vector of the cavity boundary; S3. Construct a central axis dynamic reward mechanism to improve the reinforcement learning algorithm by configuring the central axis dynamic reward mechanism. S4. An improved reinforcement learning algorithm is used to process the radar vectors to obtain the generated cavity processing path; The specific content of the radar vector of the cavity boundary obtained by radar scanning detection based on the two-dimensional contour in S2 includes: The cutting tool moves along a two-dimensional contour. S201, The cutting tool performs machining motion; S202, with the current tool center as the origin of the coordinate system; S203, the direction of machining with tool S201. As an axis, it emits several rays uniformly. Scan the left and right sides of the axis An angular sector region, in which rays With axis The angle formed is ; S204, radiation The target distance between the cutting tool and the cavity boundary contour will be detected and calculated sequentially. This forms a set of radar vectors centered on the cutting tool and pointing towards the boundary points. ; The dynamic reward mechanism along the central axis in S3 includes: Step 1: Define the radar vector as the cavity boundary; Step 2: Use a discrete point cloud containing normal information to define the cavity boundary. Characterization, The coordinates of a point in a discrete point cloud. The normal vector of a point in a discrete point cloud; Step 3: Observe the normal direction of each point in the sampling tool's observation space. Obtain the set of normal directions ; Step 4: Calculate the global central axis guiding vector by performing a weighted average of the normals in the normal direction set. ; An improved reinforcement learning algorithm is used to process the radar vector to obtain the angle between the current path direction and the central axis guidance vector in real time during the cavity machining path. If the included angle is less than 5°, a positive reward is given, and cutting continues along the central axis. If the included angle is greater than 30°, a negative reward is given, and the path is adjusted to make the path direction closer to the central axis for cutting.
2. The method for autonomous generation of cavity machining paths based on central axis transformation according to claim 1, characterized in that, The specific details of obtaining the two-dimensional contour by orthogonally projecting the bottom surface of the curved cavity in S1 include: Establish a two-dimensional reference plane perpendicular to the tool axis; Define the neighborhood of the current tool position; The two-dimensional profile is obtained by orthogonally projecting the bottom surface of the curved cavity within the neighborhood of the current position onto the two-dimensional reference plane.
3. The method for autonomous generation of cavity machining paths based on central axis transformation according to claim 2, characterized in that, The criteria for determining whether a sample is within the tool observation space are: For any point in a point cloud The distance to the center point of the tool, i.e., the sampling center Less than the maximum observation distance This means that within the observation space, the number of points that meet the conditions is denoted as . There are, therefore there are .
4. The method for autonomous generation of cavity machining paths based on central axis transformation according to claim 3, characterized in that, The global central axis guiding vector reflects the overall geometric features and central axis trend of the cavity.
5. A cavity machining path reinforcement learning autonomous generation system based on central axis transformation, applicable to implementing the cavity machining path reinforcement learning autonomous generation method based on central axis transformation as described in any one of claims 1-4, characterized in that, include: Contour generation module: Orthogonally projects the bottom surface of the curved cavity to obtain a two-dimensional contour; Boundary generation module: Based on the two-dimensional contour, radar scanning detection is used to sample the boundary and obtain the radar vector of the cavity boundary; Mechanism Configuration Module: Constructs a central axis dynamic reward mechanism, and improves the reinforcement learning algorithm by configuring the central axis dynamic reward mechanism; Path generation module: An improved reinforcement learning algorithm is used to process radar vectors to generate the cavity machining path.
Citation Information
Patent Citations
Milling processing path automatic generation method based on reinforcement learning
CN120370833A