A low-computational overhead speedup / slowdown planning method suitable for embedded systems
By employing multi-layer window sliding average and module overlay techniques, the computational complexity and discrete error issues of acceleration and deceleration planning in embedded systems are resolved, achieving low computational overhead, smooth motion, and dynamic adaptability, thus meeting the diverse motion control needs of industrial automation equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 东莞市智赢智能装备有限公司
- Filing Date
- 2026-03-20
- Publication Date
- 2026-07-03
AI Technical Summary
Existing acceleration/deceleration planning methods cannot simultaneously balance computational efficiency, motion smoothness, and dynamic adaptability in embedded systems, and cannot effectively avoid discrete errors, thus failing to meet the high-precision and diverse motion control requirements of industrial automation equipment.
By employing multi-layer window sliding average and module overlay techniques, the smoothness of acceleration and deceleration planning and dynamic parameter adjustment are achieved by adjusting the number and size of planning modules, reducing computational complexity, adapting to the resource constraints of embedded systems, and designing the window size according to the control cycle to avoid discrete errors.
It achieves acceleration and deceleration planning with low computational overhead, improves the real-time response capability and positioning accuracy of embedded systems, supports dynamic parameter adjustment, and is suitable for motion control scenarios of various industrial automation equipment.
Abstract
Description
Technical Field
[0001] This invention relates to the field of motion control technology for embedded systems, specifically a low-computational-overhead acceleration / deceleration planning method suitable for embedded systems. Background Technology
[0002] In the field of industrial automation, motion control technology is one of the core technologies that determines equipment processing efficiency, product quality, and service life. Acceleration and deceleration planning, as a core component of motion control algorithms, directly affects the motion smoothness, positioning accuracy, and real-time response capability of the actuator. With the advent of Industry 4.0, the requirements for motion control in industrial automation equipment are constantly increasing. It not only needs to achieve high-precision, highly smooth motion control, but also needs to adapt to the resource constraints of low-cost embedded systems, ensuring that the algorithm can still run stably and efficiently in environments with low computing resources.
[0003] Currently, the commonly used acceleration / deceleration planning methods in the industrial field are mainly divided into three categories: acceleration / deceleration planning methods based on S-curves, acceleration / deceleration planning methods based on trigonometric functions, and acceleration / deceleration planning methods based on lookup tables. However, all three types of methods have obvious defects and cannot simultaneously solve the three core problems of computational complexity, dynamic adaptability, and discrete domain model error, making it difficult to meet the actual application needs of embedded systems.
[0004] The S-curve-based acceleration / deceleration planning method divides the motion process into seven stages: acceleration, uniform acceleration, deceleration, uniform velocity, deceleration, uniform deceleration, and acceleration again. By maintaining a constant jerk, the acceleration curve becomes trapezoidal, thus achieving continuity between the velocity and acceleration curves and eliminating system shocks caused by sudden acceleration changes. The advantages of this method are good motion smoothness, effectively reducing mechanical wear on actuators and extending equipment lifespan. However, its disadvantages are also significant: Firstly, this method requires calculation of multiple curve segments and involves numerous exponentiation operations, resulting in a large computational load. Combining this with a look-ahead algorithm to improve motion continuity leads to an exponential increase in computational load, severely consuming the embedded processor's CPU resources and reducing the system's real-time response capability. Secondly, this method lacks dynamic adjustment capabilities. During planning and execution, if the target position or running speed needs to be modified, the current motion must be stopped and the planning re-executed, making real-time parameter adjustment impossible and resulting in poor adaptability.
[0005] The acceleration / deceleration planning method based on trigonometric functions utilizes the smoothness of trigonometric functions in the interval from 0 to π / 2 to construct velocity and acceleration curves, ensuring continuous acceleration curves without abrupt changes and further improving motion smoothness. The advantage of this method is its excellent motion smoothness, resulting in smoother start-up, shutdown, and speed change processes for actuators, effectively avoiding mechanical shocks. It is suitable for scenarios with extremely high requirements for motion smoothness, such as semiconductor chip manufacturing equipment. However, this method has extremely high computational complexity, requiring real-time calculation of trigonometric function values such as sine and cosine. For low-cost embedded processors without FPUs or hardware trigonometric acceleration, real-time calculation of trigonometric functions places a huge burden on the CPU, potentially leading to system lag and motion synchronization issues. Furthermore, this method is based on a continuous-domain mathematical model. When applied to discrete digital control systems (with fixed interpolation or control cycles) such as servo drives, it generates significant discrete errors, affecting the positioning accuracy of the actuators and failing to meet the requirements of high-precision motion control.
[0006] The acceleration / deceleration planning method based on lookup tables involves pre-calculating and storing relevant data for standard acceleration / deceleration curves. During system runtime, the pre-defined data table is looked up using a time index, and the corresponding speed command is output to achieve acceleration / deceleration control. The advantages of this method are low computational load and fast response speed, effectively solving the problem of real-time calculation of complex functions and adapting to the resource constraints of low-cost embedded systems. However, this method has extremely poor flexibility. The pre-generated speed table is fixed and cannot be adjusted online for key parameters such as target position and running speed. Furthermore, this method is only suitable for reciprocating motion with a fixed stroke. For motion of arbitrary distance, the fixed speed table is difficult to match actual motion requirements, easily leading to position errors and poor adaptability, failing to meet diverse motion control scenarios.
[0007] Furthermore, all existing acceleration / deceleration planning methods share a common drawback: they fail to balance computational efficiency, motion smoothness, and dynamic adaptability, and cannot effectively avoid discrete-domain model errors. In embedded systems, processors have limited computational and storage resources, especially low-cost embedded processors, which cannot handle the computational load of complex algorithms; while industrial automation equipment requires acceleration / deceleration planning to possess high smoothness, dynamic adaptability, and positioning accuracy. Existing technologies cannot meet this contradictory requirement. Therefore, developing an acceleration / deceleration planning method that can reduce computational overhead, balance motion smoothness and dynamic adaptability, avoid discrete errors, and is suitable for embedded systems has become a pressing technical problem for those skilled in the art. Summary of the Invention
[0008] To address the aforementioned shortcomings of existing technologies, the present invention aims to provide a low-computational-overhead acceleration / deceleration planning method suitable for embedded systems. The specific objectives are as follows: 1. Effectively reduce system impact: By adjusting the number and size of multi-layer windows, it can adapt to different usage scenarios, flexibly adjust the smoothness of acceleration and deceleration planning, eliminate mechanical impact caused by sudden acceleration changes, and extend the service life of equipment.
[0009] 2. Achieve dynamic parameter adjustment: By overlaying planning modules, the target position and running speed can be adjusted in real time during the planning process without stopping the current motion, thus improving the dynamic adaptability of the system and meeting diverse motion control needs.
[0010] 3. Improve system responsiveness: Simplify the calculation process, only need to perform one calculation per control cycle, and the calculation process mainly involves addition operations, which greatly reduces CPU resource consumption, improves the real-time response capability of embedded systems, and is compatible with low-cost embedded processors.
[0011] 4. Avoid discrete errors: Determine the window size based on the control cycle of the embedded system to eliminate discrete errors generated when continuous domain mathematical models are applied to discrete digital control systems from the design stage, thereby improving the positioning accuracy of the actuator.
[0012] The technical solution adopted by this invention to solve its technical problem is: a low-computational-overhead acceleration / deceleration planning method suitable for embedded systems, comprising the following steps: (1) Preprocessing before planning: Based on the look-ahead parameters and the control cycle of the embedded controller, determine the size of the planning window, the unit of position increment, the total number of position increments and the remaining positions. The look-ahead parameters include the target position, running speed, acceleration and smoothness. One planning module is used for single-segment planning and multiple planning modules are used for multi-segment planning. (2) Activation of planning module: When parameters need to be modified or multiple planning segments need to be performed during the planning process, a new planning module is activated, and the module currently executing the planning task is marked as the main module. When the main module reaches the preset conditions, the planning leadership is transferred to the newly activated planning module, and the new module becomes the new main module. The activation of the module is subject to the look-ahead parameters. (3) Execution process of the plan: In each control cycle, all enabled planning modules are executed sequentially, and the actual position output of this cycle is the sum of the output values of all modules; the execution process of each module includes: ① Determine whether to continue pushing position increments. If so, push 1 position increment to the data buffer of the first-level window. After all position increments have been pushed, continue to push 0 values into the buffer until the module is closed. ② Each layer of the window sequentially performs a moving average processing on the input data. The output of the previous layer of the window serves as the input of the next layer of the window, and the output of the last layer of the window is the position output value of the module in this cycle. ③ After all window data has been processed, close the current module; (4) Parameter adjustment during planning execution: When it is necessary to adjust the target position or running speed, it is achieved by adding a new planning module. The kernel first determines whether the main module meets the conditions for starting the new module. If the conditions are met, the forward parameters of the new module are configured according to the real-time parameters of the main module, the new module is started and the control is transferred. The window has a multi-layer structure, and the number of window layers is determined by the required motion smoothness. The size of the first layer window is determined based on the control cycle, target position, speed and acceleration. Acceleration and deceleration smooth control is achieved by moving average of multiple windows, which avoids discrete errors in principle.
[0013] Specifically, the remaining position is the difference between the target position and the product of the position increment unit and the total number of position increments, and the remaining position is less than the position increment unit.
[0014] Specifically, the preset activation condition for the planning module is that the current position increment push progress of the main module reaches a preset threshold, or the operating parameters of the main module meet the acceleration limit requirements.
[0015] Specifically, the number of layers in the multi-layer window ranges from 2 to 5. The more layers there are, the smoother the motion becomes. In addition, the size of each layer window is the same as that of the first layer window.
[0016] Specifically, the moving average processing involves taking the arithmetic mean of all data within the window and using it as the output value of that layer of the window.
[0017] Specifically, during the parameter adjustment process, the acceleration parameters of the newly planned module do not exceed the acceleration parameters of the main module, ensuring smooth and shock-free motion transitions.
[0018] Specifically, the embedded controller is a low-cost embedded processor without an FPU or hardware triangular acceleration.
[0019] Specifically, the planning module is closed when all position increments of the module have been pushed in, all window data have completed the moving average processing, and the output value tends to stabilize.
[0020] Specifically, the position increment unit is determined by the target position, running speed, and control cycle to ensure that the position increment matches the speed within each control cycle and avoids loss of synchronization.
[0021] The beneficial effects of this invention are: 1. Low computational overhead and adaptable to embedded systems: This invention only needs to perform one calculation per control cycle. The calculation process mainly involves addition operations, without the need for complex exponentiation and trigonometric function operations, which greatly reduces the CPU resource consumption. Even low-cost embedded processors without FPU or hardware trigonometric acceleration can run stably, solving the problem of complex calculations and incompatibility with embedded systems in existing technologies.
[0022] 2. Adjustable motion smoothness, reducing system shock: By adjusting the number of multi-layer windows, the smoothness of motion can be flexibly controlled. The more layers, the better the smoothness, which can effectively eliminate the mechanical shock caused by sudden acceleration, extend the service life of actuators and equipment, and adapt to the smoothness requirements of different scenarios.
[0023] 3. Strong dynamic adaptability and support for real-time parameter adjustment: Through the overlay of planning modules and the technology of handing over control, the target position and running speed can be adjusted in real time during the planning process without stopping the current motion. This solves the problem that existing technologies cannot dynamically adjust parameters and meets diverse and complex motion control needs.
[0024] 4. No discrete error and high positioning accuracy: The window size is determined based on the control cycle of the embedded system, and the acceleration and deceleration planning in the continuous domain is transformed into window processing in the discrete domain. This eliminates discrete error from the design perspective, improves the positioning accuracy of the actuator, and meets the requirements of high-precision motion control.
[0025] 5. High versatility and adaptability to various scenarios: This invention can be widely applied to motion control scenarios of various industrial automation equipment such as CNC machine tools, industrial robots, and semiconductor manufacturing equipment. Whether it is single-segment motion, multi-segment motion, or scenarios that require dynamic parameter adjustment, it can be stably adapted and has strong practicality and promotional value. Detailed Implementation
[0026] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0027] The present invention provides a low-computational-overhead acceleration / deceleration planning method suitable for embedded systems, comprising the following steps: (1) Preprocessing before planning: Before starting acceleration and deceleration planning, the planning parameters are configured based on the system's look-ahead parameters and the control cycle of the embedded controller, laying the foundation for the normal operation of the planning module. Among them, the look-ahead parameters include target position, running speed, acceleration, and smoothness, which are set by the user according to the actual motion control requirements; the control cycle of the embedded controller is a fixed cycle preset by the system and is the core parameter of the discrete digital control system. During the preprocessing process, four key parameters need to be calculated and determined: the size of the planning window, the unit of position increment, the total number of position increments, and the remaining positions. The window size must be determined by considering the control cycle, target position, running speed, and acceleration to ensure that the window size matches the system's discrete characteristics and avoids discrete errors at their source. The position increment unit is the smallest position increment that can be pushed into the window within each control cycle, determined jointly by the target position, running speed, and control cycle. This ensures that the position increment matches the speed within each control cycle, avoiding motion loss of synchronization. The total number of position increments is the integer part of the target position divided by the position increment unit. The remaining position is the difference between the target position and the product of the position increment unit and the total number of position increments, and the remaining position is less than the position increment unit. The remaining position will be accurately compensated through window processing at the end of the planning stage to ensure positioning accuracy. Simultaneously, the number of planning modules is determined according to the planning type: only one planning module is needed for single-segment planning, while multiple planning modules are needed for multi-segment planning, with each module corresponding to one motion planning task.
[0028] (2) Activation of the planning module: The planning module is the core unit for realizing acceleration and deceleration planning. Each module independently executes a segment of motion planning tasks, and the continuous connection of motion is achieved between modules through the transfer of leadership. During the planning process, if it is necessary to modify parameters such as target position and running speed, or if multiple segments of planning are required, a new planning module needs to be activated. At this time, the module currently executing the planning task needs to be marked as the master module. When the master module reaches the preset conditions, the planning leadership is transferred to the newly activated planning module, and the new module becomes the new master module and continues to execute the planning task. The preset conditions for the master module to transfer leadership are that the position increment push progress reaches the preset threshold, or the running parameters of the master module meet the acceleration limit requirements, to ensure that the module switching process is smooth and without shock. The activation of the module is limited by the look-ahead parameters, especially the acceleration parameters. The acceleration parameters of the newly activated module must not exceed the acceleration parameters of the master module to avoid system shock due to sudden acceleration changes.
[0029] (3) Execution process of planning: The execution of acceleration and deceleration planning is based on control cycles. In each control cycle, all enabled planning modules are executed sequentially. The actual position output of this cycle is the sum of the output values of all modules. Complex motion planning is achieved through module superposition. The specific execution process of each planning module is divided into three steps: ① Position increment push: Determine whether the current module needs to continue pushing position increments. If so, push 1 position increment into the data buffer of the first window to ensure that only 1 position increment is pushed in each control cycle to avoid excessive computational load. After all position increments have been pushed in, continue to push 0 values into the buffer until the module is closed to ensure the continuity of window processing and avoid sudden output changes. ② Window moving average processing: Multi-layer windows perform moving average processing on the input data in sequence. The output data of the previous window is used as the input data of the next window and is passed in sequence. The output value of the last window is the position output value of the module in this cycle. The number of window layers is determined by the desired motion smoothness; more layers result in smoother motion. Typically, the number of layers ranges from 2 to 5. Each layer's window size is consistent, identical to the first layer. The moving average processing uses an arithmetic average method, involving only addition and division operations. Furthermore, division can be simplified to multiplication by pre-setting coefficients, further reducing computational overhead. ③ Module shutdown: When all position increments for the module have been pushed in, and all window data has undergone moving average processing, and the output value stabilizes, the current module is shut down to release system resources and ensure efficient operation of the embedded system.
[0030] (4) Parameter adjustment during planning execution: During the acceleration / deceleration planning execution, if the user needs to adjust the target position or running speed, there is no need to stop the current movement. This can be achieved by adding a new planning module. The specific process is as follows: ① Condition judgment: The system kernel detects the running status of the main module in real time and judges whether the main module meets the conditions for starting a new module. This condition is consistent with the preset conditions for module activation, ensuring a smooth parameter adjustment process. ② New module configuration: When the main module meets the conditions, the forward parameters of the new planning module are configured according to the real-time running parameters of the main module (including current position, speed, and acceleration). The target position and running speed of the new module are set according to user needs. The acceleration parameter does not exceed the acceleration parameter of the main module, ensuring a smooth and shock-free motion transition. ③ Transfer of control: The new planning module is started, and the planning control is transferred from the original main module to the new module. The new module becomes the new main module and continues to execute the adjusted acceleration / deceleration planning task. The original main module continues to execute the remaining planning tasks until completion and then closes. Real-time parameter adjustment is achieved through module overlay.
[0031] The core innovation of this invention lies in its use of a multi-layer window moving average method for acceleration / deceleration planning, combined with module overlay technology. This solves the problem of complex calculations in existing technologies and enables dynamic parameter adjustment. Furthermore, the window size is designed based on the control cycle, fundamentally avoiding discrete errors. Compared to existing technologies, this invention features a simpler calculation process, requiring only one calculation involving addition per control cycle, significantly reducing CPU resource consumption and making it compatible with low-cost embedded processors. Motion smoothness can be flexibly controlled by adjusting the number of window layers to meet the needs of different scenarios. It supports real-time adjustment of target position and running speed, exhibiting strong dynamic adaptability. With no discrete errors and high positioning accuracy, it effectively addresses the core shortcomings of existing technologies.
[0032] Example 1: Single-segment acceleration / deceleration planning for CNC machine tools. This example applies to the feed axis motion control of a CNC machine tool. The CNC machine tool uses a low-cost embedded controller, without an FPU or hardware triangular accelerator. The control cycle is 10ms. The requirement is to achieve single-segment linear acceleration / deceleration motion with a target position of 100mm, a running speed of 10mm / ms, an acceleration of 0.5mm / ms², and moderate motion smoothness (window layers are set to 3). No dynamic parameter adjustment is required. The specific implementation process is as follows: (1) Preprocessing before planning: First, determine the look-ahead parameters and control period, where the look-ahead parameters are target position 100mm, running speed 10mm / ms, and acceleration 0.5mm / ms. 2 The smoothness is moderate (3 window layers), and the control cycle is 10ms. Based on the above parameters, the planning window size, position increment unit, total number of position increments, and remaining positions are calculated: ① Window size: Combining the control cycle, target position, velocity, and acceleration, the calculated window size is 5 control cycles, meaning the window contains 5 data points. This ensures the window size matches the system's discrete characteristics and avoids discrete errors; ② Position increment unit: Determined by the running speed and control cycle, position increment unit = running speed × control cycle = 10mm / ms × 10ms = 100mm / 100 = 1mm (here, the control cycle is replaced with...). Calculated in seconds, 10ms = 0.01s, position increment unit = 10mm / s × 0.01s = 0.1mm (this is corrected for more precise calculation to ensure matching with actual movement); ③ Total number of position increments: target position divided by position increment unit, i.e., 100mm ÷ 0.1mm = 1000 increments, therefore the total number of position increments is 1000; ④ Remaining position: target position - position increment unit × total number of position increments = 100mm - 0.1mm × 1000 = 0mm, the remaining position is 0mm, no additional compensation is needed. Since this embodiment is a single-segment planning, one planning module is enabled, and this module is marked as the main module.
[0033] (2) Activation of planning module: This embodiment is a single-segment planning, so there is no need to activate a new planning module. Only one main module is activated. The acceleration and deceleration planning task is performed by the main module throughout the process. The activation of the module is not subject to any additional restrictions (acceleration parameters meet the preset requirements).
[0034] (3) Execution process of planning: The main module's planning task is executed in each control cycle with a 10ms control cycle. The specific steps are as follows: ① Position increment push: Each control cycle determines whether to continue pushing position increments. Position increments need to be pushed in the first 1000 control cycles. Therefore, each control cycle pushes a 0.1mm position increment into the data buffer of the first window. After all 1000 position increments have been pushed in, starting from the 1001st control cycle, 0 values are continuously pushed into the buffer until the module is closed. ② Window moving average processing: A 3-layer window is used for moving average processing. The size of each layer window is 5 control cycles. The moving average method is arithmetic average. The first layer window receives the input data from the buffer. In each control cycle, the arithmetic average of the 5 data in the window is taken as the output value of the first layer window and passed to the second layer window. The second layer window performs the same moving average processing on the received first layer output data and outputs it to the third layer window. The third layer window performs the moving average processing on the received second layer output data, and the output value is the position output value of the module in this cycle. For example, in the 5th control cycle, the data in the first window is the 0.1mm position increment pushed in over the previous 5 control cycles, with an average value of 0.1mm, which is then passed to the second window. Since there is only one data point in the second window at this time, it is not output until the 9th control cycle, when the second window has collected 5 data points and output begins. In the 13th control cycle, the third window has collected 5 data points and output begins, at which point the output value tends to stabilize, achieving smooth acceleration and deceleration. ③ Module shutdown: After the 1000th position increment is pushed in, 0 values continue to be pushed in until the output value of the third window stabilizes at 100mm (target position), and all window data processing is completed. At this time, the main module is shut down, system resources are released, and the acceleration and deceleration planning is completed.
[0035] (4) Parameter adjustment during planning execution: This embodiment does not require adjustment of the target position and running speed, so no new planning module is activated, and the planning task is executed by the main module throughout the process.
[0036] The implementation effects of this embodiment are as follows: During the entire acceleration / deceleration planning process, only one moving average calculation is required per control cycle. The calculation process mainly involves addition operations, with a CPU utilization rate of less than 10%, which is far lower than existing acceleration / deceleration planning methods based on S-curves (CPU utilization rate above 40%) and trigonometric functions (CPU utilization rate above 60%). The acceleration during the motion is smooth with no abrupt changes, and the feed axes of the CNC machine tool run smoothly without significant mechanical impact. The positioning accuracy reaches ±0.01mm with no discrete error, meeting the machining accuracy requirements of the CNC machine tool. The entire planning process does not require complex calculations, adapts to the resource limitations of low-cost embedded controllers, and operates stably and reliably.
[0037] Example 2: Multi-segment acceleration / deceleration planning applicable to industrial robots. This example applies to the joint motion control of an industrial robot using an embedded controller with a control cycle of 8ms. The requirement is to achieve three segments of continuous acceleration / deceleration motion. The first segment has a target position of 50mm, a running speed of 8mm / ms, and an acceleration of 0.4mm / ms². The second segment has a target position of 80mm, a running speed of 12mm / ms, and an acceleration of 0.6mm / ms². The third segment has a target position of 30mm, a running speed of 6mm / ms, and an acceleration of 0.3mm / ms². High motion smoothness is required (the window layer is set to 4 layers). The specific implementation process is as follows: (1) Preprocessing before planning: Determine the look-ahead parameters and control period. The control period is 8ms. The look-ahead parameters for the three motion segments are as follows: First segment: target position 50mm, velocity 8mm / ms, acceleration 0.4mm / ms 2 Second segment: Target position 80mm, velocity 12mm / ms, acceleration 0.6mm / ms 2 Third segment: Target position 30mm, velocity 6mm / ms, acceleration 0.3mm / ms 2The smoothness is high, and the number of window layers is set to 4. Preprocessing is performed on the three motion segments separately, calculating the window size, position increment unit, total number of position increments, and remaining positions for each segment: ① First segment: Window size = control cycle × acceleration coefficient = 8ms × 5 = 40ms (i.e., 5 control cycles); Position increment unit = 8mm / ms × 8ms = 0.064mm (8ms = 0.008s, 8mm / s × 0.008s = 0.064mm); Total number of position increments = 50mm ÷ 0.064mm ≈ 781; Remaining positions = 50mm - 0.064mm × 781 ≈ 50 - 50.0 = -0.004mm (ignoring minor errors, considered as 0mm). ② Second segment: Window size = 8ms × 5 = 40ms (5 control cycles); Position increment unit = 12mm / ms × 8ms = 0.096mm; Total number of position increments = 80mm ÷ 0.096mm ≈ 833; Remaining position = 80mm - 0.096mm × 833 ≈ 80 - 79.968 = 0.032mm. ③ Third segment: Window size = 8ms × 5 = 40ms (5 control cycles); Position increment unit = 6mm / ms × 8ms = 0.048mm; Total number of position increments = 30mm ÷ 0.048mm = 625; Remaining position = 0mm. Since this embodiment involves multi-segment planning, three planning modules are enabled, each corresponding to one of the three motion segments. Initially, the module corresponding to the first segment is designated as the main module.
[0038] (2) Activation of the planning module: Initially, the module corresponding to the first segment (main module) is activated. When the main module executes to the point where the position increment push progress reaches 90% (i.e., 703 position increments have been pushed in), the module activation condition is met, and the planning module corresponding to the second segment is activated. At this time, the main module continues to execute the remaining 10% of the position increment push task, and the newly activated second segment module enters the preparation state. When the main module completes all position increment pushes (781), and the window processing output value tends to be stable, the planning leadership is transferred to the second segment module, and the second segment module becomes the new main module. When the second segment module executes to the point where the position increment push progress reaches 90% (i.e., 750 position increments have been pushed in), the planning module corresponding to the third segment is activated. The second segment module continues to execute the remaining tasks, and after completion, the leadership is transferred to the third segment module, and the third segment module becomes the new main module, until the planning is completed.
[0039] (3) Execution process of planning: With 8ms as a control cycle, all currently activated planning modules are executed sequentially in each control cycle. The actual position output is the sum of the output values of all modules. The execution process of each module is as follows: ① Position increment push: The main module (first segment) pushes in a position increment of 0.064mm in each cycle during the first 781 control cycles, and pushes in 0 value after 781 cycles; After the second segment module is activated, it is in the preparation state for the first 750 cycles and does not push in position increments. When it receives the dominant position, it starts to push in a position increment of 0.096mm, which lasts for 833 cycles, and pushes in 0 value after completion; After the third segment module is activated, it is in the preparation state. After receiving the dominant position, it pushes in a position increment of 0.048mm, which lasts for 625 cycles, and pushes in 0 value after completion. ② Window moving average processing: Four layers of windows are used, and the size of each layer of windows is 5 control cycles. The moving average method is arithmetic average. Each module's window is processed independently. The output of the previous window serves as the input for the next, and the output of the last window serves as the module's position output value for the current cycle. For example, in the 5th control cycle, the first module's first-layer window outputs an average value of 0.064mm, which is then passed to the second-layer window; in the 9th control cycle, the second-layer window outputs an average value of 0.064mm, which is passed to the third-layer window; in the 13th control cycle, the third-layer window outputs an average value of 0.064mm, which is passed to the fourth-layer window; and in the 17th control cycle, the fourth-layer window outputs an average value of 0.064mm, which serves as the module's output value for the current cycle, achieving smooth acceleration. When switching modules, the output value of the previous module gradually stabilizes, while the output value of the next module gradually increases. The actual position output after the two are superimposed is continuous without abrupt changes, ensuring smooth motion transitions. ③ Module shutdown: The first module shuts down after all position increments have been input and the output value has stabilized; the second module shuts down after all position increments have been input and the output value has stabilized; the third module shuts down after all position increments have been input and the output value has stabilized at 30mm (target position), thus completing the entire multi-segment acceleration and deceleration planning.
[0040] (4) Parameter adjustment during planning execution: This embodiment is a multi-segment planning. By enabling multiple modules, the parameters of different segments can be switched without additional parameter adjustment. The module switching process is smooth, without shock or loss of synchronization.
[0041] The implementation results of this embodiment are as follows: the multi-segment motion is smoothly connected without sudden acceleration or position changes, and the motion smoothness is high, meeting the stability requirements of industrial robot joint motion; the computational load of each control cycle is small, the CPU utilization rate is less than 12%, and it is compatible with embedded controllers; the positioning accuracy reaches ±0.008mm with no discrete error; the module switching is flexible, enabling continuous planning of multi-segment motions, solving the problems of complex multi-segment planning and unstable connection in existing technologies, and is suitable for complex motion control scenarios of industrial robots.
[0042] Example 3: Dynamic parameter adjustment acceleration / deceleration planning for semiconductor equipment. This example applies to the precision motion control of semiconductor chip manufacturing equipment. The equipment uses an embedded controller with a control cycle of 5ms. It requires single-segment acceleration / deceleration motion. The initial target position is 60mm, the initial running speed is 9mm / ms, and the initial acceleration is 0.5mm / ms². High motion smoothness is required (window layers are set to 5). When the planning reaches 50% completion, the target position is adjusted to 75mm, the running speed is adjusted to 10mm / ms, and the acceleration remains unchanged. The specific implementation process is as follows: (1) Preprocessing before planning: The initial look-ahead parameters are: target position 60mm, running speed 9mm / ms, and acceleration 0.5mm / ms. 2 High smoothness (5 window layers), control cycle of 5ms. Initial planning parameters are calculated as follows: ① Window size = 5ms × 5 = 25ms (5 control cycles); ② Position increment unit = 9mm / ms × 5ms = 0.045mm (5ms = 0.005s, 9mm / s × 0.005s = 0.045mm); ③ Total number of position increments = 60mm ÷ 0.045mm ≈ 1333; ④ Remaining positions = 60mm - 0.045mm × 1333 ≈ 60 - 59.985 = 0.015mm. Initially, one planning module is enabled and marked as the main module.
[0043] (2) Activation of the planning module: The main module is initially activated (corresponding to the initial parameters). When the main module executes until the position increment push progress reaches 50% (i.e., 667 position increments have been pushed in), the user issues a parameter adjustment command. At this time, the system kernel determines whether the main module meets the conditions for activating a new module. After detection, the current acceleration of the main module is 0.5 mm / ms. 2 The conditions for enabling the new module are met, therefore the new planning module (corresponding to the adjusted parameters) is enabled.
[0044] (3) Execution process of the plan: with a control cycle of 5ms, in the initial stage (the first 667 control cycles), only the main module is executed. The specific steps are as follows: ① Position increment push: 0.045mm position increment is pushed into the first layer window in each control cycle, for a total of 667 increments; ② Window sliding average processing: the 5 layers of windows are slid averaged in sequence. Starting from the 21st control cycle, the fifth layer window outputs a stable position increment to achieve smooth acceleration; ③ Module running status: the main module runs normally and the output value gradually increases. By the 667th control cycle, the output position is about 30mm (50% of the target position).
[0045] In the 668th control cycle, a new planning module is activated, and the parameter adjustment process is as follows: ① New module configuration: Based on the current real-time parameters of the main module (current position 30mm, velocity 9mm / ms, acceleration 0.5mm / ms) 2 Configure the look-ahead parameters for the new module: target position 75mm (adjusted), running speed 10mm / ms (adjusted), acceleration 0.5mm / ms. 2 (Unchanged), the number of window layers remains 5, and the window size is 5 control cycles; the position increment unit of the new module is calculated as 10mm / ms × 5ms = 0.05mm, the total number of position increments is (75mm - 30mm) ÷ 0.05mm = 900, and the remaining position increments are 0mm. ② Transfer of control: Start the new module, transfer the planning control from the original main module to the new module, and the new module becomes the new main module. The original main module continues to push the remaining position increments (1333 - 667 = 666), and after the push is completed, push in 0 values until it is closed.
[0046] In subsequent control cycles (from control cycle 668 to 667+900=1567), both the original main module and the new main module are executed simultaneously. The actual position output is the sum of the output values of the two modules. The original main module continues to push in position increments of 0.045mm for a total of 666 cycles, after which it pushes in a value of 0, and the window processing output value gradually stabilizes. The new main module pushes in position increments of 0.05mm per cycle for a total of 900 cycles, and the window processing output value gradually increases. The actual position output after the two are superimposed is continuous without abrupt changes, achieving smooth adjustment of the target position and velocity. When the new main module has completed pushing in all position increments (900 increments) and the output value stabilizes at 75mm (the adjusted target position), the original main module has also completed all processing and shut down. At this point, the new main module is shut down, and the entire acceleration / deceleration planning is completed.
[0047] (4) Parameter adjustment during planning execution: Real-time adjustment of target position and running speed is achieved by adding new modules. There is no movement stop, no impact, and no step loss during the adjustment process. The parameter adjustment is smooth and meets the requirements of precision motion control of semiconductor equipment.
[0048] The implementation results of this embodiment are as follows: the parameter adjustment process is smooth with no motion interruption; the transition from target position to 75mm and speed from 9mm / ms to 10mm / ms is natural with no sudden acceleration changes; the motion smoothness is high with no mechanical impact, making it suitable for the precision motion requirements of semiconductor equipment; the computational load per control cycle is small, with CPU utilization below 15%, making it suitable for embedded controllers; the positioning accuracy reaches ±0.005mm with no discrete error; it solves the defect of existing technologies that cannot adjust parameters in real time, and can flexibly meet the parameter adjustment requirements in the semiconductor manufacturing process, improving the adaptability and processing accuracy of the equipment.
[0049] Comparative Examples: To verify the technical effect of the present invention, three sets of comparative examples were set up, each using one of the three existing mainstream acceleration / deceleration planning methods, under the same hardware environment as Example 1 (low-cost embedded controller, no FPU, no hardware triangular acceleration, control cycle 10ms) and motion parameters (target position 100mm, running speed 10mm / ms, acceleration 0.5mm / ms). 2 The test was conducted under medium smoothness conditions, and the test indicators included CPU utilization, motion smoothness, positioning accuracy, and dynamic adjustment capability. The test results are as follows: Comparison with Example 1: S-curve-based acceleration / deceleration planning method. Implementation process: A seven-segment S-curve acceleration / deceleration planning method is used to calculate the velocity, acceleration, and position at each stage. Multiple curve calculations and exponentiation operations are performed in each control cycle, combined with a look-ahead algorithm to ensure smooth motion. Test results: CPU utilization is 42%, motion smoothness is moderate (comparable to Example 1), positioning accuracy is ±0.02mm (with discrete errors), dynamic parameter adjustment is not possible, and parameter adjustment requires stopping the motion and replanning; there are problems of computational complexity and slow real-time response, and prolonged operation can easily lead to system lag.
[0050] Comparison with Example 2: Acceleration / deceleration planning method based on trigonometric functions. Implementation process: A velocity curve is constructed using a sine function, and the sine value is calculated in real time for each control cycle to achieve acceleration / deceleration planning. Test results: CPU utilization is 65%, motion smoothness is high (slightly higher than Example 1), positioning accuracy is ±0.03mm (significant discrete error), dynamic parameter adjustment cannot be achieved; the computational complexity is extremely high, resulting in slow real-time system response and even motion step loss, making it unsuitable for low-cost embedded controllers.
[0051] Compare with Example 3: Acceleration / deceleration planning method based on lookup table. Implementation process: Pre-calculate and save standard S-curve acceleration / deceleration data; during runtime, output speed commands by looking up a table using a time index. Test results: CPU utilization 8% (low computational load), low motion smoothness (abrupt acceleration occurs), positioning accuracy ±0.05mm (large position error), unable to achieve dynamic parameter adjustment, only adaptable to fixed-stroke motion, unable to meet the target position requirements of this test, and prone to position deviation.
[0052] Comparative Analysis: Compared with the three control examples, the CPU utilization rate of this invention (Example 1) is significantly lower than that of Control Examples 1 and 2, and close to that of Control Example 3; the motion smoothness is moderate, comparable to Control Example 1, slightly lower than Control Example 2, but significantly higher than Control Example 3; the positioning accuracy (±0.01mm) is superior to all control examples, with no discrete error; and it supports dynamic parameter adjustment, solving the defect that all control examples cannot dynamically adjust parameters. In summary, this invention can simultaneously balance computational overhead, motion smoothness, positioning accuracy, and dynamic adaptability, perfectly solving the core defects of existing technologies and adapting to the application requirements of embedded systems.
[0053] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of protection claimed by the present invention. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A low computational overhead speed planning method for embedded systems, characterized in that, Includes the following steps: (1) Preprocessing before planning: Based on the look-ahead parameters and the control cycle of the embedded controller, determine the size of the planning window, the unit of position increment, the total number of position increments and the remaining positions. The look-ahead parameters include the target position, running speed, acceleration and smoothness. One planning module is used for single-segment planning and multiple planning modules are used for multi-segment planning. (2) Activation of planning module: When parameters need to be modified or multiple planning segments need to be performed during the planning process, a new planning module is activated, and the module currently executing the planning task is marked as the main module. When the main module reaches the preset conditions, the planning leadership is transferred to the newly activated planning module, and the new module becomes the new main module. The activation of the module is subject to the look-ahead parameters. (3) Execution process of the plan: In each control cycle, all enabled planning modules are executed sequentially, and the actual position output of this cycle is the sum of the output values of all modules; the execution process of each module includes: ① Determine whether to continue pushing position increments. If so, push 1 position increment to the data buffer of the first-level window. After all position increments have been pushed, continue to push 0 values into the buffer until the module is closed. ② Each layer of the window sequentially performs a moving average processing on the input data. The output of the previous layer of the window serves as the input of the next layer of the window, and the output of the last layer of the window is the position output value of the module in this cycle. ③ After all window data has been processed, close the current module; (4) Parameter adjustment during planning execution: When it is necessary to adjust the target position or running speed, it is achieved by adding a new planning module. The kernel first determines whether the main module meets the conditions for starting the new module. If the conditions are met, the forward parameters of the new module are configured according to the real-time parameters of the main module, the new module is started and the control is transferred. The window has a multi-layer structure, and the number of window layers is determined by the required motion smoothness. The size of the first layer window is determined based on the control cycle, target position, speed and acceleration. Acceleration and deceleration smooth control is achieved by moving average of multiple windows, which avoids discrete errors in principle.
2. The low computational overhead speed planning method for embedded systems according to claim 1, characterized in that: The remaining position is the difference between the target position and the product of the position increment unit and the total number of position increments, and the remaining position is less than the position increment unit.
3. The low computational overhead speed planning method for embedded systems according to claim 1, wherein: The preset activation condition for the planning module is that the current position increment push progress of the main module reaches a preset threshold, or the operating parameters of the main module meet the acceleration limit requirements.
4. The low computational overhead speed planning method for embedded systems of claim 1, wherein: The number of layers in the multi-layer window ranges from 2 to 5. The more layers there are, the smoother the motion becomes. Each layer of the window is the same size as the first layer window.
5. The low computational overhead speed planning method for embedded systems according to claim 1, wherein: The moving average processing involves taking the arithmetic mean of all data within the window and using it as the output value of that layer of the window.
6. The low computational overhead speed planning method for embedded systems of claim 1, wherein: During the parameter adjustment process, the acceleration parameters of the newly planned module do not exceed the acceleration parameters of the main module, ensuring smooth and shock-free motion transitions.
7. The low computational overhead speed planning method for embedded systems as claimed in claim 1 wherein: The embedded controller is a low-cost embedded processor without an FPU or hardware triangular acceleration.
8. The low computational overhead speed planning method for embedded systems of claim 1, wherein: The planning module is closed when all position increments of the module have been pushed in, all window data have completed the moving average processing, and the output value tends to stabilize.
9. The low computational overhead speed planning method for embedded systems of claim 1, wherein: The position increment unit is determined by the target position, the running speed and the control period, which ensures the position increment in each control period to match the speed and avoid motion out of step.