A method, system, and storage medium for interpolating and connecting S-shaped velocity curves.

The reverse extension mechanism solves the problem of time misalignment at the connection point of the S-shaped speed curve in CNC machining, achieving smooth speed control and better machining quality, and is suitable for CNC systems.

CN121900314BActive Publication Date: 2026-05-26SUZHOU MOU XUN INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

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-05-26

AI Technical Summary

Technical Problem

In high-speed, high-precision CNC machining, the connection point of the S-shaped speed curve is not aligned with the fixed interpolation cycle time of the CNC system in time, which causes the actual average speed to deviate from the planned theoretical instantaneous speed, resulting in speed fluctuations and uneven tool marks.

Method used

By adopting a reverse extension mechanism, the residual motion is judged and the time axis is virtually extended by one interpolation period. The time point corresponding to the residual motion is solved in reverse, and the internal clock state of the system is corrected, so that the subsequent interpolation calculation starts from a more accurate initial state, achieving a smooth transition between the connection points of segments.

Benefits of technology

It eliminates speed fluctuations caused by misalignment of interpolation cycles, improves the quality of high-speed and high-precision machining, maintains consistency between interpolation output and speed planning, reduces computational losses, and is suitable for CNC systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900314B_ABST
    Figure CN121900314B_ABST
Patent Text Reader

Abstract

This invention relates to the field of CNC machining and motion control technology, specifically to a method, system, and storage medium for interpolation connection processing of S-shaped speed curves. This method addresses the speed fluctuations and uneven machining marks caused by the asynchronous connection points between segments and the interpolation cycle in existing global S-shaped speed planning by proposing a reverse extension compensation mechanism. The steps include: when entering a new curve segment for interpolation, if there is residual motion and the motion stage is continuous, the current motion stage is extended backward by one interpolation cycle in the time domain; by solving the displacement equation, the historical time point corresponding to the residual motion in the current stage is accurately calculated; and the system's time state is corrected accordingly, thereby achieving smooth and accurate connection between segments. This invention effectively eliminates the deviation between interpolation commands and speed planning, solves the speed fluctuation problem caused by toolpath deflection, makes the tool marks more uniform, and improves machining quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CNC machining and motion control technology, and in particular to a method, system and storage medium for interpolating and connecting S-shaped speed curves. 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 planned speed curve connection points are not aligned with the fixed interpolation cycle time points of the CNC system in time. This results in the endpoint of a certain path segment (i.e., the connection point) potentially being located 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 and 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, and storage medium for interpolating and connecting S-shaped velocity curves. Summary of the Invention

[0006] The purpose of this invention is to provide a method, system, and storage medium for interpolation and connection processing of S-shaped speed curves, 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 method for interpolating and connecting S-shaped velocity curves, comprising:

[0008] Obtain global planning information for the current velocity curve, including global stage markers, initial velocity, acceleration, jerk, and jerk-jerk.

[0009] Search for the first valid curve phase on the velocity curve;

[0010] Based on the interpolation state of the first valid curve stage, determine whether reverse extension processing is required;

[0011] If the conditions for reverse extension processing are met, then through reverse extension processing, the interpolation state of the adjacent previous cycle is traced back to obtain the time t corresponding to the residual motion quantity recorded by the system after reverse extension in the current motion stage, where, , The interpolation period;

[0012] Correct the interpolation residual time based on the calculated time t corresponding to the reverse extension. ;

[0013] Based on the corrected system state, proceed to the standard interpolation cycle calculation and output process for the current motion phase.

[0014] Preferably, the criterion for determining whether reverse extension compensation processing is needed for the current motion phase is: the interpolation residual time recorded by the system. The value is not zero, and after performing a bitwise OR operation between the global stage marker and the stage type identifier of the current motion stage, the global stage marker remains unchanged.

[0015] Preferably, the residual motion is a three-dimensional vector, and its scalar length is calculated. The reverse extension refers to extending the displacement function describing the current motion phase. The range of values ​​for the independent variable t, from its original domain. Expand to , This represents the effective duration of the current motion phase, determined by solving the displacement function equation. Obtain the time t.

