Time domain extension based cross-path segment interpolation method, system, device and medium
By using a cross-path segment interpolation method with time domain extension, the problem of time misalignment at the speed curve connection points in CNC machining is solved, achieving smooth transition and efficient speed control, thus improving machining quality and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU MOU XUN INTELLIGENT TECH CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-06-19
AI Technical Summary
In high-speed, high-precision CNC machining, traditional interpolation methods cause the connection points of the speed curves to not align with the fixed interpolation cycle time points of the CNC system in time, resulting in a deviation between the actual average speed and the theoretical instantaneous speed, causing speed fluctuations and uneven tool marks.
A cross-path segment interpolation method based on time domain extension is adopted. By extending the time domain in reverse and implementing a compensation mechanism, the residual motion is calculated and the motion is accurately intercepted to ensure that the interpolated motion is highly consistent with the velocity planning and reduce velocity fluctuations.
It achieves smooth transition between segment connection points, eliminates speed fluctuations, improves workpiece surface finish and processing quality, and is suitable for path interpolation of multiple small line segments, thus improving processing efficiency and smoothness.
Smart Images

Figure CN121900313B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CNC machining and motion control technology, and in particular to a cross-path segment interpolation method, system, device and medium based on time domain extension. Background Technology
[0002] In high-speed, high-precision CNC machining, S-shaped velocity planning is often used to achieve smooth motion control. Global planning allows an S-shaped velocity curve to span multiple machining path segments (toolpaths), and the acceleration at the connection points between segments does not need to be zero, thus significantly improving machining efficiency and trajectory smoothness.
[0003] However, in the practice of combining global planning with time-division interpolation, there is a technical problem that has not been fully addressed and resolved: the connection points of the speed curves planned by traditional interpolation methods are not aligned with the fixed interpolation cycle time points of the CNC system in time. This results in the start and end points (i.e., connection points) of a certain path segment potentially falling between two interpolation cycles. When the system performs speed planning, its calculations are based on precisely passing through this connection point; however, during the actual execution of interpolation output, due to the fixed cycle of sending commands, the actual tool path is a straight line segment between the two interpolation points, not precisely passing through the connection point. This microscopic misalignment between the "planned path" and the "interpolation output" in space and time causes a deviation between the actual average speed within an interpolation cycle and the planned theoretical instantaneous speed. In complex trajectories composed of numerous tiny line segments, this causes speed fluctuations, ultimately resulting in uneven tool marks in the working form, affecting machining quality.
[0004] In the prior art, for example, Chinese patent application number 201710994472.7, entitled "A Bidirectional Adaptive Interpolation Algorithm for NURBS Curves Based on S-Curve Acceleration and Deceleration Algorithm," although involving bidirectional interpolation to optimize speed, discloses a macroscopic encounter strategy of forward and reverse programming, and does not address the microscopic segment connection deviation problem caused by the discretization of the interpolation period. Chinese patent application number 201810842983.1, entitled "A PVT Control Method Based on S-Curve," discloses a scheme that matches the total motion time through time scaling (rounding), but also fails to solve the problem of accurate connection of residual motion under a fixed period.
[0005] To address the problems in the existing technology, this invention provides a method, system, device, and medium for cross-path segment interpolation based on time domain extension. Summary of the Invention
[0006] The purpose of this invention is to provide a cross-path segment interpolation method, system, device, and medium based on time domain extension, in order to solve the technical problem in the prior art where the connection points between planned speed curve segments are not aligned with the fixed interpolation cycle time points of the CNC system in time, resulting in a deviation between the actual average speed and the planned theoretical instantaneous speed within an interpolation cycle, leading to speed fluctuations and uneven tool marks.
[0007] The technical solution of this invention is: a cross-path segment interpolation method based on time domain extension, comprising:
[0008] Cross-path segment interpolation methods based on time domain extension include:
[0009] Obtain global planning information for the current velocity curve, including stage markers, initial velocity, acceleration, jerk, and jerk-jerk.
[0010] Search for the first effective velocity curve stage on the velocity curve and obtain the interpolated residual period and residual motion of the velocity curve stage.
[0011] Determine the interpolation residual period of the current velocity curve stage The value is non-zero, and the current global stage marker is ORed with the stage type identifier of the current motion stage, and the global stage marker has not changed;
[0012] If the judgment condition is met, the time domain is extended in reverse, and a compensation mechanism is adopted to compensate for the residual motion, and an interpolation command is output; then the standard interpolation cycle calculation and output process for the current motion stage begins.
[0013] Preferably, if the judgment condition is met, the time domain is expanded in reverse, expanding the range of time values for the current stage from... Expand to ,in, For the interpolation period, This indicates the effective duration of the current movement phase.
[0014] Preferably, the process of compensating for residual motion based on the reverse propagation time using a compensation mechanism includes:
[0015] Based on the extended time domain, a motion balance equation is established, and the cutoff time t that satisfies the motion balance equation is determined. The residual motion is then updated based on the cutoff time t. Output stage information.
[0016] Preferably, the expression for the motion balance equation is:
[0017] ;
[0018] in, This refers to the accumulated residual exercise volume. The unit direction vector of the current line segment. The displacement function is represented; the effective interval of the intercept time t is... .
[0019] Preferably, the displacement function is a fourth-degree polynomial with respect to time t, expressed as:
[0020] ;
[0021] in, , , , These are the instantaneous velocity, acceleration, jerk, and accelerometer at t=0 in the current stage;
[0022] The current stage can be any one of the following: acceleration phase, uniform acceleration phase, deceleration phase, uniform acceleration phase, deceleration phase, uniform deceleration phase, acceleration phase, uniform deceleration phase, acceleration phase, uniform speed phase, deceleration phase, uniform acceleration phase, acceleration phase, acceleration phase, uniform deceleration phase, acceleration phase, uniform deceleration phase, and deceleration phase.
[0023] Solving the motion balance equation includes:
[0024] If the current stage is a uniform velocity stage, the intercept time t can be directly solved by a quadratic equation in one variable.
[0025] If the current stage is a non-uniform speed stage, the intercept time t is solved by numerical iteration method.
[0026] Preferably, the method is applicable when the current curve is a line segment, and the effective duration is corrected to... .
[0027] Preferably, the method is applicable to global S-shaped speed planning, where one stage can span multiple processing path segments, and the effective duration of the current curve stage is [not specified]. satisfy .
[0028] A cross-path segment interpolation system based on time-domain extension is used to implement the aforementioned cross-path segment interpolation method based on time-domain extension for CNC machining, including:
[0029] The planning acquisition module is used to acquire the speed planning stage information corresponding to the current processing path segment;
[0030] The judgment module is used to determine whether the interpolation conditions for cross-path segments are met, including checking the interpolation residual period. Whether it is non-zero, and whether the global stage marker is consistent with the current stage;
[0031] The time domain extension module is used to expand the time domain of the current stage from... Expand to ;
[0032] The equation solving module is used to establish and solve the motion balance equation based on the extended time domain to obtain the cutoff time t.
[0033] The interpolation output module is used to extract the motion amount based on the intercept time t, update the status, and output the interpolation command;
[0034] The conventional interpolation module performs subsequent interpolation processing based on the interpolation instructions output by the interpolation output module;
[0035] The status update module is used to clear the residual period and residual motion after interpolation is completed, and to update the current stage information.
[0036] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor executes the computer program, it implements the aforementioned cross-path segment interpolation method based on time domain extension.
[0037] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the cross-path segment interpolation method based on time domain extension.
[0038] Compared with the prior art, the advantages of the present invention are:
[0039] This invention provides a cross-path segment interpolation method based on time domain extension. By setting a "reverse extension" mechanism, that is, when switching from one curve segment to the next for interpolation, the residual motion is calculated at the time point corresponding to the current stage, achieving a smooth transition at the connection point between segments. Furthermore, by extending the time domain and performing precise motion interception at the connection point, the actual interpolated motion closely matches the theoretical velocity planning, reducing velocity fluctuations caused by interpolation point offsets.
[0040] This invention achieves a smooth transition between segments, eliminates micro-speed fluctuations caused by discontinuous transitions between segments, makes the tool path smoother, and thus obtains more uniform tool marks on the machined surface (especially curved surfaces), significantly improving the surface finish of the workpiece.
[0041] The cross-path segment interpolation method provided by this invention is not limited to uniform speed segments. It supports scenarios where stages in global S-shaped speed planning span multiple path segments. For example, it can be applied to various stages of the S-shaped speed curve, especially to paths composed of multiple small line segments. It can effectively avoid uneven tool marks caused by inconsistent step size, and improve overall processing efficiency and smoothness.
[0042] The interpolation connection processing method provided by this invention, when interpolating multiple curve segments, correlates the time across the connection point with the length of the cumulative synthesized motion to correct the interpolation across the connection point. The calculation of the interpolation correction focuses on the moment of connection. It provides analytical solutions for uniform speed segments and iterative solutions for variable speed segments. While ensuring the universality of the algorithm, it also takes into account the real-time calculation requirements of the CNC system, avoids the huge computational loss caused by global replanning, is easy to integrate into the CNC system, and has strong compatibility. Attached Figure Description
[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments:
[0044] Figure 1 This is a schematic diagram of the method flow for the cross-path segment interpolation method in Embodiment 1 of the present invention;
[0045] Figure 2 This is a schematic diagram of the method flow for the cross-path segment interpolation method in Embodiment 2 of the present invention;
[0046] Figure 3 This is a schematic diagram of the module structure of the cross-path segment interpolation system based on time domain extension described in this invention;
[0047] Figure 4 This is a schematic diagram comparing the traditional method and the method of the present invention in terms of the connection between the spans of segments, taking a uniform speed segment as an example.
[0048] Figure 5 A schematic diagram comparing the velocity curves at the junction of segments using the conventional method provided by this invention and the method of this invention. Detailed Implementation
[0049] The present invention will be further described in detail below with reference to specific embodiments:
[0050] In conventional techniques, ideally, if interpolation can be aligned, the output speed will match the planned speed. However, during CNC machine tool machining, the machining toolpath inevitably involves turning and moving, making the probability that the connection point will fall exactly at the moment of the full interpolation cycle (achieving aligned interpolation) almost zero. Therefore, the connection point of the actually planned speed curve is not aligned with the fixed interpolation cycle moment of the CNC system in time. This means that the end point of a certain path segment (i.e., the connection point) may be located between two interpolation cycles, causing some connection points between segments to be missed precisely. This results in a "shortening" of the actual total distance traveled, leading to a deviation between the actual average speed within one interpolation cycle and the planned theoretical instantaneous speed in actual test results.
[0051] When interpolating the curve after speed planning, the actual trajectory is faithful to the original trajectory. However, due to the limitation of fixed interpolation cycle, in a complex trajectory composed of a large number of tiny line segments, the instantaneous speed deviation between the actual and theoretical speed will cause speed fluctuations, and ultimately lead to uneven tool marks in the working form, affecting the processing quality.
[0052] This invention provides a cross-path segment interpolation method based on time domain extension, applicable to high-precision CNC systems based on S-shaped speed planning. For the "reduced" interpolation path appearing at connection points, it can fine-tune the planning time without altering the original speed planning, accurately calculate and compensate for the residual motion at the segment connection points, restore the speed planned in the original speed plan, and ensure a high degree of consistency between the interpolation output and the speed plan, thereby achieving smoother speed control and better machined surface quality. To achieve the above objectives, this invention adopts the following technical solution.
[0053] Example 1.
[0054] A cross-path segment interpolation method based on time domain extension, comprising the following steps:
[0055] Step 1: Obtain the status.
[0056] When the system finishes interpolating the output of one curve segment and is ready to start interpolating the next curve segment, it first searches for and retrieves the first valid curve stage from the planning information of the next curve segment's velocity planning results.
[0057] The data for this motion phase includes: the global stage marker (StageMask) of the velocity curve, the initial velocity v, acceleration a, acceleration j, acceleration s, and the theoretical duration (effective time) of this phase. Simultaneously, the system reads two key state variables from global variables: the interpolated residual time. ( , (representing the interpolation period) and residual motion, where residual motion is a three-dimensional vector.
[0058] The interpolation residual time is the amount of time remaining after interpolation for a complete interpolation cycle. For example, if the current curve segment is planned for 1.3 cycles, and the current curve segment can only be interpolated for one full cycle, then the interpolation residual time after interpolation for the current curve segment is 0.3 cycles. This time will be accumulated and saved to [the specified time]. In this context, it is used as the input for the next curve segment interpolation.
[0059] In this context, an effective curve segment refers to a phase from the starting point to the ending point where the time taken is zero; otherwise, it is considered an ineffective phase. For example, if the entire motion from the starting point to the ending point consists only of acceleration phases with no constant velocity phases, then the constant velocity phases within that curve segment are ineffective.
[0060] Step 2: Compensation judgment.
[0061] The judgment logic contains two conditions that must be met simultaneously:
[0062] (1) Interpolation residual time Not equal to zero. A non-zero value indicates that the previous interpolation cycle did not complete, and there is "unfinished" motion that needs to be incorporated into the current cycle for processing.
[0063] (2) Continuous motion phase. The global stage flag (StageMask) maintained by the system is ORed with the type flag bit of the current motion phase, and the result of the operation is checked to see if the value of the global stage flag (StageMask) has changed.
[0064] The global stage marker (StageMask) is a bitmap variable used to record and track the motion stage types experienced by each interpolation cycle at the system level.
[0065] This invention is applied to 15-segment velocity curve planning, with a total of 15 motion stage types, including: acceleration segment, uniform acceleration segment, deceleration segment, uniform acceleration segment, deceleration segment, uniform deceleration segment, acceleration segment, uniform speed segment, deceleration segment, uniform acceleration segment, acceleration segment, uniform speed segment, acceleration segment, acceleration segment, uniform speed segment, acceleration segment, acceleration segment, uniform speed segment, acceleration segment, acceleration segment, uniform speed segment, and deceleration segment.
[0066] Since the 15-segment S-shaped velocity curve includes all types of the 7-segment S-shaped velocity curve, and the 7-segment S-shaped velocity curve includes all types of the 3-segment trapezoidal velocity curve, this invention is also applicable to the planning of 7-segment S-shaped velocity curves and 3-segment trapezoidal velocity curves.
[0067] Representation format: bitmask, each bit corresponds to a speed stage type. For example, taking a trapezoidal speed curve as an example, bit 0 represents a uniform acceleration segment, bit 1 represents a uniform speed segment, and bit 2 represents a uniform deceleration segment.
[0068] If the global stage marker (StageMask) maintained by the system is ORed with the type marker of the current motion stage and the marker does not change, it means that the current motion stage is of the same type as the motion stage at the end of the previous interpolation cycle, and they belong to the same stage connection.
[0069] If both of the above conditions are met, it indicates that there is a scenario requiring precise interpolation compensation, and proceed to step 3. Otherwise, it is considered a normal case, and proceed to step 5 for standard interpolation processing.
[0070] Step 3: Reverse expansion of the time domain.
[0071] The current motion phase is virtually extended forward (to the past) by one interpolation period. That is, the function describing the displacement change in this phase is... The domain of the independent variable t, from the original domain Expand to ,in, Indicates the interpolation period. This indicates the effective duration of the current movement phase.
[0072] Making t virtually negative by one instruction cycle (in this embodiment, one instruction cycle equals one interpolation cycle) is equivalent to extending this stage in reverse by one instruction cycle in order to rewind the situation that occurred earlier.
[0073] Step 4: Construct the motion balance equation and solve for the cutoff time t.
[0074] If the current curve segment is a line segment after planning, refer to the appendix. Figure 1 A flowchart illustrating the process of reverse time domain extension for fine-grained interpolation is provided. For the extended time domain, a motion balance equation is established, and its expression is as follows:
[0075] ;
[0076] in, The cumulative residual motion is expressed as , The unit vector of the current line segment. The displacement function is represented; the effective interval of the intercept time t is... .
[0077] The left side of the motion equilibrium equation represents the sum of the residual motion and the displacement corresponding to the current stage s(t), while the right side represents the motion length corresponding to one cycle of the velocity planning. This motion equilibrium equation ensures that, with time t as the cutoff point, the total interpolation path length matches the path on the velocity planning curve of the previous cycle at that time. In other words, it ensures that the motion corresponding to the residual interpolation and the span obtained after extracting the motion from the current segment are consistent with the path length on the planned velocity curve within a unit interpolation cycle.
[0078] The displacement function is a fourth-degree polynomial with respect to time t, and its expression is:
[0079] ;
[0080] in, a, j, and s represent the instantaneous velocity, acceleration, acceleration-acceleration, and acceleration-acceleration at t=0 in the current stage, respectively.
[0081] The current stage type is any one of the 15 movement stage types.
[0082] The initial state of each parameter in the displacement function determines the type of motion in that stage. For example, when j and s are both 0, if a is greater than 0, it is a uniform acceleration stage; if a is equal to 0, it is a uniform velocity stage; and if a is less than 0, it is a uniform deceleration stage.
[0083] Solve for the cutoff time t that satisfies the motion balance equation. Solving the motion balance equation includes:
[0084] If the current stage is a constant speed stage, It is a linear function of t, and the equation can be simplified to a quadratic equation. The intercept time t can be directly solved by the quadratic equation, which has high computational efficiency.
[0085] If the current stage is a non-uniform velocity stage (a, j, s are not all 0), the intercept time t is solved by numerical iteration methods. For example, the bisection method iteration or the Newton-Raphson method can be used to obtain the intercept time t that satisfies the motion balance equation, thus achieving accurate step interpolation of the curve. While ensuring accuracy, the real-time requirements are met by controlling the number of iterations.
[0086] If the calculated intercept time t satisfies Then, the total amount of exercise in the current stage will be added to the residual amount of exercise. and the effective duration of the current stage Set to zero.
[0087] If the calculated intercept time t satisfies In the current Stage, the motion amount corresponding to the intercept time t is added to the residual motion amount. And update the remaining validity period of the Stage. And the instantaneous velocity, acceleration, jerk, and jerk-jerk corresponding to the new starting point, and the effective duration. satisfy .
[0088] Residual exercise Interpolate the output, then set the current interpolation residual period. Residual exercise volume Also clear to zero (set all three vector components of X, Y, and Z to zero).
[0089] Step 5: Subsequent interpolation output and residual update.
[0090] When the current interpolation is completed, the last interpolation cycle may still have less than one interpolation cycle remaining. The time and corresponding amount of exercise are used to accumulate the remaining time, which is less than one interpolation cycle, into the interpolation residual time. In the process, the corresponding remaining exercise volume is added to the residual exercise volume. In, and update the interpolation residual time With residual exercise This serves as the input for the next curve segment interpolation, and so on in a loop.
[0091] The above method can be applied to global S-shaped speed planning, including 7-segment S-shaped speed curve planning and 15-segment S-shaped speed curve planning; one stage can span multiple processing path segments, and each curve stores the parameter information required for each stage.
[0092] However, when the entire curve interpolation is completed, the current residual motion may be formed by connecting multiple curve segments (discontinuities and abrupt changes between adjacent curve segments). Furthermore, this invention provides Embodiment 2.
[0093] Example 2.
[0094] In Implementation Example 1, when the entire curve interpolation is completed, there is an accumulated residual interpolation motion, and this accumulated residual interpolation motion crosses the path segment. This implementation provides a cross-path segment interpolation method based on time domain extension. Specifically, the overall algorithm flow is as follows: Figure 2 As shown, the specific steps include:
[0095] Steps 1, 2, and 3 are the same as those in Example 1, and are summarized in this example as follows:
[0096] After completing the interpolation of the previous curve segment, record two global variables: the interpolation residual period. The residual motion accumulated from the previous curve .
[0097] Moving on to the next curve to be interpolated, search its velocity planning data to obtain information about the first valid motion stage, including its displacement function. and the corresponding initial motion parameters (v, a, j, s) and the effective duration of the phase. .
[0098] The current stage state is determined to satisfy: interpolation residual time. If the value of the global stage flag (StageMask) is not equal to zero and the value of the global stage flag remains unchanged after a bitwise OR operation between the global stage flag and the type flag of the current motion stage, then the time domain is extended in reverse, that is, the range of values for t is expanded from the domain defined. Expand to .in, Indicates the interpolation period. This indicates the effective duration of the current motion phase. If the judgment condition is not met, normal interpolation will be performed directly.
[0099] Step S4: Correct the interpolation residual time based on the "reverse extension" time.
[0100] First, calculate the residual kinetic energy. scalar length Since this is the journey "unfinished" in the previous cycle, entering the current stage can be understood as needing to "retreat" from the starting point of the current stage. Only a certain distance is needed to connect with the end point of the previous cycle. Therefore, [the distance is to be determined]. Invert the value, substitute it into the displacement function of the current stage, and solve the equation. Find a time point t ( This means that the displacement traversed from time t in the past to time 0 is equal to the scalar length of the residual motion that needs to be "compensated". However, the direction is opposite.
[0101] The S-shaped velocity curve displacement function in this embodiment The expression and the displacement function in Example 1 The expressions are the same, and the parameters have the same meaning.
[0102] If the current phase is a uniform velocity phase (at which point a=0, j=0, s=0), the equation simplifies to: ,pass Calculate and obtain time t.
[0103] If the current phase is non-uniform, the equation is a quartic equation in one variable, within the interval... If a unique solution exists within the memory space, then methods including bisection iteration, fixed-point iteration, and Newton's iteration are used to solve the problem. The purpose of this iterative process is to find the precise motion state point that matches the residual spatial displacement in reverse along the timeline.
[0104] Since t is negative, its absolute value is equal to the scalar length of the residual motion of the previous cycle completed on the backward extension line. Given the time length corresponding to the current stage, the interpolated residual time is updated as follows: The residual period is corrected using the -t option. The system identifies time t as the start of the current motion phase within the system clock, and re-interpolates the "passed" time -t, thereby re-interpolating and planning the scalar length of the residual motion.
[0105] Step S5: Precise step interpolation.
[0106] If the current curve is a straight line segment, precise step interpolation is performed to obtain the most accurate transition effect.
[0107] In detail, establish a motion balance equation and find a time point t ( This allows us to proceed from that moment forward for one complete interpolation cycle. The total motion within the time frame is numerically equal to the current accumulated residual motion plus the vector sum of the motion vectors from the current stage start point to time t. This motion balance equation ensures that, with time t as the cutoff point, the total interpolation path length matches the path length on the velocity planning curve of the previous cycle at that time. The equation is as follows:
[0108] ;
[0109] in, It is the unit vector of the current line segment. This refers to the accumulated residual exercise volume. Represents the displacement function. The interpolation period is represented by the effective interval of the intercept time t. .
[0110] After solving the motion balance equation to obtain t, process the value of t:
[0111] like This indicates that the time required for a smooth transition exceeds the total duration of the current phase.
[0112] At this point, the total amount of exercise in the current stage is added to the residual amount of exercise. In, that is And set the current Stage's valid duration to zero. (), indicating that the phase has been exhausted.
[0113] like This indicates that a precise transition point has been found within the current stage.
[0114] At this point, the motion at time t is extracted from the current Stage and added to the residual motion. Above, that is And update the remaining validity period of the Stage. And update the instantaneous velocity, acceleration, accelerometer, and jerk-jerk corresponding to the new starting point, and the effective duration. satisfy .
[0115] Step S6: Interpolation output and residual update.
[0116] After completing step S5, if If the accumulated motion is not less than that required for one complete interpolation cycle, then the motion required for one complete interpolation cycle is sent as output to the servo driver, and the remaining interpolation cycle is processed. Reset to zero, residual exercise volume All components are also set to zero.
[0117] When the entire curve interpolation is completed, if the last interpolation cycle is incomplete (i.e., there are cycles smaller than 10), then the interpolation is incomplete. If there is a time slack, then the remaining time will be added to the remaining time. The corresponding amount of exercise is accumulated in the middle. China. New and This will serve as the input information before the next segment of curve interpolation begins, thus forming a complete closed loop.
[0118] This embodiment extends the "Stage" of the velocity curve in the reverse direction by one interpolation cycle in the next curve interpolation cycle, thus adjusting the remaining interpolation time. Corrections were made to address the issue of the interpolation path not accurately passing through the junction point. Then, based on the corrected interpolation residual time... and residual exercise Backtracking calculations are performed to establish and solve the motion balance equation, so that the motion corresponding to the residual interpolation is consistent with the path span obtained after extracting the motion in the current line segment and the path length corresponding to the unit interpolation cycle on the planned speed curve, thus achieving consistency between the actual interpolation speed and the speed planning.
[0119] This invention provides a cross-path segment interpolation system based on time domain extension, used to implement the aforementioned cross-path segment interpolation method based on time domain extension, achieving efficient and high-precision CNC machining. See appendix. Figure 3 As shown, the system includes:
[0120] The planning acquisition module is used to obtain the speed planning stage information corresponding to the current processing path segment from the global planning curve;
[0121] The judgment module is used to determine whether the interpolation conditions for cross-path segment are met, including checking the interpolation residual period. Whether it is non-zero, and whether the global stage marker is consistent with the current stage;
[0122] The time domain extension module is used to expand the time domain of the current stage from... Expand to ;
[0123] The equation solving module is used to establish and solve the motion balance equation based on the extended time domain to obtain the cutoff time t.
[0124] The interpolation output module is used to extract the motion amount based on the intercept time t, update the status, and output the interpolation command;
[0125] The conventional interpolation module performs subsequent interpolation processing based on the interpolation instructions output by the interpolation output module;
[0126] The status update module is used to clear the residual period and residual motion after interpolation is completed, and to update the current stage information.
[0127] The cross-path segment interpolation method and system based on time-domain extension provided by this invention can solve the motion deviation problem caused by the non-coincidence of interpolation points and path connection points in existing technologies, and improve the consistency of machining trajectory and speed planning. It can be widely used in high-precision motion control scenarios, such as CNC machine tools, robot trajectory control, and 3D printing, and can significantly improve machining consistency and surface quality under complex multi-segment paths, showing good prospects for industrial applications.
[0128] Based on the above methods and systems, this invention provides comparative tests on a CNC simulation platform. The control group uses a conventional interpolation method with standard compensation logic, while the experimental group uses the inverse extended time domain interpolation method provided by this invention.
[0129] The experimental conditions were as follows: the test trajectory was a spatial polyline composed of 1000 tiny straight line segments, with a global 15-segment S-shaped velocity planning, a maximum speed of 300 mm / s, and an interpolation period of 1 ms.
[0130] The test results are compared below:
[0131] See attached document Figure 5 As shown, a schematic diagram comparing the velocity curves at the segment transition between the conventional method and the method of this invention is provided, where the horizontal axis represents time and the interpolation period is used as the interpolation period. The vertical axis represents instantaneous velocity (relative value, in %).
[0132] The planned speed (ideal curve) corresponds to a dotted line, with the speed at the junction of segments being 100%. The actual output speed of the traditional interpolation method corresponds to a dotted line with a box, and because the junction is not on the interpolation point, it produces obvious fluctuations. However, the actual output speed curve using this method corresponds to a solid line with a triangle symbol.
[0133] Based on the comparison of velocity curves, the root mean square error (RMSE) of the interpolated output velocity and the planned velocity was calculated on the same trajectory segment. The RMSE of the experimental group was 0.1028 mm / s, while that of the control group was 2.2594 mm / s. The RMSE of the output velocity of the method of this invention is significantly lower than that of the traditional method, and the velocity fluctuation of the experimental group was reduced by 94.45%.
[0134] A comparison of the three velocity curves shows that, in order to eliminate the fluctuations in the synthesized velocity caused by not experiencing the connection point, this invention uses cross-cycle interpolation at the connection point, and the output velocity can match the previously planned velocity, indicating that the velocity fluctuation elimination effect is significant. In contrast, the actual interpolated output velocity curve of the traditional velocity curve is lower than the planned velocity curve.
[0135] Additionally, refer to the appendix Figure 4 The provided span comparison chart shows that, taking the uniform speed segment as an example, the traditional algorithm faithfully reproduces the original trajectory and intercepts it at equal intervals. However, the method in this embodiment, after compensation interpolation through the above-mentioned reverse extension and solution of the motion balance equation, has higher interpolation accuracy, maintains a consistent span between curve segments, and improves the uniformity of the tool marks.
[0136] By simulating the surface morphology of the workpiece, the control group showed periodic alternating bright and dark stripes (tool marks) on the workpiece surface, with a measured simulated roughness Ra of approximately 1.2 μm. The experimental group showed a reduction in simulated roughness Ra to 0.6 μm, representing an improvement of approximately 50% in surface roughness. This effectively improved the uniformity of the workpiece surface and resulted in better quality.
[0137] The test data results above show that the method of the present invention can significantly improve interpolation accuracy and surface quality with minimal computational cost.
[0138] This invention also provides an electronic device, which includes a processor and a memory; the memory stores one or more instructions, which are adapted for the processor to load and execute, to implement a cross-path segment interpolation method based on time domain extension as described in the above method embodiments.
[0139] Memory is used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in memory. Memory can primarily include a program storage area and a data storage area. The program storage area stores the operating system, application programs required for functions, etc.; the data storage area stores data created based on device usage, etc. Furthermore, memory can include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory may also include a memory controller to provide the processor with access to the memory.
[0140] The internal structure of the electronic device provided in the embodiments of the present invention may include, but is not limited to, a processor, a memory, and a communication interface. The processor, memory, and communication interface in the electronic device may be connected by a bus or other means. In the embodiments of this specification, a connection via a bus is taken as an example.
[0141] The processor (or CPU, Central Processing Unit) is the computing and control core of the electronic device. A communication interface is used for communication between the memory and the processor. The memory stores programs and data. It is understood that the memory here can be a high-speed RAM storage device, or a non-volatile memory device, such as at least one disk storage device; optionally, it can also be at least one storage device located far from the aforementioned processor. The memory provides storage space, which stores the operating system of the electronic device, including but not limited to: Windows system (an operating system), Linux system (an operating system), etc., which are not limited in this invention; and the storage space also stores computer programs (including program code) suitable for being loaded and executed by the processor. In the embodiments of this specification, the processor loads and executes the computer program stored in the memory to implement the cross-path segment interpolation method based on time domain extension provided in the above method embodiments.
[0142] This invention also provides a computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction, at least one program, code set, or instruction set related to implementing the time-domain-extended cross-path segment interpolation method in the method embodiments. The at least one instruction, at least one program, code set, or instruction set can be loaded and executed by the processor of the electronic device to implement the time-domain-extended cross-path segment interpolation method provided in the above method embodiments.
[0143] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0144] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments, while other embodiments fall within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than those shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0145] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0146] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0147] The above description is merely a preferred embodiment of the present invention and should not be construed as limiting the scope of the invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A time-domain extension based cross-path segment interpolation method, characterized in that, include: Obtain global planning information for the current velocity curve, including stage markers, initial velocity, acceleration, jerk, and jerk-jerk. Search for the first effective velocity curve stage on the velocity curve and obtain the interpolated residual period and residual motion of the velocity curve stage. determining an interpolation residual period for the current speed profile phase is non-zero and the current global phase flag does not change after an or operation with the phase type identification of the current motion phase If the judgment condition is met, the time domain is extended in reverse, and a compensation mechanism is adopted to compensate for the residual motion, and an interpolation instruction is output. The process for calculating and outputting the standard interpolation cycle following the current motion phase; If the judgment condition is met, the time domain is reversely expanded, and the time value range of the current stage is expanded from to , wherein, is an interpolation period, represents the effective duration of the current motion stage. The process of compensating for residual motion based on the reverse extension time includes: Based on the extended time domain, a motion balance equation is established, and the cutoff time t that satisfies the motion balance equation is determined. The residual motion is then updated based on the cutoff time t. Output stage information; The expression for the motion balance equation is: ; in, This refers to the accumulated residual exercise volume. The unit direction vector of the current line segment. The displacement function is represented; the effective interval of the intercept time t is... .
2. The cross-path segment interpolation method based on time domain extension according to claim 1, characterized in that, The displacement function is a fourth-degree polynomial with respect to time t, and its expression is: ; in, , , , These are the instantaneous velocity, acceleration, jerk, and accelerometer at t=0 in the current stage, respectively. The current stage can be any one of the following: acceleration phase, uniform acceleration phase, deceleration phase, uniform acceleration phase, deceleration phase, uniform deceleration phase, acceleration phase, uniform deceleration phase, acceleration phase, uniform speed phase, deceleration phase, uniform acceleration phase, acceleration phase, acceleration phase, uniform deceleration phase, acceleration phase, uniform deceleration phase, and deceleration phase. Solving the motion balance equation includes: If the current stage is a uniform velocity stage, the intercept time t can be directly solved by a quadratic equation in one variable. If the current stage is a non-uniform speed stage, the intercept time t is solved by numerical iteration method.
3. The cross-path segment interpolation method based on time domain extension according to claim 1, characterized in that, The method is applicable when the current curve is a line segment, and the effective duration is adjusted to... .
4. The cross-path segment interpolation method based on time domain extension according to claim 1, characterized in that, The method is applicable to global S-shaped velocity planning, where one stage can span multiple processing path segments, and the effective duration of the current curve stage is... satisfy .
5. A cross-path segment interpolation system based on time domain extension, used to implement the cross-path segment interpolation method based on time domain extension as described in any one of claims 1-4, for CNC machining, characterized in that, include: The planning acquisition module is used to acquire the speed planning stage information corresponding to the current processing path segment; The judgment module is used to determine whether the interpolation conditions for cross-path segments are met, including checking the interpolation residual period. Whether it is non-zero, and whether the global stage marker is consistent with the current stage; The time domain extension module is used to expand the time domain of the current stage from... Expand to ; The equation solving module is used to establish and solve the motion balance equation based on the extended time domain to obtain the cutoff time t. The interpolation output module is used to extract the motion amount based on the intercept time t, update the status, and output the interpolation command; The conventional interpolation module performs subsequent interpolation processing based on the interpolation instructions output by the interpolation output module; The status update module is used to clear the residual period and residual motion after interpolation is completed, and to update the current stage information.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; characterized in that, When the processor executes the computer program, it implements the cross-path segment interpolation method based on time domain extension as described in any one of claims 1-4.
7. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the cross-path segment interpolation method based on time domain extension as described in any one of claims 1-4.