Track planning method and device for machine tool, equipment and medium

By parsing and segmenting the G-code trajectory files of CNC machine tools, and combining smooth transition and speed planning, the problems of low efficiency, poor accuracy and large vibration caused by small line segments in CNC machine tools are solved, and efficient and accurate trajectory planning is achieved.

CN121559981AActive Publication Date: 2026-02-24YOUJI TECH (SHANGHAI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202610099700.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-26
Publication Date
2026-02-24
Estimated Expiration
2046-01-26

AI Technical Summary

Technical Problem

Existing CNC machine tool trajectory planning methods suffer from low processing efficiency, poor accuracy, and large vibrations due to the large number of tiny line segments. Furthermore, they are not accurate when dealing with asynchronous joint movements.

Method used

By parsing the G-code trajectory file of the CNC machine tool, intermediate trajectory instructions are generated, the directional angle and theoretical speed change are calculated, trajectory segmentation and merging are performed, joint space trajectory is constructed, and smooth transition and speed planning are carried out to generate machine tool control instructions that meet kinematic and geometric accuracy constraints.

Benefits of technology

It significantly reduces the number of tiny line segments, improves machining accuracy and efficiency, eliminates acceleration abrupt changes, avoids machine tool vibration, and achieves a smooth machining process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121559981A_ABST
    Figure CN121559981A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent manufacturing, in particular to a trajectory planning method and device for a machine tool, equipment and a medium. The method comprises the following steps: analyzing a G code track file of the numerical control machine tool to generate a middle track instruction; in a Cartesian space trajectory represented by the intermediate trajectory instruction, calculating a direction included angle and a theoretical speed variation according to the pose parameter and the motion parameter; according to the direction included angle and the theoretical speed variation, dividing the trajectory points into segmentation points or merging points so as to perform trajectory segmentation and merging processing on the Cartesian space trajectory; based on the Cartesian space trajectory subjected to trajectory segmentation and merging processing, a joint space trajectory is constructed through discrete and inverse solution processing; and performing smooth transition processing and speed planning processing on the joint space trajectory to generate a machine tool control instruction. Compared with the prior art, the problems that a track planning method is low in machining efficiency, poor in precision and large in vibration in machine tool application are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent manufacturing technology, and in particular to a trajectory planning method, apparatus, equipment and medium for machine tools. Background Technology

[0002] CNC machining is one of the fundamental processes in modern mechanical manufacturing. Modern CAM (Computer-Aided Manufacturing) software, when programming the machining of complex three-dimensional curved surface models (such as automotive molds and aircraft blades), typically discretizes continuous curves into numerous tiny straight line segments and arc segments. If the CNC system simply executes these tiny line segments segment by segment, it leads to frequent acceleration and deceleration of the machine tool, resulting in reduced machining efficiency, compromised machining accuracy, and even severe machine tool vibration, affecting the quality of the machined surface. Therefore, it is essential to plan the CNC machine tool machining trajectory, transforming the discrete path into a smooth, continuous trajectory with stable acceleration.

[0003] Trajectory planning generally includes two processes: trajectory smoothing and velocity planning. Although there are existing trajectory planning methods in other fields, applying these methods to CNC machine tools can lead to asynchronous joint movements, resulting in poor accuracy. Furthermore, because CNC machine tool control involves numerous small line segments, directly applying velocity planning methods can also cause problems such as discontinuous acceleration and frequent acceleration / deceleration.

[0004] Therefore, how to design a trajectory planning method that can be applied to machine tool control while ensuring control accuracy has become an urgent problem to be solved. Summary of the Invention

[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, this application provides a trajectory planning method, device, equipment and medium for machine tools. The main purpose is to solve the problems of low processing efficiency, poor accuracy and large vibration of the machine tool due to the large number of small line segments when the current trajectory planning method is applied in the field of machine tools.

[0006] To achieve the above objectives, the main technical solutions adopted in this application include:

[0007] In a first aspect, embodiments of this application provide a trajectory planning method for a machine tool, comprising:

[0008] The G-code trajectory file of the CNC machine tool is parsed to generate intermediate trajectory instructions; the intermediate trajectory instructions are used to represent the pose parameters of the trajectory point in Cartesian space and the coordinate parameters in joint space, as well as the motion parameters at the trajectory point.

[0009] In the Cartesian space trajectory represented by the intermediate trajectory command, based on the pose parameters and the motion parameters, calculate the directional angle between two adjacent trajectory segments in Cartesian space, excluding the start and end points, as well as the theoretical velocity change of each motion axis of the machine tool when passing through the current trajectory point;

[0010] Based on the directional angle and the theoretical velocity change, the trajectory points are divided into segment points or merging points to perform trajectory segmentation and merging processing on the Cartesian space trajectory;

[0011] Based on the Cartesian space trajectory processed by the aforementioned trajectory segmentation and merging, a joint space trajectory is constructed through discretization and inverse solution processing.

[0012] Machine tool control commands are generated by performing smooth transition processing and speed planning processing on the joint space trajectory; wherein, the smooth transition processing is based on iterative smoothing based on simultaneously satisfying kinematic constraints and geometric accuracy error conditions; the speed planning processing performs differential planning and speed connection on the linear segment and transition segment obtained after the smooth transition processing.

[0013] Optionally, the step of dividing the trajectory point into segment points or merging points based on the directional angle and the theoretical velocity change, to perform trajectory segmentation and merging processing on the Cartesian space trajectory, includes: determining the current trajectory point as a segment point under a first condition; the first condition being that the theoretical velocity change of at least one motion axis is greater than a preset velocity threshold, or the directional angle is within a first preset angle range; determining the current trajectory point as a merging point under a second condition, and merging adjacent two trajectory segments; the second condition being that the directional angle is within a second preset angle range, and the contour error of the merged adjacent two trajectory segments of the current trajectory point is less than a preset contour error threshold; wherein, the minimum value of the first preset angle range is greater than the maximum value of the second preset angle range.

[0014] Optionally, the step of generating machine tool control commands by performing smooth transition processing and velocity planning processing on the joint space trajectory includes: iterating the smoothness parameters of the smooth transition processing process with the goal of simultaneously satisfying preset kinematic constraints and geometric accuracy error conditions to complete the smooth transition processing of the joint space trajectory; and performing velocity planning based on the smooth transitioned joint space trajectory to generate machine tool control commands; the velocity planning includes: planning a velocity curve with continuous acceleration for the linear segment in the joint space trajectory, planning uniform parameter motion for the transition segment in the joint space trajectory, and using a bidirectional scanning algorithm to determine the velocity connection relationship between the linear segment and the transition segment.

[0015] Optionally, the smoothness parameters of the smooth transition process are iterated to achieve a smooth transition of the joint space trajectory, with the goal of simultaneously satisfying preset kinematic constraints and geometric accuracy error conditions. This includes: initializing a set of smoothness coefficients for the smoothness parameters based on preset geometric accuracy error thresholds and kinematic constraint thresholds; calculating the transition segment trajectory curve based on the current smoothness coefficients; calculating the acceleration and jerk of the transition segment trajectory curve and determining whether the acceleration and jerk satisfy the kinematic constraint thresholds; calculating the geometric error between the transition segment trajectory curve and discrete points in the joint space and determining whether the geometric error satisfies the geometric accuracy error threshold; updating the smoothness coefficients if any one of the acceleration, jerk, or geometric error does not meet the corresponding threshold requirement, until the acceleration, jerk, and geometric error calculated using the current smoothness coefficients all meet the corresponding threshold requirements; and completing the smooth transition of the joint space trajectory based on the smoothness coefficients that meet the threshold requirements.

[0016] Optionally, velocity planning is performed based on the joint space trajectory after a smooth transition, including: generating a feed velocity curve with continuous acceleration for the linear segments in the joint space trajectory using an S-shaped or polynomial velocity planning method; performing velocity planning for the transition segments in the joint space trajectory based on parametric uniform motion; determining the endpoint velocity of each linear segment under acceleration constraints in the forward scan and the starting velocity of each linear segment under deceleration constraints in the reverse scan using a bidirectional scanning algorithm; and adjusting the velocity between the linear segments and the transition segments according to the endpoint velocity and the starting velocity.

[0017] Optionally, the joint space trajectory is constructed through discretization and inverse kinematics processing, including: discretizing the Cartesian space trajectory based on a preset contour error threshold to generate Cartesian space discrete points; mapping the Cartesian space discrete points one by one to joint space discrete points according to the inverse kinematics model of the three-axis machine tool to form a joint space discrete point sequence; and constructing the joint space trajectory using a unified parameterization method based on the joint space discrete point sequence.

[0018] Optionally, after generating the machine tool control command, the method further includes: calculating a Cartesian space verification trajectory based on the joint space trajectory corresponding to the machine tool control command using a forward kinematics model; and comparing the Cartesian space verification trajectory with the Cartesian space trajectory obtained by parsing the G-code to evaluate the trajectory planning accuracy.

[0019] Secondly, embodiments of this application provide a trajectory planning device for a machine tool, comprising:

[0020] The parsing unit is configured to parse the G-code trajectory file of the CNC machine tool and generate intermediate trajectory instructions; the intermediate trajectory instructions are used to represent the pose parameters of the trajectory point in Cartesian space and the coordinate parameters in joint space, as well as the motion parameters at the trajectory point.

[0021] The calculation unit is configured to calculate, based on the pose parameters and motion parameters, the directional angle between two adjacent segments of the current trajectory point in the Cartesian space, excluding the start and end points, and the theoretical velocity change of each motion axis of the machine tool when passing the current trajectory point, according to the pose parameters and motion parameters.

[0022] The processing unit is configured to divide the trajectory points into segment points or merge points according to the directional angle and the theoretical velocity change, so as to perform trajectory segmentation and merging processing on the Cartesian space trajectory.

[0023] The construction unit is configured to construct a joint space trajectory based on the Cartesian space trajectory processed by said trajectory segmentation and merging, through discretization and inverse solution processing.

[0024] The generation unit is configured to generate machine tool control commands by performing smooth transition processing and speed planning processing on the joint space trajectory; wherein, the smooth transition processing is based on iterative smoothing based on simultaneously satisfying kinematic constraints and geometric accuracy error conditions; the speed planning processing performs differential planning and speed connection on the linear segment and transition segment obtained after the smooth transition processing.

[0025] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the trajectory planning method for machine tools described in the first aspect.

[0026] Fourthly, this application provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the computer program to implement the trajectory planning method for machine tools described in the first aspect.

[0027] By employing the above technical solution, this application provides a trajectory planning method for machine tools. First, the G-code trajectory file of the CNC machine tool is parsed to generate intermediate trajectory instructions. These intermediate trajectory instructions represent the pose parameters of the trajectory point in Cartesian space, the coordinate parameters in joint space, and the motion parameters at the trajectory point. In the Cartesian space trajectory represented by the intermediate trajectory instructions, based on the pose and motion parameters, the angle between adjacent trajectory segments in Cartesian space (excluding the start and end points) and the theoretical velocity change of each motion axis of the machine tool when passing the current trajectory point are calculated. Then, based on the angle and theoretical velocity change, the trajectory point is divided into segmentation points or merging points to perform trajectory segmentation and merging processing on the Cartesian space trajectory. Next, based on the Cartesian space trajectory processed by trajectory segmentation and merging, the joint space trajectory is constructed through discretization and inverse kinematics. Finally, machine tool control instructions are generated by performing smooth transition processing and velocity planning processing on the joint space trajectory. The smooth transition processing is based on iterative smoothing that simultaneously satisfies kinematic constraints and geometric accuracy error conditions. The velocity planning process involves differential planning and velocity connection between the linear segments and transition segments obtained after the smooth transition processing. Compared to related technologies, this approach first identifies key motion trajectory points in the Cartesian space trajectory before joint space trajectory planning. Then, it calculates the angle between the adjacent trajectories at each trajectory point and the theoretical velocity change of each motion axis of the machine tool when passing through that trajectory point. Based on this, the Cartesian space trajectory is segmented and merged, significantly reducing the number of small line segments and providing optimized input for subsequent efficient planning. Simultaneously, in the joint space trajectory planning, geometric accuracy constraints and kinematic constraints are used as iterative conditions for the smooth transition process, thereby improving machining accuracy. Furthermore, in the velocity planning process, differentiated velocity planning and coordination methods are used for the linear segments and transition segments respectively, eliminating acceleration abrupt changes and solving the problems of low machining efficiency, poor accuracy, and large vibrations in machine tool applications caused by trajectory planning methods in related technologies. Attached Figure Description

[0028] Figure 1 A flowchart illustrating a trajectory planning method for a machine tool provided in an embodiment of this application;

[0029] Figure 2 A flowchart illustrating another trajectory planning method for machine tools provided in this application embodiment;

[0030] Figure 3 A schematic diagram illustrating the included angle of a trajectory direction provided in an embodiment of this application;

[0031] Figure 4 This is a schematic diagram illustrating a smooth transition processing of joint space trajectory provided in an embodiment of this application;

[0032] Figure 5 A comparative schematic diagram showing the transition of a trajectory before and after processing, provided for an embodiment of this application;

[0033] Figure 6 A schematic diagram illustrating velocity planning using the DoubleS method, provided as an embodiment of this application;

[0034] Figure 7 This is a schematic diagram of a trajectory planning device for a machine tool, provided as an embodiment of this application. Detailed Implementation

[0035] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.

[0036] As mentioned in the background, in the field of CNC machining, continuous curves of three-dimensional surfaces are typically discretized into a large number of tiny straight line segments and arc segments. Executing these tiny line segments one by one leads to frequent acceleration and deceleration of the machine tool, which reduces machining efficiency, fails to guarantee machining accuracy, and may even cause severe machine tool vibration, affecting the quality of the machined surface. Therefore, trajectory planning is necessary. Trajectory planning includes trajectory smoothing and speed planning. Trajectory smoothing, also known as smooth transition or smooth transition processing, aims to transform discrete polyline paths into a smooth path. Speed ​​planning aims to plan the optimal curve of speed change over time, thereby generating control commands for the machine tool.

[0037] Many trajectory planning methods have been proposed in related technologies. For example, CN115122329B proposes a joint space trajectory planning method for industrial robots. If this method is extended to the trajectory planning of three-axis machine tool machining, it needs to be solved inversely to the joint space through inverse kinematics. Direct application will result in the problem of asynchronous joint movements. In addition, because the machining trajectory of three-axis machine tools has many small line segments, directly applying the velocity planning method of patent CN115122329B will result in problems such as discontinuous acceleration and frequent acceleration and deceleration.

[0038] Therefore, to address the problems of low machining efficiency, poor accuracy, and high vibration caused by the large number of tiny line segments in current trajectory planning methods applied to machine tools, this application proposes a trajectory planning method for machine tools. This method can be applied to CNC machine tool machining and related control systems, and can execute any of the trajectory planning methods for machine tools mentioned below during operation. For example... Figure 1 As shown, the method includes:

[0039] S101 parses the G-code trajectory file of the CNC machine tool and generates intermediate trajectory instructions.

[0040] CNC machine tool trajectory files are typically represented in G-code format. G-code, also known as G-language, is a programming language used in CNC machining. Its motion instructions for machining trajectories mainly include linear and circular commands such as G00, G01, G02, and G03, which can represent line numbers, functions, coordinate commands, feed rates, and other information. The G-code trajectory file is then converted into intermediate trajectory instructions. These intermediate trajectory instructions represent the pose parameters of trajectory points in Cartesian space and their coordinate parameters in joint space. They are trajectory instructions specific to the tool position and mainly include rapid traverse instructions such as PTP, linear instructions (LINE), and circular instructions (CIRCLE). They can represent both Cartesian and joint space trajectories. A trajectory point is a digital representation of the machine tool path, that is, its position on the path trajectory at different times. For example, the coordinates in the G-code are converted into Cartesian and joint space coordinates, and the motion parameters at the trajectory points, such as velocity, acceleration, jerk, and angle, are all represented using the aforementioned rapid traverse, linear, and circular instructions. It should be noted that, in addition to the aforementioned fast traverse, linear, and circular commands, other existing commands can also be used, as long as they can simultaneously represent the relevant coordinates and motion parameter information of both Cartesian space trajectory and joint space trajectory.

[0041] Using intermediate trajectory instructions serves two purposes: firstly, it avoids subtle differences between G-codes generated by different CAM software; secondly, it ensures a unified internal format across different spaces, such as Cartesian space or joint space, as well as during smooth transitions and velocity planning processes. Therefore, intermediate trajectory instructions are used for format unification to improve compatibility.

[0042] S102, in the Cartesian space trajectory represented by the intermediate trajectory command, calculate the angle between the directions of the two adjacent trajectory segments in Cartesian space, excluding the start and end points, and the theoretical velocity change of each motion axis of the machine tool when passing the current trajectory point, based on the pose parameters and motion parameters.

[0043] S103, based on the directional angle and the theoretical velocity change, divides the trajectory points into segment points or merging points to perform trajectory segmentation and merging processing on the Cartesian space trajectory.

[0044] In S102 and S103, the trajectory segmentation and merging process, which is the preprocessing of the Cartesian space trajectory in this embodiment, can eliminate a large number of tiny line segments interspersed in the trajectory. Since the intermediate trajectory command can represent the pose parameters of a trajectory point in Cartesian space, the coordinate parameters in joint space, and the motion parameters at the trajectory point, the trajectory segmentation and merging process specifically involves first identifying each trajectory point in the Cartesian space trajectory represented by the intermediate trajectory command based on the pose and motion parameters, and calculating the directional angle between two adjacent trajectory segments in Cartesian space (excluding the start and end points), as well as the theoretical velocity change of each motion axis of the machine tool when passing the current trajectory point. Then, the trajectory points are divided based on the directional angle and the theoretical velocity change, thereby realizing the trajectory segmentation and merging process of the Cartesian space trajectory.

[0045] S104, based on the Cartesian space trajectory after trajectory segmentation and merging, constructs the joint space trajectory through discretization and inverse solution.

[0046] Specifically, based on the chord height difference constraint, the preprocessed trajectory curve can be discretized and inversely solved to obtain the joint space trajectory point array, and then the joint space trajectory can be constructed using a unified parameterization method.

[0047] S105 generates machine tool control commands by performing smooth transition processing and speed planning on the joint space trajectory.

[0048] In S105, the smooth transition processing is based on iterative smoothing that simultaneously satisfies kinematic constraints and geometric accuracy error conditions. Specifically, the smooth transition processing uses a set of adjustable smoothness coefficients from the smoothness parameters as optimization variables. Through iterative calculation, the generated transition trajectory curve satisfies kinematic constraint thresholds such as machine tool joint acceleration and jerk, while its geometric deviation from the original joint path points is also controlled within a preset accuracy error threshold. Through this dual-constraint iteration, the machining contour accuracy can be effectively guaranteed while ensuring a smooth trajectory.

[0049] Speed ​​planning is performed to differentiate between linear segments and transition segments obtained after smooth transition processing, and to connect speeds accordingly. Specifically, for linear segments, a continuous S-shaped acceleration speed planning method is used to generate smooth speed curves, so as to make full use of the machine tool's acceleration capability and improve motion efficiency; for transition segments, parametric uniform speed motion planning is used to maintain motion stability when passing through curved segments.

[0050] To achieve a smooth connection between the speeds of linear segments and transition segments, this embodiment employs a bidirectional scanning algorithm. The forward scan determines the endpoint speed of each linear segment under acceleration constraints, while the reverse scan determines the starting speed of each linear segment under deceleration requirements. Finally, the actual execution speed of each segment is determined in a coordinated manner, thereby ensuring the continuity of speed and acceleration globally and avoiding frequent acceleration / deceleration and sudden acceleration changes.

[0051] In this embodiment, the G-code trajectory file of the CNC machine tool is first parsed to generate intermediate trajectory instructions. These intermediate trajectory instructions represent the pose parameters of the trajectory points in Cartesian space, their coordinate parameters in joint space, and their motion parameters at the trajectory points. In the Cartesian space trajectory represented by the intermediate trajectory instructions, based on the pose and motion parameters, the angle between adjacent trajectory segments in Cartesian space (excluding the start and end points) and the theoretical velocity change of each motion axis of the machine tool when passing the current trajectory point are calculated. Then, based on the angle and theoretical velocity change, the trajectory points are divided into segmentation points or merging points to perform trajectory segmentation and merging processing on the Cartesian space trajectory. Afterwards, based on the segmented and merged Cartesian space trajectory, the joint space trajectory is constructed through discretization and inverse kinematics processing. Finally, machine tool control instructions are generated by performing smooth transition processing and velocity planning on the joint space trajectory. The smooth transition processing is based on iterative smoothing that simultaneously satisfies kinematic constraints and geometric accuracy error conditions. The velocity planning process involves differential planning and velocity connection between the linear segments and transition segments obtained after the smooth transition processing. Compared to related technologies, this approach first identifies key motion trajectory points in the Cartesian space trajectory before joint space trajectory planning. Then, it calculates the angle between the adjacent trajectories at each trajectory point and the theoretical velocity change of each motion axis of the machine tool when passing through that trajectory point. Based on this, the Cartesian space trajectory is segmented and merged, significantly reducing the number of small line segments and providing optimized input for subsequent efficient planning. Simultaneously, in the joint space trajectory planning, geometric accuracy constraints and kinematic constraints are used as iterative conditions for the smooth transition process, thereby improving machining accuracy. Furthermore, in the velocity planning process, differentiated velocity planning and coordination methods are used for the linear segments and transition segments respectively, eliminating acceleration abrupt changes and solving the problems of low machining efficiency, poor accuracy, and large vibrations in machine tool applications caused by trajectory planning methods in related technologies.

[0052] Optionally, the trajectory point is divided into segment points or merging points based on the directional angle and the theoretical velocity change, to perform trajectory segmentation and merging processing on the Cartesian space trajectory, including: determining the current trajectory point as a segment point under the condition that a first condition is met; the first condition is that the theoretical velocity change of at least one motion axis is greater than a preset velocity threshold, or the directional angle is within a first preset angle range; determining the current trajectory point as a merging point under the condition that a second condition is met, and merging two adjacent trajectory segments; the second condition is that the directional angle is within a second preset angle range, and the contour error of the merged two adjacent trajectory segments of the current trajectory point is less than a preset contour error threshold; wherein, the minimum value of the first preset angle range is greater than the maximum value of the second preset angle range.

[0053] In this embodiment, if the theoretical speed change of at least one motion axis (applicable to a three-axis or five-axis machine tool) corresponding to the current trajectory point is greater than a preset speed threshold, or if the directional angle is within a first preset angle range (e.g., 10°~90°), it is determined to be a segmentation point, thus requiring the trajectory at both ends of the segmentation point to be segmented. If the current trajectory point is within a second preset angle range (e.g., 0°~10°), and the contour error after merging two adjacent trajectory segments of the current trajectory point is less than a preset contour error threshold, it is determined to be a merging point. In specific implementation, the motion parameters include speed, acceleration, jerk, and angle. The above condition setting is not a simple geometric line segment merging, but rather a comprehensive consideration of kinematic predictions represented by the theoretical speed change and geometric features represented by the directional angle, thereby achieving intelligent trajectory simplification, reducing the number of trajectory segments to be processed, especially the large number of tiny line segments generated during programming, thus laying an efficient input foundation for subsequent high computational complexity smoothness and speed planning in joint space.

[0054] Optionally, machine tool control commands are generated by performing smooth transition processing and velocity planning on the joint space trajectory. This includes: iterating the smoothness parameters of the smooth transition process with the goal of simultaneously satisfying preset kinematic constraints and geometric accuracy error conditions to complete the smooth transition processing of the joint space trajectory; and generating machine tool control commands based on the smooth transition joint space trajectory. The velocity planning includes: planning a velocity curve with continuous acceleration for the linear segment in the joint space trajectory, planning uniform parameter motion for the transition segment in the joint space trajectory, and using a bidirectional scanning algorithm to determine the velocity connection relationship between the linear segment and the transition segment.

[0055] In this embodiment, the linear segment and transition segment are curves obtained after smoothing the joint space trajectory. A linear segment is a straight path segment connecting two adjacent trajectory points in joint space, while a transition segment is a curved path segment inserted during the smoothing process to connect two linear segments. Its purpose is to eliminate sharp corners and achieve geometric continuity. Traditional smooth transitions focus solely on kinematic constraints without considering geometric accuracy. However, in reality, changes to the trajectory during smooth transition processing can easily lead to a decrease in processing accuracy. Therefore, the smooth transition process aims to simultaneously satisfy preset kinematic constraints and geometric accuracy error conditions, and iterates multiple times using the smoothness parameters as indicators, thereby improving accuracy. Speed ​​planning considers using different speed allocation strategies for different speed curves, fundamentally avoiding machine tool vibration and impact problems caused by discontinuous speed and acceleration. Simultaneously, efficient acceleration utilization improves overall machining efficiency.

[0056] Furthermore, with the goal of simultaneously satisfying preset kinematic constraints and geometric accuracy error conditions, the smoothness parameters of the smooth transition process are iterated to complete the smooth transition processing of the joint space trajectory. This includes: initializing a set of smoothness coefficients for the smoothness parameters based on preset geometric accuracy error thresholds and kinematic constraint thresholds; calculating the transition segment trajectory curve based on the current smoothness coefficients; calculating the acceleration and jerk of the transition segment trajectory curve and determining whether the acceleration and jerk meet the kinematic constraint thresholds; calculating the geometric error between the transition segment trajectory curve and the discrete points in the joint space and determining whether the geometric error meets the geometric accuracy error threshold; updating the smoothness coefficients if any of the acceleration, jerk, or geometric error does not meet the corresponding threshold requirements, until the acceleration, jerk, and geometric error calculated by the current smoothness coefficients all meet the corresponding threshold requirements; and completing the smooth transition processing of the joint space trajectory based on the smoothness coefficients that meet the threshold requirements.

[0057] This embodiment details the iterative smoothing process with dual constraints, the key being the transformation of abstract constraints into an iterative optimization process for a set of control variables—the smoothness coefficients. Each iteration simultaneously examines kinematic indices (such as acceleration and jerk) and geometric accuracy indices (deviation from the original point), ensuring a balance between smoothness and accuracy in the smooth transition process.

[0058] Optionally, velocity planning is performed based on the joint space trajectory after a smooth transition, including: generating a feed velocity curve with continuous acceleration using an S-shaped or polynomial velocity planning method for the linear segments in the joint space trajectory; performing velocity planning based on parametric uniform motion for the transition segments in the joint space trajectory; determining the endpoint velocity of each linear segment under acceleration constraints in the forward scan and the starting velocity of each linear segment under deceleration constraints in the reverse scan using a bidirectional scanning algorithm; and adjusting the velocity between the linear segments and the transition segments based on the endpoint velocity and the starting velocity.

[0059] In this embodiment, an S-shaped or polynomial-type velocity planning method with continuous acceleration is selected for linear segments, allowing velocity variations in the originally linear trajectory, thereby maximizing machining efficiency. Uniform motion is selected for velocity planning of transition segments, ensuring smooth movement and uniform force distribution in the originally curvilinear trajectory. Furthermore, through constraint propagation in both forward and reverse directions in the bidirectional scanning algorithm, feasible velocities between adjacent segments are calculated and coordinated, resolving potential conflicts in local trajectory planning and thus avoiding machine tool vibration and impact problems caused by discontinuous velocity and acceleration.

[0060] Optionally, the joint space trajectory is constructed through discretization and inverse kinematics processing, including: discretizing the Cartesian space trajectory based on a preset contour error threshold to generate Cartesian space discrete points; mapping the Cartesian space discrete points one by one to joint space discrete points according to the inverse kinematics model of the three-axis machine tool to form a joint space discrete point sequence; and constructing the joint space trajectory using a unified parameterization method based on the joint space discrete point sequence.

[0061] In this embodiment, discretization based on chord height difference ensures that the trajectory geometry is sampled with sufficient accuracy. Inverse kinematics provides the mathematical basis for the transformation to joint space. A unified parameterization method (such as linear interpolation) provides a unified, computable trajectory representation for all subsequent smoothness and velocity planning.

[0062] Optionally, after generating the machine tool control instructions, the method further includes: calculating a Cartesian space verification trajectory based on the joint space trajectory corresponding to the machine tool control instructions using a forward kinematics model; and comparing the Cartesian space verification trajectory with the Cartesian space trajectory obtained by parsing the G-code to evaluate the trajectory planning accuracy.

[0063] In this embodiment, an optional accuracy verification and quality closed-loop process is provided. The planned joint trajectory is mapped back to Cartesian space using forward kinematics to obtain the actual toolpath to be executed. Comparing this with the Cartesian space trajectory obtained from G-code parsing, i.e., the original trajectory, allows for a quantitative assessment of the geometric errors introduced throughout the planning process, improving debuggability.

[0064] The above only describes the functions and effects of each step. The following will combine... Figure 2 The illustrated embodiment of this application provides another trajectory planning method for machine tools, illustrating the specific calculation process of each step. The technical effects and functions of each step can be combined with the above content and will not be repeated here. Before execution, it is necessary to obtain the Gcode trajectory file and determine the error threshold, angle threshold, joint velocity threshold, joint acceleration threshold, joint jerk threshold, etc. Each threshold can be set according to the motion parameters (such as actual velocity, actual acceleration, etc.) in the trajectory file and historical experience. The method specifically includes:

[0065] S201, Trajectory Command Parsing.

[0066] The G-code trajectory file is parsed and converted into a T-code trajectory. Taking the G-code "N20, G94, G01, Z11.481, F250" as an example, according to the parsing rules, it can be converted to: LINE / D,X / -0.546,Y / 9.755,Z / 11.481,I / 0.0,J / 0.0,K / 1.0,U / 1.0,V / 0.0,W / 0.0,FV / 250.0,SV / 1061.0. Here, D represents Cartesian space, X, Y, and Z represent the target point position (default values ​​are padded with preceding values), I / 0.0,J / 0.0,K / 1.0 represent the main axis direction of the target point, U / 1.0,V / 0.0,W / 0.0 represent the secondary axis direction of the target point, FV represents the feed rate in mm / min, and SV represents the spindle speed in rad / s. Tcode is only one feasible implementation method; other intermediate trajectory instructions can also be used.

[0067] This leads to the trajectory curve represented by the Tcode trajectory in Cartesian space. This serves as the initial trajectory curve. Here, M represents the number of trajectory segments contained in the initial trajectory curve, and i is the current trajectory segment.

[0068] S202, Trajectory Preprocessing.

[0069] Trajectory preprocessing mainly includes trajectory segmentation and merging. The trajectory obtained in step S201 is segmented and merged according to geometric constraints (angle threshold constraints, error threshold constraints) and kinematic constraints (acceleration, jerk constraints). The input to this step is the initial trajectory in Cartesian space. Acceleration threshold Speed ​​threshold accelerometer threshold (Preset contour) error threshold Angle threshold and This then outputs the preprocessed trajectory. .

[0070] in, The preprocessed trajectory is represented by a set representation. Because during preprocessing, numerous tiny line segments in Cartesian space are merged and segmented, multiple line segments may pass through the same trajectory point. Therefore, different sets are used to represent this, replacing the line segment label i with j, and M... j α represents the current subset bus segment, α represents different subsets, and n is the total number of subsets.

[0071] Specifically, S202 also includes:

[0072] S2021, determine the type of trajectory points. Traverse the initial trajectory and calculate the direction angle between two adjacent trajectory segments. , can be combined Figure 3 As shown, P i-1 P i P i+1 The three points form two adjacent trajectories L. i-1,i and L i,i+1 The directional angle can be calculated using vectors:

[0073]

[0074] Calculate trajectory segment Maximum parameter speed The constraint relationship is as follows: .

[0075] Calculate trajectory segment Maximum parameter speed The constraint relationship is as follows: .

[0076] Calculate the midpoint The forward and backward speeds at that point have:

[0077]

[0078] Then, the change in speed is calculated for each moving axis. (k is the axis number), which is the theoretical speed change of each axis, and based on the theoretical speed change of each axis... Angle with direction Determine whether the first or second condition is met.

[0079] Specifically, it is determined that the theoretical speed change of at least one motion axis is greater than a preset speed threshold. .in This is the cutoff factor, which is set to 1.5 in this embodiment. It is used when one axis does not meet the constraint conditions or... If the first condition is met, then the judgment is made. This is the segmentation point. Otherwise, if And calculate the chord height difference after merging.

[0080] If the chord height difference is less than the error threshold, i.e. ,determination This is the merging point. If none of the above conditions are met, then... This is a typical inflection point.

[0081] S2022, preprocess the trajectory according to the trajectory point type. If If the point is a segmentation point, then the trajectory is segmented; if If it is a merging point, then the trajectory endpoint is adjusted; if If it is a general inflection point, no action is required.

[0082] S203, discrete inverse solution and construction of joint space trajectory.

[0083] The trajectory obtained from step S202 is a Cartesian space trajectory. It is necessary to obtain the joint space trajectory point array by discretizing the inverse solution based on the chord height difference constraint, and then construct the joint space trajectory using a unified parameterization form.

[0084] Specifically, S203 also includes:

[0085] S2031, Discrete and Inverse Solution. Input is the preprocessed trajectory. and preset contour error threshold Traverse the preprocessed trajectory to obtain trajectory segments. Under the condition of satisfying the preset contour error threshold, the discrete points in Cartesian space are solved iteratively. Then, the discrete points in joint space are obtained through inverse kinematics. The final output is an array of joint space trajectory points obtained from the discrete inverse solution. The inverse kinematics process here can be found in the computational processes of relevant mature technologies, and will not be elaborated upon here.

[0086] S2032, Construct a linear trajectory in joint space. This is achieved by representing the linear trajectory using a unified parameterized form from the array of trajectory points in joint space. This represents the trajectory between the (i-1)th and ith trajectory points, where u is a uniform parameter, ultimately yielding the joint space trajectory. .

[0087] S204, Smooth transition of joint space trajectory considering error constraints.

[0088] like Figure 4 As shown, q i-1 q i q i+1 q i+2 There are 4 trajectory points, forming three line segments L. i-1,i L i,i+1 L i+1,i+2 The dashed line represents the line segment before the smooth transition, and the solid line represents the curve after the smooth transition. E represents the control points during the smooth transition process. It can be seen that the smooth transition process makes the machine tool's motion trajectory smoother and more reasonable.

[0089] Specifically, S204 uses a convex combination, that is, a combination of control points and basis functions to represent the joint space transition trajectory, selects appropriate basis functions as transition curves, and uses uniform parameters. Represents the trajectory of the joint space transition segment ,get And save it as a structure array .in Denote the basis functions that satisfy q i-1 q i q i+1 This is the control vertex of the convex combination.

[0090] The process involves acquiring joint space command trajectory points, machine tool kinematic parameters (including kinematic constraint thresholds such as joint velocity threshold, joint acceleration threshold, and joint jerk threshold), and geometric constraint parameters (geometric accuracy error threshold). Smooth transition of the joint space trajectory mainly includes: selecting and calculating the basis functions of the transition segment trajectory, and calculating the smoothness coefficient of the transition segment trajectory. Considering the characteristic of three-axis machine tool machining trajectories with numerous small line segments, linear segments should not be too short. Compared with the trajectory smoothing process in related technologies, this embodiment optimizes and improves the calculation of the transition segment trajectory smoothness coefficient. In addition to considering kinematic constraints, geometric constraints are also considered, and an error threshold constraint is introduced to optimize the calculation of the smoothness coefficient through an iterative method, ensuring both trajectory smoothness and trajectory accuracy.

[0091] In summary, the specific inputs to S204 are the joint space trajectory points, the joint space parameter trajectory, the joint acceleration threshold, the joint jerk threshold, and the geometric accuracy error threshold. Maximum number of iterations The maximum number of iterations can be set according to computational accuracy and real-time requirements, for example, 10 iterations can be set as the maximum. Finally, the joint space trajectory, consisting of the linear segment trajectory and the transition segment trajectory, can be output after a smooth transition. .

[0092] Specifically, considering the geometric continuity issue, a fourth-order Beizer curve is chosen as the transition curve, satisfying G2 continuity, i.e., curvature / second-order geometric continuity. Its transition curve function can be expressed as: ,in, and As control points, Unified parameters Control points:

[0093]

[0094] in, This is a set of smoothness coefficients in the smoothness parameters.

[0095] For a linear trajectory, we have:

[0096]

[0097] For the transitional trajectory:

[0098]

[0099] For ease of calculation, the transition section adopts a parametric uniform velocity planning, that is:

[0100]

[0101] To satisfy the continuity of geometric acceleration, i.e.,

[0102]

[0103]

[0104]

[0105]

[0106] make It can satisfy G2 continuity.

[0107] Specifically, S204 includes:

[0108] S2041, Selection of basis functions for the transition segment trajectory. This embodiment uses a fourth-order Beizer transition curve as an example, but other transition curves can also be used. Substituting the control points and simplifying, the expression for the odd function is obtained as follows:

[0109]

[0110] Wherein, basis functions Calculation and smoothness coefficient The smoothness coefficient of the transition segment trajectory is consistent for all shaft joints. The calculation of the smoothness coefficient is explained below.

[0111] S2042, Iterative optimization calculation of smoothness coefficient .

[0112] To maintain the symmetry of the smooth trajectory and simplify the calculation, let ,in , .

[0113] First, the smoothness coefficient is initialized to an initial value of 0.5, i.e. Number of iterations Therefore, we should consider solving for kinematic constraints. ,have:

[0114]

[0115] in, For the aforementioned pre-set acceleration threshold, This is the acceleration threshold. The acceleration of the transition segment trajectory is...

[0116]

[0117]

[0118] The parametric velocity of the transition segment trajectory remains constant, i.e. Therefore, we can conclude that:

[0119]

[0120] Therefore, the acceleration and smoothness coefficient of each joint in the transition segment trajectory Parameter speed Related. Because the acceleration of the transition trajectory is relative to time. To simplify calculations, we can take u = 0, 0.5, and 1 at the endpoints and midpoint to satisfy the acceleration threshold, thus:

[0121]

[0122] Since there was no velocity planning before the trajectory became smooth, the parameter velocity... Take the maximum parameter velocity of the linear trajectory before and after. The smaller one, namely:

[0123]

[0124] The acceleration of the transition segment trajectory is:

[0125]

[0126]

[0127] The parametric velocity of the transition segment trajectory remains constant, i.e. , Therefore, we can conclude that:

[0128]

[0129] The acceleration of the transition segment trajectory is a first-order polynomial with respect to time t, so at the endpoint, that is... When the acceleration threshold is met That is, there are:

[0130]

[0131] because The maximum smoothness coefficient can be obtained by combining the formulas. .

[0132] Then, the error between the control vertex and the transition trajectory is calculated. To simplify the calculation, the error is calculated as follows: , And determine d. iter Is it less than or equal to the geometric precision error threshold? If so, then iter = iter + 1 to perform iterations, and check if the iteration count iter is less than the maximum iteration count. If so, calculate the adjustment factor. and iterate = Recalculate. Otherwise, output the smoothness coefficient. = , .

[0133] S2043, Construct the trajectory curve after a smooth transition. ,Right now:

[0134]

[0135] Figure 5 The diagram shows a comparison of the trajectories before and after a smooth transition in Cartesian space, represented by different line segments. The comparison reveals that the curve after a fourth-order Beizer smooth transition is smoother at the corners.

[0136] S205, velocity planning considering joint space trajectories with smooth velocity and continuous acceleration.

[0137] Step S204 yielded the parametric trajectory curve in joint space. Then, velocity planning is performed on the parameter u. For different trajectory types (linear segment trajectory, transition segment trajectory), corresponding velocity planning methods (including trigonometric functions, DoubleS velocity planning methods, etc.) are adopted. Considering acceleration continuity, velocity planning methods with continuous acceleration are preferred, such as DoubleS velocity planning. A bidirectional velocity look-ahead algorithm is used to fully consider velocity look-ahead. To simplify calculations and consider acceleration continuity, this embodiment uses a uniform velocity planning method for the transition segment parameter trajectory and a DoubleS velocity planning method for the linear segment parameter trajectory. Taking full account of velocity look-ahead, the parametric velocity planning for the transition segment trajectory is calculated in both forward and reverse directions. Finally, parametric velocity planning is performed on the linear segment trajectory. However, this embodiment is not limited to the DoubleS velocity planning method; other velocity planning methods with continuous acceleration are also applicable. Figure 6 The diagram shows the DoubleS speed planning used in this embodiment. It adopts a 7-segment speed planning, where the first three segments are acceleration stages, the last three segments are deceleration stages, and the middle segment is a constant speed stage. The specific calculation process can be found in the following implementation method.

[0138] Specifically, S2051 calculates the velocity threshold of the trajectory segment parameters. Parameter acceleration threshold Parameter accelerometer threshold For the specific calculation process, please refer to relevant technologies, which will not be elaborated here.

[0139] S2052, Forward velocity planning for the transition section. Forward calculation of the transition section. Parameter speed Calculate the trajectory of a linear segment Starting parameter velocity ,have:

[0140]

[0141] Considering speed percentage and percentage of acceleration Calculate the trajectory of a linear segment Endpoint parameter velocity ,have:

[0142]

[0143] Calculate the trajectory of a linear segment Starting parameter velocity Based on the continuity of velocity, the velocities at the beginning and end of the transition section are calculated as follows:

[0144]

[0145]

[0146] S2053, Transition Section Reverse Velocity Planning. Reverse calculation of transition section parameter velocities. Considering the percentage of velocity and the percentage of acceleration, calculate the trajectory of the linear segment. Start and end point parameters speed ,have:

[0147]

[0148]

[0149] Calculate the trajectory of a linear segment Starting parameter velocity Based on the velocity continuity, the velocity parameters at the beginning and end of the transition section are calculated as follows:

[0150]

[0151]

[0152] The calculation of the transition section parameter velocity planning is as follows:

[0153]

[0154] The parameters for the transition section are calculated as follows:

[0155]

[0156]

[0157] That is, the result of the transition speed planning is complete:

[0158]

[0159] S2054, linear segment velocity programming. Based on velocity continuity, calculate... Starting parameter velocity Endpoint parameter speed ,have:

[0160]

[0161] Based on the continuity of acceleration, calculate The starting parameter acceleration Endpoint parameter acceleration ,have:

[0162]

[0163] Given the initial and final velocities, initial and final accelerations, total displacement, maximum acceleration, and maximum jerk, use DoubleS velocity programming to calculate the velocity parameters. First, calculate the acceleration phase time. , ,have:

[0164]

[0165]

[0166] To calculate the deceleration phase time, we have:

[0167]

[0168]

[0169] To calculate the time of the uniform velocity phase, we have: , And establish a candidate velocity set. nn can be set manually or calculated using an algorithm; here, nn is set to 10. = [i], calculate the displacement S during the acceleration phase. acc and time , , ,have:

[0170]

[0171] like Greater than ,have:

[0172]

[0173]

[0174] +

[0175] like Less than Then the acceleration aumid of the intermediate segment parameter u is:

[0176]

[0177]

[0178]

[0179] Calculate the displacement S during the deceleration phase dec and time , , ,have:

[0180]

[0181] if Greater than Then we have:

[0182]

[0183]

[0184] if Less than Then we have:

[0185]

[0186]

[0187]

[0188] +

[0189] calculate and The linear segment trajectory, after velocity planning, is saved as an array with the following structure:

[0190] The entire trajectory, after velocity planning, is saved as an array with the following structure:

[0191]

[0192] The above is a specific and feasible implementation method, which shows the calculation process of each step. The technical effects and functions of each step can be combined with the above content and will not be repeated here.

[0193] Furthermore, as Figures 1 to 6 The specific implementation of the method shown in this embodiment provides a trajectory planning device for machine tools, such as... Figure 7 As shown, the device includes:

[0194] The parsing unit 701 is configured to parse the G-code trajectory file of the CNC machine tool and generate intermediate trajectory instructions; the intermediate trajectory instructions are used to represent the pose parameters of the trajectory point in Cartesian space and the coordinate parameters in joint space, as well as the motion parameters at the trajectory point.

[0195] The calculation unit 702 is configured to calculate, based on the pose parameters and motion parameters, the directional angle between two adjacent segments of the current trajectory point in the Cartesian space, excluding the start and end points, and the theoretical velocity change of each motion axis of the machine tool when passing the current trajectory point, according to the pose parameters and motion parameters.

[0196] The processing unit 703 is configured to divide the trajectory points into segment points or merging points according to the directional angle and the theoretical velocity change, so as to perform trajectory segmentation and merging processing on the Cartesian space trajectory.

[0197] Construction unit 704 is configured to construct a joint space trajectory based on the Cartesian space trajectory processed by said trajectory segmentation and merging, through discretization and inverse solution processing.

[0198] The generation unit 705 is configured to generate machine tool control commands by performing smooth transition processing and speed planning processing on the joint space trajectory; wherein, the smooth transition processing is based on iterative smoothing based on simultaneously satisfying kinematic constraints and geometric accuracy error conditions; the speed planning processing performs differential planning and speed connection on the linear segment and transition segment obtained after the smooth transition processing.

[0199] In a specific application scenario, the processing unit 703 is further configured to determine the current trajectory point as a segmentation point under the following conditions: the first condition is that the theoretical velocity change of at least one motion axis is greater than a preset velocity threshold, or the directional angle is within a first preset angle range; under the following second condition, the current trajectory point is determined as a merging point, and adjacent two trajectory segments are merged; the second condition is that the directional angle is within a second preset angle range, and the contour error of the merged adjacent two trajectory segments of the current trajectory point is less than a preset contour error threshold; wherein, the minimum value of the first preset angle range is greater than the maximum value of the second preset angle range.

[0200] In specific application scenarios, the generation unit 705 is further configured to iterate the smoothness parameters of the smooth transition process with the goal of simultaneously satisfying preset kinematic constraints and geometric accuracy error conditions, so as to complete the smooth transition process of the joint space trajectory; based on the smooth transition joint space trajectory, speed planning is performed to generate machine tool control commands; the speed planning includes: planning a velocity curve with continuous acceleration for the linear segment in the joint space trajectory, planning uniform parameter motion for the transition segment in the joint space trajectory, and using a bidirectional scanning algorithm to determine the speed connection relationship between the linear segment and the transition segment.

[0201] In specific application scenarios, the generation unit 705 is further configured to initialize a set of smoothness coefficients for the smoothness parameters based on preset geometric accuracy error thresholds and kinematic constraint thresholds; calculate the transition trajectory curve based on the current smoothness coefficients; calculate the acceleration and jerk of the transition trajectory curve and determine whether the acceleration and jerk satisfy the kinematic constraint thresholds; calculate the geometric error between the transition trajectory curve and the discrete points in the joint space and determine whether the geometric error satisfies the geometric accuracy error threshold; if any of the acceleration, jerk, or geometric error does not meet the corresponding threshold requirement, update the smoothness coefficients until the acceleration, jerk, and geometric error calculated by the current smoothness coefficients all meet the corresponding threshold requirements; and complete the smooth transition processing of the joint space trajectory based on the smoothness coefficients that meet the threshold requirements.

[0202] In specific application scenarios, the generation unit 705 is further configured to generate a continuously accelerating feed velocity curve for the linear segments in the joint space trajectory using an S-shaped or polynomial velocity planning method; to perform velocity planning for the transition segments in the joint space trajectory based on parameter uniform motion; to determine the endpoint velocity of each linear segment under acceleration constraints in the forward scan and the starting velocity of each linear segment under deceleration constraints in the reverse scan using a bidirectional scanning algorithm; and to adjust the velocity between the linear segments and the transition segments based on the endpoint velocity and the starting velocity.

[0203] In a specific application scenario, the construction unit 704 is further configured to discretize the Cartesian space trajectory based on a preset contour error threshold to generate Cartesian space discrete points; according to the inverse kinematics model of the three-axis machine tool, the Cartesian space discrete points are mapped one by one to joint space discrete points to form a joint space discrete point sequence; based on the joint space discrete point sequence, the joint space trajectory is constructed using a unified parameterization method.

[0204] In specific application scenarios, the generation unit 705 is further configured to calculate the Cartesian space verification trajectory based on the joint space trajectory corresponding to the machine tool control command through a forward kinematics model; and compare the Cartesian space verification trajectory with the Cartesian space trajectory obtained by parsing the G code to evaluate the trajectory planning accuracy.

[0205] It should be noted that other corresponding descriptions of the functional units involved in the trajectory planning device for machine tools provided in this embodiment can be found in [reference needed]. Figures 1 to 6 The corresponding description in [the document] will not be repeated here.

[0206] Based on the above, Figures 1 to 6Accordingly, this embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figures 1 to 6 The method shown.

[0207] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause a computer device (such as personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of this application.

[0208] Based on the above, Figures 1 to 6 The method shown, and Figure 7 To achieve the above objectives, this application also provides an electronic device, which can be configured on a computer side, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-described objectives. Figures 1 to 6 The method shown.

[0209] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.

[0210] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0211] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software in the information processing physical device.

[0212] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms, or it can be implemented by hardware. By applying the solution of this embodiment, compared with related technologies, firstly, before performing joint space trajectory planning, the trajectory points of key motions are identified in the Cartesian space trajectory. Then, the included angle between the two adjacent trajectories of each trajectory point and the theoretical speed change of each motion axis of the machine tool when the machine tool passes through the trajectory point are calculated. Based on this, the Cartesian space trajectory is segmented and merged, thereby significantly reducing the number of small line segments and providing optimized input for subsequent efficient planning. At the same time, in the trajectory planning of joint space, geometric accuracy constraints and kinematic constraints are used as iterative conditions for a smooth transition process, thereby improving machining accuracy. In the speed planning process, differentiated speed planning and coordination methods are used for linear segments and transition segments respectively, thereby eliminating the acceleration mutation problem and solving the problems of low machining efficiency, poor accuracy, and large vibration in the trajectory planning methods of related technologies in machine tool applications.

[0213] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0214] In the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0215] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A trajectory planning method for machine tools, characterized in that, include: The G-code trajectory file of the CNC machine tool is parsed to generate intermediate trajectory instructions; The intermediate trajectory instruction is used to represent the pose parameters of the trajectory point in Cartesian space and the coordinate parameters in joint space, as well as the motion parameters at the trajectory point. In the Cartesian space trajectory represented by the intermediate trajectory command, based on the pose parameters and the motion parameters, calculate the directional angle between two adjacent trajectory segments in Cartesian space, excluding the start and end points, as well as the theoretical velocity change of each motion axis of the machine tool when passing through the current trajectory point; Based on the directional angle and the theoretical velocity change, the trajectory points are divided into segment points or merging points to perform trajectory segmentation and merging processing on the Cartesian space trajectory; Based on the Cartesian space trajectory processed by the aforementioned trajectory segmentation and merging, a joint space trajectory is constructed through discretization and inverse solution processing. Machine tool control commands are generated by performing smooth transition processing and speed planning processing on the joint space trajectory; wherein, the smooth transition processing is based on iterative smoothing based on simultaneously satisfying kinematic constraints and geometric accuracy error conditions; the speed planning processing performs differential planning and speed connection on the linear segment and transition segment obtained after the smooth transition processing.

