Surface path planning method for five-axis CNC machine tool machining

By using the condition number of the Jacobian matrix of the computer tool's rotary axis and its spatial gradient, combined with the angle between the feed direction and the gradient direction to calculate the approach rate, adaptively adjust the warning threshold, and use a sequential quadratic programming algorithm to optimize the rotary axis angle, the kinematic singularity problem of a five-axis CNC machine tool when machining complex curved surfaces is solved, achieving high-precision and stable curved surface machining.

CN122308255APending Publication Date: 2026-06-30CHANGZHOU TIANRUIDA MOULD CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGZHOU TIANRUIDA MOULD CO LTD
Filing Date
2026-03-03
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing five-axis CNC machine tools have difficulty solving the problems of uneven rotary axis motion, accumulation of nonlinear errors, and feed interpolation mismatch caused by the tool axis posture entering the kinematically singular/near-singular sensitive region when machining complex curved surfaces, which affects machining stability and accuracy.

Method used

By using the condition number of the Jacobian matrix of the computer tool's rotary axis and its spatial gradient, combined with the angle between the feed direction and the gradient direction, the approach rate is calculated. The warning threshold is adaptively adjusted to identify singular sensitive segments. The rotary axis angle is optimized using a sequential quadratic programming algorithm. Combined with servo synchronous interpolation and real-time following error monitoring in the online control stage, the adaptive adjustment and optimization of the tool axis posture is achieved.

Benefits of technology

It effectively reduces the mapping amplification effect of the rotation axis motion, improves the overall quality and accuracy of surface machining, ensures the stability of the machining process and high-quality surface finish, and enhances the robustness of the machining process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308255A_ABST
    Figure CN122308255A_ABST
Patent Text Reader

Abstract

This invention relates to the field of process control technology, specifically to a surface path planning method for five-axis CNC machine tool machining, comprising a collaborative planning scheme with offline and online phases. In the offline planning phase: after extracting tool position data, the Jacobian matrix condition number and spatial gradient of the machine tool's rotary axis are calculated, and the threshold is dynamically adjusted based on the approach rate to identify singular sensitive segments. Subsequently, angles are evenly distributed according to arc length to establish a hierarchical constraint optimization model, and tool axis posture deviations are compensated through normal fine-tuning. In the online control phase: the optimized trajectory is loaded into the CNC system, and the spline interpolation order is adaptively selected based on the number of servo sampling points. During machining, the following error is monitored in real time, and when the error exceeds the limit, the spline tension coefficient of the next interpolation segment is dynamically self-tuned. This invention effectively achieves smooth rotary axis motion and high-precision servo following, improving the overall quality of surface machining.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of process control technology, specifically to a surface path planning method for five-axis CNC machine tool machining. Background Technology

[0002] Five-axis CNC machine tools, by adding two rotational degrees of freedom, enable the cutting tool to approach the workpiece surface at any angle, playing a dominant role in the machining of complex curved surfaces such as automotive mold cavities and headlight lenses. The core of five-axis machining lies in the tool axis posture control, that is, the planning and optimization of the tool axis vector. This not only requires avoiding possible interference and collisions during machining, but also ensuring the smoothness and controllability of the machine tool's rotary axis motion.

[0003] In the process of machining complex curved surfaces on a five-axis CNC machine tool, when the tool axis posture enters the kinematically singular / near-singular sensitive region or the tool path contains short segments and corners, the existing path planning method is difficult to adaptively reconstruct and interpolate the servo sampling scale of the rotary axis motion at the process control layer of the CNC system. This causes small posture changes in the workpiece coordinate system to have a mapping amplification effect at the machine tool rotary axis layer, resulting in sudden changes in the angular velocity / angular acceleration of the rotary axis, accumulation of nonlinear errors, and feed interpolation mismatch. Ultimately, this restricts the machining stability, dimensional accuracy, and surface quality of the mold surface machining. Summary of the Invention

[0004] To address the aforementioned technical problems, the purpose of this invention is to provide a surface path planning method for five-axis CNC machine tool machining.

[0005] A surface path planning method for five-axis CNC machine tool machining includes:

[0006] Offline planning phase: Read the tool position file and extract the tool position sequence and tool axis posture sequence; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through machine tool kinematics, generating the initial machining trajectory; establish the machine tool rotary axis Jacobian matrix for the current tool position and calculate the condition number; calculate the spatial gradient of the condition number along the tool position trajectory direction; calculate the rate at which the tool axis posture approaches the singular region by combining the angle between the feed rate and the gradient direction; adaptively adjust the warning threshold according to the rate, and mark the tool position as a singular sensitive point when the condition number exceeds the threshold; along the tool... The position trajectory identifies singular sensitive segments formed by continuous singular sensitive points, calculates the angular travel of the rotary axis from the start point to the end point within the sensitive segment, and uniformly distributes the angular travel according to the arc length parameter. A hierarchical constraint optimization model is established, with the first constraint being that the angular acceleration of the rotary axis does not exceed the physical limit of the machine tool, and the second constraint being that the forward tilt angle and the side tilt angle of the tool axis satisfy the interference-free feasible region. The optimized rotary axis angle sequence is solved using a sequential quadratic programming algorithm, and the tool axis posture is synthesized in the forward direction. When the deviation between the synthesized tool axis posture and the original posture exceeds the tolerance, the tool position point is finely adjusted in the normal direction of the surface to compensate, thus obtaining the optimized machining trajectory. In the online control phase: the optimized machining trajectory is loaded into the CNC system; the number of servo sampling points between adjacent tool positions is calculated; the spline interpolation order is adaptively selected according to the number of sampling points, and a mapping table of rotation axis angle and time is generated discretely according to the servo sampling cycle; during the machining process, the actual position of the rotation axis is collected and the following error with the planned position is calculated; when the following error exceeds the error threshold, the spline tension coefficient of the next interpolation segment is self-tuned and adjusted.

[0007] Furthermore, the generation of the initial processing trajectory includes: Read the toolpath file for surface machining; extract the tool position sequence from the toolpath file, the tool position sequence being the spatial coordinates of the tool center point of each tool position in the workpiece coordinate system; extract the tool axis posture sequence from the toolpath file, the tool axis posture sequence being the spatial direction of the tool axis at each tool position point; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through inverse kinematics of the machine tool; the tool position sequence and tool axis posture sequence in the workpiece coordinate system, and the linear axis position sequence and rotary axis angle sequence in the machine tool coordinate system together constitute the initial machining trajectory.

[0008] Furthermore, the step of establishing the machine tool rotation axis Jacobian matrix and calculating the condition number for the current tool position includes: Establish the kinematic mapping relationship between the tool axis posture and the rotation axis angle based on the machine tool rotation axis configuration; calculate the partial derivative of the kinematic mapping relationship to obtain the Jacobian matrix of the tool axis posture relative to the rotation axis angle; perform singular value decomposition on the Jacobian matrix to extract the maximum singular value and the minimum singular value; calculate the ratio of the maximum singular value to the minimum singular value as the condition number.

[0009] Furthermore, the spatial gradient of the calculated condition number along the tool path direction includes: Neighboring tool points are selected before and after the current tool point to form a neighborhood window. The width of the neighborhood window is adjusted according to the local curvature of the tool trajectory. The rate of change of the condition number between the preceding and following neighboring tool points is calculated using the central difference method. The rate of change is divided by the corresponding arc length increment to obtain the condition number gradient. The condition number gradient is projected onto the unit tangent vector direction of the tool trajectory to obtain the spatial gradient of the condition number along the trajectory direction.