[0016] The method for obtaining the residual motion recorded by the system and extending it backwards to the corresponding time t in the current motion phase includes:

[0017] Scalar length for calculating residual motion , ;

[0018] By solving the displacement function Obtain the t value. ;

[0019] The displacement function is a fourth-degree polynomial with respect to time t, and its expression is:

[0020] ;

[0021] in, a, j, and s represent the instantaneous velocity, acceleration, acceleration-acceleration, and acceleration-acceleration of the current segment at t=0, respectively.

[0022] Preferably, when the current motion phase is a uniform velocity phase, a = 0. , The displacement function is simply expressed as The time t is passed through Calculated;

[0023] When the current motion phase is a non-uniform phase, the displacement function equation is solved using a numerical iteration method. .

[0024] Preferably, based on the corrected system state, the process proceeds to the standard interpolation cycle calculation and output for the current motion phase, and then includes:

[0025] At the end of the current curve segment interpolation, the remaining time, which is less than one interpolation cycle, is added to the interpolation residual time. The corresponding remaining motion is added to the residual motion, and the updated interpolated residual time is then used. The residual motion is used as the input for the next curve segment interpolation.

[0026] Preferably, the global stage is marked as a bitmap variable, which is used to record and track the motion stage type experienced by each interpolation cycle at the system level.

[0027] Preferably, the interpolation connection processing method further includes:

[0028] If it is determined that no reverse extension processing is needed, then proceed directly to the subsequent interpolation cycle processing of the current segment;

[0029] After interpolation is complete, update the remaining interpolation time. and residual exercise As input for the next segment of curve interpolation.

[0030] A numerical control system, comprising:

[0031] The memory stores the computer program and a motion planning database, which stores the global S-shaped velocity curve planning results generated in the S-shaped velocity curve interpolation and connection processing method, as well as the motion stage parameters of each curve segment reflecting the system state, including global stage markers, initial velocity, acceleration, jerk, jerk-jerk, and interpolation residual time. and residual exercise volume;

[0032] A processor, coupled to the memory, is used to execute the computer program to implement the interpolation and connection processing method for an S-shaped speed curve.

[0033] Servo drive and actuator: Receives interpolation commands and drives the motor to complete the motion according to the speed plan after interpolation connection processing.

[0034] Preferably, the memory also stores the modular structure of the system, including:

[0035] The data acquisition and interface module is used to read the currently required planning data and system status from the memory;

[0036] The phase search module locates and retrieves the parameters of the next curve segment to be executed and the first effective motion phase from the planning data based on the current interpolation progress.

[0037] The compensation judgment logic module executes judgment logic based on the current stage parameters and system status to determine whether the system should run the compensation operation of reverse extension processing or directly run the conventional interpolation operation.

[0038] The reverse extension processing logic module performs a calculation process during system compensation operations, including: calculating the length of the residual motion. Constructing displacement equations In the interval Calculate the corrected interpolation residual time at time t during the internal solution process. ;

[0039] The interpolation calculation and output module calculates the position increment of each axis within the current interpolation cycle based on the latest corrected system state and according to the discrete iterative formula, and generates interpolation commands.

[0040] The state update module calculates the remaining time and motion that are not divisible by the interpolation period after the interpolation of a curve segment is completed, and updates it to the global state memory for use by the next curve segment.

[0041] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the aforementioned interpolation and connection processing method for an S-shaped velocity curve.

[0042] Compared with the prior art, the advantages of the present invention are:

[0043] This invention provides an S-shaped velocity curve interpolation method. By setting a "reverse extension" mechanism, when switching from one curve segment to the next for interpolation, it first determines whether there is any "residual motion" due to incomplete previous cycles and whether the current motion phase is continuous. If the conditions are met, the current motion phase is virtually extended forward (i.e., towards the historical direction) by one interpolation cycle on the time axis. By establishing a mathematical model, the residual motion is considered as the displacement to be completed within this "extended segment," thereby reversibly solving for the precise time point corresponding to this displacement. The internal clock state of the system (interpolation residual time) is corrected using the reverse-solved time point. This allows subsequent standard interpolation calculations to start from an initial state that better matches the planned curve, thus smoothly "absorbing" the residual motion into the current motion stage, achieving precise interpolation compensation at the inter-segment connection points, compensating for the inter-segment connection errors caused by the discretization of the interpolation cycle, eliminating the resulting speed fluctuations, and solving the problem of uneven tool marks.