2. The method according to claim 1, characterized in that, The step of dividing the trajectory points into segmentation points or merging points based on the directional angle and the theoretical velocity change, in order to perform trajectory segmentation and merging processing on the Cartesian space trajectory, includes: Under the condition that the current trajectory point is determined as a segmentation point, the first condition is that the theoretical velocity change of at least one motion axis is greater than a preset velocity threshold, or the directional angle is within a first preset angle range. Under the second condition, the current trajectory point is determined as the merging point, and the two adjacent trajectory segments are merged; the second condition is that the included angle of the direction is within the second preset angle range, and the contour error of the merged two adjacent trajectory segments of the current trajectory point is less than the preset contour error threshold. Wherein, the minimum value of the first preset angle range is greater than the maximum value of the second preset angle range.

3. The method according to claim 1, characterized in that, The process of generating machine tool control commands by performing smooth transition processing and speed planning on the joint space trajectory includes: With the goal of simultaneously satisfying the preset kinematic constraints and geometric accuracy error conditions, the smoothness parameters of the smooth transition process are iterated to complete the smooth transition process of the joint space trajectory. Based on the joint space trajectory after a smooth transition, speed planning is performed to generate machine tool control commands; the speed planning includes: planning a speed curve with continuous acceleration for the linear segment in the joint space trajectory, planning uniform parameter motion for the transition segment in the joint space trajectory, and using a bidirectional scanning algorithm to determine the speed connection relationship between the linear segment and the transition segment.