[0010] Furthermore, the calculation of the rate at which the tool axis attitude approaches the singular region by combining the angle between the feed rate and the gradient direction, and the adaptive adjustment of the warning threshold based on the rate, includes: Extract the unit tangent vector of the tool trajectory at the current tool position point as the feed direction; extract the unit direction vector of the condition number spatial gradient as the gradient direction; calculate the angle between the feed direction and the gradient direction; multiply the current feed rate by the cosine of the angle to obtain the projection component of the feed rate along the gradient direction; multiply the projection component by the magnitude of the condition number gradient to obtain the approach rate; calculate the dynamic warning threshold based on the baseline warning threshold and the approach rate; when the condition number exceeds the dynamic warning threshold, mark the current tool position point as a singular sensitive point.

[0011] Furthermore, the identification of singular sensitive segments formed by continuous singular sensitive points along the tool path includes: The scanning begins from the starting point of the toolpath trajectory; when the first singular sensitive point is detected, it is recorded as the starting point of the sensitive segment; the scanning continues until a preset number of non-singular sensitive points appear consecutively, at which point the previous singular sensitive point is recorded as the ending point of the sensitive segment; the identified singular sensitive segments are merged, and when the interval between two sensitive segments is less than a preset interval threshold and the average value of the condition number of the interval segment is greater than a preset judgment threshold, the two sensitive segments and the interval segment are merged into one sensitive segment; the boundary of the merged sensitive segment is extended.

[0012] Furthermore, the calculation of the angular travel of the rotation axis from the starting point to the ending point within the sensitive segment and its uniform distribution according to the arc length parameter includes: Inverse kinematics is performed on the starting and ending tool positions of the singular sensitive segment to obtain the starting and ending rotation axis angles. The difference between the ending and starting rotation axis angles is calculated as the angular travel. The cumulative arc length from each tool position to the starting point of the sensitive segment is calculated. The cumulative arc length is divided by the total arc length of the sensitive segment to obtain the arc length ratio. The angular travel is linearly distributed to each tool position according to the arc length ratio. Boundary constraint checks are performed on the uniform distribution results.

[0013] Furthermore, the establishment of the hierarchical constraint optimization model and the solution using a sequential quadratic programming algorithm includes: The optimization objective is set to minimize the sum of the squares of the changes in angular acceleration of the rotation axes between all adjacent tool points within the singular sensitive segment; the first constraint is set to ensure that the absolute value of the angular acceleration of each rotation axis does not exceed the physical limit of angular acceleration calibrated by the machine tool; the second constraint is set to ensure that the forward tilt angle of the optimized rotation axis angle is within the feasible region of the forward tilt angle and the side tilt angle is within the feasible region of the side tilt angle; the sequential quadratic programming algorithm is used to solve the problem iteratively.

[0014] Furthermore, the compensation method of fine-tuning the tool position point in the normal direction of the curved surface when the deviation between the synthesized tool axis posture and the original posture exceeds the tolerance includes: The optimized rotation axis angle sequence is synthesized into a tool axis posture sequence through forward kinematics transformation; the angular deviation between the synthesized tool axis posture sequence and the original tool axis posture sequence is calculated; a posture deviation tolerance is set; when the angular deviation exceeds the tolerance, tool position compensation is initiated; the unit normal vector of the surface at the current tool position is extracted; the tool position is fine-tuned along the direction of the normal vector; the rotation axis angle is recalculated for the fine-tuned tool position and the tool axis posture is synthesized in the forward direction; the fine-tuning amount is iteratively adjusted until the angular deviation between the synthesized posture and the original posture is less than the tolerance.

[0015] Furthermore, the servo synchronous interpolation and real-time following error monitoring in the online control phase includes: The optimized machining trajectory is loaded into the CNC system; servo cycle parameters are read from the CNC system; the spatial distance between adjacent tool positions is calculated and divided by the current feed rate to obtain the tool travel time; the travel time is divided by the servo cycle to obtain the number of servo sampling points; the spline interpolation order is adaptively selected based on the comparison result of the number of sampling points and a preset threshold; a mapping table of rotary axis angle and time is generated discretely in the time domain according to the servo sampling cycle as the planned angle position sequence; during machining execution, the actual angle position sequence fed back by the rotary axis encoder is acquired through the CNC system interface; the absolute value of the difference between the actual angle position sequence and the planned angle position sequence is calculated as the following error sequence; when the mean of the following error exceeds the preset error threshold, the spline tension coefficient of the next interpolation segment is adjusted.

[0016] By means of the above-described solution, the present invention has at least the following advantages: 1. This invention calculates the approach rate by combining the condition number of the Jacobian matrix of the machine tool's rotary axis and its spatial gradient with the angle between the feed direction and the gradient direction to adaptively adjust the warning threshold to identify singular sensitive segments. Furthermore, it uniformly allocates the angular travel according to the arc length and uses a sequential quadratic programming algorithm to solve the hierarchical constraint optimization model that minimizes angular acceleration. This overcomes the limitations of traditional static experience-based warnings and can proactively quantify the severity of the tool's approach to the singular region. From a geometric and dynamic perspective, it reduces the mapping amplification effect of small posture changes at the end of the machine tool's rotary axis, avoids sudden changes in axis motion speed, achieves ultimate smoothness of the machine tool's rotary axis, and further improves the overall quality of surface machining.

[0017] 2. This invention sets tool axis posture constraints that satisfy the non-interference feasible region in the hierarchical constraint optimization model, synthesizes the optimized rotation axis angle into the tool axis posture in the positive direction and calculates the angular deviation from the original posture, and performs fine-tuning compensation along the unit normal vector direction of the surface at the current tool position when the angular deviation exceeds the tolerance; it actively eliminates the geometric deviation of the tool axis spatial position caused by simply smoothing the rotation axis, makes full use of the geometric redundancy characteristics of ball end mills in surface machining, and ensures the dimensional accuracy and trajectory fidelity of complex surface machining of molds without destroying the smoothness of axis motion dynamics, further improving the overall quality of surface machining.

[0018] 3. This invention calculates the number of sampling points by measuring the ratio of the time taken to the servo cycle period of adjacent tool positions and adaptively selects the spline interpolation order. During the machining process, it collects the actual angle position sequence in real time to calculate the following error. When the average following error exceeds the preset error threshold, it dynamically amplifies the spline tension coefficient of the next interpolation segment for self-tuning. This breaks down the barriers between offline geometric trajectory planning and online CNC servo control, giving the system dynamic perception and adaptive matching control capabilities. It significantly improves the robustness of the machining process against physical disturbances of cutting forces, effectively reduces nonlinear following errors, ensures high-quality surface finish of the final part, and further improves the overall quality of curved surface machining.

[0019] 4. This invention includes a collaborative planning scheme with two stages: offline and online. In the offline planning stage: after extracting tool position data, the condition number of the Jacobian matrix of the computer tool's rotary axis and its spatial gradient are used, combined with the approach rate to dynamically adjust the threshold to identify singular sensitive segments. Subsequently, angles are evenly distributed according to arc length to establish a hierarchical constraint optimization model, and tool axis posture deviations are compensated through normal fine-tuning. In the online control stage: the optimized trajectory is loaded into the CNC system, and the spline interpolation order is adaptively selected based on the number of servo sampling points. The following error is monitored in real time during machining, and the spline tension coefficient of the next interpolation segment is dynamically self-tuned when the error exceeds the limit. This invention effectively achieves smooth rotary axis motion and high-precision servo following, further improving the overall quality of surface machining.

[0020] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show a certain embodiment of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the singularity sensitive region identification process based on condition number gradient and approach rate. Detailed Implementation

