Five-axis machining control method and system based on motion controller
By marking and deleting the tiny reverse motion segments of a five-axis CNC machine tool, generating S-curve motion segments and optimizing the trajectory, the machine tool wear and accuracy problems caused by tiny reverse motions in five-axis linkage machining are solved, achieving efficient and high-precision machining control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FOSHAN DMT INTELLIGENT EQUIPMENT TECHNOLOGY CO LTD
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-19
AI Technical Summary
In the five-axis linkage machining process of a five-axis CNC machine tool, minute reverse motions cause the elimination of backlash in the rotary axis and frequent reversals in the servo system, increasing wear on the motor and transmission mechanism, reducing the surface quality of the machined parts, and existing processing methods such as parameter setting dead zones or low-pass filtering may lead to trajectory distortion or phase lag.
By acquiring the continuous motion sequence of the rotary axis, marking and deleting small reverse motion segments, generating S-curve motion segments, and obtaining and updating the tool tip trajectory through the forward kinematics mechanism, combined with trajectory deviation judgment and local smoothing optimization, an optimized S-curve motion segment is generated for machining control.
Shorten processing time, improve processing efficiency, enhance processing accuracy, reduce machine tool wear, and ensure processing quality.
Smart Images

Figure CN122018442B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of numerical control technology, specifically to a five-axis machining control method and system based on a motion controller. Background Technology
[0002] When performing five-axis linkage machining on a five-axis CNC machine tool, especially in complex surface machining scenarios such as precision mold cavities, the rotary axis will inevitably produce a slight reverse motion when the CAM software generates toolpath files due to factors such as the surface discretization sampling accuracy.
[0003] These tiny reverse movements are invalid noise generated during the numerical calculation process of the CAM algorithm. They trigger the elimination of backlash in the rotating shaft and frequent reversals in the servo system. This not only increases the wear of the motor and transmission mechanism, but also reduces the surface quality of the machined parts. The impact is even more prominent in high-precision machining scenarios.
[0004] If the above problems are not addressed, they will persist; simple parameter settings with dead zones will cause trajectory distortion; and using low-pass filtering may produce phase lag, affecting contour accuracy. Summary of the Invention
[0005] In view of the aforementioned problems, and in conjunction with the first aspect of the present invention, embodiments of the present invention provide a five-axis machining control method based on a motion controller, the method comprising:
[0006] Obtain a continuous motion sequence of the rotating axis, and mark the motion segments in the motion sequence whose motion distance is less than the first threshold, whose motion direction is opposite to the adjacent front and rear motion directions, and whose tool tip displacement is less than the second threshold as small reverse motion segments;
[0007] Delete the tiny reverse motion segments, and extract the endpoint and starting point parameters of the adjacent preceding and following motion segments of the tiny reverse motion segments. Reconnect based on the endpoint and starting point parameters to generate S-curve motion segments.
[0008] The updated blade tip trajectory corresponding to the S-curve motion segment is obtained based on the positive kinematics mechanism, and compared with the original blade tip trajectory to obtain the trajectory deviation.
[0009] Based on trajectory deviation and combined with a third threshold, the validity of the S-curve motion segment is judged, and the judgment result is obtained.
[0010] Based on the judgment results, local smoothing optimization is performed to obtain the optimized S-curve motion segment. The motion controller then controls the machining of the five-axis CNC machine tool based on the optimized S-curve motion segment.
[0011] As a further aspect of the present invention, a continuous motion sequence of the rotating axis is obtained, and motion segments in the motion sequence whose motion distance is less than a first threshold, whose motion direction is opposite to the adjacent preceding and following motion directions, and whose tool tip displacement is less than a second threshold are marked as micro-reverse motion segments, including:
[0012] The CAM toolpath file is obtained and parsed by the motion controller to extract the continuous motion sequence of the rotary axis, which contains several consecutive motion segments.
[0013] For each motion segment in the motion sequence, the motion distance, motion direction, and corresponding blade tip displacement after the motion segment is executed are extracted.
[0014] The extracted motion distance is compared with the first threshold, the motion direction is compared with the motion direction of adjacent preceding and following motion segments, and the displacement of the blade tip is compared with the second threshold.
[0015] When any movement segment simultaneously satisfies the following conditions: movement distance is less than the first threshold, movement direction is opposite to the movement direction of adjacent preceding and following movement segments, and blade tip displacement is less than the second threshold, it is marked as a micro reverse movement segment.
[0016] As a further aspect of the present invention, the minute reverse motion segment is deleted, and the endpoint and starting point parameters of the adjacent preceding and following motion segments of the minute reverse motion segment are extracted. Based on the endpoint and starting point parameters, reconnection is performed to generate an S-curve motion segment, including:
[0017] Based on the motion controller, a small reverse motion segment is deleted, and the endpoint parameters of the adjacent preceding motion segment and the starting parameters of the adjacent following motion segment are extracted. The endpoint parameters include the endpoint position and the endpoint velocity, and the starting parameters include the starting position and the starting velocity.
[0018] Obtain the distance between the end point of the adjacent preceding motion segment and the starting point of the adjacent following motion segment, and combine it with the velocity and acceleration constraints of the rotation axis to generate the S-curve motion segment.
[0019] As a further aspect of the present invention, the distance between the end point of an adjacent preceding motion segment and the starting point of an adjacent following motion segment is obtained, and combined with the velocity and acceleration constraints of the rotation axis, an S-curve motion segment is generated, including:
[0020] Set a distance threshold. If the distance is greater than or equal to the distance threshold, generate a three-segment S-curve motion segment of acceleration-uniform speed-deceleration. That is, accelerate from the end speed of the adjacent previous motion segment to the preset middle speed, and then decelerate to the starting speed of the adjacent next motion segment.
[0021] If the distance is less than the distance threshold, the acceleration and jerk parameters of the S-curve motion segment are adjusted.
[0022] As a further aspect of the present invention, the updated tool tip trajectory corresponding to the S-curve motion segment is obtained based on the positive kinematics mechanism, and compared with the original tool tip trajectory to obtain the trajectory deviation, including:
[0023] Based on the forward kinematics mechanism, and combined with the rotation axis angle and linear axis position parameters corresponding to the S-curve motion segment, the motion chain of the five-axis CNC machine tool is forward recursively derived through the homogeneous coordinate transformation matrix to obtain and update the tool tip trajectory.
[0024] Extract the original tool tip trajectory from the CAM toolpath file, and compare the updated tool tip trajectory with the original tool tip trajectory point by point to obtain the trajectory deviation.
[0025] As a further aspect of the present invention, the original tool tip trajectory is extracted from the CAM toolpath file, and the updated tool tip trajectory is compared with the original tool tip trajectory point by point to obtain the trajectory deviation, including:
[0026] The motion controller extracts the original tool tip trajectory from the original CAM tool position file when the tiny reverse motion segment is not deleted;
[0027] The updated tool tip trajectory is compared point by point with the original tool tip trajectory to obtain the position deviation value of each corresponding point. The absolute value of all position deviation values is taken, and the position deviation value with the largest absolute value is selected as the trajectory deviation.
[0028] As a further aspect of the present invention, based on trajectory deviation and in conjunction with a third threshold, the validity of the S-curve motion segment is determined, and the determination result is obtained, including:
[0029] Set a third threshold and compare the trajectory deviation with the third threshold;
[0030] If the trajectory deviation is less than or equal to the third threshold, the S-curve motion segment is deemed valid, and a valid judgment result is obtained.
[0031] If the trajectory deviation is greater than the third preset threshold, the S-curve motion segment is determined to be invalid, the invalid judgment result is obtained, the S-curve motion segment is cancelled, and the original motion sequence composed of the small reverse motion segment and the adjacent front and rear motion segments is retained.
[0032] As a further aspect of the present invention, local smoothing optimization is performed based on the judgment result to obtain an optimized S-curve motion segment. The motion controller then performs machining control on the five-axis CNC machine tool based on the optimized S-curve motion segment, including:
[0033] When the judgment result is a valid judgment result, the motion controller performs local smoothing optimization on multiple interpolation points before and after the reconnection point to obtain the optimized S-curve motion segment. The reconnection point is the point where the S-curve motion segment is reconnected with the adjacent preceding and following motion segments.
[0034] The optimization objective is to minimize the peak acceleration of the rotation axis motion;
[0035] The optimized S-curve motion segment is integrated into the rotary axis motion sequence, and the motion controller outputs control commands to drive the five-axis CNC machine tool to perform machining operations.
[0036] If the judgment result is invalid, the processing operation is performed based on the original motion sequence.
[0037] Furthermore, embodiments of the present invention also provide a five-axis machining control system based on a motion controller, applied to a motion controller for a five-axis CNC machine tool, comprising:
[0038] The acquisition module is used to acquire a continuous motion sequence of the rotation axis;
[0039] The marking module marks motion segments in the motion sequence whose motion distance is less than a first threshold, whose motion direction is opposite to the adjacent preceding and following motion directions, and whose blade tip displacement is less than a second threshold as tiny reverse motion segments.
[0040] The processing module is used to delete minute reverse motion segments, extract the endpoint and starting point parameters of adjacent preceding and following motion segments of the minute reverse motion segments, reconnect based on the endpoint and starting point parameters, and generate S-curve motion segments.
[0041] The comparison module obtains the updated blade tip trajectory corresponding to the S-curve motion segment based on the positive kinematics mechanism, and compares it with the original blade tip trajectory to obtain the trajectory deviation.
[0042] The judgment module, based on trajectory deviation and combined with a third threshold, performs a validity judgment on the S-curve motion segment and obtains the judgment result;
[0043] The optimization module performs local smoothing optimization based on the judgment result to obtain the optimized S-curve motion segment, and the motion controller performs machining control on the five-axis CNC machine tool based on the optimized S-curve motion segment.
[0044] This invention optimizes five-axis machining control by replacing minor reverse motions with S-curve motion segments that have no machining significance, thereby shortening machining time and improving machining efficiency. It also incorporates a conservative strategy of trajectory verification using forward kinematics, which helps to improve machining accuracy. Attached Figure Description
[0045] Figure 1This is a flowchart of the five-axis machining control method based on a motion controller according to the present invention;
[0046] Figure 2 This is a schematic diagram of the five-axis machining control system based on a motion controller according to the present invention. Detailed Implementation
[0047] The present invention will be further described in detail below through specific embodiments. The following embodiments are merely descriptive and not limiting, and should not be used to limit the scope of protection of the present invention.
[0048] like Figure 1 As shown, the five-axis machining control method based on a motion controller includes the following steps:
[0049] Step S1: Obtain the continuous motion sequence of the rotating axis, and mark the motion segments in the motion sequence whose motion distance is less than the first threshold, whose motion direction is opposite to the adjacent front and rear motion directions, and whose blade tip displacement is less than the second threshold as small reverse motion segments.
[0050] Step S1 includes:
[0051] Step S1-1: Obtain the CAM tool position file and parse the CAM tool position file through the motion controller to extract the continuous motion sequence of the rotary axis. The continuous motion sequence contains several continuously connected motion segments.
[0052] Specifically, the CAM toolpath file is a five-axis machining instruction file, including information such as motion parameters of each axis, tool parameters, and machining process parameters during the machining process. The motion controller, as the control unit of the five-axis CNC machine tool, has the function of parsing the CAM toolpath file, filtering and extracting the motion parameters of the rotary axes, such as the A-axis, from the toolpath file, and integrating them to form a continuous motion sequence. This motion sequence consists of several continuously connected motion segments, each corresponding to a continuous motion of a rotary axis, including key parameters such as the start position, end position, direction of motion, distance of motion, and speed of motion.
[0053] Furthermore, the parsing steps include reading standardized format data of the CAM toolpath file through the built-in file parsing interface, filtering out non-motion-related parameters such as tool compensation and machining modes; then identifying the motion commands of the rotary axes in the file, extracting core information such as the start angle, end angle, and motion speed from each command; sorting the extracted rotary axis motion commands according to the machining sequence, eliminating invalid and duplicate commands, and integrating them into a continuous rotary axis motion sequence.
[0054] In some possible embodiments, taking the machining of a complex curved surface part on a five-axis CNC machine tool as an example, the CAM tool position file of the part is obtained and imported into the motion controller; the motion controller extracts the motion parameters of the A-axis to obtain a continuous motion sequence. The A-axis moves from 89.90° to 89.95° and is marked as motion segment M1, from 89.95° to 90.05° and is marked as motion segment M2, from 90.05° to 89.98° and is marked as motion segment M3, and from 89.98° to 90.00° and is marked as motion segment M4. The above M1, M2, M3, and M4 are continuously connected motion segments, constituting the continuous motion sequence of the A-axis.
[0055] Step S1-2: For each motion segment in the motion sequence, extract the motion distance, motion direction, and the corresponding blade tip displacement after the motion segment is executed.
[0056] Specifically, the motion controller analyzes the extracted continuous motion sequence of the rotary axis segment by segment. For each motion segment, three parameters are extracted: motion distance, motion direction, and the corresponding tool tip displacement after the motion segment is executed. The motion distance is the absolute value of the difference between the starting and ending positions of the motion segment, reflecting the rotation amplitude of the rotary axis in that segment. The motion direction is divided into positive (e.g., the direction of increasing A-axis angle) and negative (e.g., the direction of decreasing A-axis angle), determined by comparing the magnitude of the starting and ending positions of the motion segment. The tool tip displacement is the change in position of the tool tip in the spatial coordinate system after the motion segment is executed, obtained through positive kinematics, reflecting the degree of influence of the motion segment on the machining trajectory.
[0057] Furthermore, the process of obtaining the tool tip displacement includes the following steps: the motion controller first obtains the initial angle of the rotary axis, the fixed position parameters of the linear axis, and the machine tool DH parameter table before the execution of the motion segment, including parameters such as the rotary axis installation angle, connecting rod length, and tool length; then, through a homogeneous coordinate transformation matrix, the machine tool motion chain is recursively transformed from the base coordinate system to the tool coordinate system in a forward direction to obtain the initial spatial coordinates of the tool tip before the execution of the motion segment; then, using the same method, the termination spatial coordinates of the tool tip when the rotary axis reaches the termination angle after the execution of the motion segment are calculated; finally, the difference between the initial coordinates and the termination coordinates in the X, Y, and Z directions is calculated, and the straight-line distance between the two points is calculated using the spatial distance formula. This distance is the tool tip displacement corresponding to the execution of the motion segment.
[0058] For example, taking motion segment M1, where the A-axis changes from 89.90° to 89.95°, the motion controller obtains the initial A-axis angle of 89.90° before the motion segment is executed, the fixed position parameters of the X, Y, and Z linear axes are X=100.23mm, Y=50.15mm, and Z=80.32mm respectively, and the machine tool DH parameters, including the A-axis installation angle of 0°, the connecting rod length of 150mm, and the tool length of 80mm; through forward recursion using the homogeneous coordinate transformation matrix, the initial coordinates of the tool tip before the motion are obtained as (10... 0.2300mm, 50.1500mm, 80.3200mm); After the motion segment is executed, the A-axis reaches the termination angle of 89.95°. By recalculating in the same forward direction, the termination coordinates of the tool tip are obtained as (100.2302mm, 50.1501mm, 80.3208mm); The spatial distance between the two points is calculated to be 0.0008mm, which is the tool tip displacement corresponding to the execution of motion segment M1; Similarly, the tool tip displacements of other motion segments are obtained according to the same scheme.
[0059] In some possible embodiments, the parameters of the A-axis motion sequence in step S1-1 are extracted segment by segment, including M1, 89.90° to 89.95°, with a motion distance of 0.05°, a positive motion direction, and a tool tip displacement of 0.0008mm after execution; M2, 89.95° to 90.05°, with a motion distance of 0.10°, a positive motion direction, and a tool tip displacement of 0.0015mm after execution; M3, 90.05° to 89.98°, with a motion distance of 0.07°, a negative motion direction, and a tool tip displacement of 0.0009mm after execution; M4, 89.98° to 90.00°, with a motion distance of 0.02°, a positive motion direction, and a tool tip displacement of 0.0003mm after execution.
[0060] Steps S1-3 compare the extracted motion distance with the first threshold, the motion direction with the motion direction of adjacent preceding and following motion segments, and the displacement of the blade tip with the second threshold.
[0061] When any movement segment simultaneously satisfies the following conditions: movement distance is less than the first threshold, movement direction is opposite to the movement direction of adjacent preceding and following movement segments, and blade tip displacement is less than the second threshold, it is marked as a micro reverse movement segment.
[0062] It should be noted that in this embodiment, the first threshold is set to 0.05°. The function of the first threshold is to determine whether the rotary axis motion segment is a minute motion. The specific value is set according to the actual motion characteristics of the rotary axis of the five-axis CNC machine tool and the requirements of the machining process. For example, the minimum resolution of the rotary axis of the existing mainstream five-axis CNC machine tool is usually 0.001°. The setting of 0.05° is much larger than the minimum resolution, which can effectively avoid misjudging the normal minute feed motion of the machine tool as a minute reverse motion. At the same time, combined with the discretization error when generating the CAM tool position file, when the rotary axis motion distance is less than 0.05°, its motion amplitude is extremely small and belongs to the noise generated by the numerical calculation of the CAM algorithm, which is not required by the machining process. Therefore, setting the first threshold to 0.05° can both filter out minute motion segments that have no machining significance and avoid misjudging normal machining motion.
[0063] Furthermore, in this embodiment, the second threshold is set to 0.001mm. The function of the second threshold is to determine whether the rotary axis motion segment has machining significance. The specific value is set based on the accuracy requirements of five-axis machining and the actual influence of the tool tip displacement. For example, the typical dimensional accuracy requirements of five-axis machining are usually ±0.001mm to ±0.005mm, and 0.001mm is the basic accuracy threshold for precision machining. When a certain motion segment of the rotary axis is executed, if the tool tip displacement is less than 0.001mm, the displacement is much smaller than the machining accuracy requirements and will not affect the final size and surface quality of the part, which is considered a motion without machining significance. If the set value is too large, such as 0.005mm, some small reverse motions that affect machining accuracy will not be identified. If the set value is too small, such as 0.0005mm, it will increase the load on the motion controller. Therefore, setting the second threshold to 0.001mm can filter out small reverse motion segments without machining significance while ensuring machining accuracy.
[0064] Understandably, this step employs a triple screening condition: the movement distance is less than the first threshold, the movement direction is opposite to both adjacent front and rear movements, and the tool tip displacement is less than the second threshold. The aim is to accurately identify rotary axis noise movements that have no machining significance and are solely caused by CAM numerical errors, thus avoiding misjudging normal machining movements. Specifically, the movement distance being less than the first threshold ensures that the selected movements are minute, excluding normal machining feed movements. The movement direction being opposite to both adjacent front and rear movements ensures that the selected movements are reverse movements, which are prone to servo reversal, backlash elimination, and increased machine tool wear. The tool tip displacement being less than the second threshold ensures that the selected movements have no machining significance; these movements will not affect part dimensions or surface quality, and their deletion will not affect machining accuracy. Only when all three conditions are met simultaneously can the movement segment be determined to be a minute reverse movement with no machining value caused by CAM numerical errors, and therefore it is marked as a minute reverse movement segment.
[0065] For example, by setting a first threshold of 0.05° and a second threshold of 0.001mm, the four motion segments in step S1-2 are compared. The motion distance of M1 is 0.05°, which is equal to the first threshold. The direction is positive and the same as the adjacent next segment M2, so no further judgment is needed. The motion distance of M2 is 0.10°, which is greater than the first threshold, so it is directly excluded. The motion distance of M3 is 0.07°, which is greater than the first threshold, so it is directly excluded. The motion distance of M4 is 0.02°, which is less than the first threshold. The direction is positive and opposite to the adjacent previous segment M3 and opposite to the adjacent next segment. Here, it is assumed that the direction of M5 is opposite. At the same time, the displacement of the blade tip is 0.0003mm, which is less than the second threshold. All three sets of comparisons meet the preliminary judgment conditions. Therefore, M4 is marked as a small reverse motion segment, while M1, M2, M3, and M5 do not meet the conditions and are not marked.
[0066] Step S2: Delete the small reverse motion segment, and extract the endpoint and starting point parameters of the adjacent preceding and following motion segments of the small reverse motion segment. Reconnect based on the endpoint and starting point parameters to generate the S-curve motion segment.
[0067] Step S2 includes:
[0068] Step S2-1: Based on the motion controller, delete the small reverse motion segment, extract the endpoint parameters of the adjacent preceding motion segment and the starting point parameters of the adjacent following motion segment. The endpoint parameters include the endpoint position and the endpoint velocity, and the starting point parameters include the starting point position and the starting point velocity.
[0069] Specifically, after the motion controller identifies and marks the minute reverse motion segment, it performs a deletion operation to remove the minute reverse motion segment from the continuous motion sequence of the rotation axis. Then, it extracts the endpoint parameters of the adjacent preceding motion segment and the starting parameters of the adjacent following motion segment. The endpoint parameters include the endpoint position, i.e., the rotation axis angle, and the endpoint velocity, i.e., the instantaneous velocity at the end of the motion. The starting parameters include the starting position, i.e., the rotation axis angle, and the starting velocity, i.e., the instantaneous velocity at the beginning of the motion. By extracting these two sets of parameters, a basis is provided for the smooth connection of subsequent preceding and following motion segments, avoiding motion discontinuities after deleting the minute reverse motion segment.
[0070] In some possible embodiments, continuing the above case, the motion controller deletes the marked small reverse motion segment M4, extracts the end point parameters of the adjacent preceding motion segment M3 and the starting point parameters of the adjacent following motion segment M5: the end point position of M3 is 89.98° and the end point speed is 5° / s; the starting point position of M5 is 90.00° and the starting point speed is 3° / s, and stores these two sets of parameters in the temporary buffer of the motion controller.
[0071] Step S2-2: Obtain the distance between the end point of the adjacent preceding motion segment and the starting point of the adjacent following motion segment, and combine the velocity and acceleration constraints of the rotation axis to generate the S-curve motion segment.
[0072] Step S2-2 includes:
[0073] Step S2-2-1: Set a distance threshold. If the distance is greater than or equal to the distance threshold, generate a three-segment S-curve motion segment of acceleration-uniform speed-deceleration. That is, accelerate from the end speed of the adjacent previous motion segment to the preset intermediate speed, and then decelerate to the starting speed of the adjacent next motion segment.
[0074] It should be noted that the distance threshold in this step can be set to 0.03°. The purpose of the distance threshold is to determine whether the distance between the preceding and following motion segments is sufficient to generate a complete three-segment S-curve motion segment. Its value is set based on the motion constraints of the rotary axis, the acceleration and deceleration characteristics of the S-curve, and the machining accuracy requirements, and it is compatible with the first and second thresholds mentioned above. On the one hand, it takes into account the motion capability of the rotary axis, such as the maximum acceleration of the A-axis of 5° / s² in this scheme. 2 Maximum jerk 2° / s 2 A spacing of 0.03° provides ample space for the three-stage acceleration-uniform speed-deceleration motion of the S-curve, ensuring that the acceleration phase can smoothly increase from the end speed of the adjacent previous segment to the middle speed, and the deceleration phase can smoothly decrease to the starting speed of the adjacent subsequent segment. This avoids incomplete acceleration / deceleration and sudden speed changes due to insufficient spacing. On the other hand, this value is between the first threshold and the typical motion distance of the micro-reverse motion segment, such as 0.02° of M4. This value can distinguish between a complete three-stage S-curve that can be generated and a short spacing that requires parameter adjustment. It can also adapt to the spacing characteristics after the micro-reverse motion segment is deleted. This avoids using the parameter adjustment mode when the spacing is too large and forcibly generating a three-stage S-curve when the spacing is too small. At the same time, it takes into account both motion smoothness and processing efficiency, thereby ensuring the reliability of S-curve connection.
[0075] Furthermore, the three-segment S-curve motion segment is a motion trajectory curve that balances smoothness and efficiency. Specifically, it involves continuous and seamless speed changes without abrupt changes during the motion, with acceleration and jerk controlled within the constraints of the rotating axis motion. It is divided into three continuous and smoothly connected stages: The first stage is the acceleration stage, where the motion controller, based on the maximum acceleration and jerk constraints of the rotating axis, controls the rotating axis to accelerate smoothly from the end speed of the adjacent previous motion segment to a preset intermediate speed in a smooth S-shaped manner. In this stage, the acceleration gradually increases from 0 to its maximum value and then gradually decreases back to 0, avoiding machine tool impact caused by sudden acceleration changes. The second stage is the constant speed stage, where the rotating axis moves at a preset intermediate speed at a constant speed. In this stage, both acceleration and jerk are 0, resulting in smooth motion and reducing machine tool vibration while ensuring motion efficiency. The third stage is the deceleration stage, symmetrical to the acceleration stage. The motion controller controls the rotating axis to decelerate smoothly from the intermediate speed to the starting speed of the adjacent next motion segment in an S-shaped manner. In the deceleration stage, the acceleration gradually increases from 0 to its maximum value and then gradually decreases back to 0, ensuring seamless connection with the speed of subsequent motion segments.
[0076] The preset intermediate speed is the speed parameter of the uniform phase of the three-segment S-curve motion segment. Its value range is between the end speed of the adjacent preceding motion segment and the starting speed of the adjacent following motion segment, and it must not exceed the maximum speed constraint of the rotation axis, such as the maximum speed of the A-axis of 10° / s. The average value of the speeds of the preceding and following segments is preferred as the initial intermediate speed, and then fine-tuned in combination with the acceleration and jerk constraints of the rotation axis to ensure that the acceleration phase can smoothly increase from the end speed of the adjacent preceding segment to the intermediate speed, and the deceleration phase can smoothly decrease from the intermediate speed to the starting speed of the adjacent following segment, avoiding sudden speed changes. For example, combining the parameters M3, the end speed of 5° / s and M7, the starting speed of 3° / s mentioned above, the preset intermediate speed can be 4° / s. This speed does not exceed the maximum speed of the A-axis of 10° / s, and can achieve a smooth connection between the acceleration and deceleration phases, adapting to the motion characteristics of the three-segment S-curve.
[0077] Understandably, in order to achieve a smooth connection between the preceding and following motion segments, balance processing efficiency and machine tool operation stability, and protect machine tool components while improving the quality of the processed surface, this embodiment uses a three-segment S-curve motion segment to reconnect the preceding and following motion segments of the deleted motion segment. Firstly, it avoids sudden speed changes. If the preceding and following motion segments are directly and abruptly connected, sudden speed increases and decreases will occur, causing impact on the rotary axis servo system and increasing wear on the motor and transmission mechanism. The acceleration and deceleration stages of the three-segment S-curve can achieve a smooth speed transition, eliminating impact. Secondly, it balances stability and efficiency. The acceleration stage rapidly increases speed, the deceleration stage smoothly decreases speed, and the constant speed stage ensures motion efficiency. Compared to a single acceleration and deceleration curve, it avoids both the decrease in processing efficiency caused by excessively slow motion and the vibration caused by excessively fast motion. Thirdly, it adapts to the motion constraints of the rotary axis. The three-segment structure can precisely control acceleration, ensuring that the acceleration does not exceed the maximum limit of the rotary axis, preventing servo overload and motion instability, and ensuring motion safety.
[0078] For example, if the distance threshold is set to 0.03°, and another small reverse motion segment M6 appears in the subsequent processing, after deleting M6, the end position of its adjacent preceding segment M5 is 90.05°, and the starting position of its adjacent following segment M7 is 90.09°, with a distance of 0.04° between them, which is greater than or equal to the distance threshold, then a three-segment S-curve is generated. The speed at the end of M5 is 4° / s, which accelerates to the middle speed of 6° / s. After moving at a constant speed for a certain distance, it decelerates to the starting speed of M7 of 5° / s, completing a smooth transition.
[0079] Step S2-2-2: If the distance is less than the distance threshold, the acceleration and jerk parameters of the S-curve motion segment are adjusted.
[0080] Understandably, if the distance is less than the distance threshold, the three-segment S-curve motion segment of acceleration-uniform speed-deceleration will not be generated. This is primarily because the motion space is insufficient to complete a full speed transition; the three-segment S-curve requires the uniform speed phase to maintain a stable length, otherwise the speed cannot rise smoothly or decelerate steadily. When the distance is small, such as in this embodiment where the distance between M3 and M5 is only 0.02°, far less than the distance threshold of 0.03°, the rotation axis must begin to decelerate before reaching the preset intermediate speed, and the uniform speed segment is almost compressed to disappear, degenerating the three-segment curve into an approximately sharp-peak abrupt trajectory; simultaneously, the acceleration... Speed and jerk are prone to exceeding limits, causing servo shock or vibration. Due to the limited travel, to complete the speed switch from the end speed to the starting speed within a very short distance, a forced transition with larger instantaneous acceleration and jerk is necessary. This can cause the rotary axis to accelerate or decelerate rapidly in a short time, which can easily cause servo drive overload, mechanical shock, vibration, or even contour errors. Therefore, when the spacing is insufficient, a three-segment S-curve is not used. Instead, the acceleration and jerk parameters are reduced to ensure continuous and controllable speed changes, while avoiding exceeding the dynamic capability boundary of the rotary axis, thus ensuring machining stability and trajectory accuracy.
[0081] Meanwhile, the adjustment of acceleration and jerk parameters for the S-curve motion segment must follow the logic of finite travel adaptation, constraint not exceeding limits, and smooth transition. First, the theoretical jerk for adapting to the finite distance is calculated. The motion controller, based on the distance between preceding and following motion segments, the end velocity of the previous segment, and the starting velocity of the next segment, combined with the maximum jerk constraint of the rotation axis, calculates the theoretical jerk that enables a smooth transition using kinematic formulas. This ensures that the speed switch from the starting point to the end point is completed within the finite distance, and that the jerk does not exceed the maximum limit of the rotation axis. Then, the acceleration parameters are adjusted using the theoretical jerk, with the acceleration adjustment matching the jerk, employing a gradual adjustment method. To avoid abrupt acceleration changes, the acceleration is gradually increased from 0 to the adjusted maximum value and then gradually decreased back to 0, forming a smooth S-shaped acceleration / deceleration trajectory. Simultaneously, the adjusted acceleration does not exceed the maximum acceleration constraint of the rotation axis. Finally, verification and fine-tuning are performed. The motion controller substitutes the adjusted acceleration and jerk parameters into the motion trajectory simulation module to simulate the S-curve motion process, verifying whether the speed transition is smooth and whether there are any impacts. If there are sudden speed changes or parameter exceedances, the jerk and acceleration values are further fine-tuned until the requirements of smooth transition within a finite interval and parameter not exceeding limits are met. Finally, the adjusted parameters are determined and applied to S-curve generation.
[0082] For example, if the distance between M3 and M5 is 0.02°, which is less than the distance threshold of 0.03°, a three-segment S-curve cannot be generated. In this case, the motion controller adjusts the acceleration and jerk parameters of the S-curve, changing the acceleration in the originally planned three-segment S-curve motion segment to 5° / s². 2Adjust to 3° / s 2 acceleration 2° / s 3 Adjust to 1° / s 3 Within a finite distance of 0.02°, a smooth transition is achieved from the end velocity of 5° / s at the end of M3 to the starting velocity of 3° / s at the beginning of M5, avoiding sudden velocity changes while not exceeding the motion constraints of the A-axis.
[0083] Step S3: Based on the positive kinematics mechanism, obtain the updated blade tip trajectory corresponding to the S-curve motion segment, and compare it with the original blade tip trajectory to obtain the trajectory deviation.
[0084] Step S3 includes:
[0085] Step S3-1: Based on the forward kinematics mechanism and combined with the rotation axis angle and linear axis position parameters corresponding to the S-curve motion segment, the motion chain of the five-axis CNC machine tool is forward recursively derived through the homogeneous coordinate transformation matrix to obtain the updated tool tip trajectory.
[0086] Specifically, obtaining the updated blade tip trajectory includes five steps.
[0087] The first step is parameter initialization and loading. The motion controller first loads the core parameters of the machine tool, including the DH parameter table of the five-axis CNC machine tool, which includes key parameters such as the A-axis installation angle, connecting rod length, and tool length. In this embodiment, the A-axis installation angle is 0°, the connecting rod length is 150mm, and the tool length is 80mm. The complete parameters of the S-curve motion segment are also loaded, including the A-axis angle variation range of 89.98°→90.00° corresponding to the S-curve, the M3 end speed of 5° / s, the M5 starting speed of 3° / s, and the fixed position parameters of the X, Y, and Z linear axes, such as X=100.23mm, Y=50.15mm, and Z=80.32mm. The position of the linear axes remains unchanged when machining this complex curved surface. At the same time, the preset interpolation period is loaded. In this embodiment, 1ms is used, that is, the angle of the S-curve motion segment is sampled once every 1ms to ensure the smoothness of the trajectory.
[0088] The second step is to discretize the S-curve motion segment. The motion controller discretizes the S-curve motion segment connecting M3 and M5 according to a preset interpolation period, decomposing the continuous S-curve trajectory into several discrete sampling moments. Each sampling moment corresponds to an instantaneous angle value of the A-axis. For example, with an interpolation period of 1ms and a total duration of 0.004s for the S-curve motion segment, it can be discretized into 4 sampling moments. The instantaneous angles of the A-axis corresponding to each moment are 89.98°, 89.99°, 89.995°, and 90.00°, respectively. Each angle value accurately matches the velocity change pattern of the S-curve, ensuring that the sampling points cover the entire S-curve motion range.
[0089] The third step is to construct a homogeneous coordinate transformation matrix chain. Based on the loaded machine tool DH parameters, the motion controller constructs a corresponding homogeneous coordinate transformation matrix for each kinematic pair, including the X, Y, and Z linear axes and the A-axis rotational axis, forming a complete transformation matrix chain from the base coordinate system to the tool coordinate system. The base coordinate system represents the machine tool fixed coordinate system, and the tool coordinate system represents the coordinate system where the tool tip is located. Among them, the X, Y, and Z linear axes correspond to translation transformation matrices, which only realize coordinate translation and do not change the posture. The A-axis corresponds to a rotation transformation matrix. The matrix parameters are updated in real time according to the instantaneous angle of the A-axis at each sampling moment to describe the change in tool posture after the A-axis rotation. The total transformation matrix is the product of the transformation matrices of each axis.
[0090] The fourth step involves recursively obtaining the tool tip coordinates point by point. For each discrete sampling moment, the motion controller substitutes the instantaneous A-axis angle at that moment into the rotation transformation matrix, and then performs matrix multiplication with the translation transformation matrices of the X, Y, and Z linear axes to obtain the tool pose matrix at that moment. The three elements of the translation portion are extracted from the pose matrix, which represent the three-dimensional spatial coordinates (X, Y, Z) of the tool tip in the world coordinate system at that sampling moment. new Y new Z new For example, the A-axis angle corresponding to sampling time t1 is 89.98°. After substituting into the transformation matrix, the coordinates of the tool tip are (100.2300mm, 50.1500mm, 80.3200mm); the A-axis angle corresponding to sampling time t2 is 89.99°, and the coordinates are (100.2301mm, 50.1501mm, 80.3204mm). The coordinates of all sampling times are obtained using the same method.
[0091] The fifth step is to integrate and form an updated tool tip trajectory. The motion controller sorts the three-dimensional coordinates of the tool tip calculated at all discrete sampling times according to the sampling time sequence, removes abnormal coordinate points, such as points whose calculation deviation exceeds the allowable range, and then connects the discrete coordinate points into a continuous trajectory curve through a linear interpolation algorithm. This curve is the updated tool tip trajectory corresponding to the S-curve motion segment.
[0092] Step S3-2: Extract the original tool tip trajectory from the CAM tool position file, and compare the updated tool tip trajectory with the original tool tip trajectory point by point to obtain the trajectory deviation.
[0093] The motion controller extracts the original tool tip trajectory from the original CAM tool position file when the small reverse motion segment is not deleted. It then compares the updated tool tip trajectory with the original tool tip trajectory point by point to obtain the position deviation value of each corresponding point. The absolute value of all position deviation values is taken, and the position deviation value with the largest absolute value is selected as the trajectory deviation.
[0094] For example, extract the original tool tip trajectory containing the M4 motion segment from the original CAM toolpath file. The corresponding tool tip coordinates for the M3 to M5 interval (M3 endpoint - M4 - M5 start point) are, in the original motion sequence: (100.2300mm, 50.1500mm, 80.3200mm) M3 endpoint, (100.2301mm, 50.1501mm, 80.3203mm) M4 midway, and (100.2302mm, 50.1501mm, 80.3205mm) M5 start point. Update the tool tip trajectory to the coordinates of this interval, in the S-curve sampling sequence: (100.2300mm, 50.1500mm, 80.3200mm) M3 endpoint, (100.2301mm, 50.1501mm, 80.3203mm) M4 midway, and (100.2302mm, 50.1501mm, 80.3205mm) M5 start point. (1500mm, 80.3200mm) M3 endpoint, (100.2301mm, 50.1501mm, 80.3202mm) midway along the S-curve, (100.2302mm, 50.1501mm, 80.3205mm) M5 starting point; compare the coordinates of each point with the corresponding sampling time, calculate the deviation value of each point, the first pair of corresponding points has a deviation of 0mm; the second pair of corresponding points has a deviation of 0mm in the X direction, 0mm in the Y direction, and 0.0001mm in the Z direction; the third pair of corresponding points has a deviation of 0mm; take the maximum value of all deviation values, that is, the trajectory deviation is 0.0001mm, which is less than the third threshold of 0.001mm.
[0095] Step S4: Based on the trajectory deviation and combined with the third threshold, the validity of the S-curve motion segment is judged, and the judgment result is obtained.
[0096] Step S4 includes:
[0097] Step S4-1: Set a third threshold and compare the trajectory deviation with the third threshold.
[0098] It should be noted that in this embodiment, the third threshold is set to 0.001mm. The function of the third threshold is to determine whether the deviation of the tool tip trajectory is within the allowable range of the process after the S-curve motion segment is reconnected. The setting of its threshold needs to be adapted to the machining accuracy target of this invention, the machine tool motion characteristics, and the threshold mentioned above, while also meeting the actual needs of precision five-axis machining. First, this embodiment is aimed at high-precision machining of complex curved surfaces, such as precision mold cavities. The typical dimensional accuracy requirement for such machining is ±0.001mm-±0.005mm. Setting the third threshold to 0.001mm can ensure that the trajectory deviation does not exceed the machining accuracy requirement, avoiding the scrapping of parts due to excessive deviation. Second, combined with the setting logic of the second threshold mentioned above, the second... The threshold is used to determine that a small reverse motion segment is meaningless for machining. The third threshold is consistent with the second threshold, which can realize the logic that after the meaningless motion is deleted, the trajectory deviation does not exceed the meaningless displacement. This ensures that after deleting the small reverse motion segment, the trajectory deviation will not exceed the original meaningless displacement, thus ensuring the consistency of accuracy. In combination with the motion capability of the machine tool in this embodiment, the minimum resolution of the rotary axis of the five-axis CNC machine tool is 0.001°, and the positioning accuracy of the linear axis is ±0.0005mm. The third threshold of 0.001mm will not cause the S-curve motion segment to be frequently judged as invalid due to being set too small, nor will it cause the trajectory deviation to exceed the accuracy requirements due to being set too large. It can ensure machining accuracy while taking into account the effectiveness of S-curve reconnection and machining efficiency.
[0099] Step S4-2: If the trajectory deviation is less than or equal to the third threshold, the S-curve motion segment is determined to be valid, and a valid judgment result is obtained.
[0100] Specifically, when the trajectory deviation is less than or equal to the third threshold, it means that after the generated S-curve motion segment connects the preceding and following motion segments, the deviation of the tool tip trajectory is within the allowable range of the process and will not affect the machining accuracy. At this time, the motion controller determines that the S-curve motion segment is valid and generates a valid judgment result.
[0101] In some possible embodiments, in conjunction with the example of step S4-1, if the trajectory deviation of 0.001mm is less than or equal to the set third threshold of 0.001mm, the motion controller determines that the S-curve motion segment connecting M3 and M5 is valid, obtains a valid judgment result, confirms that the S-curve motion segment can be used for subsequent processing and will not affect the machining accuracy of the part.
[0102] Step S4-3: If the trajectory deviation is greater than the third preset threshold, the S-curve motion segment is determined to be invalid, the invalid judgment result is obtained, and the S-curve motion segment is cancelled, while the original motion sequence composed of the small reverse motion segment and the adjacent front and rear motion segments is retained.
[0103] It is understood that the third threshold of 0.001mm is the minimum precision limit for precision machining in this embodiment. Its setting is completely matched with the machining process requirements and machine tool positioning accuracy. If the trajectory deviation is greater than this threshold, it means that the reconnection of the S-curve motion segment has caused the tool tip trajectory to deviate from the original design trajectory, and the deviation exceeds the part machining accuracy requirements. If the S-curve motion segment is used for machining, it will lead to the part dimensions being out of tolerance, the surface quality not meeting the standards, or even the part being scrapped. Therefore, the S-curve motion segment must be determined to be invalid and its use for machining must be prohibited.
[0104] Furthermore, although the original motion sequence contains minor reverse movements that have no machining significance, this sequence is the original trajectory designed in the CAM toolpath file, and its corresponding tool tip trajectory fully meets the machining accuracy requirements, so there will be no problem of excessive trajectory deviation. Compared with using invalid S-curves that lead to part scrap, retaining the original motion sequence may cause machine tool wear and slightly lower machining efficiency due to minor reverse movements, but it can avoid accuracy risks to the greatest extent and ensure that the machined parts meet the process requirements. It is a conservative and safe control strategy, and it also leaves room for subsequent re-optimization of S-curves and re-attempt to eliminate minor reverse movements.
[0105] For example, suppose that under a certain working condition, after deleting the small reverse motion segment M8, the trajectory deviation corresponding to the generated S-curve motion segment is 0.002mm, which is greater than the third threshold of 0.001mm. The motion controller determines that the S-curve motion segment is invalid and obtains the invalid judgment result. Then, the S-curve motion segment is canceled, the M8 motion segment is restored, and the original motion sequence composed of M7, M8 and M9 is retained. The processing is performed according to the original sequence.
[0106] Step S5: Based on the judgment result, perform local smoothing optimization to obtain the optimized S-curve motion segment, and the motion controller performs machining control on the five-axis CNC machine tool based on the optimized S-curve motion segment.
[0107] Step S5 includes:
[0108] Step S5-1: When the judgment result is a valid judgment result, local smoothing optimization is performed on multiple interpolation points before and after the reconnection point based on the motion controller to obtain the optimized S-curve motion segment. The reconnection point is represented as the point where the S-curve motion segment reconnects with the adjacent preceding and following motion segments.
[0109] The optimization objective is to minimize the peak jerk of the rotation axis motion.
[0110] It should be noted that the interpolation point is a tiny coordinate point or angle point after the motion controller discretizes the continuous motion trajectory. It is the smallest control unit for the machine tool to execute motion. The interval is determined by the interpolation cycle. In this embodiment, the interpolation cycle is 1ms, that is, an interpolation point is generated every 1ms. Taking the S-curve motion segment connecting M3 and M5 as an example, the S-curve is discretized to generate several continuous interpolation points. Each interpolation point corresponds to an instantaneous angle and speed of the A-axis. The machine tool achieves continuous and smooth motion by executing these interpolation points one by one. In this embodiment, five interpolation points before and after the reconnection point are selected for local smoothing optimization, that is, the five M3 interpolation points before the starting point of the S-curve, the five S-curve interpolation points after the starting point, the five S-curve interpolation points before the ending point of the S-curve, and the five M5 interpolation points after the ending point.
[0111] Specifically, the local smoothing optimization is performed to minimize the peak jerk of the rotation axis, and consists of a total of 4 steps.
[0112] The first step involves the motion controller precisely selecting five interpolation points before and after the reconnection point, and extracting parameters from these interpolation points, including instantaneous angle, velocity, acceleration, jerk, and the time interval between adjacent interpolation points. This time interval is consistent with the interpolation period and is 1ms. Simultaneously, the maximum jerk constraint of the rotation axis is retrieved; in this embodiment, it is 2° / s. 3 , as the boundary condition for optimization.
[0113] The second step is to establish an interpolation point parameter optimization model with the objective function of minimizing the peak jerk and the constraints of the maximum jerk of the rotation axis, velocity continuity, and acceleration continuity. This model can be solved by a quadratic programming algorithm to ensure that the jerk changes at each interpolation point are continuous and to avoid abrupt peak changes.
[0114] The third step involves the motion controller adjusting the parameters of the selected interpolation points point by point. This includes fine-tuning the acceleration and jerk values of interpolation points with sudden acceleration changes, using a gradual adjustment method to keep the difference in jerk between adjacent interpolation points within a preset range. At the same time, it ensures that the adjusted speed and acceleration do not exceed the rotation axis motion constraints and are smoothly connected with the parameters of adjacent unoptimized interpolation points.
[0115] The fourth step involves substituting the adjusted interpolation point parameters into the motion trajectory simulation module to simulate the rotation axis motion process and monitor the change in peak jerk in real time. If the peak jerk still exceeds the target value or there is a sudden change, the third step is repeated for a second fine-tuning. If the peak jerk drops to the minimum, in this embodiment, it starts from 2° / s. 3 Reduced to 1° / s 3 If the velocity and acceleration are continuous without abrupt changes and the motion is smooth, then the optimized interpolation point parameters are determined, and these optimized interpolation points are re-integrated to form the optimized S-curve motion segment.
[0116] The interpolation point parameter optimization model adopts a three-layer architecture including a target layer, a constraint layer, and an execution layer. The target layer aims to minimize the peak jerk of the rotation axis while maintaining the continuity of velocity and acceleration. Specifically, the quantitative objective is to control the peak jerk within the maximum jerk constraint range of the rotation axis and reduce it to the lowest possible level, with the ultimate goal of being less than or equal to 1° / s. 3 The constraint layer is used to limit the range of parameter adjustment to prevent the optimized parameters from exceeding the machine tool's motion capabilities. It mainly includes three types of constraints: jerk constraints, velocity constraints, and acceleration constraints. The jerk constraint requires the absolute value of the jerk to be less than 2° / s. 3 The velocity constraint is that the velocity is less than or equal to 10° / s, and the acceleration constraint is that the absolute value of the acceleration is less than or equal to 5° / s. 2 The execution layer is responsible for receiving the boundary conditions from the constraint layer, solving and adjusting the interpolation point parameters based on the optimization objective of the target layer, and outputting the optimized interpolation point parameters.
[0117] Furthermore, the model optimization parameters are specifically solved using a quadratic programming algorithm. The specific steps include: the execution layer receiving the interpolation point parameters (including instantaneous angle, velocity, acceleration, and jerk) and time intervals extracted in the first step, as well as various constraints from the constraint layer; inputting this data into the parameter storage module to complete model initialization; clarifying the parameters to be optimized, including the acceleration and jerk values at each interpolation point; using minimizing the peak jerk as the objective function, transforming the various constraints from the constraint layer into mathematical inequalities to construct a complete quadratic programming model; and obtaining a set of initial optimization parameters, i.e., the values for each interpolation point, through iterative solution. The acceleration and jerk adjustment values are set to ensure that the set of parameters meets all constraints and initially reduces the peak jerk. The execution layer verifies the initial optimization parameters, focusing on whether the jerk difference between adjacent interpolation points is controlled within the preset range, and whether the velocity and acceleration are continuous without discontinuities. If there is an excessive difference or motion discontinuity, the parameters of the corresponding interpolation point are fine-tuned. The fine-tuned parameters are fed back to the target layer to verify whether the peak jerk reaches the preset target. If not, the solution-fine-tuning process is repeated until the peak jerk is reduced to the minimum and all constraints are met. At this point, the final optimization parameters are output.
[0118] For example, continuing the above case, the judgment result is valid, and the reconnection points are the connection point of M3 and the S-curve at 89.98° and the connection point of the S-curve and M5 at 90.00°. The motion controller performs local smoothing optimization on 5 interpolation points before and after the two reconnection points. During the optimization process, the goal is to minimize the peak value of the A-axis acceleration. The velocity and acceleration parameters of the interpolation points are adjusted to reduce the peak acceleration from 2° / s. 3 Reduced to 1° / s 3To avoid vibration, the optimized S-curve motion segment is ultimately obtained.
[0119] It is understandable that at the point where the S-curve motion segment overlaps with the adjacent preceding and following motion segments, sudden changes in motion parameters, such as velocity, acceleration, and jerk, are likely to occur. If these are not optimized, they will affect the processing stability and surface quality. Therefore, this embodiment introduces a local smoothing optimization method in this step.
[0120] On the one hand, although the S-curve motion segment has achieved basic connection between the preceding and following motion segments, at the reconnection points, such as the connection positions between the S-curve and M3, and the S-curve and M5, the speed and acceleration parameters of the preceding and following motion segments are different, which can easily cause instantaneous changes in acceleration, triggering an impact on the rotary axis servo system, resulting in slight vibration of the machine tool, and in turn, producing fine tool marks on the surface of the parts. Local optimization can eliminate such abrupt changes by smoothly connecting the interpolation point parameters, ensuring a continuous and stable motion trajectory, and reducing vibration from the root cause.
[0121] On the other hand, when the jerk peak is too large, it will increase the instantaneous load on the rotary axis motor and transmission mechanism. Long-term operation will easily aggravate component wear and shorten the service life of the machine tool. Local optimization controls the jerk peak within a reasonable range by precisely adjusting the interpolation point parameters, reducing the impact load on the servo system, reducing component wear, and extending the service life of the machine tool.
[0122] Meanwhile, to avoid trajectory deviation during processing, local optimization can compensate for possible parameter deviations during S-curve generation by iteratively fine-tuning the interpolation point parameters, ensuring that the motion trajectory always meets the processing requirements and maintaining smooth motion even when the machine tool load fluctuates slightly.
[0123] Step S5-2: Integrate the optimized S-curve motion segment into the rotary axis motion sequence, and output control commands through the motion controller to drive the five-axis CNC machine tool to perform machining operations.
[0124] For example, the optimized S-curve motion segment is integrated into the A-axis motion sequence, and the new motion sequence is M1-M2-M3-optimized S-curve-M5-M6, etc. The motion controller generates control commands based on the optimized sequence to drive the A-axis to move along the optimized trajectory, such as smoothly transitioning from 89.98° to 90.00° through the optimized S-curve. At the same time, the X, Y, and Z linear axes are driven to move along the preset trajectory, eliminating the slight reverse motion caused by the original M4 motion segment.
[0125] Step S5-3: When the judgment result is invalid, the processing operation is performed based on the original motion sequence.
[0126] For example, if the judgment result is invalid, the motion controller abandons the local smoothing optimization, calls the restored original motion sequence, generates control commands, drives the A-axis to move along the original trajectory, and simultaneously drives the linear axis to move in coordination to perform machining operations; at the same time, the motion controller continues to perform minute reverse motion detection on the motion segment after M9.
[0127] Figure 2 The diagram shows a five-axis machining control system based on a motion controller, which can realize the ideas of this application, according to some embodiments of this application.
[0128] Specifically, a five-axis machining control system based on a motion controller, applied to motion controllers of five-axis CNC machine tools, includes:
[0129] The acquisition module is used to acquire a continuous motion sequence of the rotation axis;
[0130] The marking module marks motion segments in the motion sequence whose motion distance is less than a first threshold, whose motion direction is opposite to the adjacent preceding and following motion directions, and whose blade tip displacement is less than a second threshold as tiny reverse motion segments.
[0131] The processing module is used to delete minute reverse motion segments, extract the endpoint and starting point parameters of adjacent preceding and following motion segments of the minute reverse motion segments, reconnect based on the endpoint and starting point parameters, and generate S-curve motion segments.
[0132] The comparison module obtains the updated blade tip trajectory corresponding to the S-curve motion segment based on the positive kinematics mechanism, and compares it with the original blade tip trajectory to obtain the trajectory deviation.
[0133] The judgment module, based on trajectory deviation and combined with a third threshold, performs a validity judgment on the S-curve motion segment and obtains the judgment result;
[0134] The optimization module performs local smoothing optimization based on the judgment result to obtain the optimized S-curve motion segment, and the motion controller performs machining control on the five-axis CNC machine tool based on the optimized S-curve motion segment.
[0135] The specific usage and function of this embodiment are explained below:
[0136] First, a continuous motion sequence of the rotary axis is obtained. Motion segments in the sequence whose motion distance is less than a first threshold, whose motion direction is opposite to the adjacent preceding and following motion directions, and whose tool tip displacement is less than a second threshold are marked as micro-reverse motion segments. Next, these micro-reverse motion segments are deleted, and the endpoint and starting point parameters of the adjacent preceding and following motion segments are extracted. The endpoint and starting point parameters are reconnected to generate an S-curve motion segment. The updated tool tip trajectory corresponding to the S-curve motion segment is obtained through a forward kinematics mechanism and compared with the original tool tip trajectory to obtain the trajectory deviation. The validity of the S-curve motion segment is then judged based on a third threshold, and the judgment result is obtained. Finally, local smoothing optimization is performed based on the judgment result to obtain an optimized S-curve motion segment. The optimized S-curve motion segment is used to control five-axis machining. By replacing the meaningless micro-reverse motions with S-curve motion segments, machining time is shortened and machining efficiency is improved. Forward kinematics is used for trajectory verification, and a conservative strategy is combined to ensure machining accuracy.
[0137] In this embodiment, this application provides an electronic device, including a memory, a processor, a communication interface, and a communication bus. The memory stores a computer program that can run on the processor. The memory and the processor communicate with each other through the communication bus and the communication interface. When the processor executes the computer program, it implements the steps of the above method.
[0138] In this embodiment, the present application also provides a computer-readable medium having processor-executable non-volatile program code that causes the processor to perform the above-described method.
[0139] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A five-axis machining control method based on a motion controller, characterized in that, Including the following steps: To obtain a continuous motion sequence of the rotary axis, motion segments in the motion sequence whose motion distance is less than a first threshold, whose motion direction is opposite to the adjacent preceding and following motion directions, and whose tool tip displacement is less than a second threshold are marked as micro-reverse motion segments. This includes: obtaining a CAM toolpath file and parsing the CAM toolpath file through a motion controller to extract a continuous motion sequence of the rotary axis, wherein the continuous motion sequence contains several consecutive motion segments; for each motion segment in the motion sequence, extracting the motion distance, motion direction, and corresponding tool tip displacement after the motion segment is executed; comparing the extracted motion distance with the first threshold, the motion direction with the motion direction of the adjacent preceding and following motion segments, and the tool tip displacement with the second threshold; when any motion segment simultaneously satisfies the following conditions: motion distance less than the first threshold, motion direction opposite to the motion direction of the adjacent preceding and following motion segments, and tool tip displacement less than the second threshold, it is marked as a micro-reverse motion segment. Delete the tiny reverse motion segments, and extract the endpoint and starting point parameters of the adjacent preceding and following motion segments of the tiny reverse motion segments. Reconnect based on the endpoint and starting point parameters to generate S-curve motion segments. The updated blade tip trajectory corresponding to the S-curve motion segment is obtained based on the positive kinematics mechanism, and compared with the original blade tip trajectory to obtain the trajectory deviation. Based on the trajectory deviation and combined with the third threshold, the validity of the S-curve motion segment is judged and the judgment result is obtained. The judgment result includes: setting the third threshold and comparing the trajectory deviation with the third threshold; if the trajectory deviation is less than or equal to the third threshold, the S-curve motion segment is judged to be valid and a valid judgment result is obtained; if the trajectory deviation is greater than the third preset threshold, the S-curve motion segment is judged to be invalid and an invalid judgment result is obtained. The S-curve motion segment is then canceled, and the original motion sequence composed of the small reverse motion segment and the adjacent front and rear motion segments is retained. Based on the judgment results, local smoothing optimization is performed to obtain the optimized S-curve motion segment. The motion controller then controls the machining of the five-axis CNC machine tool based on the optimized S-curve motion segment.
2. The five-axis machining control method based on a motion controller according to claim 1, characterized in that, Delete the minute reverse motion segments, and extract the endpoint and starting point parameters of the adjacent preceding and following motion segments of the minute reverse motion segments. Reconnect based on the endpoint and starting point parameters to generate S-curve motion segments, including: Based on the motion controller, a small reverse motion segment is deleted, and the endpoint parameters of the adjacent preceding motion segment and the starting parameters of the adjacent following motion segment are extracted. The endpoint parameters include the endpoint position and the endpoint velocity, and the starting parameters include the starting position and the starting velocity. Obtain the distance between the end point of the adjacent preceding motion segment and the starting point of the adjacent following motion segment, and combine it with the velocity and acceleration constraints of the rotation axis to generate the S-curve motion segment.
3. The five-axis machining control method based on a motion controller according to claim 2, characterized in that, Obtain the distance between the end point of the adjacent preceding motion segment and the start point of the adjacent following motion segment, and combine this distance with the velocity and acceleration constraints of the rotation axis to generate an S-curve motion segment, including: Set a distance threshold. If the distance is greater than or equal to the distance threshold, generate a three-segment S-curve motion segment of acceleration-uniform speed-deceleration. That is, accelerate from the end speed of the adjacent previous motion segment to the preset middle speed, and then decelerate to the starting speed of the adjacent next motion segment. If the distance is less than the distance threshold, the acceleration and jerk parameters of the S-curve motion segment are adjusted.
4. The five-axis machining control method based on a motion controller according to claim 1, characterized in that, The updated blade tip trajectory corresponding to the S-curve motion segment is obtained based on the positive kinematics mechanism, and compared with the original blade tip trajectory to obtain the trajectory deviation, including: Based on the forward kinematics mechanism, and combined with the rotation axis angle and linear axis position parameters corresponding to the S-curve motion segment, the motion chain of the five-axis CNC machine tool is forward recursively derived through the homogeneous coordinate transformation matrix to obtain and update the tool tip trajectory. Extract the original tool tip trajectory from the CAM toolpath file, and compare the updated tool tip trajectory with the original tool tip trajectory point by point to obtain the trajectory deviation.
5. The five-axis machining control method based on a motion controller according to claim 4, characterized in that, Extract the original tool tip trajectory from the CAM toolpath file, compare the updated tool tip trajectory with the original tool tip trajectory point by point to obtain the trajectory deviation, including: The motion controller extracts the original tool tip trajectory from the original CAM tool position file when the tiny reverse motion segment is not deleted; The updated tool tip trajectory is compared point by point with the original tool tip trajectory to obtain the position deviation value of each corresponding point. The absolute value of all position deviation values is taken, and the position deviation value with the largest absolute value is selected as the trajectory deviation.
6. The five-axis machining control method based on a motion controller according to claim 1, characterized in that, Based on the judgment results, local smoothing optimization is performed to obtain the optimized S-curve motion segment. The motion controller then uses this optimized S-curve motion segment to control the machining of the five-axis CNC machine tool, including: When the judgment result is a valid judgment result, the motion controller performs local smoothing optimization on multiple interpolation points before and after the reconnection point to obtain the optimized S-curve motion segment. The reconnection point is the point where the S-curve motion segment is reconnected with the adjacent preceding and following motion segments. The optimization objective is to minimize the peak jerk of the rotation axis motion; The optimized S-curve motion segment is integrated into the rotary axis motion sequence, and the motion controller outputs control commands to drive the five-axis CNC machine tool to perform machining operations. If the judgment result is invalid, the processing operation is performed based on the original motion sequence.
7. A five-axis machining control system based on a motion controller, applied to the motion controller of a five-axis CNC machine tool, employing the five-axis machining control method based on a motion controller as described in any one of claims 1-6, characterized in that, include: The acquisition module is used to acquire a continuous motion sequence of the rotation axis; The marking module marks motion segments in the motion sequence whose motion distance is less than a first threshold, whose motion direction is opposite to the adjacent preceding and following motion directions, and whose blade tip displacement is less than a second threshold as tiny reverse motion segments. The processing module is used to delete minute reverse motion segments, extract the endpoint and starting point parameters of adjacent preceding and following motion segments of the minute reverse motion segments, reconnect based on the endpoint and starting point parameters, and generate S-curve motion segments. The comparison module obtains the updated blade tip trajectory corresponding to the S-curve motion segment based on the positive kinematics mechanism, and compares it with the original blade tip trajectory to obtain the trajectory deviation. The judgment module, based on trajectory deviation and combined with a third threshold, performs a validity judgment on the S-curve motion segment and obtains the judgment result; The optimization module performs local smoothing optimization based on the judgment result to obtain the optimized S-curve motion segment, and the motion controller performs machining control on the five-axis CNC machine tool based on the optimized S-curve motion segment.
Citation Information
Patent Citations
Five-axis curved surface machining path planning method based on differential vector optimization
CN113341876A
Machine tool machining shaft anomaly detection method and system based on dual-order excitation
CN121763944A