4. The method according to claim 3, characterized in that, The process aims to simultaneously satisfy preset kinematic constraints and geometric accuracy error conditions, iterating the smoothness parameters of the smooth transition process to complete the smooth transition processing of the joint space trajectory, including: Based on the preset geometric accuracy error threshold and kinematic constraint threshold, a set of smoothness coefficients for the smoothness parameters are initialized; Calculate the transition section trajectory curve based on the current smoothness coefficient; Calculate the acceleration and jerk of the transition segment trajectory curve, and determine whether the acceleration and jerk satisfy the kinematic constraint threshold; Calculate the geometric error between the transition segment trajectory curve and the discrete points in the joint space, and determine whether the geometric error meets the geometric accuracy error threshold; If any of the acceleration, jerk, or geometric error fails to meet the corresponding threshold requirement, the smoothness coefficient is updated until the acceleration, jerk, and geometric error calculated using the current smoothness coefficient all meet the corresponding threshold requirement. The smooth transition of the joint space trajectory is completed based on a smoothness coefficient that meets the threshold requirements.

5. The method according to claim 3, characterized in that, Velocity planning is performed based on the joint space trajectory after a smooth transition, including: For the linear segments in the joint space trajectory, an S-shaped or polynomial velocity planning method is used to generate a feed rate curve with continuous acceleration. For the transition segment in the joint space trajectory, velocity planning is performed based on parameter-based uniform motion; The bidirectional scanning algorithm determines the endpoint velocity of each linear segment under acceleration constraints in the forward scan and the starting velocity of each linear segment under deceleration constraints in the reverse scan. Adjust the speed between the linear segment and the transition segment based on the endpoint speed and the starting speed.