[0023] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0024] Example 1: This embodiment is mainly applied to the complex curved surface finishing of automotive LED headlight lens molds. In the automotive mold manufacturing field, headlight lenses are usually injection molded from optical-grade PMMA or PC materials. Their mold cavities are mostly free-form surfaces composed of non-uniform rational B-splines (NURBS), with drastic curvature changes and extremely high precision requirements (typically at the Ra 0.01μm level). When machining such molds using a five-axis CNC machine tool (such as an AC dual-rotary table structure), due to the deep cavity characteristics of the lens surface, the tool axis often needs to swing significantly to avoid interference. However, when the tool axis approaches the machine tool's extreme point (such as the C-axis singularity when the A-axis swing angle is 0 degrees), even a small change in the tool position can cause a drastic change in angular velocity and angular acceleration of the rotary axis. This not only leaves "striking marks" or "overcutting" marks on the mold surface that are difficult to polish, but in severe cases, it can also trigger machine tool servo alarms or even damage the spindle. Existing CAM software often lacks a deep consideration of the machine tool's dynamic characteristics in its toolpath generation, making it difficult to solve this process pain point.

[0025] This embodiment provides a surface path planning method for five-axis CNC machine tool machining. This method can effectively solve the problems mentioned in the background art, such as uneven rotary axis motion, poor machining quality in singular areas, and large servo following errors. The entire method is mainly divided into an offline planning stage and an online control stage. The offline stage focuses on the optimization of geometry and kinematics by identifying singular sensitive areas and reconstructing the rotary axis motion using optimization algorithms; the online stage focuses on matching servo dynamics to achieve high-precision trajectory following.

[0026] A surface path planning method for five-axis CNC machine tool machining. Figure 1 This is a schematic flowchart provided by an embodiment of the present invention; including: Offline planning phase: Read the tool position file and extract the tool position sequence and tool axis posture sequence; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through machine tool kinematics, generating the initial machining trajectory; establish the machine tool rotary axis Jacobian matrix for the current tool position and calculate the condition number; calculate the spatial gradient of the condition number along the tool position trajectory direction; calculate the rate at which the tool axis posture approaches the singular region by combining the angle between the feed rate and the gradient direction; adaptively adjust the warning threshold according to the rate, and mark the tool position as a singular sensitive point when the condition number exceeds the threshold; along the tool... The position trajectory identifies singular sensitive segments formed by continuous singular sensitive points, calculates the angular travel of the rotary axis from the start point to the end point within the sensitive segment, and uniformly distributes the angular travel according to the arc length parameter. A hierarchical constraint optimization model is established, with the first constraint being that the angular acceleration of the rotary axis does not exceed the physical limit of the machine tool, and the second constraint being that the forward tilt angle and the side tilt angle of the tool axis satisfy the interference-free feasible region. The optimized rotary axis angle sequence is solved using a sequential quadratic programming algorithm, and the tool axis posture is synthesized in the forward direction. When the deviation between the synthesized tool axis posture and the original posture exceeds the tolerance, the tool position point is finely adjusted in the normal direction of the surface to compensate, thus obtaining the optimized machining trajectory. In the online control phase: the optimized machining trajectory is loaded into the CNC system; the number of servo sampling points between adjacent tool positions is calculated; the spline interpolation order is adaptively selected according to the number of sampling points, and a mapping table of rotation axis angle and time is generated discretely according to the servo sampling cycle; during the machining process, the actual position of the rotation axis is collected and the following error with the planned position is calculated; when the following error exceeds the error threshold, the spline tension coefficient of the next interpolation segment is self-tuned and adjusted; the optimized condition number sequence, angular acceleration sequence, and following error sequence are output.

[0027] Furthermore, the generation of the initial processing trajectory includes: Read the toolpath file for surface machining; extract the tool position sequence from the toolpath file, the tool position sequence being the spatial coordinates of the tool center point of each tool position in the workpiece coordinate system; extract the tool axis posture sequence from the toolpath file, the tool axis posture sequence being the spatial direction of the tool axis at each tool position point; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through inverse kinematics of the machine tool; the tool position sequence and tool axis posture sequence in the workpiece coordinate system, and the linear axis position sequence and rotary axis angle sequence in the machine tool coordinate system together constitute the initial machining trajectory.

[0028] Specifically, in the actual operation of this embodiment, the toolpath of the aforementioned automotive headlight lens mold is first calculated using general CAM software (such as Siemens NX or HyperMill). The operator imports the 3D CAD model of the mold, selects a ball end mill with a diameter of 6mm, sets the surface allowance to 0.05mm as the semi-finishing parameter, and generates a standard CLSF (Cutter Location Source File) toolpath file. The system reads this file, which contains approximately 150,000 discrete toolpath data lines.

[0029] The program parses the file line by line, extracting the tool center coordinates (x, y, z) and the corresponding tool axis vectors (i, j, k) from each line of data. For example, the coordinates of the 12050th tool point in the workpiece coordinate system are extracted as P_w(105.234, -45.678, 88.120), and the tool axis vector is V_w(0.1736, 0.0000, 0.9848). Subsequently, the system calls the post-processing module customized for this AC dual-rotor five-axis machine tool, using the inverse kinematics formula of the machine tool to convert the workpiece coordinate system data into motion commands for each axis in the machine tool coordinate system. Assuming the machine tool's A-axis is the oscillating axis and the C-axis is the rotary axis, after inverse kinematics calculation, the corresponding machine tool coordinate system data for this point are: linear axes X_m = 102.110mm, Y_m = -48.220mm, Z_m = 150.330mm; rotary axes A_m = 10.000 degrees, C_m = 0.000 degrees. The system stores these 150,000 sets of converted data according to the machining sequence, forming the initial linear axis position sequence. With rotation axis angle sequence This serves as the basic input for subsequent optimizations.

[0030] By standardizing the reading and inverse transformation of toolpath files, this step achieves seamless integration with existing mainstream CAM software. By clearly distinguishing between the workpiece coordinate system (toolpath / tool ​​axis) and the machine tool coordinate system (axis coordinate / angle), it provides direct data support for subsequent dynamic analysis and singularity identification at the physical axis level of the machine tool. This ensures that the baseline data for path planning accurately reflects the actual motion state of the machine tool, which is a prerequisite for achieving high-precision machining.

[0031] Furthermore, the step of establishing the machine tool rotation axis Jacobian matrix and calculating the condition number for the current tool position includes: Establish the kinematic mapping relationship between the tool axis posture and the rotation axis angle based on the machine tool rotation axis configuration; calculate the partial derivative of the kinematic mapping relationship to obtain the Jacobian matrix of the tool axis posture relative to the rotation axis angle; perform singular value decomposition on the Jacobian matrix to extract the maximum singular value and the minimum singular value; calculate the ratio of the maximum singular value to the minimum singular value as the condition number.

[0032] Specifically: For the aforementioned AC dual-rotary-table five-axis machine tool, its rotary axis configuration determines the nonlinear mapping relationship between the tool axis posture and the rotary axis angles (A, C). The system constructs a kinematic Jacobian matrix for each tool position point. For the current 12050th tool position (A=10°, C=0°), the system establishes a partial derivative matrix, which describes the small rate of change of the tool axis vector components with respect to the angles of the A-axis and C-axis.

