DDA-based multi-axis linear interpolation control method, system and device, and storage medium
Through the multi-axis linear interpolation control method based on DDA, the complex machining profile is decomposed into tiny linear segments, and the digital differential analysis algorithm is used to solve the problem of high computational complexity in the traditional method, and efficient and high-precision multi-axis linkage control is achieved, which is suitable for CNC machine tools, 3D printers and industrial robots.
Patent Information
- Application Number
- CN202510644295.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional multi-axis collaborative motion control method has high computational complexity in precision manufacturing fields such as CNC machine tools, 3D printing and robots, resulting in insufficient path fitting accuracy and affecting the processing surface quality.
The multi-axis linear interpolation control method based on DDA is adopted, and the complex machining profile is decomposed into multiple tiny linear segments through finite element segmentation technology. The interpolation algorithm of digital differential analysis is used to generate the target step count of each axis, reducing the computational complexity and path planning complexity.
It significantly improves the efficiency and accuracy of multi-axis linkage control, reduces the cost of system implementation, and enhances the portability of code. It is suitable for CNC machine tools, 3D printers and industrial robots and other scenarios.
Smart Images

Figure CN120447473A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a DDA-based multi-axis linear interpolation control method, system, device and storage medium. Background Art
[0002] In precision manufacturing fields such as CNC machine tools, 3D printing, and robotics, multi-axis collaborative motion control is a core technology for achieving complex contour machining. Traditional methods approximate the target curve by breaking down the machining path into tiny straight line segments, which are then collaboratively executed by multiple-axis stepper or servo motors. Currently, the point-by-point comparison method is a commonly used interpolation algorithm, but its computational complexity and hardware resource consumption are high, especially in multi-axis linkage scenarios. This can easily lead to insufficient path fitting accuracy, affecting the quality of the machined surface. Summary of the Invention
[0003] The present application provides a DDA-based multi-axis linear interpolation control method, system, device, and storage medium to solve the problems raised by the above background technology.
[0004] In a first aspect, the present application provides a multi-axis linear interpolation control method based on DDA, comprising: In response to a part processing control instruction, a processing contour of the part is obtained, and a finite element segmentation process is performed on the processing contour to obtain a plurality of finite element line segments; For each of the finite element segments, the target step number corresponding to each axis is generated based on the motor parameters and the endpoints corresponding to the finite element segment, and the finite element segment is processed based on the current total step number, the target step number corresponding to each axis, and the current step number corresponding to each axis.
[0005] In one possible implementation, the motor parameters include a step angle and a screw lead, and generating a target step number corresponding to each axis based on the motor parameters and the endpoints corresponding to the finite element line segments includes: Calculating the number of steps per unit length based on the step angle and the lead of the screw; For each axis, a processing length corresponding to the axis is determined based on the endpoints corresponding to the finite element line segments, and a target number of steps corresponding to the axis is calculated based on the number of steps per unit length and the processing length.
[0006] In a possible implementation, the calculating the number of steps per unit length based on the step angle and the lead of the screw includes: pass Calculate the number of steps per unit length; wherein, is the number of steps per unit length.
[0007] In a possible implementation, processing the finite element line segment based on the current total number of steps, the target number of steps corresponding to each axis, and the current number of steps corresponding to each axis includes: Selecting the maximum target step number from among the target step numbers; For each of the axes, the step number threshold corresponding to the axis is determined based on the current total number of steps, the target number of steps corresponding to the axis and the maximum target number of steps, and the current number of steps corresponding to the axis is compared with the step number threshold. When the step number threshold is greater than the current number of steps corresponding to the axis, the lead screw of the drive motor corresponding to the axis is controlled to move one step. When the step number threshold is not greater than the current number of steps corresponding to the axis, the axis is controlled to stop moving.
[0008] In a possible implementation, determining the step number threshold corresponding to the axis based on the current total step number, the target step number corresponding to the axis, and the maximum target step number includes: General The rounded value of the calculated value is used as the step number threshold.
[0009] In a second aspect, the present application provides a multi-axis linear interpolation control system based on DDA, comprising: an acquisition module, configured to respond to a part processing control instruction, acquire a processing contour of the part, and perform finite element segmentation processing on the processing contour to obtain a plurality of finite element line segments; A processing module is used to generate a target number of steps corresponding to each axis for each finite element segment based on the motor parameters and the endpoints corresponding to the finite element segment, and to process the finite element segment based on the current total number of steps, the target number of steps corresponding to each axis, and the current number of steps corresponding to each axis.
[0010] In a third aspect, the present application provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the DDA-based multi-axis linear interpolation control method as described in any one of the above items is implemented.
[0011] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the DDA-based multi-axis linear interpolation control method as described in any one of the above items is implemented.
[0012] This application provides a multi-axis linear interpolation control method, system, device, and storage medium based on DDA. The method includes: responding to a part processing control instruction, obtaining the processing contour of the part, and performing finite element segmentation processing on the processing contour to obtain multiple finite element line segments; for each finite element line segment, generating a target step number corresponding to each axis based on motor parameters and the endpoints corresponding to the finite element line segment, and processing the finite element line segment based on the current total step number, the target step number corresponding to each axis, and the current step number corresponding to each axis. This method, on the one hand, decomposes the complex machining contour into multiple tiny straight line segments through finite element segmentation technology, significantly reducing the path planning complexity of multi-axis linkage control and laying the foundation for high-precision machining. On the other hand, by adopting an interpolation algorithm based on digital differential analysis (DDA) to replace the traditional point-by-point comparison method, it reduces the computational complexity and makes multi-axis linkage control more efficient. On the other hand, through hardware-independent algorithm design, the code portability is enhanced, and it can be flexibly adapted to different application scenarios such as CNC machine tools, 3D printers and industrial robots. It improves machining efficiency while reducing system implementation costs, providing a cost-effective solution for complex contour machining. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 A flow chart of a multi-axis linear interpolation control method based on DDA provided in an embodiment of the present application; Figure 2 A schematic block diagram of the structure of a multi-axis linear interpolation control system based on DDA provided in an embodiment of the present application; Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0015] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0016] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0017] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0018] It should be further understood that the term "and / or" used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0019] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0020] See also Figure 1 , Figure 1 A flow chart of a multi-axis linear interpolation control method based on DDA provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the DDA-based multi-axis linear interpolation control method provided in an embodiment of the present application includes steps S1 to S2.
[0021] Step S1: respond to a part processing control instruction, obtain a processing contour of the part, and perform finite element segmentation processing on the processing contour to obtain a plurality of finite element line segments.
[0022] Step S2: For each of the finite element segments, generate the target step number corresponding to each axis based on the motor parameters and the endpoints corresponding to the finite element segment, and process the finite element segment based on the current total step number, the target step number corresponding to each axis, and the current step number corresponding to each axis.
[0023] It should be noted that the execution entity of this embodiment can be a server or a multi-axis linear interpolation control system based on DDA.
[0024] This embodiment specifically includes: As described in step S1 above, in response to a part machining control instruction, a machining contour of the part is obtained, and finite element segmentation processing is performed on the machining contour to obtain a plurality of finite element line segments. Specifically, when the part machining control instruction is received, image information of the part in a preset coordinate system is obtained using a preset camera device, and based on the image information and a design drawing corresponding to the part, a machining contour corresponding to the part in the preset coordinate system is obtained, and finite element segmentation processing is performed on the machining contour to obtain a plurality of finite element line segments.
[0025] As described in step S2 above, for each of the finite element segments, the target number of steps corresponding to each axis is generated based on the motor parameters and the endpoints corresponding to the finite element segment, and the finite element segment is processed based on the current total number of steps, the target number of steps corresponding to each axis, and the current number of steps corresponding to each axis. Among them, the motor parameters include step angle and screw lead (movement length corresponding to each revolution). Specifically, for each of the finite element units, first, the number of steps per unit length is calculated based on the step angle and the screw lead. Then, for each of the axes, the processing length corresponding to the axis is determined based on the endpoints corresponding to the finite element line segments, and the target number of steps corresponding to the axis is calculated based on the number of steps per unit length and the processing length. Secondly, the maximum target number of steps is selected from each of the target step numbers. Finally, for each of the axes, the step number threshold corresponding to the axis is determined based on the current total number of steps, the target number of steps corresponding to the axis, and the maximum target number of steps. The current number of steps corresponding to the axis is compared with the step number threshold, and when the step number threshold is greater than the current number of steps corresponding to the axis, the screw of the drive motor corresponding to the axis is controlled to move one step. When the step number threshold is not greater than the current number of steps corresponding to the axis, the axis is controlled to stop moving.
[0026] The method provided in this embodiment, on the one hand, decomposes the complex machining contour into multiple tiny straight line segments through finite element segmentation technology, significantly reducing the path planning complexity of multi-axis linkage control and laying the foundation for high-precision machining. On the other hand, by adopting an interpolation algorithm based on digital differential analysis (DDA) to replace the traditional point-by-point comparison method, the computational complexity is reduced, making the multi-axis linkage control more efficient. On the other hand, through the hardware-independent algorithm design, the code portability is enhanced, and it can be flexibly adapted to different application scenarios such as CNC machine tools, 3D printers and industrial robots. While improving machining efficiency, it also reduces the system implementation cost, providing a cost-effective solution for complex contour machining.
[0027] In some embodiments, the motor parameters include a step angle and a screw lead, and generating a target step number corresponding to each axis based on the motor parameters and the endpoints corresponding to the finite element line segments includes the following steps: The number of steps per unit length is calculated based on the step angle and the lead of the screw; wherein the lead of the screw refers to the linear distance that the nut moves axially when the screw rotates one circle; For each axis, a processing length corresponding to the axis is determined based on the endpoints corresponding to the finite element line segments, and a target number of steps corresponding to the axis is calculated based on the number of steps per unit length and the processing length.
[0028] The step of calculating the number of steps per unit length based on the step angle and the lead of the screw comprises the following steps: pass Calculate the number of steps per unit length; wherein, is the number of steps per unit length.
[0029] The step of determining the machining length corresponding to the axis based on the endpoints corresponding to the finite element line segments, and calculating the target number of steps corresponding to the axis based on the number of steps per unit length and the machining length, comprises the following steps: Calculate the difference between the two endpoints corresponding to the finite element line segment on the axis, and determine the absolute value of the difference as the processing length; for example, if the two endpoints corresponding to the finite element line segment are (2, 3) and (12, 20), then the processing length corresponding to the X axis is 10, and the processing length corresponding to the Y axis is 17; The product of the number of steps per unit length and the processing length is determined as the target number of steps.
[0030] In some embodiments, processing the finite element line segment based on the current total number of steps, the target number of steps corresponding to each axis, and the current number of steps corresponding to each axis includes the following steps: Selecting the maximum target step number from among the target step numbers; For each of the axes, the step number threshold corresponding to the axis is determined based on the current total number of steps, the target number of steps corresponding to the axis and the maximum target number of steps, and the current number of steps corresponding to the axis is compared with the step number threshold. When the step number threshold is greater than the current number of steps corresponding to the axis, the lead screw of the drive motor corresponding to the axis is controlled to move one step. When the step number threshold is not greater than the current number of steps corresponding to the axis, the axis is controlled to stop moving.
[0031] Among them, the current total step number refers to the sum of the current step numbers corresponding to each of the axes. In this embodiment, the screw of the drive motor corresponding to each of the axes is controlled to move one step in sequence based on the target step number corresponding to each of the axes. Specifically, within the same control cycle corresponding to each of the axes, the axes are sorted based on the target step number corresponding to each of the axes, and the screw of the drive motor corresponding to each of the axes is controlled to move one step based on the serial number corresponding to each of the axes; wherein the serial number corresponding to each of the axes is negatively correlated with its corresponding target step number.
[0032] The step number threshold corresponding to the axis is determined based on the current total number of steps, the target number of steps corresponding to the axis, and the maximum target number of steps, including the following steps: General The calculated value of is rounded off as the step number threshold; specifically, the step number is rounded off by The calculated value of is rounded to obtain the step number threshold corresponding to the axis.
[0033] The method provided in this embodiment can effectively reduce the cumulative error of path fitting and improve the accuracy of machining contours.
[0034] See also Figure 2 , Figure 2 The schematic block diagram of the structure of the multi-axis linear interpolation control system 100 based on DDA provided in the embodiment of the present application is as follows: Figure 2 As shown, the DDA-based multi-axis linear interpolation control system 100 provided in an embodiment of the present application includes: The acquisition module 110 is used to respond to a part processing control instruction, acquire a processing contour of the part, and perform finite element segmentation processing on the processing contour to obtain a plurality of finite element line segments.
[0035] The processing module 120 is used to generate the target step number corresponding to each axis for each finite element segment based on the motor parameters and the endpoints corresponding to the finite element segment, and to process the finite element segment based on the current total step number, the target step number corresponding to each axis, and the current step number corresponding to each axis.
[0036] It should be noted that, those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described system and each module can refer to the processes in the aforementioned DDA-based multi-axis linear interpolation control method embodiment, and will not be repeated here.
[0037] The multi-axis linear interpolation control system 100 based on DDA provided in the above embodiment can be implemented in the form of a computer program. The computer program can be used in Figure 3 The system is run on the terminal device 200 shown.
[0038] See also Figure 3 , Figure 3 This is a schematic block diagram of the structure of a terminal device 200 provided in an embodiment of the present application. The terminal device 200 includes a processor 201 and a memory 202. The processor 201 and the memory 202 are connected via a system bus 203, wherein the memory 202 may include a non-volatile storage medium and an internal memory.
[0039] The non-volatile storage medium can store a computer program. The computer program includes program instructions. When the program instructions are executed by the processor 201, the processor 201 can execute any of the above-mentioned multi-axis linear interpolation control methods based on DDA.
[0040] The processor 201 is used to provide computing and control capabilities to support the operation of the entire terminal device 200.
[0041] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 201, the processor 201 can execute any of the above-mentioned multi-axis linear interpolation control methods based on DDA.
[0042] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal device 200 involved in the solution of the present application. The specific terminal device 200 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0043] It should be understood that the processor 201 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0044] In some embodiments, the processor 201 is configured to execute a computer program stored in the memory to implement the following steps: In response to a part processing control instruction, a processing contour of the part is obtained, and a finite element segmentation process is performed on the processing contour to obtain a plurality of finite element line segments; For each of the finite element segments, the target step number corresponding to each axis is generated based on the motor parameters and the endpoints corresponding to the finite element segment, and the finite element segment is processed based on the current total step number, the target step number corresponding to each axis, and the current step number corresponding to each axis.
[0045] It should be noted that, those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the terminal device 200 described above can refer to the corresponding process of the aforementioned DDA-based multi-axis linear interpolation control method, and will not be repeated here.
[0046] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the one or more processors implement the DDA-based multi-axis linear interpolation control method provided in the embodiment of the present application.
[0047] The computer-readable storage medium may be an internal storage unit of the terminal device 200 in the aforementioned embodiment, such as a hard disk or memory of the terminal device 200. The computer-readable storage medium may also be an external storage device of the terminal device 200, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped with the terminal device 200.
[0048] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A multi-axis linear interpolation control method based on DDA, characterized in that: include: In response to a part processing control instruction, a processing contour of the part is obtained, and a finite element segmentation process is performed on the processing contour to obtain a plurality of finite element line segments; For each of the finite element segments, the target step number corresponding to each axis is generated based on the motor parameters and the endpoints corresponding to the finite element segment, and the finite element segment is processed based on the current total step number, the target step number corresponding to each axis, and the current step number corresponding to each axis.
2. The multi-axis linear interpolation control method based on DDA according to claim 1, characterized in that: The motor parameters include a step angle and a lead screw. The target step number corresponding to each axis is generated based on the motor parameters and the endpoints corresponding to the finite element line segments, including: Calculating the number of steps per unit length based on the step angle and the lead of the screw; For each axis, a processing length corresponding to the axis is determined based on the endpoints corresponding to the finite element line segments, and a target number of steps corresponding to the axis is calculated based on the number of steps per unit length and the processing length.
3. The multi-axis linear interpolation control method based on DDA according to claim 2, characterized in that: The calculating the number of steps per unit length based on the step angle and the lead of the screw comprises: pass Calculate the number of steps per unit length; wherein, is the number of steps per unit length.
4. The multi-axis linear interpolation control method based on DDA according to claim 1, characterized in that: The processing of the finite element line segment based on the current total number of steps, the target number of steps corresponding to each axis, and the current number of steps corresponding to each axis includes: Selecting the maximum target step number from among the target step numbers; For each of the axes, the step number threshold corresponding to the axis is determined based on the current total number of steps, the target number of steps corresponding to the axis and the maximum target number of steps, and the current number of steps corresponding to the axis is compared with the step number threshold. When the step number threshold is greater than the current number of steps corresponding to the axis, the lead screw of the drive motor corresponding to the axis is controlled to move one step. When the step number threshold is not greater than the current number of steps corresponding to the axis, the axis is controlled to stop moving.
5. The multi-axis linear interpolation control method based on DDA according to claim 4, characterized in that: The determining the step number threshold corresponding to the axis based on the current total step number, the target step number corresponding to the axis, and the maximum target step number includes: General The rounded value of the calculated value is used as the step number threshold.
6. A multi-axis linear interpolation control system based on DDA, characterized in that: include: an acquisition module, configured to respond to a part processing control instruction, acquire a processing contour of the part, and perform finite element segmentation processing on the processing contour to obtain a plurality of finite element line segments; A processing module is used to generate a target number of steps corresponding to each axis for each finite element segment based on the motor parameters and the endpoints corresponding to the finite element segment, and to process the finite element segment based on the current total number of steps, the target number of steps corresponding to each axis, and the current number of steps corresponding to each axis.
7. A terminal device, characterized in that: The terminal device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the DDA-based multi-axis linear interpolation control method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the DDA-based multi-axis linear interpolation control method according to any one of claims 1 to 5 is implemented.