6. The method according to claim 1, characterized in that, The joint space trajectory is constructed through discretization and inverse kinematics, including: Based on a preset contour error threshold, the Cartesian space trajectory is discretized to generate discrete points in Cartesian space. Based on the inverse kinematics model of a three-axis machine tool, the discrete points in Cartesian space are mapped one by one to discrete points in joint space to form a sequence of discrete points in joint space. Based on the discrete point sequence in the joint space, the joint space trajectory is constructed using a unified parameterization method.

7. The method according to claim 1, characterized in that, After generating the machine tool control commands, the method further includes: Based on the joint space trajectory corresponding to the machine tool control command, the Cartesian space verification trajectory is calculated using a forward kinematics model. The Cartesian space verification trajectory is compared with the Cartesian space trajectory obtained by parsing the G code to evaluate the trajectory planning accuracy.

8. A trajectory planning device for machine tools, characterized in that, include: The parsing unit is configured to parse the G-code trajectory file of the CNC machine tool and generate intermediate trajectory instructions; The intermediate trajectory instruction is used to represent the pose parameters of the trajectory point in Cartesian space and the coordinate parameters in joint space, as well as the motion parameters at the trajectory point. The calculation unit is configured to calculate, based on the pose parameters and motion parameters, the directional angle between two adjacent segments of the current trajectory point in the Cartesian space, excluding the start and end points, and the theoretical velocity change of each motion axis of the machine tool when passing the current trajectory point, according to the pose parameters and motion parameters. The processing unit is configured to divide the trajectory points into segment points or merge points according to the directional angle and the theoretical velocity change, so as to perform trajectory segmentation and merging processing on the Cartesian space trajectory. The construction unit is configured to construct a joint space trajectory based on the Cartesian space trajectory processed by said trajectory segmentation and merging, through discretization and inverse solution processing. The generation unit is configured to generate machine tool control commands by performing smooth transition processing and speed planning processing on the joint space trajectory; wherein, the smooth transition processing is based on iterative smoothing based on simultaneously satisfying kinematic constraints and geometric accuracy error conditions; the speed planning processing performs differential planning and speed connection on the linear segment and transition segment obtained after the smooth transition processing.

9. An electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • A convenient method for joint space trajectory planning in industrial robots

    CN115122329B

  • Error-controllable short line segment trajectory smoothing method

    CN109571473A

  • High-speed corner trajectory planning method based on jerk constraint in numerical control machining

    CN119322488A

  • Numerical control system and path planning method therefor, and computer readable storage medium

    WO2019113972A1

  • Cartesian space trajectory planning method and apparatus

    WO2024041647A1