[0033] In this embodiment, due to the tool axis vector ( Let be a unit vector whose three components satisfy the following relationship: The constraints have only two independent degrees of freedom, therefore the tool axis attitude is characterized by two independent angular parameters (equivalent to tilt angle and yaw angle), resulting in a 2×2 dimensional partial derivative matrix. If the computational environment directly uses (… If the tool axis data is stored in three-component form, it should first be converted into the two independent angular parameters mentioned above before partial derivatives and SVD decomposition are performed to ensure the consistency between the matrix dimension and the physical meaning.

[0034] In the specific calculation, the system performs singular value decomposition (SVD) on the Jacobian matrix. Assuming a region with near-vertical machining (i.e., axis A is close to 0 degrees), the calculated Jacobian matrix is ​​a 2×2 matrix. After decomposition, its maximum singular value is obtained. However, since this location is close to a singular point, the minimum singular value... Extremely small, for example, 0.002. The system calculates the ratio of the two as the condition number. .

[0035] The system iterates through all 150,000 points, generating a sequence of condition numbers. For example, when machining in a flat area, the A-axis angle is relatively large (e.g., 45 degrees). The condition number is approximately 1.414, which is within the healthy range. However, when machining the lens top pole, the condition number may soar to over 1000, which clearly quantifies the degree of motion pathology of the machine tool at that position. In other words, a small adjustment of the tool axis posture may require a large C-axis rotation to compensate for it.

[0036] This embodiment utilizes the condition number of the Jacobian matrix as a mathematical indicator to scientifically and quantitatively evaluate the kinematic performance of a five-axis machine tool at any machining position. Compared to traditional methods that rely solely on empirical judgments of "A-axis approaching 0 degrees" as a singularity warning, the condition number method more accurately reflects the impact of the machine tool configuration on motion transferability. The ratio of the maximum to the minimum singular value directly reveals the error amplification factor, providing a rigorous basis for subsequent accurate identification of singularity-sensitive areas and avoiding missed or incorrect judgments.

[0037] Furthermore, the spatial gradient of the calculated condition number along the tool path direction includes: Neighboring tool points are selected before and after the current tool point to form a neighborhood window. The width of the neighborhood window is adjusted according to the local curvature of the tool trajectory. The rate of change of the condition number between the preceding and following neighboring tool points is calculated using the central difference method. The rate of change is divided by the corresponding arc length increment to obtain the condition number gradient. The condition number gradient is projected onto the unit tangent vector direction of the tool trajectory to obtain the spatial gradient of the condition number along the trajectory direction.

[0038] Specifically, the system at the current tool position (set as...) The analysis window is constructed by selecting neighboring knife points before and after the curve. For flat regions with a radius of curvature R > 50 mm, the window width is set to 5 points before and after (approximately 1 mm span); for regions with abrupt changes in radius of curvature R < 10 mm (such as the R angle of a lens edge), the window width automatically shrinks to 2 points before and after to ensure that local features are not smoothed. When the radius of curvature R The window width is set to 3 points at the front and 3 at the back; when the radius of curvature R The window width is set to 4 points at the front and 4 at the back; when the radius of curvature R Set the window width to 5 points at the front and back; Assuming in The condition number of the Jacobian matrix calculated by the point is = 80. In the previous neighboring points Place In the later neighboring points Place The increase in arc length between adjacent points =0.02mm. The rate of change was calculated using the central difference method. mm. Subsequently, the trajectory was extracted in The unit tangent vector t of the point. The scalar rate of change 50 / mm is combined with the direction of the tangent vector and projected onto the actual trajectory direction. If the calculated gradient value is positive and large (e.g., >100 / mm), it indicates that the tool is rapidly climbing along the "condition number slope". Even if the current condition number has not exceeded the limit, the system will determine that there is a "cliff-like" kinematic risk ahead and thus intervene in control in advance.

[0039] This embodiment introduces the higher-order metric of "condition number spatial gradient," endowing the path planning algorithm with "predictive" capabilities. Traditional threshold methods can only issue an alarm after entering the singularity zone, often too late, leading to motor overload. The gradient method can identify the spatial growth rate of the condition number, effectively distinguishing between "slowly entering the singularity zone" and "rapidly colliding with the singularity zone," thus providing a more forward-looking physical basis for subsequent adaptive speed planning and threshold adjustment, significantly improving the safety of the processing.

[0040] Furthermore, the calculation of the rate at which the tool axis attitude approaches the singular region by combining the angle between the feed rate and the gradient direction, and the adaptive adjustment of the warning threshold based on the rate, includes: Extract the unit tangent vector of the tool trajectory at the current tool position point as the feed direction; extract the unit direction vector of the condition number spatial gradient as the gradient direction; calculate the angle between the feed direction and the gradient direction; multiply the current feed rate by the cosine of the angle to obtain the projection component of the feed rate along the gradient direction; multiply the projection component by the magnitude of the condition number gradient to obtain the approach rate; set a baseline warning threshold and a rate gain coefficient; calculate a dynamic warning threshold based on the baseline warning threshold and the approach rate; mark the current tool position point as a singular sensitive point when the condition number exceeds the dynamic warning threshold.

[0041] Specifically, when identifying singularities, a single fixed threshold often fails to balance processing efficiency and safety. This embodiment employs a dynamic adaptive threshold strategy. The system sets a baseline warning threshold. = 50, rate gain coefficient This is used to convert the approach rate into a threshold adjustment. For the 13000th tool position, the current feed rate F is set to 3000 mm / min. The system first extracts the unit tangent vector T (i.e., the feed direction) of the tool trajectory at that point, and the condition number gradient direction vector G (i.e., the direction in which the condition number grows the fastest), with an angle between them. If the tool is moving directly towards the center of the singularity along the gradient direction (i.e., the angle between T and G) ), at this time cos( = 1. The projected component of the feed rate in the gradient direction is 3000 mm / min. Assuming the rate of change of the condition number (the first derivative of the condition number with respect to the arc length) along the trajectory direction is 0.1 (1 / mm), then the approach rate... = 3000 × 1 × 0.1 = 300 (1 / min). The system calculates the dynamic threshold. Among them, the rate gain coefficient = 0.5 (min); After calculating the approach rate, the system lowers the threshold or adds a sensitivity marker. For example, when the tool is found to be rapidly approaching the singular region at a high speed (2000 mm / min) and a small angle (15 degrees), the original threshold of 50 is deemed insufficient to cope with the impending acceleration change. The system uses an algorithm to lower the threshold for determining that point as a "singular sensitive point," or directly makes a judgment based on the dynamic threshold calculated by the rate (such as adjusting it to 30).

[0042] The actual data shows that: in the lens edge region, although the condition number reaches 60, the approach rate is close to 0 because the tool is tangentially passing through the singularity (angle 90 degrees), so the system does not mark it as a sensitive point, thus avoiding unnecessary speed reduction; while at the lens apex, although the current condition number is only 40, the tool is rushing towards the extreme point at full speed, so the system marks it as a sensitive point in advance and starts the optimization program.

[0043] This embodiment introduces the "approach rate," a metric combining dynamics and geometry, overcoming the limitations of the static threshold method. By combining feed rate and directional angle, this method can distinguish between two distinct operating conditions: "passing through a singularity zone" and "rushing into a singularity zone." For high-speed approach to a singularity, it can provide early warning, allowing the servo system sufficient response and deceleration time. For tangential passage, it avoids processing interruptions or unnecessary trajectory reconstruction caused by false alarms, thereby maximizing processing efficiency while ensuring processing safety.

[0044] Furthermore, the identification of singular sensitive segments formed by continuous singular sensitive points along the tool path includes: The scanning begins from the starting point of the toolpath trajectory; when the first singular sensitive point is detected, it is recorded as the starting point of the sensitive segment; the scanning continues until a preset number of non-singular sensitive points appear consecutively, at which point the previous singular sensitive point is recorded as the ending point of the sensitive segment; the identified singular sensitive segments are merged, and when the interval between two sensitive segments is less than a preset interval threshold and the average value of the condition number of the interval segment is greater than a preset judgment threshold, the two sensitive segments and the interval segment are merged into one sensitive segment; the boundary of the merged sensitive segment is extended.

[0045] Specifically: After generating a sequence of tool points labeled with "sensitive / insensitive" attributes, the system begins scanning from the trajectory start point. Assuming the first sensitive point with an excessive condition number is detected at point 2000, the system records it as the sensitive segment start point S_start. As the scan continues until point 2050, if the system detects 20 consecutive (preset number) insensitive points, then point 2049 is determined as the natural end point of that segment.

[0046] However, on complex curved surfaces, singular regions often appear intermittently. For example, points 2000-2050 constitute the first sensitive region, and points 2060-2100 constitute the second sensitive region. There is only a 10-point interval (approximately 0.5mm arc length) between them. Processing them separately would cause frequent acceleration and deceleration of the machine tool. This system sets an interval threshold of 50 points (or 2mm), and although the detected 10 points within this interval do not exceed the threshold, their average condition number is still as high as 45 (the preset judgment threshold is 40). Therefore, the system performs a merging operation, combining points 2000 to 2100 into a single complete "singular sensitive segment."

[0047] The preset quantity is used to determine the termination condition of the singular sensitive segment, and its value is related to the tool position spacing and the target smooth transition length. In a typical mold finishing scenario, the number of tool positions corresponding to several servo sampling cycles can be selected so that each singular sensitive segment covers at least one tool position interval that causes significant fluctuations in the rotary axis angular velocity. The preset interval threshold is used to limit the maximum interval arc length between adjacent sensitive segments, and its value usually does not exceed the minimum uniform feed distance of the tool when maintaining a stable cutting state. The preset judgment threshold is used to characterize the degree to which the interval segment as a whole is in a high condition number region. When the average condition number of the interval segment is higher than the judgment threshold, it is considered that the two sensitive segments are still in a kinematically ill-conditioned region and should be merged.

[0048] Subsequently, the system extends the boundaries of the merged sensitive segments by 10 knife points forward and backward to ensure a smooth optimization transition. The final identified sensitive segments cover the entire process from entering the singular influence zone to completely leaving it.

[0049] Figure 2 This is a schematic diagram of the singular sensitive region identification process based on condition number gradient and approach rate; Furthermore, the calculation of the angular travel of the rotation axis from the starting point to the ending point within the sensitive segment and its uniform distribution according to the arc length parameter includes: Inverse kinematics is performed on the starting and ending tool positions of the singular sensitive segment to obtain the starting and ending rotation axis angles. The difference between the ending and starting rotation axis angles is calculated as the angular travel. The cumulative arc length from each tool position to the starting point of the sensitive segment is calculated. The cumulative arc length is divided by the total arc length of the sensitive segment to obtain the arc length ratio. The angular travel is linearly distributed to each tool position according to the arc length ratio. Boundary constraint checks are performed on the uniform distribution results.

[0050] Specifically: For the peculiar sensitive segment of approximately 15mm in length identified in the aforementioned steps, the system needs to reconstruct the motion of its internal rotation axis. Assume that the C-axis angle corresponding to the starting point P_start of this sensitive segment is 10°, and the C-axis angle corresponding to the ending point P_end is -10° (i.e., the tool crosses a flip range of the C-axis within this segment).

[0051] The system first calculates the total angular travel of this segment using inverse kinematics. °.

[0052] Next, the system iterates through each tool position point within the sensitive segment. Calculate the cumulative arc length S_k from the starting point. Assume the total arc length of the sensitive segment is S_total = 15mm, and a certain intermediate point... The cumulative arc length is 7.5mm, then its arc length percentage is... = 7.5 / 15 = 0.5.

[0053] The system distributes the C-axis angle in a linear proportion. =10°+0.5×(-20°)=0°.

[0054] In this way, the system generates an ideal reference angle sequence that varies linearly with the arc length. The same process is performed for the A-axis. After allocation, the system also performs boundary constraint checks to ensure that the calculated intermediate angles do not exceed the machine tool's soft limits (e.g., the C-axis travel range ±360°). This linearized angle sequence serves as the initial value for subsequent Sequential Quadratic Programming (SQP) optimization, significantly reducing the risk of the optimization algorithm getting trapped in local minima.

[0055] This embodiment utilizes arc length parameterization to solve the common problem of "non-uniform motion of rotary axes" in five-axis machining. Near singular regions, minute spatial displacements often correspond to drastic angular changes (extremely strong nonlinearity). This method forces the total stroke of the rotary axis to be uniformly "spread" across the entire arc length of the machining path, eliminating the root cause of abrupt changes in angular velocity at a geometric level. This not only provides a good initial solution for subsequent dynamic optimization but also ensures that the final generated tool axis motion has natural geometric smoothness, preventing the machine tool from experiencing violent wobbling over short distances.

[0056] Furthermore, the establishment of the hierarchical constraint optimization model and the solution using a sequential quadratic programming algorithm includes: The optimization objective is set to minimize the sum of the squares of the changes in angular acceleration of the rotation axes between all adjacent tool points within the singular sensitive segment; the first constraint is set to ensure that the absolute value of the angular acceleration of each rotation axis does not exceed the physical limit of angular acceleration calibrated by the machine tool; the second constraint is set to ensure that the forward tilt angle of the optimized rotation axis angle is within the feasible region of the forward tilt angle and the side tilt angle is within the feasible region of the side tilt angle; the sequential quadratic programming algorithm is used to solve the problem iteratively.

[0057] Specifically: For the identified singular sensitive segment (containing about 300 tool points) with a length of about 15 mm, the system constructs a hierarchical optimization model; when calculating the angular acceleration and its change in the offline solution model, the discrete time step is obtained by dividing the spatial distance between adjacent tool points by the time obtained by setting the feed rate. First constraint (physical limit): Set the maximum angular acceleration of the machine tool's A-axis to 200°. The maximum angular acceleration along the C-axis is 200. This is a hard constraint; no optimization result may exceed this physical boundary to prevent motor overload.

[0058] The second layer of constraints (geometric interference): This embodiment uses the local conical envelope method to generate an interference-free feasible region to establish the boundary conditions for the tool axis orientation. The specific calculation steps are as follows: 1. Feature Extraction: Obtain the unit normal vector of the workpiece surface at the current tool position point. ; 2. Set parameters: Based on the geometric parameters of the selected ball end mill, including the shank radius. With the effective overhang length of the tool , and the local curvature of the workpiece surface; 3. Calculate the cone angle: Define the maximum allowable tilt angle. The calculation formula is: =arccos( / )- ;in, This is a preset safety margin, for example (2°). 4. Construct constraints: The optimized tool axis vector... Restricted to normal vector Centered on, with half-vertical angle as Within the cone, this is expressed in the mathematical model as inequality constraints. ; Based on the above calculation method, in this embodiment, the feasible range of the tool axis forward tilt angle is [-5°, 5°], and the feasible range of the side tilt angle is [-3°, 3°]. This is to ensure that when adjusting the tool axis to avoid singularities, there will be no collision between the tool holder and the mold, and the cutting conditions will not be significantly changed.

[0059] Optimization objective: Minimize the sum of squares of the changes in rotational angular acceleration between adjacent tool positions within the sensitive segment. Mathematically expressed as... .

[0060] The system employs a sequential quadratic programming (SQP) algorithm for iterative solution. During the initial iterations, the C-axis may experience abrupt shifts from 0° to 180° near singular points. The SQP algorithm, while satisfying the tilt / roll angle constraints, distributes these abrupt shifts across the entire sensitive segment's 300 points by fine-tuning the tool axis vector at each point.

[0061] After approximately 50 iterations of convergence, the optimized trajectory shows that the peak C-axis angular velocity in the original trajectory decreased from 1200. Reduced to 150 The peak angular acceleration is 5000 Reduced to 180 (Within this constraint). Although the tool axis posture is slightly deflected relative to the original command (e.g., by 1.5 degrees), this deflection is strictly controlled within the interference-free feasible region, and the rotation axis motion is extremely smooth.

[0062] This embodiment cleverly balances the machine tool's physical capabilities with the process geometry requirements through a hierarchical constraint optimization model. Traditional smoothing methods often sacrifice accuracy for smoothness, or cause machine tool overshoot in order to maintain accuracy. This method uses angular acceleration as the core optimization objective and leverages the powerful optimization capability of the SQP algorithm to find the optimal motion solution.

[0063] Furthermore, the compensation method of fine-tuning the tool position point in the normal direction of the curved surface when the deviation between the synthesized tool axis posture and the original posture exceeds the tolerance includes: The optimized rotation axis angle sequence is synthesized into a tool axis posture sequence through forward kinematics transformation; the angular deviation between the synthesized tool axis posture sequence and the original tool axis posture sequence is calculated; a posture deviation tolerance is set; when the angular deviation exceeds the tolerance, tool position compensation is initiated; the unit normal vector of the surface at the current tool position is extracted; the tool position is fine-tuned along the direction of the normal vector; the rotation axis angle is recalculated for the fine-tuned tool position and the tool axis posture is synthesized in the forward direction; the fine-tuning amount is iteratively adjusted until the angular deviation between the synthesized posture and the original posture is less than the tolerance.

[0064] Specifically: After obtaining a smooth sequence of rotation axis angles through Sequential Quadratic Programming (SQP), the system performs positive validation. The optimized angles (e.g., Substituting into the forward kinematics equations, a new tool axis vector is synthesized. .

[0065] Assuming at a certain finishing point on the lens surface, the original tool axis vector is... = (0, 0, 1), while the optimized and smoothed composite vector is = (0.001, 0, 0.9999995). The system calculates the angular deviation between the two. =arccos( , ).

[0066] The set attitude deviation tolerance is 0.05°. If the calculated deviation at a certain point reaches 0.08°, exceeding the allowable range, the system will activate the compensation mechanism.

[0067] The system extracts the surface unit normal vector n = (0.5, 0.5, 0.707) at the tool position point. To correct attitude errors while maintaining smooth rotation, the system fine-tunes the spatial coordinates (X, Y, Z) of the tool position point along the normal vector direction. = 1μm (0.001mm). The fine-tuned new coordinates are fed into the inverse kinematics solution, and the rotation axis angle is recalculated by combining the optimized smoothing trend constraint.

[0068] The system repeats the iterative process of "fine-tuning - calculation - verification" to adjust the fine-tuning amount. This process continues until the deviation between the synthesized posture and the original command converges to within 0.05°. In actual testing, typically 2-3 iterations are needed to control the geometric error within the tolerance zone allowed by precision mold machining without compromising the smoothness of the axis motion.

[0069] This embodiment cleverly resolves the contradiction between "motion smoothness" and "trajectory fidelity" through this compensation mechanism. In five-axis machining, forcibly smoothing the rotating axis often causes the tool axis to deviate from the design direction, resulting in overcutting or undercutting. This embodiment utilizes the geometric redundancy characteristics of ball end mills in curved surface machining, actively eliminating attitude errors caused by angle optimization through minute positional compensation along the normal direction. This ensures that the final machining result has both excellent surface finish (thanks to smooth axis motion) and strictly meets the geometric accuracy requirements of the CAD model.

[0070] Furthermore, the servo synchronous interpolation and real-time following error monitoring in the online control phase includes: The optimized machining trajectory is loaded into the CNC system; servo cycle parameters are read from the CNC system; the spatial distance between adjacent tool positions is calculated and divided by the current feed rate to obtain the tool travel time; the travel time is divided by the servo cycle to obtain the number of servo sampling points; the spline interpolation order is adaptively selected based on the comparison result of the number of sampling points and a preset threshold; a mapping table of rotary axis angle and time is generated discretely in the time domain according to the servo sampling cycle as the planned angle position sequence; during machining execution, the actual angle position sequence fed back by the rotary axis encoder is acquired through the CNC system interface; the absolute value of the difference between the actual angle position sequence and the planned angle position sequence is calculated as the following error sequence; when the mean of the following error exceeds the preset error threshold, the spline tension coefficient of the next interpolation segment is adjusted.

[0071] Specifically, the offline optimized trajectory is loaded into the Siemens 840D SL CNC system. During machining execution, the system reads the servo cycle parameters. = 2ms.

[0072] Adaptive interpolation: Calculating the physical distance between two adjacent planned tool positions as 0.2 mm and the feed rate as 3000 mm / min, the transit time t = 0.2 / (3000 / 60) = 0.004 s = 4 ms. This means that there are 4 ms / 2 ms = 2 servo sampling points between each two tool positions. Since the number of sampling points is relatively small (<5), the system adaptively selects low-order (e.g., 3rd order) spline interpolation to avoid high-order oscillations; when the number of sampling points is not less than 5, a 5th order B-spline is used.

[0073] Real-time tension adjustment: The system acquires the actual position feedback from the rotary axis grating ruler in real time through the NC kernel interface. Assume that when machining to the lens R-angle, the average C-axis following error suddenly increases to 8μm (preset threshold 5μm). This indicates that the physical axis lags behind the planned command. The system immediately triggers the feedback mechanism to self-tune the B-spline tension coefficient of the next interpolation segment. The spline tension coefficient is a control parameter used to adjust the trade-off between the smoothness of the interpolation curve and the actual trajectory following accuracy. The specific adjustment is as follows: ;in, The tension coefficient for the next interpolation segment. For the current tension coefficient, This represents the average of the actual following errors; This is a preset error threshold; Adjust the gain for tension; Data logging: Simultaneously, the system records the optimized condition number, angular acceleration, and real-time tracking error to a CSV log at a frequency of 2ms for subsequent quality traceability. Actual test data shows that after adopting this online control strategy, the final processed lens surface contour error is stabilized within 3μm, and there are no visible tool marks on the surface.

[0074] This invention breaks down the information barriers between offline planning and online control. In traditional methods, once the offline-planned path is input into the machine tool, the CNC system can only passively execute it. The online control strategy proposed in this embodiment enables the CNC system to dynamically adjust the order of the interpolation algorithm and tension parameters based on real-time servo sampling density and physical following error. This "sensor-response" mechanism endows the machining process with extremely strong robustness, effectively resisting disturbances such as cutting force fluctuations and frictional changes, ensuring a high degree of consistency between the geometric accuracy and surface quality of the final part.

[0075] Example 2: A surface path planning method for five-axis CNC machine tool machining includes: Offline planning phase: Read the tool position file and extract the tool position sequence and tool axis posture sequence; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through machine tool kinematics, generating the initial machining trajectory; establish the machine tool rotary axis Jacobian matrix for the current tool position and calculate the condition number; calculate the spatial gradient of the condition number along the tool position trajectory direction; calculate the rate at which the tool axis posture approaches the singular region by combining the angle between the feed rate and the gradient direction; adaptively adjust the warning threshold according to the rate, and mark the tool position as a singular sensitive point when the condition number exceeds the threshold; along the tool... The position trajectory identifies singular sensitive segments formed by continuous singular sensitive points, calculates the angular travel of the rotary axis from the start point to the end point within the sensitive segment, and uniformly distributes the angular travel according to the arc length parameter. A hierarchical constraint optimization model is established, with the first constraint being that the angular acceleration of the rotary axis does not exceed the physical limit of the machine tool, and the second constraint being that the forward tilt angle and the side tilt angle of the tool axis satisfy the interference-free feasible region. The optimized rotary axis angle sequence is solved using a sequential quadratic programming algorithm, and the tool axis posture is synthesized in the forward direction. When the deviation between the synthesized tool axis posture and the original posture exceeds the tolerance, the tool position point is finely adjusted in the normal direction of the surface to compensate, thus obtaining the optimized machining trajectory. In the online control phase: the optimized machining trajectory is loaded into the CNC system; the number of servo sampling points between adjacent tool positions is calculated; the spline interpolation order is adaptively selected according to the number of sampling points, and a mapping table of rotation axis angle and time is generated discretely according to the servo sampling cycle; during the machining process, the actual position of the rotation axis is collected and the following error with the planned position is calculated; when the following error exceeds the error threshold, the spline tension coefficient of the next interpolation segment is self-tuned and adjusted.

[0076] Furthermore, the generation of the initial processing trajectory includes: Read the toolpath file for surface machining; extract the tool position sequence from the toolpath file, the tool position sequence being the spatial coordinates of the tool center point of each tool position in the workpiece coordinate system; extract the tool axis posture sequence from the toolpath file, the tool axis posture sequence being the spatial direction of the tool axis at each tool position point; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through inverse kinematics of the machine tool; the tool position sequence and tool axis posture sequence in the workpiece coordinate system, and the linear axis position sequence and rotary axis angle sequence in the machine tool coordinate system together constitute the initial machining trajectory.

[0077] Furthermore, the step of establishing the machine tool rotation axis Jacobian matrix and calculating the condition number for the current tool position includes: Establish the kinematic mapping relationship between the tool axis posture and the rotation axis angle based on the machine tool rotation axis configuration; calculate the partial derivative of the kinematic mapping relationship to obtain the Jacobian matrix of the tool axis posture relative to the rotation axis angle; perform singular value decomposition on the Jacobian matrix to extract the maximum singular value and the minimum singular value; calculate the ratio of the maximum singular value to the minimum singular value as the condition number.

[0078] Furthermore, the spatial gradient of the calculated condition number along the tool path direction includes: Neighboring tool points are selected before and after the current tool point to form a neighborhood window. The width of the neighborhood window is adjusted according to the local curvature of the tool trajectory. The rate of change of the condition number between the preceding and following neighboring tool points is calculated using the central difference method. The rate of change is divided by the corresponding arc length increment to obtain the condition number gradient. The condition number gradient is projected onto the unit tangent vector direction of the tool trajectory to obtain the spatial gradient of the condition number along the trajectory direction.

[0079] Furthermore, the calculation of the rate at which the tool axis attitude approaches the singular region by combining the angle between the feed rate and the gradient direction, and the adaptive adjustment of the warning threshold based on the rate, includes: Extract the unit tangent vector of the tool trajectory at the current tool position point as the feed direction; extract the unit direction vector of the condition number spatial gradient as the gradient direction; calculate the angle between the feed direction and the gradient direction; multiply the current feed rate by the cosine of the angle to obtain the projection component of the feed rate along the gradient direction; multiply the projection component by the magnitude of the condition number gradient to obtain the approach rate; set a baseline warning threshold and a rate gain coefficient; calculate a dynamic warning threshold based on the baseline warning threshold and the approach rate; mark the current tool position point as a singular sensitive point when the condition number exceeds the dynamic warning threshold.

[0080] Furthermore, the identification of singular sensitive segments formed by continuous singular sensitive points along the tool path includes: The scanning begins from the starting point of the toolpath trajectory; when the first singular sensitive point is detected, it is recorded as the starting point of the sensitive segment; the scanning continues until a preset number of non-singular sensitive points appear consecutively, at which point the previous singular sensitive point is recorded as the ending point of the sensitive segment; the identified singular sensitive segments are merged, and when the interval between two sensitive segments is less than a preset interval threshold and the average value of the condition number of the interval segment is greater than a preset judgment threshold, the two sensitive segments and the interval segment are merged into one sensitive segment; the boundary of the merged sensitive segment is extended.

[0081] Furthermore, the calculation of the angular travel of the rotation axis from the starting point to the ending point within the sensitive segment and its uniform distribution according to the arc length parameter includes: Inverse kinematics is performed on the starting and ending tool positions of the singular sensitive segment to obtain the starting and ending rotation axis angles. The difference between the ending and starting rotation axis angles is calculated as the angular travel. The cumulative arc length from each tool position to the starting point of the sensitive segment is calculated. The cumulative arc length is divided by the total arc length of the sensitive segment to obtain the arc length ratio. The angular travel is linearly distributed to each tool position according to the arc length ratio. Boundary constraint checks are performed on the uniform distribution results.

[0082] Furthermore, the establishment of the hierarchical constraint optimization model and the solution using a sequential quadratic programming algorithm includes: The optimization objective is set to minimize the sum of the squares of the changes in angular acceleration of the rotation axes between all adjacent tool points within the singular sensitive segment; the first constraint is set to ensure that the absolute value of the angular acceleration of each rotation axis does not exceed the physical limit of angular acceleration calibrated by the machine tool; the second constraint is set to ensure that the forward tilt angle of the optimized rotation axis angle is within the feasible region of the forward tilt angle and the side tilt angle is within the feasible region of the side tilt angle; the sequential quadratic programming algorithm is used to solve the problem iteratively.

[0083] Furthermore, the compensation method of fine-tuning the tool position point in the normal direction of the curved surface when the deviation between the synthesized tool axis posture and the original posture exceeds the tolerance includes: The optimized rotation axis angle sequence is synthesized into a tool axis posture sequence through forward kinematics transformation; the angular deviation between the synthesized tool axis posture sequence and the original tool axis posture sequence is calculated; a posture deviation tolerance is set; when the angular deviation exceeds the tolerance, tool position compensation is initiated; the unit normal vector of the surface at the current tool position is extracted; the tool position is fine-tuned along the direction of the normal vector; the rotation axis angle is recalculated for the fine-tuned tool position and the tool axis posture is synthesized in the forward direction; the fine-tuning amount is iteratively adjusted until the angular deviation between the synthesized posture and the original posture is less than the tolerance.

[0084] Furthermore, the servo synchronous interpolation and real-time following error monitoring in the online control phase includes: The optimized machining trajectory is loaded into the CNC system; servo cycle parameters are read from the CNC system; the spatial distance between adjacent tool positions is calculated and divided by the current feed rate to obtain the tool travel time; the travel time is divided by the servo cycle to obtain the number of servo sampling points; the spline interpolation order is adaptively selected based on the comparison result of the number of sampling points and a preset threshold; a mapping table of rotary axis angle and time is generated discretely in the time domain according to the servo sampling cycle as the planned angle position sequence; during machining execution, the actual angle position sequence fed back by the rotary axis encoder is acquired through the CNC system interface; the absolute value of the difference between the actual angle position sequence and the planned angle position sequence is calculated as the following error sequence; when the mean of the following error exceeds the preset error threshold, the spline tension coefficient of the next interpolation segment is adjusted.

[0085] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for surface path planning for machining with a five-axis NC machine tool, characterized in that, include: Offline planning phase: Read the tool position file and extract the tool position sequence and tool axis posture sequence; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through machine tool kinematics, generating the initial machining trajectory; establish the machine tool rotary axis Jacobian matrix for the current tool position and calculate the condition number; calculate the spatial gradient of the condition number along the tool position trajectory direction; calculate the rate at which the tool axis posture approaches the singular region by combining the angle between the feed rate and the gradient direction; adaptively adjust the warning threshold according to the rate, and mark the tool position as a singular sensitive point when the condition number exceeds the threshold; along the tool... The position trajectory identifies singular sensitive segments formed by continuous singular sensitive points, calculates the angular travel of the rotary axis from the start point to the end point within the sensitive segment, and uniformly distributes the angular travel according to the arc length parameter. A hierarchical constraint optimization model is established, with the first constraint being that the angular acceleration of the rotary axis does not exceed the physical limit of the machine tool, and the second constraint being that the forward tilt angle and the side tilt angle of the tool axis satisfy the interference-free feasible region. The optimized rotary axis angle sequence is solved using a sequential quadratic programming algorithm, and the tool axis posture is synthesized in the forward direction. When the deviation between the synthesized tool axis posture and the original posture exceeds the tolerance, the tool position point is finely adjusted in the normal direction of the surface to compensate, thus obtaining the optimized machining trajectory. Online control phase: The optimized machining trajectory is loaded into the CNC system; Calculate the number of servo sampling points between adjacent tool positions; adaptively select the spline interpolation order based on the number of sampling points, and generate a mapping table of rotation axis angle and time discretely according to the servo sampling cycle; collect the actual position of the rotation axis during the machining process and calculate the following error with the planned position; when the following error exceeds the error threshold, perform self-tuning adjustment on the spline tension coefficient of the next interpolation segment.

2. The method of claim 1, wherein: The generation of the initial processing trajectory includes: Read the toolpath file for surface machining; extract the tool position sequence from the toolpath file, the tool position sequence being the spatial coordinates of the tool center point of each tool position in the workpiece coordinate system; extract the tool axis posture sequence from the toolpath file, the tool axis posture sequence being the spatial direction of the tool axis at each tool position point; convert the tool position sequence and tool axis posture sequence into a linear axis position sequence and a rotary axis angle sequence in the machine tool coordinate system through inverse kinematics of the machine tool; the tool position sequence and tool axis posture sequence in the workpiece coordinate system, and the linear axis position sequence and rotary axis angle sequence in the machine tool coordinate system together constitute the initial machining trajectory.

3. The method of claim 1, wherein: The step of establishing the machine tool rotation axis Jacobian matrix and calculating the condition number for the current tool position includes: Establish the kinematic mapping relationship between the tool axis posture and the rotation axis angle based on the machine tool rotation axis configuration; calculate the partial derivative of the kinematic mapping relationship to obtain the Jacobian matrix of the tool axis posture relative to the rotation axis angle; perform singular value decomposition on the Jacobian matrix to extract the maximum singular value and the minimum singular value; calculate the ratio of the maximum singular value to the minimum singular value as the condition number.

4. The surface path planning method for five-axis CNC machine tool machining according to claim 1, characterized in that: The calculation of the spatial gradient of the condition number along the tool path direction includes: Neighboring tool points are selected before and after the current tool point to form a neighborhood window. The width of the neighborhood window is adjusted according to the local curvature of the tool trajectory. The rate of change of the condition number between the preceding and following neighboring tool points is calculated using the central difference method. The rate of change is divided by the corresponding arc length increment to obtain the condition number gradient. The condition number gradient is projected onto the unit tangent vector direction of the tool trajectory to obtain the spatial gradient of the condition number along the trajectory direction.

5. The surface path planning method for five-axis CNC machine tool machining according to claim 1, characterized in that: The calculation of the rate at which the tool axis attitude approaches the singular region by combining the angle between the feed rate and the gradient direction, and the adaptive adjustment of the warning threshold based on the rate, include: Extract the unit tangent vector of the tool trajectory at the current tool position point as the feed direction; extract the unit direction vector of the condition number spatial gradient as the gradient direction; calculate the angle between the feed direction and the gradient direction; multiply the current feed rate by the cosine of the angle to obtain the projection component of the feed rate along the gradient direction; multiply the projection component by the magnitude of the condition number gradient to obtain the approach rate; calculate the dynamic warning threshold based on the baseline warning threshold and the approach rate; when the condition number exceeds the dynamic warning threshold, mark the current tool position point as a singular sensitive point.

6. The surface path planning method for five-axis CNC machine tool machining according to claim 1, characterized in that: The identification of singular sensitive segments formed by continuous singular sensitive points along the tool path includes: The scanning begins from the starting point of the toolpath trajectory; when the first singular sensitive point is detected, it is recorded as the starting point of the sensitive segment; the scanning continues until a preset number of non-singular sensitive points appear consecutively, at which point the previous singular sensitive point is recorded as the ending point of the sensitive segment; the identified singular sensitive segments are merged, and when the interval between two sensitive segments is less than a preset interval threshold and the average value of the condition number of the interval segment is greater than a preset judgment threshold, the two sensitive segments and the interval segment are merged into one sensitive segment; the boundary of the merged sensitive segment is extended.

7. The surface path planning method for five-axis CNC machine tool machining according to claim 1, characterized in that: The calculation of the angular travel of the rotation axis from the starting point to the ending point within the sensitive segment and its uniform distribution according to the arc length parameter includes: Inverse kinematics is performed on the starting and ending tool positions of the singular sensitive segment to obtain the starting and ending rotation axis angles. The difference between the ending and starting rotation axis angles is calculated as the angular travel. The cumulative arc length from each tool position to the starting point of the sensitive segment is calculated. The cumulative arc length is divided by the total arc length of the sensitive segment to obtain the arc length ratio. The angular travel is linearly distributed to each tool position according to the arc length ratio. Boundary constraint checks are performed on the uniform distribution results.

8. The surface path planning method for five-axis CNC machine tool machining according to claim 1, characterized in that: The establishment of the hierarchical constraint optimization model and its solution using the sequential quadratic programming algorithm includes: The optimization objective is set to minimize the sum of the squares of the changes in angular acceleration of the rotation axes between all adjacent tool points within the singular sensitive segment; the first constraint is set to ensure that the absolute value of the angular acceleration of each rotation axis does not exceed the physical limit of angular acceleration calibrated by the machine tool; the second constraint is set to ensure that the forward tilt angle of the optimized rotation axis angle is within the feasible region of the forward tilt angle and the side tilt angle is within the feasible region of the side tilt angle; the sequential quadratic programming algorithm is used to solve the problem iteratively.

9. The surface path planning method for five-axis CNC machine tool machining according to claim 1, characterized in that: The step of compensating for deviations between the synthesized tool axis posture and the original posture exceeding the tolerance by finely adjusting the tool position in the normal direction of the surface includes: The optimized rotation axis angle sequence is synthesized into a tool axis posture sequence through forward kinematics transformation; the angular deviation between the synthesized tool axis posture sequence and the original tool axis posture sequence is calculated; a posture deviation tolerance is set; when the angular deviation exceeds the tolerance, tool position compensation is initiated; the unit normal vector of the surface at the current tool position is extracted; the tool position is fine-tuned along the direction of the normal vector; the rotation axis angle is recalculated for the fine-tuned tool position and the tool axis posture is synthesized in the forward direction; the fine-tuning amount is iteratively adjusted until the angular deviation between the synthesized posture and the original posture is less than the tolerance.

10. The surface path planning method for five-axis CNC machine tool machining according to claim 1, characterized in that: The servo synchronous interpolation and real-time following error monitoring in the online control phase includes: The optimized machining trajectory is loaded into the CNC system; servo cycle parameters are read from the CNC system; the spatial distance between adjacent tool positions is calculated and divided by the current feed rate to obtain the tool travel time; the travel time is divided by the servo cycle to obtain the number of servo sampling points; the spline interpolation order is adaptively selected based on the comparison result of the number of sampling points and a preset threshold; a mapping table of rotary axis angle and time is generated discretely in the time domain according to the servo sampling cycle as the planned angle position sequence; during machining execution, the actual angle position sequence fed back by the rotary axis encoder is acquired through the CNC system interface; the absolute value of the difference between the actual angle position sequence and the planned angle position sequence is calculated as the following error sequence; when the mean of the following error exceeds the preset error threshold, the spline tension coefficient of the next interpolation segment is adjusted.