Acceleration and deceleration planning method for motion control system and motion control system
Patent Information
- Application Number
- CN202610914626.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-24
- Publication Date
- 2026-09-25
AI Technical Summary
此类方法虽然可以实现高阶平滑运动,但往往需要复杂的预处理(如极值点判断)、较多的分段,或需要实时调整多项式系数,导致计算负担仍然较重,限制了其在低成本嵌入式运动控制系统中的直接应用
[0031]本申请公开了一种用于运动控制系统的加减速规划方法,该方法获取运动参数后,基于梯形加减速模型计算加速、匀速和减速段的运行时间及理论位移,生成三段式时间框架;然后分别在加速段和减速段内构造五次多项式速度曲线,该曲线满足起点和终点处速度、加速度、加加速度均为零的边界条件,且积分位移精确等于对应段的理论位移;最后将各段曲线拼接为全局速度规划曲线用于实时插补。本申请通过位移等效约束,使五次多项式曲线的积分位移与梯形模型理论位移精确一致,在实现速度、加速度、加加速度全线连续的同时,可直接沿用梯形加减速的位移累加框架进行速度前瞻,显著降低了实时插补与轨迹规划的计算复杂度,适用于资源受限的嵌入式运动控制系统。
Smart Images

Figure CN122816100A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of motion control technology, and in particular to an acceleration / deceleration planning method for precision motion control systems such as CNC machine tools and industrial robots. Background Technology
[0002] Acceleration and deceleration motion control methods are a key factor in determining the accuracy of high-precision and high-speed CNC machining. Currently, the most widely used acceleration and deceleration control methods in the field of CNC machine tool machining mainly include trapezoidal acceleration and deceleration control, exponential acceleration and deceleration control, and S-curve acceleration and deceleration control. Each method has its own technical characteristics and applicable scenarios, but also has corresponding limitations.
[0003] Among them, the trapezoidal acceleration / deceleration control method, as the earliest applied acceleration / deceleration control method, has a continuous velocity curve, an easy-to-understand formula, and a simple implementation method; however, the acceleration of this method can change abruptly, easily causing equipment vibration and noise, and generating flexible impact problems. In comparison, the exponential acceleration / deceleration control method has better motion continuity, stronger system stability during experiments, and better overall control performance than the trapezoidal acceleration / deceleration control algorithm; however, this method involves a large number of exponential calculations, complex computational logic, high engineering implementation difficulty, and the acceleration can still change abruptly. The S-curve acceleration / deceleration control method can ensure the system's motion flexibility. It divides the entire acceleration / deceleration process into seven segments for segmented calculation, effectively improving motion stability and control accuracy; however, this method also suffers from cumbersome calculation process, large amount of computation, and high program development difficulty.
[0004] Furthermore, some existing technologies disclose methods for velocity planning using fifth-order polynomials to achieve continuity of velocity, acceleration, and jerk. While such methods can achieve high-order smooth motion, they often require complex preprocessing (such as extreme point identification), numerous segmentations, or real-time adjustment of polynomial coefficients, resulting in a still heavy computational burden and limiting their direct application in low-cost embedded motion control systems. Other existing technologies employ trigonometric basis functions, which can achieve continuous jerk, but have high computational complexity and cannot maintain displacement equivalence under simplified models.
[0005] Therefore, how to provide an acceleration / deceleration planning method that can both guarantee the smoothness of high-order motion and significantly reduce algorithm complexity, and is easy to implement on resource-constrained platforms, is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0006] This application aims to further simplify the algorithm logic of existing fifth-order polynomial acceleration / deceleration methods and reduce computational complexity. Specifically, it aims to achieve continuous (C0) velocity, acceleration, and jerk. 2While ensuring continuity, this application maintains direct equivalence between the planning results and the displacement calculations for trapezoidal acceleration and deceleration, thereby reducing the amount of displacement correction calculations in real-time trajectory planning and velocity look-ahead, and facilitating implementation in resource-constrained motion controllers (especially embedded systems). To achieve the above objectives, this application adopts the following technical solution.
[0007] In a first aspect, embodiments of this application provide an acceleration / deceleration planning method for a motion control system, comprising:
[0008] Step 1: Obtain the motion parameters of the motion command to be executed; the motion parameters include at least the target displacement, initial velocity, target velocity, and maximum acceleration constraint;
[0009] Step 2: Based on the trapezoidal acceleration and deceleration model, the motion parameters are preprocessed to generate a time frame that includes acceleration, constant speed and deceleration segments, and the running time and theoretical displacement of each segment are calculated.
[0010] Step 3: Within the acceleration segment, construct a fifth-order polynomial velocity curve that satisfies the boundary condition that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the acceleration segment calculated in Step 2.
[0011] Step 4: Within the deceleration segment, construct a fifth-order polynomial velocity curve that satisfies the boundary condition that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the deceleration segment calculated in Step 2.
[0012] Step 5: Combine the fifth-order polynomial velocity curve constructed in Steps 3 and 4 with the constant velocity curve of the uniform velocity segment to generate a complete global velocity planning curve with respect to time, which is used to control the moving parts.
[0013] Furthermore, the shape of the fifth-order polynomial velocity curve constructed in steps 3 and 4 is determined by a fixed combination of polynomial coefficients that is independent of time. This combination of coefficients is the only solution that satisfies the boundary conditions and displacement equivalent constraints.
[0014] Furthermore, the time frame generated in step 2 only includes three motion stages: acceleration, constant speed, and deceleration. The fifth-order polynomial velocity curve is applied completely to the entire acceleration stage and the entire deceleration stage, respectively.
[0015] Furthermore, the fifth-order polynomial velocity curves constructed in steps 3 and 4 have first and second derivatives that are continuous functions throughout the entire motion process, and there are no step points.
[0016] Furthermore, the motion parameters in step 1 also include jerk constraints; in step 2, when generating the time frame, if the theoretical maximum speed calculated based on the maximum acceleration constraint exceeds the target speed, the running time of the acceleration and deceleration segments is corrected according to the jerk constraint to ensure that the actual acceleration does not exceed the maximum acceleration constraint.
[0017] Furthermore, it also includes:
[0018] During the real-time interpolation phase, the position increment within each interpolation cycle is directly calculated based on the global velocity planning curve and the timestamp of each interpolation cycle. This calculation process only involves the fifth-order polynomial and the equation of uniform linear motion, and does not include any iteration or trigonometric function operations.
[0019] Furthermore, the theoretical displacement in step 2 is equal to the integral displacement of the fifth-order polynomial curve in steps 3 and 4, so that in the subsequent multi-segment velocity look-ahead planning, the theoretical displacement of each program segment can be directly accumulated for trajectory pre-calculation without the need for correction based on the actual polynomial curve, thereby achieving accurate equivalent transfer of displacement.
[0020] Furthermore, it also includes:
[0021] In the abnormal handling step, when the theoretical running time of the acceleration or deceleration segment calculated in step 2 is less than twice the minimum interpolation period of the system, the system automatically downgrades the fifth-order polynomial velocity curve to a lower-order polynomial curve that satisfies the same boundary conditions, so as to ensure that stable acceleration and deceleration control can still be achieved within the preset extremely short motion stroke.
[0022] Secondly, embodiments of this application provide a motion control system, including:
[0023] The parameter configuration module is used to acquire and store the motion parameters of the motion command to be executed; the motion parameters include at least the target displacement, the initial velocity, the target velocity, and the maximum acceleration constraint.
[0024] The trapezoidal preprocessing module is used to preprocess the motion parameters based on the trapezoidal acceleration and deceleration model to generate a time frame containing acceleration, constant speed and deceleration segments, and to calculate the running time and theoretical displacement of each segment.
[0025] A polynomial construction module is used to construct a fifth-order polynomial velocity curve within the acceleration segment, such that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the acceleration segment calculated by the trapezoidal preprocessing module; and to construct a fifth-order polynomial velocity curve within the deceleration segment, such that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the deceleration segment calculated by the trapezoidal preprocessing module.
[0026] The curve synthesis module is used to stitch together the polynomial velocity curves of the acceleration and deceleration segments generated by the polynomial construction module with the constant velocity curve of the uniform segment generated by the trapezoidal preprocessing module to generate a complete global velocity planning curve with respect to time.
[0027] The real-time interpolation module is used to directly calculate the position increment in each interpolation cycle based on the global velocity planning curve and the timestamp of each interpolation cycle during motion control, and output it to the servo drive system.
[0028] Thirdly, embodiments of this application provide an electronic device, including: one or more processors;
[0029] A memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are able to implement the steps in the acceleration / deceleration planning method described in any of the preceding claims.
[0030] Fourthly, embodiments of this application provide a computer-readable medium storing a computer program, which, when executed by a processor, can implement the steps in the acceleration / deceleration planning method described in any of the preceding claims.
[0031] This application discloses an acceleration / deceleration planning method for motion control systems. After obtaining motion parameters, the method calculates the running time and theoretical displacement of acceleration, constant velocity, and deceleration segments based on a trapezoidal acceleration / deceleration model, generating a three-segment time frame. Then, it constructs fifth-order polynomial velocity curves within the acceleration and deceleration segments, satisfying the boundary condition that velocity, acceleration, and jerk are all zero at the start and end points, and that the integral displacement is precisely equal to the theoretical displacement of the corresponding segment. Finally, the curves are stitched together to form a global velocity planning curve for real-time interpolation. This application, through displacement equivalence constraints, ensures that the integral displacement of the fifth-order polynomial curve is precisely consistent with the theoretical displacement of the trapezoidal model. While achieving full continuity of velocity, acceleration, and jerk, it can directly use the displacement accumulation framework of the trapezoidal acceleration / deceleration model for velocity look-ahead, significantly reducing the computational complexity of real-time interpolation and trajectory planning, making it suitable for resource-constrained embedded motion control systems. Attached Figure Description
[0032] Figure 1 A core flowchart of an acceleration / deceleration planning method for a motion control system provided in an embodiment of this application;
[0033] Figure 2 A velocity curve diagram including a uniform velocity segment is provided for the embodiments of this application (the velocity curve is smooth and has no inflection points);
[0034] Figure 3 An acceleration curve diagram (the acceleration curve is continuous without abrupt changes) provided for an embodiment of this application, including a uniform velocity segment.
[0035] Figure 4 An acceleration curve diagram (the acceleration curve is continuous without a step) is provided for the embodiment of this application when a uniform velocity segment is included.
[0036] Figure 5 The velocity curve diagram provided in this application embodiment does not include the constant velocity segment;
[0037] Figure 6 The acceleration curve provided in this application embodiment does not include the uniform velocity segment;
[0038] Figure 7 The acceleration curve provided in this application embodiment does not include the uniform velocity segment; Figures 5 to 7 It also exhibits the characteristic of a smooth transition throughout;
[0039] Figure 8 A schematic diagram of the module structure of a motion control system provided in an embodiment of this application;
[0040] Figure 9 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0041] To enable those skilled in the art to better understand the technical solutions of this application, exemplary embodiments of this application are described below with reference to the accompanying drawings, including various details of the embodiments of this application to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. Unless otherwise specified, the various embodiments of this application and the features within those embodiments can be combined with each other.
[0042] As used herein, the term "and / or" includes any and all combinations of one or more of the associated enumerated entries. The terminology used herein is for describing particular embodiments only and is not intended to limit the application. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that when the terms "comprising" and / or "made of" are used herein, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Terms such as "connected" or "linked" are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0043] Unless otherwise specified, all terms used in this application (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It should also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined in this application.
[0044] The core idea of this application is to quickly construct a time frame by utilizing the simplicity of the trapezoidal acceleration and deceleration model, and then construct a high-order smooth velocity curve within this time frame using a fifth-order polynomial with specific boundary conditions and satisfying displacement equivalence constraints, thereby achieving the best balance between computational complexity and motion smoothness.
[0045] refer to Figures 1-7 An embodiment of this application proposes an acceleration / deceleration planning method for a motion control system that strictly follows the logical main line of "parameter acquisition - trapezoidal preprocessing - polynomial construction - curve splicing", which may specifically include the following steps.
[0046] Step 1: Obtain the motion parameters of the motion command to be executed; the motion parameters include at least the target displacement, initial velocity, target velocity, and maximum acceleration constraint.
[0047] First, the processor of the motion control system (such as the central processing unit or motion control chip in a CNC system) acquires one or more motion instructions to be executed. Each instruction contains a series of motion parameters. In this embodiment, the motion parameters include at least: target displacement. (Units are millimeters or pulse counts), starting speed and ending speed (Units are millimeters per second or revolutions per minute), and the maximum command speed set by the system. (i.e., the target velocity). In addition, the system has pre-stored hardware constraint parameters, including maximum acceleration constraints. (Unit: mm / s) 2 These parameters constitute the original inputs for velocity planning in this acceleration / deceleration planning method.
[0048] Step 2: Based on the trapezoidal acceleration and deceleration model, the motion parameters are preprocessed to generate a time frame that includes acceleration, constant speed and deceleration segments, and the running time and theoretical displacement of each segment are calculated.
[0049] After obtaining the above parameters, the system performs trapezoidal preprocessing. The core of this step is: assuming that the moving part accelerates at a constant maximum acceleration during both the acceleration and deceleration phases. Run the program to construct an idealized trapezoidal velocity curve framework. The specific calculation process is as follows:
[0050] First, the system determines whether there is a uniform velocity segment, and based on this, determines the maximum permissible speed that the motion in this segment can actually reach. The distance difference is calculated using the following formula. :
[0051]
[0052] when When this is the case, it indicates that there is sufficient travel for the speed to reach the target speed. At this point, there exists a uniform speed segment, with a maximum permissible speed. Conversely, if This indicates that the travel distance is insufficient and the target speed cannot be reached; there is no constant speed segment. In this case, it is necessary to recalculate the actual maximum achievable speed.
[0053]
[0054] Next, based on the determined maximum permissible speed Calculate the running time and theoretical displacement of the acceleration, constant speed, and deceleration phases:
[0055] Acceleration phase: running time Theoretical displacement .
[0056] Deceleration phase: running time Theoretical displacement .
[0057] Constant speed segment: running time ,in, .
[0058] Thus, the system successfully constructed a time frame comprising three phases: acceleration, constant speed, and deceleration, and obtained the running time for each phase. ) and theoretical displacement ( The framework is characterized by its computational simplicity, involving only elementary algebraic operations, but it suffers from the drawback of sudden acceleration changes.
[0059] In this application, the time frame generated in step 2 is strictly limited to three motion phases: acceleration, constant speed, and deceleration. Specifically, when step 2 determines that there is no constant speed phase (i.e., ... The entire motion process consists only of an acceleration phase and a deceleration phase. Regardless of whether a uniform velocity phase exists, the entire fifth-degree polynomial curve constructed in steps 3 and 4 below is applied completely to the entire acceleration phase (length is...). ) and the entire deceleration phase (length is This method does not require further subdividing the acceleration process into multiple sub-stages such as "acceleration," "uniform acceleration," and "deceleration," as in existing technologies, and calculating time and displacement for each sub-stage separately. This three-stage overall application greatly simplifies the algorithm's control logic.
[0060] In practical high-performance motion control, it is necessary not only to limit acceleration but also to limit jerk to protect the mechanical structure. Therefore, in one embodiment of this application, the motion parameters obtained in step 1 also include a maximum jerk constraint. (Unit: mm / s) 3 Step 2 adds a verification and correction step when generating the timeframe.
[0061] The system is first based on maximum acceleration Calculate the theoretical acceleration time However, starting from zero and immediately reaching full acceleration would result in infinite acceleration. In order to satisfy... Given the constraints, the system will calculate the minimum acceleration time under limited jerk. .like This indicates that the system cannot reach the target speed without exceeding the acceleration limit. In this case, step 2 will automatically extend the acceleration time (for example, by setting...). ), and recalculate the actual maximum speed that can be achieved. This correction process ensures that the actual peak physical acceleration of the fifth-order polynomial curve constructed in subsequent step 3 will not exceed the system's set threshold. The peak jerk will not exceed The deceleration phase is handled in a similar manner.
[0062] To correct the defect of abrupt acceleration in the trapezoidal frame, this application no longer uses constant acceleration in the acceleration and deceleration sections, but instead constructs a specific fifth-order polynomial velocity curve for each.
[0063] Step 3: Within the acceleration segment, construct a fifth-order polynomial velocity curve that satisfies the boundary condition that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the acceleration segment calculated in Step 2.
[0064] For the acceleration phase, a fifth-order polynomial velocity curve is constructed. The following preset boundary conditions must be met:
[0065] At the beginning of the acceleration phase (i.e. At that moment, the velocity was equal to the initial velocity. The acceleration is zero. The jerk is zero. .
[0066] At the end of the acceleration phase (i.e.) At any given moment, the speed equals the maximum speed. The acceleration is zero. ; The jerk is zero: .
[0067] Meanwhile, the polynomial curve is The integral displacement within the interval must be exactly equal to the theoretical displacement of the acceleration segment calculated in step 2. This "displacement equivalence" constraint is the core of the method in this application.
[0068] Solving for the fifth-degree polynomial that satisfies all the above conditions yields the expression for the velocity curve of the acceleration segment. For ease of calculation, a dimensionless time variable is introduced. Then the velocity function of the acceleration segment is:
[0069]
[0070] Among them, coefficient combination It is the only solution that simultaneously satisfies all six boundary conditions and displacement equivalent constraints.
[0071] Step 4: Within the deceleration segment, construct a fifth-order polynomial velocity curve that satisfies the boundary condition that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the deceleration segment calculated in Step 2.
[0072] Similarly, for the deceleration phase, a fifth-order polynomial velocity curve is constructed. The following boundary conditions must be met:
[0073] At the beginning of the deceleration phase (i.e.) At any given moment, the speed equals the maximum speed. The acceleration is zero. ; The jerk is zero: .
[0074] At the end of the deceleration phase (i.e.) At any given moment, the velocity equals the final velocity. The acceleration is zero. ; The jerk is zero: .
[0075] Similarly, the integral displacement of the curve within the deceleration section must be equal to the theoretical displacement of the deceleration section calculated in step 2. Introducing local time variables for the deceleration phase. The velocity function of the deceleration segment is obtained as follows:
[0076]
[0077]
[0078] In a preferred embodiment of this application, the coefficient combination used to construct the fifth-order polynomial velocity curve These are pre-stored in the system as a fixed set of constants independent of any motion parameters. When executing steps 3 and 4, the system does not perform any real-time solution or table lookup for the polynomial coefficients; instead, it directly calls this fixed coefficient combination. For different motion commands, the system only needs to use the coefficients calculated in step 2. Parameters, and time-axis scaling of this fixed function template (via This involves both real-time computation and speed scaling (achieved through speed differences). This "solve once, use everywhere" strategy minimizes the amount of real-time computation.
[0079] Based on the fifth-order polynomial velocity curve constructed in steps 3 and 4, the acceleration curve can be obtained by taking its first derivative. :
[0080]
[0081] Then, by differentiating the acceleration curve, we obtain the jerk curve. :
[0082]
[0083] As can be seen from the above expression, at the end of the acceleration phase ( ) place, acceleration during the uniform velocity segment The two are equal; at the same time, , The two are also equal. Similarly, at the beginning of the deceleration phase ( ) and endpoint ( At point (), the left and right limits of acceleration and jerk are also equal. Therefore, the acceleration curve constructed in this application... and acceleration curve It is a continuous function throughout the entire domain of motion, without any step or abrupt change points. This achieves true C++. 2 Continuous motion planning.
[0084] Step 5: Combine the fifth-order polynomial velocity curve constructed in Steps 3 and 4 with the constant velocity curve of the uniform velocity segment to generate a complete global velocity planning curve with respect to time, which is used to control the moving parts.
[0085] After obtaining the velocity functions for the acceleration, constant velocity, and deceleration phases, the system splices them together into a complete, global time-dependent velocity function. Speed planning curve As shown below:
[0086]
[0087] This global velocity planning curve serves as the basis for the final commands used to control the moving parts. It ensures that the velocity curve is smooth throughout the entire motion process, and that acceleration and jerk transition continuously to zero at the end of the acceleration and deceleration phases.
[0088] Based on the above velocity function By integrating, we can obtain the complete displacement function. :
[0089]
[0090] As can be seen from the above formula, at the end of the acceleration phase ( The actual displacement is:
[0091]
[0092] At the end of the deceleration phase ( The actual displacement is:
[0093]
[0094] This indicates that the integral displacement of the fifth-order polynomial velocity curve during the acceleration and deceleration phases is consistent with the displacement calculated by the trapezoidal acceleration / deceleration model. , The displacement equivalence characteristic is particularly advantageous in multi-segment continuous machining (i.e., speed look-ahead). Assume the CNC system needs to execute program segment 1 and program segment 2 consecutively. Since the actual endpoint position of program segment 1 is completely consistent with the theoretically calculated endpoint position, the system can fully rely on the total displacement accumulated based on a simple trapezoidal model when performing speed look-ahead planning. This means the speed look-ahead module can work independently and efficiently without iterative interaction with the polynomial module responsible for generating smooth curves. When program segment 1 needs to be executed, the polynomial module is then called to generate the actual control curve. This decoupled design ensures that complex look-ahead calculations and precise interpolation calculations do not interfere with each other, greatly simplifying the control software architecture for multi-segment continuous machining.
[0095] During the real-time interpolation phase, the system needs to discretize the continuous global velocity planning curve into each interpolation cycle. Position increment instructions (e.g., 1 millisecond).
[0096] For the current interpolation cycle, the system first determines the time based on the accumulated time. Determine the stage of motion to which it belongs:
[0097] If it is located in the acceleration phase ( If so, the speed function of the acceleration segment is called directly. or its integral form of the displacement function The first part, substituted with the current time, calculates the theoretical position at the end of this cycle. Subtract the position at the end of the previous cycle. That is, the position increment of this period is obtained. .
[0098] If it is located in the uniform velocity segment ( Then the position increment is .
[0099] If it is located in the deceleration section ( Then the deceleration segment displacement function is called. The third segment also calculates the position increment using a differential method.
[0100] Taking the acceleration phase as an example, the displacement function is:
[0101]
[0102] The entire process involves only polynomial multiplication and addition operations, and does not include any trigonometric functions required by existing technologies. , The calculation does not involve any iterative approximation or table lookup interpolation process. This efficient calculation method enables high-precision real-time interpolation to be achieved on low-cost MCUs.
[0103] This method also includes a robust exception handling step. When step 2 calculates the acceleration phase runtime... Less than the system's minimum interpolation period twice as much (i.e.) The processor determines that the acceleration segment is too short, and constructing an accurate fifth-degree polynomial is of limited significance and may cause the motion to be unsmooth due to discretization errors.
[0104] At this point, the system automatically triggers "degradation mode." It no longer uses a fifth-order polynomial, but instead constructs a cubic polynomial velocity curve that satisfies the same boundary conditions (zero starting and ending velocities and zero acceleration), or even directly adopts a trapezoidal acceleration / deceleration model. Simultaneously, the system sets a flag. In subsequent normal-length motion segments, if the system detects that this flag has been cleared, it automatically reverts to using standard fifth-order polynomial programming. This anomaly handling mechanism ensures the stability and versatility of this method under extremely short stroke conditions.
[0105] refer to Figure 8 This application also protects a motion control system that implements the above method. In one specific embodiment, the system adopts a heterogeneous architecture of ARM+FPGA, and specifically includes the following modules.
[0106] Parameter configuration module: running on the ARM processor, responsible for parsing the G code instructions from the host computer, extracting motion parameters such as target displacement and initial / target velocity, and storing them in shared memory.
[0107] Trapezoidal preprocessing module: Also running on an ARM processor, it executes step 2 of the aforementioned method embodiment based on the acquired parameters to quickly calculate the time frame. and theoretical displacement These framework parameters are then packaged into a "motion description data package" and sent to the FPGA's buffer.
[0108] Polynomial Construction Module: This module is implemented as hardware logic in the FPGA. The fixed coefficients are embedded internally within the FPGA. The module is a fifth-order polynomial calculation unit. When the FPGA receives the motion description data packet from the ARM, this module uses hardware multipliers and accumulators to calculate the velocity or position value at the corresponding time in a single clock cycle, depending on whether the FPGA is currently in an acceleration or deceleration phase.
[0109] The curve synthesis module is implemented using a finite state machine within the FPGA. It is based on the value of an internal high-precision counter (representing time). It determines whether the current state is acceleration, constant speed, or deceleration, and selects the output of the polynomial construction module or the constant speed calculation unit accordingly to synthesize the global velocity curve in real time.
[0110] Real-time interpolation module: This module is tightly integrated with the curve synthesis module. At the boundary of each interpolation cycle, it samples the output of the curve synthesis module, calculates the position increment within the current cycle, and immediately sends it to the servo driver via the bus.
[0111] This system implementation based on ARM+FPGA fully utilizes the flexibility of ARM and the parallel computing capabilities of FPGA, perfectly adapting to the characteristics of "trapezoidal frame + fixed polynomial coefficients" in the algorithm of this application, and realizing ultra-high speed and high precision real-time motion control.
[0112] The embodiments of the aforementioned acceleration / deceleration planning method and the embodiments of the aforementioned motion control system are identical or related in technical concept. They can be referenced and learned from each other in terms of technical details and technical effects, which will not be repeated here.
[0113] Overall, the advantages of this application compared to the prior art include:
[0114] 1. Traditional trapezoidal acceleration / deceleration control methods exhibit abrupt acceleration changes at the start and end points of the acceleration / deceleration phases. These abrupt changes translate into flexible impacts on the moving parts of the machine tool, directly affecting the quality of the machined surface and the long-term operational stability of the equipment. This application addresses this by using the time frame output from the trapezoidal acceleration / deceleration model as input. Within this frame, the velocity curves of the acceleration and deceleration phases are reconstructed using a fifth-order polynomial. Furthermore, the polynomial curves are forced to satisfy the boundary condition that both acceleration and jerk are zero at the start and end points. This fundamentally eliminates the flexible impacts caused by abrupt acceleration changes while fully preserving the concise time frame of the trapezoidal acceleration / deceleration model.
[0115] 2. While the traditional seven-segment S-shaped acceleration / deceleration method solves the problem of sudden acceleration changes, it requires subdividing the acceleration / deceleration process into multiple sub-stages such as acceleration-acceleration, uniform acceleration, and deceleration. These sub-stages involve complex interval discrimination and simultaneous solution of boundary times, resulting in cumbersome algorithm logic, massive computational load, and high processor performance requirements. This application simplifies the motion process into three segments: acceleration, uniform acceleration, and deceleration. The acceleration and deceleration segments are each covered by a complete fifth-order polynomial curve in one step. This eliminates the need to determine the existence of sub-stages such as uniform acceleration and deceleration segments, and also eliminates the need to solve boundary times separately for each sub-stage, thus significantly reducing the algorithm's logical complexity and code implementation difficulty.
[0116] 3. Existing solutions for velocity planning using fifth-order polynomials require a series of complex preprocessing steps, such as rapid interpolation, recording velocity extrema, and determining whether the maximum acceleration can be reached, to determine the starting point and boundaries of each segment for acceleration and deceleration. The preprocessing process itself consumes a large amount of computational resources. This application adopts a two-step architecture of "trapezoidal framework pre-computation + fixed-coefficient polynomial filling," which decomposes the complex fifth-order polynomial construction problem into two steps: first, a time frame is quickly output from a trapezoidal model; then, a smooth curve is generated within a fixed time interval using a unified polynomial template. This completely eliminates the preprocessing steps such as determining extrema and iteratively solving for theoretical acceleration and deceleration distances, significantly simplifying the overall computational process of the algorithm.
[0117] 4. Existing fifth-order polynomial velocity planning methods typically require solving different polynomial coefficients in real time based on different acceleration / deceleration scenarios (whether maximum acceleration is reached, whether a uniform acceleration segment exists, etc.). The dynamic changes in the coefficients result in a heavy computational burden during the real-time interpolation stage. The fifth-order polynomial coefficients (10, -15, 6) used in this application are the only solution that simultaneously satisfies zero initial and final velocities, acceleration, and jerk, and that the integral displacement is exactly equal to the theoretical displacement of the trapezoidal model. This coefficient combination is independent of specific motion parameters and can be pre-fixed in the system. For different motion commands, only linear scaling of the time axis and velocity axis is needed to obtain the corresponding velocity curve. The real-time interpolation stage only involves polynomial multiplication and addition operations, without any iteration or table lookup.
[0118] 5. While trigonometric function acceleration / deceleration methods can achieve continuous acceleration, their acceleration and deceleration expressions involve trigonometric function operations, resulting in a large computational load in engineering applications. In this application, all expressions are simple fifth-degree polynomials or their derivatives. During real-time interpolation, only a few multiplication and addition operations are needed to complete the position increment calculation for one interpolation cycle. This computational efficiency is significantly better than the trigonometric function method, making it more suitable for implementation on embedded motion controllers with limited computing power.
[0119] 6. Existing fifth-order polynomial velocity programming methods often produce discrepancies between the actual displacement of the smooth curve constructed and the model displacement estimated during the preprocessing stage. This necessitates repeated corrections and compensations of the actual displacement during multi-segment velocity look-ahead calculations. This application addresses this by using "displacement equivalence" as the core constraint in polynomial construction. This ensures that the integral displacement of the fifth-order polynomial curve in the acceleration and deceleration segments is precisely equal to the theoretical displacement of the trapezoidal acceleration / deceleration model. Therefore, the velocity look-ahead module can directly use the displacement accumulation results from the trapezoidal model for trajectory pre-calculation without iterative correction based on the actual polynomial curve, thus decoupling the look-ahead planning layer from the smooth interpolation layer.
[0120] Based on the same inventive concept, embodiments of this application also provide an electronic device. Figure 9This is a structural block diagram of an electronic device provided in an embodiment of this application. Figure 9 As shown in the embodiments of this application, an electronic device includes: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement any of the acceleration / deceleration planning methods described in the above embodiments; the one or more I / O interfaces 103 are connected between the processors and the memory, configured to enable information interaction between the processors and the memory.
[0121] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0122] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0123] In some embodiments, the one or more processors 101 include a field-programmable gate array.
[0124] This application also provides a computer-readable medium. The computer-readable medium stores a computer program, which, when executed by a processor, implements the steps of any of the acceleration / deceleration planning methods described in the above embodiments. The computer-readable storage medium can be volatile or non-volatile.
[0125] This application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the above-described acceleration / deceleration planning method.
[0126] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0127] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0128] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0129] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing the status information of the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.
[0130] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0131] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0132] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0133] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0135] Exemplary embodiments have been disclosed in this application, and while specific terminology has been used, it is used only and should be interpreted in a general illustrative sense and is not intended to be limiting. In some embodiments, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this application as set forth by the appended claims.
Claims
1. An acceleration / deceleration planning method for a motion control system, characterized in that, include: Step 1: Obtain the motion parameters of the motion command to be executed; the motion parameters include at least the target displacement, initial velocity, target velocity, and maximum acceleration constraint; Step 2: Based on the trapezoidal acceleration and deceleration model, the motion parameters are preprocessed to generate a time frame that includes acceleration, constant speed and deceleration segments, and the running time and theoretical displacement of each segment are calculated. Step 3: Within the acceleration segment, construct a fifth-order polynomial velocity curve that satisfies the boundary condition that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the acceleration segment calculated in Step 2. Step 4: Within the deceleration segment, construct a fifth-order polynomial velocity curve that satisfies the boundary condition that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the deceleration segment calculated in Step 2. Step 5: Combine the fifth-order polynomial velocity curve constructed in Steps 3 and 4 with the constant velocity curve of the uniform velocity segment to generate a complete global velocity planning curve with respect to time, which is used to control the moving parts.
2. The acceleration / deceleration planning method according to claim 1, characterized in that, The shape of the fifth-order polynomial velocity curve constructed in steps 3 and 4 is determined by a fixed combination of polynomial coefficients that is independent of time. This combination of coefficients is the only solution that satisfies the boundary conditions and displacement equivalent constraints.
3. The acceleration / deceleration planning method according to claim 1, characterized in that, The time frame generated in step 2 only includes three motion stages: acceleration, constant speed, and deceleration. The fifth-order polynomial velocity curve is applied completely to the entire acceleration stage and the entire deceleration stage.
4. The acceleration / deceleration planning method according to claim 1, characterized in that, The fifth-order polynomial velocity curves constructed in steps 3 and 4 have first and second derivatives that are continuous functions throughout the entire motion process, and there are no step points.
5. The acceleration / deceleration planning method according to claim 1, characterized in that, The motion parameters in step 1 also include jerk constraints; in step 2, when generating the time frame, if the theoretical maximum speed calculated based on the maximum acceleration constraint exceeds the target speed, the running time of the acceleration and deceleration segments is corrected according to the jerk constraint to ensure that the actual acceleration does not exceed the maximum acceleration constraint.
6. The acceleration / deceleration planning method according to claim 1, characterized in that, Also includes: During the real-time interpolation phase, the position increment within each interpolation cycle is directly calculated based on the global velocity planning curve and the timestamp of each interpolation cycle. This calculation process only involves the fifth-order polynomial and the equation of uniform linear motion, and does not include any iteration or trigonometric function operations.
7. The acceleration / deceleration planning method according to claim 1, characterized in that, The theoretical displacement in step 2 is equal to the integral displacement of the fifth-order polynomial curve in steps 3 and 4. This allows the theoretical displacement of each program segment to be directly accumulated for trajectory pre-calculation in subsequent multi-program segment velocity look-ahead planning, without the need for correction based on the actual polynomial curve, thereby achieving accurate equivalent transfer of displacement.
8. The acceleration / deceleration planning method according to claim 1, characterized in that, Also includes: In the abnormal handling step, when the theoretical running time of the acceleration or deceleration segment calculated in step 2 is less than twice the minimum interpolation period of the system, the system automatically downgrades the fifth-order polynomial velocity curve to a lower-order polynomial curve that satisfies the same boundary conditions, so as to ensure that stable acceleration and deceleration control can still be achieved within the preset extremely short motion stroke.
9. A motion control system, characterized in that, include: The parameter configuration module is used to acquire and store the motion parameters of the motion command to be executed; the motion parameters include at least the target displacement, the initial velocity, the target velocity, and the maximum acceleration constraint. The trapezoidal preprocessing module is used to preprocess the motion parameters based on the trapezoidal acceleration and deceleration model to generate a time frame containing acceleration, constant speed and deceleration segments, and to calculate the running time and theoretical displacement of each segment. The polynomial construction module is used to construct a fifth-order polynomial velocity curve within the acceleration segment, such that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and that the integral displacement within the segment is exactly equal to the theoretical displacement of the acceleration segment calculated by the trapezoidal preprocessing module. And within the deceleration segment, a fifth-order polynomial velocity curve is constructed to satisfy the boundary condition that the velocity, acceleration, and jerk at the beginning and end of the segment are all zero, and the integral displacement within the segment is exactly equal to the theoretical displacement of the deceleration segment calculated by the trapezoidal preprocessing module. The curve synthesis module is used to stitch together the polynomial velocity curves of the acceleration and deceleration segments generated by the polynomial construction module with the constant velocity curve of the uniform segment generated by the trapezoidal preprocessing module to generate a complete global velocity planning curve with respect to time. The real-time interpolation module is used to directly calculate the position increment in each interpolation cycle based on the global velocity planning curve and the timestamp of each interpolation cycle during motion control, and output it to the servo drive system.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it can implement the steps in the acceleration / deceleration planning method according to any one of claims 1 to 8.