[0044] This invention sets up a post-processing compensation mechanism in the interpolation execution layer. By extending the time of the current stage backward by one interpolation cycle, it accurately calculates the time point corresponding to the residual motion in the current stage, realizes a smooth transition between segments, reduces speed fluctuations caused by misalignment of interpolation cycles, is suitable for global S-shaped speed planning, and improves the quality of high-speed and high-precision machining. The calculation of the reverse extension mechanism focuses on the moment of connection, avoiding the huge calculation loss caused by global replanning. It is easy to integrate into CNC systems and has strong compatibility. Attached Figure Description

[0045] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0046] Figure 1 This is a flowchart illustrating the reverse extension logic judgment in the interpolation connection processing method provided in this embodiment of the invention.

[0047] Figure 2 A schematic diagram illustrating the principle of a CNC system performing a reverse extension interpolation operation, provided in an embodiment of the present invention.

[0048] Figure 3 The flowchart illustrates the principle of interpolation correction for timing deviations between two curve segments based on a reverse extension mechanism, as provided in this embodiment of the invention.

[0049] Figure 4 This is a schematic diagram comparing the velocity curves at the junction of segments in the traditional method and the method of the present invention, as provided in the embodiments of the present invention. Detailed Implementation

[0050] The present invention will be further described in detail below with reference to specific embodiments:

[0051] 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.

[0052] When interpolating the curve after speed planning, it remains faithful to the original trajectory. However, due to the limitation of the fixed interpolation cycle, speed fluctuations will occur in the complex trajectory composed of a large number of tiny line segments, which will eventually lead to uneven tool marks in the working form and affect the processing quality.

[0053] This invention provides an interpolation connection processing method. For the "reduced" interpolation distance occurring at the connection point, it can fine-tune the planning time without changing the original speed planning, accurately calculate and compensate for the residual motion at the connection point, restore the speed after the speed planning was completed, and ensure the consistency between the interpolation output and the speed planning, thereby achieving smoother speed control and better machining surface quality. To achieve the above objectives, this invention adopts the following technical solution:

[0054] A method for interpolating and connecting S-shaped velocity curves, see attached figure. Figure 1 The provided flowchart illustrates the reverse extension logic judgment and execution path. This method includes 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 the state variables from global variables: interpolated residual time. ( , This represents the interpolation period (e.g., 1 ms) and the residual motion. The residual motion is a three-dimensional vector, and its scalar length is calculated. .

[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 remaining interpolation residual time for the current curve segment after interpolation 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 phases. This is achieved by performing a bitwise OR operation between the global phase flag maintained by the system and the type flag of the current motion phase, and checking whether the result of the operation changes the value of the global phase flag. The global phase flag is a bitmap variable used to record and track the motion phase types experienced by each interpolation cycle at the system level.

[0064] A global phase marker is a bitmap variable used to record and track the motion phase types experienced by each interpolation cycle at the system level.

[0065] The motion phases include uniform speed phase, uniform acceleration phase, uniform deceleration phase, acceleration phase, and acceleration-acceleration phase.

[0066] The representation is a bitmask, with each bit corresponding to a velocity stage type. For example, taking a trapezoidal velocity curve as an example, bit 0 represents a uniform acceleration segment, bit 1 represents a uniform velocity segment, and bit 2 represents a uniform deceleration segment.

[0067] If the global stage flag maintained by the system is ORed with the type flag of the current motion stage and the flag 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.

[0068] If both of the above conditions are met, it indicates 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.

[0069] Step 3: Extend the time domain, extend it in reverse, and perform the solution.

[0070] In global S-shaped velocity planning, a stage can span multiple curves, and each curve stores the parameter information required for each stage.

[0071] The current residual motion may be formed by connecting multiple curve segments (discontinuities and abrupt changes between adjacent curve segments). It is necessary to calculate the corresponding time within this segment, referring to the appendix. Figure 3 As shown, this provides a time-based view of how the interpolation residual time is transferred and processed between adjacent interpolated curve segments to eliminate interpolation bias between two continuous curve segments.

[0072] The current motion phase is virtually extended forward 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.

[0073] 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, so as to rewind to the situation that occurred before.

[0074] In detail, the calculation process for interpolation processing of multiple curve segments by reverse extension is as follows:

[0075] Residual kinetic energy is expressed as Calculate the scalar length of the residual motion. 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.

[0076] The displacement function adopts a fourth-order polynomial displacement model with respect to time t:

[0077] ;

[0078] in, a, j, and s represent the instantaneous velocity, acceleration, acceleration-acceleration, and acceleration-acceleration of the current segment at time t=0, respectively.

[0079] 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.

[0080] Establish and solve the displacement function equations , and obtain time t.

[0081] 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.

[0082] If the current phase is non-uniform, the highest possible equation is a quartic equation, which occurs 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. This iterative process involves searching backward along the timeline for the precise motion state point that matches the residual spatial displacement.

[0083] Step 4: Status Correction.

[0084] Based on the time point t calculated in step 3, the residual time state of the system is corrected. Since t is a negative value, and its absolute value represents the completion of the residual displacement on the backward extension line. The required time, therefore, the interpolation residual time is updated as follows: By correcting the operation, time t is identified as the start time of the current motion phase within the system clock, and time "passed" by -t is re-interpolated, thereby re-interpolating and planning the scalar length of the residual motion.

[0085] Step 5: Standard interpolation output.

[0086] With the corrected system state (updated) Starting with the residual motion, the system calculates and outputs the position commands of each axis for the current and subsequent interpolation cycles according to the conventional discrete interpolation iterative formula.

[0087] Step 6: Residual update.

[0088] When the interpolation of the entire current curve segment is completed, the last interpolation cycle may still have less than one interpolation cycle remaining. The time and corresponding amount of motion are used to accumulate the remaining time (less than one interpolation cycle) to the interpolation residual time. The corresponding remaining motion is added to the residual motion, and the updated interpolated residual time is then used. The residual motion is used as the input for the next curve segment interpolation, and this process is repeated.

[0089] See attached document Figure 2 The present invention provides a numerical control system for implementing the above-mentioned interpolation connection processing method. The system includes a memory, a processor, a servo drive and an actuator, and a communication interface. The processor, memory and communication interface can be connected by a bus or other means.

[0090] The memory mainly consists of a program storage area and a data storage area. The program storage area can store the operating system, application programs, and modules required for the functions.

[0091] The storage data area can store data created based on the use of the device. For example, the memory stores a motion planning database, which stores the global S-shaped velocity curve planning results generated in the above interpolation and connection processing method, as well as the motion stage parameters of each curve segment that reflect the system state, including global stage markers, initial velocity, acceleration, jerk, jerk-jerk, and interpolation residual time. And residual exercise volume.

[0092] The modular structure stored in the memory includes:

[0093] The data acquisition and interface module is used to read the currently required planning data and system status from the memory;

[0094] The phase search module locates and retrieves the parameters of the next curve segment to be executed and the first effective motion phase from the planning data based on the current interpolation progress.

[0095] The compensation judgment logic module executes judgment logic based on the current stage parameters and system status to determine whether the system should run the compensation operation of reverse extension processing or directly run the conventional interpolation operation.

[0096] The reverse extension processing logic module performs a calculation process during system compensation operations, including: calculating the length of the residual motion. Constructing displacement equations In the interval Calculate the corrected interpolation residual time at time t during the internal solution process. , .

[0097] The interpolation calculation and output module calculates the position increment of each axis within the current interpolation cycle based on the latest corrected system state and according to the discrete iterative formula, and generates interpolation commands.

[0098] The state update module calculates the remaining time and motion that are not divisible by the interpolation period after the interpolation of a curve segment is completed, and updates it to the global state memory as residual information before the next curve segment interpolation.

[0099] The processor is coupled with the memory. The processor executes various functional applications and data processing by running software programs and modules stored in the memory. The steps of the above method are used to perform interpolation and calculation, and control commands are sent to the servo drive and actuator through the communication interface.

[0100] The memory may 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, the memory may also include a memory controller to provide the processor with access to the memory.

[0101] Based on the above method and system, this invention provides comparative testing on a CNC simulation platform. The control group uses a conventional interpolation method with standard compensation logic, while the experimental group uses the interpolation method based on reverse extension processing provided by this invention.

[0102] 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.

[0103] The test results are compared below:

[0104] See attached document Figure 4 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 %).

[0105] 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.

[0106] Based on the velocity curve comparison chart, the root mean square error (RMSE) of the interpolated output velocity and the planned velocity, as well as the reduction ratio of velocity fluctuation, were calculated for the same trajectory segment. The RMSE of the experimental group was 1.10 mm / s, while the RMSE of the control group was 4.34 mm / s, representing a reduction of 74.65% in RMSE.

[0107] The velocity variance of the control group was 8.56, while that of the experimental group was 0.56. The velocity fluctuation reduction rate of the experimental group was 93.46%.

[0108] The interpolation connection processing method provided by this invention, when interpolating multiple curve segments, correlates the time across connection points with the length of the cumulative synthesized motion to correct the interpolation across connection points. Results show that, after adopting the method of this invention, the root mean square error between the interpolated output speed and the planned speed is significantly reduced, accuracy is improved by 75%, and speed fluctuation is greatly reduced, with fluctuation decreasing by 93.46%.

[0109] If the interpolation itself is on the same line segment (aligned interpolation), the interpolation speed output by this invention can perfectly match the planned speed. If the interpolation itself is not on the same line segment (there is a deviation between the actual speed and the planned speed), compared with existing interpolation methods, the actual speed of this invention can still achieve an output effect that is closer to the planned speed. Therefore, the method of this invention can maintain a stable interpolation speed, effectively solve the problem of speed fluctuation at the junction of segments, and better match the planned speed curve (ideal curve) compared with conventional algorithms in the prior art.

[0110] In addition, after the multi-segment curve interpolation processing of the present invention, the average processing time for each interpolation point increases by about 5μs. Compared with the 1ms interpolation cycle, the overhead accounts for only 0.5%, the calculation time is lower, and the real-time requirements are fully met.

[0111] This invention employs a "reverse extension compensation" mechanism. When switching from one curve segment to the next for interpolation, the method first determines whether there is any "residual motion" resulting from an incomplete previous cycle and whether the current movement is in a continuous phase. If the conditions are met, the current movement phase is virtually extended forward (i.e., towards the historical direction) on the time axis by one interpolation cycle. By establishing a mathematical model, the residual motion is considered as the displacement that should be completed within this "extended segment," thus allowing the precise time point corresponding to that displacement to be calculated in reverse. This process is not a simple mathematical division, but rather a "backtracking" and "reconstruction" of the motion state at the connection point on the timeline.

[0112] Finally, the internal clock state of the system is corrected by inverse solving of the time points (interpolating residual time). This allows subsequent standard interpolation calculations to start from an initial state that better matches the planned curve, thus smoothly "absorbing" the residual motion into the current motion stage, achieving accurate interpolation compensation at the connection points between segments, and ensuring that the velocity planning and interpolation output at the connection points of multiple curve segments remain consistent.

[0113] 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 S-shaped velocity curve interpolation and connection processing method in the method embodiment. 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 S-shaped velocity curve interpolation and connection processing method provided in the above method embodiment.

[0114] 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.

[0115] 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.

[0116] 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.

[0117] 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.

[0118] 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 method for interpolating and connecting S-shaped velocity curves, characterized in that, include: Obtain global planning information for the current velocity curve, including global stage markers, initial velocity, acceleration, jerk, and jerk-jerk. Search for the first valid curve phase on the velocity curve; Based on the interpolation state of the first valid curve stage, determine whether reverse extension processing is required; If the conditions for reverse extension processing are met, then through reverse extension processing, the interpolation state of the adjacent previous cycle is traced back to obtain the time t corresponding to the residual motion quantity recorded by the system after reverse extension in the current motion stage, where, , The interpolation period; Correct the interpolation residual time based on the calculated time t corresponding to the reverse extension. ; Based on the corrected system state, proceed to the standard interpolation cycle calculation and output process for the current motion phase; The residual motion is a three-dimensional vector, and its scalar length is calculated. The reverse extension refers to extending the displacement function describing the current motion phase. The range of values ​​for the independent variable t, from its original domain. Expand to , This represents the effective duration of the current motion phase, determined by solving the displacement function equation. Obtain the time t; The method for obtaining the residual motion recorded by the system and extending it backwards to the corresponding time t in the current motion phase includes: Scalar length for calculating residual motion , ; By solving the displacement function Obtain the t value. ; The displacement function is a fourth-degree polynomial with respect to time t, and its expression is: ; in, a, j, and s represent the instantaneous velocity, acceleration, acceleration-acceleration, and acceleration-acceleration of the current segment at t=0, respectively. When the current motion phase is a uniform velocity phase, a = 0. , The displacement function is simply expressed as The time t is passed through Calculated; When the current motion phase is a non-uniform phase, the displacement function equation is solved using a numerical iteration method. .

2. The interpolation and connection method for an S-shaped velocity curve according to claim 1, characterized in that, The criterion for determining whether reverse extension compensation is needed for the current motion phase is: the interpolation residual time recorded by the system. The value is not zero, and after performing a bitwise OR operation between the global stage marker and the stage type identifier of the current motion stage, the global stage marker remains unchanged.

3. The interpolation and connection method for an S-shaped velocity curve according to claim 1, characterized in that, Based on the corrected system state, the process proceeds to the standard interpolation cycle calculation and output for the current motion phase, followed by: At the end of the current curve segment interpolation, the remaining time, which is less than one interpolation cycle, is added to the interpolation residual time. The corresponding remaining motion is added to the residual motion, and the updated interpolated residual time is then used. The residual motion is used as the input for the next curve segment interpolation.

4. The interpolation and connection method for an S-shaped velocity curve according to claim 2, characterized in that, The global stage is marked as a bitmap variable, which is used to record and track the motion stage type experienced by each interpolation cycle at the system level.

5. The interpolation and connection method for an S-shaped velocity curve according to claim 1, characterized in that, This interpolation and splicing method also includes: If it is determined that no reverse extension processing is needed, then proceed directly to the subsequent interpolation cycle processing of the current segment; After interpolation is complete, update the remaining interpolation time. and residual exercise As input for the next segment of curve interpolation.

6. A numerical control system, characterized in that, include: The memory stores computer programs and a motion planning database, which stores the global S-shaped velocity curve planning results generated in the S-shaped velocity curve interpolation and connection processing method as described in any one of claims 1-5, as well as the motion stage parameters of each curve segment reflecting the system state, including global stage markers, initial velocity, acceleration, jerk, jerk-jerk, and interpolation residual time. and residual exercise volume; A processor, coupled to the memory, is used to execute the computer program to implement an interpolation and connection processing method for an S-shaped velocity curve as described in any one of claims 1-5; Servo drive and actuator: Receives interpolation commands and drives the motor to complete the motion according to the speed plan after interpolation connection processing.

7. A numerical control system according to claim 6, characterized in that, The memory also stores the modular structure of the system, including: The data acquisition and interface module is used to read the currently required planning data and system status from the memory; The phase search module locates and retrieves the parameters of the next curve segment to be executed and the first effective motion phase from the planning data based on the current interpolation progress. The compensation judgment logic module executes judgment logic based on the current stage parameters and system status to determine whether the system should run the compensation operation of reverse extension processing or directly run the conventional interpolation operation. The reverse extension processing logic module performs a calculation process during system compensation operations, including: calculating the length of the residual motion. Constructing displacement equations In the interval Calculate the corrected interpolation residual time at time t during the internal solution process. ; The interpolation calculation and output module calculates the position increment of each axis within the current interpolation cycle based on the latest corrected system state and according to the discrete iterative formula, and generates interpolation commands. The state update module calculates the remaining time and motion that are not divisible by the interpolation period after the interpolation of a curve segment is completed, and updates it to the global state memory for use by the next curve segment.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements an interpolation and connection processing method for an S-shaped velocity curve as described in any one of claims 1-5.