Closed-loop stepping motor multi-machine synchronous motion control method and system for 3D printer
By using a closed-loop stepper motor multi-machine synchronous motion control method, the positional deviation of the 3D printer's motion axes is monitored and adjusted in real time, solving the synchronization problem during multi-axis linkage and improving the surface quality and precision of 3D printed parts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU QIANHUI INFORMATION TECH
- Filing Date
- 2026-04-20
- Publication Date
- 2026-07-07
AI Technical Summary
Existing motion control systems for 3D printers lack real-time closed-loop feedback and dynamic adjustment, which leads to the inability of various motion axes to synchronize during multi-axis linkage, resulting in spatial trajectory distortion and a decrease in the surface quality of 3D printed parts.
A closed-loop stepper motor multi-machine synchronous motion control method is adopted. By monitoring the position deviation of each motion axis in real time, the lagging axis is selected and the non-lagging axis is delayed based on the position deviation change trend. The motion timing is adjusted to ensure that each motion axis runs in coordination to the theoretical synchronization time, and the residual synchronization error is judged after reaching the target endpoint.
It achieves synchronization of each motion axis in the multi-axis linkage process of 3D printer, improves the surface quality and accuracy of 3D printed parts, and solves the problem of spatial trajectory distortion caused by lack of real-time closed-loop feedback.
Smart Images

Figure CN122348699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D printing technology, and in particular to a closed-loop stepper motor multi-machine synchronous motion control method and system for 3D printers. Background Technology
[0002] In the field of 3D printing technology, multi-axis linkage control is crucial for achieving the molding of complex three-dimensional structures. Existing motion control systems for 3D printers typically employ open-loop or semi-closed-loop stepper motor control methods based on pulse commands. In this method, the main control unit calculates the target pulse count for each motion axis based on the path data generated from the slices, and sends synchronization pulse signals to each axis driver via pulse signal lines to drive the motor rotation.
[0003] However, due to backlash, load fluctuations, and individual motor variations in the mechanical transmission chain, cumulative positional errors can easily accumulate in each motion axis during high-speed start-stop or variable acceleration. Existing control methods lack a dynamic timing adjustment mechanism based on the real-time actual positional deviations of each motion axis. When one motion axis lags, other motion axes continue to operate at the original pulse frequency, causing distortion of the spatial trajectory of multi-axis linkage. This prevents the motion axes of the 3D printer from achieving synchronization during multi-axis linkage, resulting in interlayer misalignment or dimensional deviations in the 3D printed parts, leading to a decrease in the surface quality of the 3D printed parts. Summary of the Invention
[0004] This invention provides a closed-loop stepper motor multi-machine synchronous motion control method and system for 3D printers, aiming to solve the technical problem of spatial trajectory distortion caused by the lack of real-time closed-loop feedback dynamic adjustment in the background art, realize the synchronization of each motion axis in the multi-axis linkage process of 3D printers, and improve the surface quality of 3D printed parts.
[0005] In a first aspect, the present invention provides a closed-loop stepper motor multi-machine synchronous motion control method for 3D printers. The 3D printer includes at least a motor controller and closed-loop stepper motors connected to the X-axis, Y-axis, Z-axis, and E-axis, wherein the motor controller is connected to each closed-loop stepper motor respectively; the method includes: Motion analysis is performed on the target endpoint position and preset motion parameters of each motion axis in the current segment path planning data of the model to be printed. The theoretical synchronization time for each motion axis to reach the target endpoint position at the same time is obtained. Position deviation analysis is performed on the current position of each closed-loop stepper motor and the theoretical expected position corresponding to the current sampling time to obtain the position deviation of each motion axis. The motion axis corresponding to the largest position deviation is taken as the lag axis. Based on the position deviation change trend of the lag axis, the control cycle of the non-lag axis is delayed and mapped to obtain the waiting delay amount. The first original motion timing of the non-lagging axis is updated based on the waiting delay amount to obtain the updated motion timing. Based on the updated motion timing and the second original motion timing of the lagging axis, each closed-loop stepper motor is driven to perform coordinated motion until the theoretical synchronization time is reached. Based on the final position and target endpoint position after the movement of each closed-loop stepper motor, the residual synchronization error is determined until the synchronization error condition is met, and then the next segment of path planning data is executed.
[0006] In a second aspect, the present invention also provides a closed-loop stepper motor multi-machine synchronous motion control system for 3D printers, used to implement the method described in the first aspect; the 3D printer includes at least a motor controller and closed-loop stepper motors connected to the X-axis, Y-axis, Z-axis and E-axis, wherein the motor controller is connected to each closed-loop stepper motor respectively; the system includes: The position deviation analysis module is used to perform motion analysis based on the target endpoint position and preset motion parameters of each motion axis in the current segment path planning data of the model to be printed, to obtain the theoretical synchronization time for each motion axis to reach the target endpoint position at the same time, and to perform position deviation analysis based on the current position of each closed-loop stepper motor and the theoretical expected position corresponding to the current sampling time, to obtain the position deviation of each motion axis. The delay mapping module is used to delay the control cycle of the non-lag axis based on the position deviation change trend of the lag axis, with the motion axis with the maximum position deviation as the lag axis, to obtain the waiting delay amount. The cooperative motion control module is used to update the first original motion timing of the non-lagging axis based on the waiting delay amount to obtain the updated motion timing, and drive each closed-loop stepper motor to perform cooperative motion based on the updated motion timing and the second original motion timing of the lagging axis until the theoretical synchronization time is reached. The model printing control module is used to determine the synchronization residual error based on the final position and target endpoint position after the movement of each closed-loop stepper motor. Once the synchronization error condition is met, the next segment of path planning data is executed.
[0007] Thirdly, the present invention also provides an electronic device, comprising: a memory for storing computer software programs; and a processor for reading and executing the computer software programs, thereby realizing the closed-loop stepper motor multi-machine synchronous motion control method for 3D printers as described above.
[0008] Fourthly, the present invention also provides a non-transitory computer-readable storage medium storing a computer software program, which, when executed by a processor, implements the closed-loop stepper motor multi-machine synchronous motion control method for 3D printers as described above.
[0009] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the closed-loop stepper motor multi-machine synchronous motion control method for 3D printers as described above.
[0010] The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers provided in this invention compares and analyzes the current actual position of each closed-loop stepper motor's corresponding motion axis with the theoretical expected position at the current sampling time. This accurately calculates the position deviation of each motion axis, achieving real-time closed-loop monitoring of the actual operating state of each motion axis and overcoming the limitation of existing technologies lacking real-time position deviation feedback. Based on the position deviation of each motion axis, the motion axis corresponding to the largest position deviation is selected as the lagging axis. Subsequently, by analyzing the position deviation change trend of the lagging axis, the control cycle of the non-lagging axes is delayed and mapped, calculating a reasonable waiting delay. This provides a precise basis for the timing adjustment of the non-lagging axes, ensuring that the adjustment behavior is targeted rather than blindly delayed. The original motion timing of the non-lagging axis is updated based on the waiting delay, resulting in an updated motion timing adapted to the operating state of the lagging axis. The non-lagging axis is driven according to the updated motion timing, and the lagging axis is driven according to the original motion timing. All closed-loop stepper motors are controlled to operate in coordination until the theoretical synchronization time is reached. This effectively solves the drawback of the prior art where other motion axes still operate at the original pulse frequency when one motion axis lags. It avoids timing misalignment of multi-axis linkage from the timing level and ensures that all motion axes advance in coordination towards the same time reference. Based on the final actual position of each closed-loop stepper motor after its movement and the target endpoint position, the residual error is determined. If the residual error does not meet the preset synchronization error condition, the movement timing is fine-tuned until it meets the standard, and then the next segment of path planning data is executed. This further corrects the small deviations caused by mechanical backlash, load fluctuations and other factors during the movement process, ensuring the multi-axis synchronization accuracy of each path segment. It solves the technical problem of spatial trajectory distortion caused by the lack of real-time closed-loop feedback dynamic adjustment, and realizes the synchronization of each motion axis in the multi-axis linkage process of the 3D printer, thereby improving the surface quality of the 3D printed parts. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating a closed-loop stepper motor multi-machine synchronous motion control method for 3D printers provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of a closed-loop stepper motor multi-machine synchronous motion control system for 3D printers provided in an embodiment of the present invention; Figure 3 An embodiment diagram of the electronic device provided in this invention; Figure 4An embodiment diagram of a computer-readable storage medium provided in accordance with the present invention. Detailed Implementation
[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0013] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0014] In the description of this invention, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.
[0015] Optionally, see Figure 1 , Figure 1 This is a flowchart illustrating a closed-loop stepper motor multi-machine synchronous motion control method for 3D printers provided by the present invention. In this embodiment, the 3D printer includes at least a motor controller and closed-loop stepper motors connected to the X, Y, Z, and E axes. The motor controller is connected to each closed-loop stepper motor via methods such as RS485, CAN, or MODBUS_RTU. In this embodiment, the motor controller is the executing entity of the closed-loop stepper motor multi-machine synchronous motion control method for 3D printers. Therefore, the closed-loop stepper motor multi-machine synchronous motion control method for 3D printers includes: Step 10: Based on the target endpoint position and preset motion parameters of each motion axis in the current segment path planning data of the model to be printed, perform motion analysis to obtain the theoretical synchronization time for each motion axis to reach the target endpoint position simultaneously. Based on the current position of each closed-loop stepper motor and the theoretical expected position corresponding to the current sampling time, perform position deviation analysis to obtain the position deviation of each motion axis.
[0016] Optionally, the motor controller acquires the target endpoint positions of each motion axis of the model to be printed in the current path planning data. Each motion axis specifically includes the X-axis, Y-axis, Z-axis, and E-axis (extrusion axis), and each motion axis is connected to a closed-loop stepper motor, i.e., an X-axis closed-loop stepper motor, a Y-axis closed-loop stepper motor, a Z-axis closed-loop stepper motor, and an E-axis closed-loop stepper motor. Preset motion parameters refer to the relevant parameters stored in the motor controller to control the movement of each closed-loop stepper motor. These parameters specifically include the rated speed, acceleration, and deceleration of each motion axis, and are preset based on the printing accuracy requirements of the model to be printed, the performance parameters of the closed-loop stepper motors, and the length of the current path segment. Furthermore, the preset motion parameters for each motion axis can be set individually according to actual printing needs to ensure printing accuracy during the motion process.
[0017] The motor controller performs motion analysis on each motion axis based on the target endpoint position and corresponding preset motion parameters. The purpose of this motion analysis in this embodiment is to calculate the theoretical time required for each motion axis to move from its current position to the target endpoint position, ensuring that all motion axes reach the target endpoint position simultaneously. This theoretical time is the theoretical synchronization time. Specifically, the motor controller calculates the time required for each motion axis to complete this displacement through kinematic analysis, based on the difference between the target endpoint position and the current position, combined with the preset rated motion speed, acceleration, and deceleration of that motion axis. After calculating the motion time of all motion axes one by one, the time that allows all motion axes to reach the target endpoint position simultaneously is selected as the theoretical synchronization time. This ensures that the motion processes of each motion axis are coordinated and synchronized, avoiding motion misalignment that could affect printing results.
[0018] The motor controller performs position deviation analysis on each closed-loop stepper motor. The specific process of position deviation analysis is as follows: the motor controller collects the current position of each closed-loop stepper motor in real time. The current position refers to the actual position of the corresponding motion axis of each closed-loop stepper motor at the time of collection. The position is collected by the position detection module (such as an encoder) built into the closed-loop stepper motor and fed back to the motor controller.
[0019] Simultaneously, the motor controller calculates the theoretical expected position of each motion axis at the current sampling moment based on the theoretical synchronization time. The theoretical expected position refers to the position that each motion axis should be at the current sampling moment under ideal conditions, moving according to preset motion parameters. The motor controller calculates the difference between the current position of the closed-loop stepper motor corresponding to each motion axis and the theoretical expected position at the current sampling moment. The calculated difference is the position deviation of that motion axis. The sign of the position deviation indicates whether the current position is ahead or behind the theoretical expected position, and the absolute value of the position deviation indicates the magnitude of the deviation.
[0020] In one embodiment, assuming that in the current segment path planning data of the model to be printed, the target endpoint position is 100 mm on the X-axis, 80 mm on the Y-axis, 5 mm on the Z-axis, and 20 mm on the E-axis. In the preset motion parameters, the rated motion speed on the X-axis is 50 mm / s, and the acceleration is 100 mm / s. 2 The deceleration is 100 mm / s. 2 The rated speed of movement on the Y-axis is 40 mm / s, and the acceleration is 80 mm / s. 2 The deceleration is 80 mm / s. 2 The rated speed of the Z-axis is 10 mm / s, and the acceleration is 20 mm / s. 2 The deceleration is 20 mm / s. 2 The rated speed of the E-axis is 15 mm / s, and the acceleration is 30 mm / s. 2 The deceleration is 30 mm / s. 2 .
[0021] Calculate the motion time for each axis: The X-axis is currently at 0 mm with a displacement of 100 mm. Following preset motion parameters, it first accelerates to the rated speed, then moves at a constant speed, and finally decelerates to a stop. The calculated time for the X-axis to complete the motion is 2.2 seconds. The Y-axis is currently at 0 mm with a displacement of 80 mm, and the calculated time is 2.2 seconds. The Z-axis is currently at 0 mm with a displacement of 5 mm, and the calculated time is 2.2 seconds. The E-axis is currently at 0 mm with a displacement of 20 mm, and the calculated time is 2.2 seconds. Therefore, the theoretical synchronization time is determined to be 2.2 seconds.
[0022] The motor controller is set to a sampling period of 0.1 seconds. At the first sampling moment (0.1 seconds), the theoretical expected position of each motion axis is calculated: the theoretical expected position of the X-axis is 0.5 mm (displacement during acceleration), the theoretical expected position of the Y-axis is 0.4 mm, the theoretical expected position of the Z-axis is 0.1 mm, and the theoretical expected position of the E-axis is 0.15 mm. The current positions of each closed-loop stepper motor acquired by the position detection module are 0.48 mm for the X-axis, 0.39 mm for the Y-axis, 0.11 mm for the Z-axis, and 0.14 mm for the E-axis. The motor controller calculates the position deviation of each motion axis: X-axis position deviation is 0.48-0.5 mm = -0.02 mm (negative sign indicates lag), Y-axis position deviation is 0.39-0.4 mm = -0.01 mm, Z-axis position deviation is 0.11-0.1 mm = 0.01 mm (positive sign indicates lead), and E-axis position deviation is 0.14-0.15 mm = -0.01 mm, thus completing the position deviation analysis.
[0023] Step 20: Using the motion axis corresponding to the largest position deviation as the lag axis, perform a delay mapping on the control cycle of the non-lag axis based on the position deviation change trend of the lag axis to obtain the waiting delay amount.
[0024] Optionally, the position deviation change trend refers to the change pattern of the position deviation of the lagging axis at multiple consecutive sampling times, such as the absolute value of the deviation gradually increasing, gradually decreasing, or remaining stable. Based on this position deviation change trend, the motor controller performs a delay mapping on the control cycle of the non-lagging axes. The non-lagging axes refer to all motion axes other than the lagging axes. The control cycle refers to the time interval between the motor controller sending control commands to the closed-loop stepper motor. The delay mapping refers to calculating the time that the non-lagging axes need to be delayed based on the deviation change of the lagging axes, and obtaining the waiting delay amount of each non-lagging axis, so that the motion progress of the non-lagging axes can match the motion progress of the lagging axes, as specifically in steps 201 to 209.
[0025] Step 30: Update the first original motion timing of the non-lagging axis based on the waiting delay amount to obtain the updated motion timing. Based on the updated motion timing and the second original motion timing of the lagging axis, drive each closed-loop stepper motor to perform coordinated motion until the theoretical synchronization time is reached.
[0026] Optionally, the first original motion timing refers to the motion command transmission timing determined by preset motion parameters and theoretical synchronization time for the non-lagging axis before delay adjustment. This timing specifies the motion state (acceleration, constant speed, deceleration) and displacement of the non-lagging axis in each control cycle. The motor controller applies the waiting delay amount obtained in step 20 to the first original motion timing to update it. The updated motion timing is the updated motion timing. The updated motion timing will send control commands after delaying the waiting delay amount, thereby adjusting the motion progress of the non-lagging axis.
[0027] The second original motion timing refers to the motion command transmission timing formulated by the lagging axis based on preset motion parameters and theoretical synchronization time. This timing is not subject to delay adjustment and serves as the reference timing for coordinated motion.
[0028] Based on the updated motion timing, the motor controller sends control commands to the closed-loop stepper motors corresponding to each non-lagging axis. Based on the second original motion timing, it sends control commands to the closed-loop stepper motors corresponding to the lagging axes, driving all closed-loop stepper motors to perform coordinated motion simultaneously. During the motion, the motor controller continuously monitors the position and motion status of each motion axis to ensure that each motion axis moves according to the adjusted timing until all motion axes reach the target endpoint position, i.e., the theoretical synchronization time is achieved.
[0029] Continuing with the embodiment based on step 10, the absolute values of the position deviations of each motion axis obtained in step 10 are 0.02 mm for the X-axis, 0.01 mm for the Y-axis, 0.01 mm for the Z-axis, and 0.01 mm for the E-axis. Therefore, the X-axis is selected as the lag axis. The motor controller detects that the position deviation of the X-axis is changing in a trend where the absolute value of the deviation is gradually increasing (i.e., the lag is gradually worsening). Based on this trend, the waiting delay of the non-lag axes (Y-axis, Z-axis, and E-axis) is calculated to be 0.02 seconds through delay mapping.
[0030] Assume the initial motion timing for the Y, Z, and E axes is as follows: a start-acceleration command is sent at 0 seconds, a constant-speed motion command at 0.5 seconds, and a deceleration / stop command at 2 seconds. The second initial motion timing for the lagging axis (X-axis) is as follows: a start-acceleration command is sent at 0 seconds, a constant-speed motion command at 0.5 seconds, and a deceleration / stop command at 2 seconds. Based on a wait delay of 0.02 seconds, the motor controller updates the initial initial motion timing for the non-lagging axes. The updated motion timing is as follows: a start-acceleration command is sent at 0.02 seconds, a constant-speed motion command at 0.52 seconds, and a deceleration / stop command at 2.02 seconds.
[0031] The motor controller sends control commands to the closed-loop stepper motors corresponding to the Y-axis, Z-axis, and E-axis according to the updated motion sequence, and sends control commands to the closed-loop stepper motor corresponding to the X-axis according to the second original motion sequence, driving the four closed-loop stepper motors to move in coordination, continuously monitoring the position of each motion axis until the theoretical synchronization time of 2.2 seconds is reached, at which point all four motion axes have moved to their respective target endpoint positions.
[0032] Step 40: Based on the final position and target endpoint position after the movement of each closed-loop stepper motor, determine the synchronization residual error until the synchronization error condition is met, and then execute the next segment of path planning data.
[0033] Optionally, after each closed-loop stepper motor completes its coordinated motion according to the instructions in step 30 and reaches the theoretical synchronization time, the motor controller collects the final position of each closed-loop stepper motor after the motion is completed. The final position refers to the actual position of the corresponding closed-loop stepper motor when it stops moving. The position is collected by the position detection module of each closed-loop stepper motor and fed back to the motor controller.
[0034] The motor controller compares the final position of each motion axis with the target end position of each motion axis, and calculates the difference between the final position and the target end position of each motion axis. This difference is the synchronization residual error of each motion axis.
[0035] The motor controller determines the synchronization residual error. The synchronization residual error determination refers to determining whether the synchronization residual error of each motion axis meets the preset synchronization error conditions, as detailed in steps 401 to 403.
[0036] If the determination result indicates that the synchronization error condition is met, it means that the coordinated movement of each motion axis has reached the preset synchronization accuracy. The motor controller then calls the next segment path planning data of the model to be printed and repeats steps 10 to 40 to continue executing the coordinated movement of the next segment path. If the determination result indicates that the synchronization error condition is not met, the motor controller continues to execute steps 20 to 40 for each motion axis until the synchronization residual error of all motion axes meets the synchronization error condition. Only then will it execute the next segment path planning data to ensure the synchronization accuracy and print quality of the entire printing process.
[0037] The embodiments of the present invention solve the technical problem of spatial trajectory distortion caused by the lack of real-time closed-loop feedback dynamic adjustment in multi-axis linkage, realize the synchronization of each motion axis in the multi-axis linkage process of 3D printer, thereby improving the surface quality of 3D printed parts.
[0038] Optionally, steps 201 to 203 include: Step 201: Optionally, in this embodiment of the invention, the X-axis and Y-axis are both horizontal motion axes of the 3D printer, used to drive the print head to move horizontally and achieve trajectory shaping within the printing plane. The Z-axis is the vertical motion axis of the 3D printer, used to drive the print head or printing platform to move vertically up and down, achieving layer stacking of the printed part. The E-axis is the extrusion axis of the 3D printer, used to drive the extrusion mechanism to extrude the printing filament and achieve material filling of the printed part.
[0039] If the judgment result is that the lagging axis is the X-axis or Y-axis, for the non-lagging axis Z-axis, the motor controller obtains the total vertical lifting stroke of the non-lagging Z-axis in the current segment path planning data. The total vertical lifting stroke refers to the total vertical distance of the non-lagging Z-axis from the starting position to the target end position in the current segment path planning. It has been generated and stored in the previous path planning stage, and the motor controller can directly call it.
[0040] Subsequently, the motor controller divides the total vertical lifting stroke into segments, clearly defining three key nodes: the quarter-height node, the half-height node, and the three-quarter-height node.
[0041] Among them, the quarter height node refers to the position point corresponding to one-quarter of the total vertical lifting stroke; the half height node refers to the position point corresponding to one-half of the total vertical lifting stroke; and the three-quarters height node refers to the position point corresponding to three-quarters of the total vertical lifting stroke.
[0042] After segmentation, the motor controller calculates the theoretical remaining time for the lagging axis to reach the three height nodes. The theoretical remaining time refers to the theoretical time required for the lagging axis to move from its current position to the corresponding height node according to the preset motion parameters, starting from the current sampling time. The calculation process is as follows: The motor controller first obtains the current position of the lagging axis, the position of the corresponding height node, and the preset motion parameters (rated motion speed, acceleration, deceleration) of the lagging axis. It then calculates the displacement of the lagging axis from its current position to the corresponding height node. Based on this displacement and the preset motion parameters, it calculates the time required to complete this displacement through kinematic analysis. This time is the theoretical remaining time for the lagging axis to reach the height node.
[0043] In one embodiment, assuming the lagging axis is the X-axis, the total vertical lifting stroke of the non-lagging Z-axis in the current segment path planning data is 40 mm. The motor controller divides this into quarter-height nodes (10 mm), half-height nodes (20 mm), and three-quarter-height nodes (30 mm). Given the known displacement progress corresponding to the current position of the X-axis, combined with the preset motion parameters of the X-axis (rated speed 40 mm / s, acceleration 80 mm / s),... 2 Deceleration 80 mm / s 2The specific calculation process is as follows: First, determine the motion stage of the X-axis from the current position to each height node. It is determined that the X-axis motion from the current position to all three height nodes is in a uniform speed stage (because the speed is stable and the displacement is small, there is no need to undergo a complete acceleration-uniform speed-deceleration process). The formula for calculating the motion time in the uniform speed stage is: Theoretical remaining time = Displacement / Rated motion speed. Specifically, the displacement of the X-axis to the 10 mm height node is 10 mm. Substituting this into the formula: 10 mm / 40 mm / s = 0.25 seconds. Since the X-axis has already completed a 0.5 mm displacement at the current sampling time, the actual required displacement is 9.5 mm. 9.5 mm / 40 mm / s = 0.2375 seconds, meaning the theoretical remaining time for the X-axis to reach the 10 mm height node is 0.2375 seconds. The displacement of the X-axis to the 20 mm height node is 20 mm, deducting the already completed 0 mm displacement. The actual displacement is 19.5 mm, which is 5 mm. 19.5 mm / 40 mm / second = 0.4875 seconds, meaning the theoretical remaining time for the X-axis to reach the 20 mm height node is 0.4875 seconds. The displacement of the X-axis to the 30 mm height node is 30 mm. Subtracting the 0.5 mm already completed, the actual displacement is 29.5 mm. 29.5 mm / 40 mm / second = 0.7375 seconds, meaning the theoretical remaining time for the X-axis to reach the 30 mm height node is 0.7375 seconds.
[0044] Step 202: The tolerance threshold is used to determine whether the position deviation of the hysteresis axis exceeds the reasonable range. It is set according to the accuracy requirements of 3D printing and the performance parameters of the closed-loop stepper motor. The values of the first tolerance threshold, the second tolerance threshold, and the third tolerance threshold decrease sequentially to ensure the gradient and rationality of the judgment.
[0045] The motor controller sequentially checks whether the position deviation of the lagging axis at each height node exceeds the corresponding tolerance threshold according to the movement progress of the lagging axis: First, it checks whether the lagging axis has reached the quarter-height node. If it has, and the position deviation of the lagging axis is greater than the first tolerance threshold, it means that the lag of the lagging axis has exceeded the initial reasonable range, and the non-lagging Z-axis needs to be delayed. The motor controller then directly determines the theoretical remaining time corresponding to the quarter-height node as the waiting delay of the non-lagging Z-axis. If the lag axis has already passed the quarter-height node, that is, completed the displacement corresponding to the quarter-height node, but has not reached the half-height node, then it is determined whether the position deviation of the lag axis when it reaches the half-height node is greater than the second tolerance threshold. If it is greater, it means that the lag of the lag axis has intensified. Then the theoretical remaining time corresponding to the half-height node is determined as the waiting delay of the non-lag Z-axis. If the lag axis has passed the half-height node but not reached the three-quarters height node, then it is determined whether the positional deviation of the lag axis when reaching the three-quarters height node is greater than the third tolerance threshold. If it is greater, it indicates that the lag of the lag axis is still not under control. In this case, the theoretical remaining time corresponding to the three-quarters height node is determined as the waiting delay of the non-lag Z-axis. If none of the above three conditions are met, that is, the positional deviation of the lag axis at each height node does not exceed the corresponding tolerance threshold, it indicates that the lag degree of the lag axis is within a reasonable range, and there is no need to adjust the delay of the non-lag Z-axis. The motor controller then determines that the waiting delay of the non-lag Z-axis is zero.
[0046] Continuing with the embodiment of step 201, the first tolerance threshold is 0.03 mm, the second tolerance threshold is 0.02 mm, and the third tolerance threshold is 0.01 mm. When the lag axis (X-axis) is detected to reach the quarter-height node (10 mm), the position deviation is 0.04 mm, which is greater than the first tolerance threshold of 0.03 mm. Therefore, the theoretical remaining time of 0.2375 seconds corresponding to the quarter-height node is determined as the waiting delay of the non-lag Z-axis. If the lag axis crosses the quarter-height node and reaches the half-height node (20 mm), the position deviation is 0.025 mm, which is greater than the second tolerance threshold of 0.02 mm. Then, the theoretical remaining time of 0.4875 seconds corresponding to the half-height node is determined as the waiting delay. If the lag axis crosses the half-height node and reaches the three-quarter-height node (30 mm), the position deviation is 0.015 mm, which is greater than the third tolerance threshold of 0.01 mm. Then, the theoretical remaining time of 0.7375 seconds corresponding to the three-quarter-height node is determined as the waiting delay. If none of the above deviations exceed the corresponding thresholds, the waiting delay is zero.
[0047] Step 203: For the E-axis (non-hysteresis axis), the motor controller obtains the total number of extrusion pulses for the non-hysteresis E-axis in the current path planning data. The total number of extrusion pulses refers to the total number of pulse commands required for the non-hysteresis E-axis to complete material extrusion in the current path planning segment. The motor controller divides this total number of extrusion pulses into segments: the end point of the first pulse interval, the end point of the middle pulse interval, and the end point of the last pulse interval. Specifically, the end point of the first pulse interval corresponds to one-third of the total extrusion pulses; the end point of the middle pulse interval corresponds to two-thirds of the total extrusion pulses; and the end point of the last pulse interval corresponds to nine-tenths of the total extrusion pulses.
[0048] The motor controller calculates the theoretical remaining time for the lagging shaft to reach the end of these three pulse intervals. The calculation method is the same as that used in step 201 for calculating the theoretical remaining time, and will not be repeated here.
[0049] Example: Assuming the total number of extrusion pulses for the non-hysteresis E-axis in the current path planning data is 3000, the motor controller divides it into three segments: the end of the first pulse interval (1000 pulses), the end of the middle pulse interval (2000 pulses), and the end of the last pulse interval (2700 pulses). Combining the current position of the hysteresis axis (X-axis), the corresponding positions of the end points of each pulse interval, and preset motion parameters (rated speed 40 mm / s, acceleration 80 mm / s), the controller... 2 Deceleration 80 mm / s 2 The specific calculation process is as follows: First, determine the motion stage of the X-axis from the current position to the end of each pulse interval. It is determined that all are in the uniform speed stage. The formula for calculating the motion time in the uniform speed stage is: theoretical remaining time = displacement / rated motion speed. Given that the X-axis has currently completed a displacement of 0.5 mm, the displacement corresponding to the end point of the first pulse interval is 10 mm, and the actual displacement required is 9.5 mm. 9.5 mm / 40 mm / s = 0.2375 seconds, meaning the theoretical remaining time for the X-axis to reach the end point of the interval corresponding to 1000 pulses is 0.2375 seconds. The displacement corresponding to the end point of the middle pulse interval is 20 mm, and the actual displacement required is 19.5 mm. 19.5 mm / 40 mm / s = 0.4875 seconds, meaning the theoretical remaining time for the X-axis to reach the end point of the interval corresponding to 2000 pulses is 0.4875 seconds. The displacement corresponding to the end point of the last pulse interval is 27 mm, and the actual displacement required is 26.5 mm. 26.5 mm / 40 mm / s = 0.6625 seconds, meaning the theoretical remaining time for the X-axis to reach the end point of the interval corresponding to 2700 pulses is 0.6625 seconds.
[0050] The position deviation change rate refers to the change in the position deviation of the hysteresis axis per unit time. It is used to reflect the rate of change of the hysteresis axis's lag. It is calculated based on the position deviation at multiple consecutive sampling times. The calculation method is to divide the difference in position deviation between two adjacent sampling times by the sampling period.
[0051] The rate threshold is a value pre-stored in the motor controller to determine whether the rate of change of the hysteresis axis position deviation exceeds a reasonable range. It is set according to the accuracy requirements of 3D printing and the response speed of the closed-loop stepper motor. The first rate threshold is greater than the second rate threshold to ensure the rationality and gradient of the judgment.
[0052] The motor controller sequentially judges whether the relevant parameters of the lagging axis at the end of each pulse interval meet the set conditions according to the movement progress of the lagging axis: First, it judges whether the lagging axis has reached the end of the previous pulse interval. If it has reached the end, and the position deviation change rate of the lagging axis is positive (indicating that the degree of lag is continuously increasing), and the value exceeds the first rate threshold, the motor controller determines the theoretical remaining time corresponding to the end of the previous pulse interval as the waiting delay of the non-lagging E-axis.
[0053] If the lag axis has passed the end of the first pulse interval but has not reached the end of the middle pulse interval, it is determined that the position deviation change rate of the lag axis when it reaches the end of the middle pulse interval is positive and the value exceeds the second rate threshold. This indicates that the lag of the lag axis is still increasing, but the rate of increase has slowed down. The theoretical remaining time corresponding to the end of the middle pulse interval is then determined as the waiting delay of the non-lag E-axis.
[0054] If the lagging axis has passed the end of the middle pulse interval but has not reached the end of the later pulse interval, it is determined that the position deviation of the lagging axis when it reaches the end of the later pulse interval has not converged to zero (i.e., the absolute value of the position deviation is still greater than zero and does not show a trend of gradually approaching zero). This indicates that the lagging state of the lagging axis has not been improved. The motor controller then determines the theoretical remaining time corresponding to the end of the later pulse interval as the waiting delay of the non-lagging E-axis.
[0055] If none of the above three conditions are met, that is, the relevant parameters of the lag axis at the end of each pulse interval do not meet the set conditions, it means that the lag degree of the lag axis has been controlled or is within a reasonable range, and there is no need to adjust the delay of the non-lag E-axis. The motor controller then determines that the waiting delay of the non-lag E-axis is zero.
[0056] Continuing with the embodiment of step 203, the first rate threshold is 0.02 mm / s and the second rate threshold is 0.01 mm / s. When the hysteresis axis (X-axis) reaches the end of the preceding pulse interval (1000 pulses), the position deviation change rate is 0.025 mm / s, which is positive and exceeds the first rate threshold of 0.02 mm / s. Therefore, the theoretical remaining time of 0.2375 seconds corresponding to the end of the preceding pulse interval is determined as the waiting delay of the non-hysteresis E-axis. If the lag axis crosses the end of the first pulse interval and reaches the end of the middle pulse interval (2000 pulses), and the position deviation change rate is 0.015 mm / s, which is positive and exceeds the second rate threshold of 0.01 mm / s, then the theoretical remaining time of 0.4875 seconds corresponding to the end of the middle pulse interval is determined as the waiting delay. If the lag axis crosses the end of the middle pulse interval and reaches the end of the second pulse interval (2700 pulses), and the position deviation is 0.008 mm, which has not converged to zero, then the theoretical remaining time of 0.6625 seconds corresponding to the end of the second pulse interval is determined as the waiting delay. If none of the above conditions are met, then the waiting delay is zero.
[0057] This invention specifically determines the waiting delay amount for each non-hysteresis axis, avoiding multi-axis timing misalignment caused by blind delay and insufficient coordination between hysteresis and non-hysteresis axes due to untimely delay. This optimizes the synchronization accuracy of multi-axis coordinated motion, ensuring the coordination consistency of Z-axis vertical lifting, E-axis filament extrusion, and X-axis or Y-axis horizontal movement. It reduces problems such as uneven printing layer thickness and abnormal filament extrusion caused by timing misalignment, thereby improving the surface quality of 3D printed parts.
[0058] Optionally, steps 204 to 206 include: Step 204: If the lagging axis is the Z-axis, for the X-axis or Y-axis, the motor controller obtains the planar composite displacement trajectory of the non-lagging X-axis and non-lagging Y-axis in the current segment path planning data. The planar composite displacement trajectory refers to the complete motion trajectory in the printing plane formed by the superposition of the horizontal displacement of the non-lagging X-axis and the horizontal displacement of the non-lagging Y-axis. This trajectory is pre-generated and stored by the path planning algorithm.
[0059] The motor controller performs corner recognition on the composite displacement trajectory of the plane. Corner recognition refers to identifying the feature points at the connection between the straight line segment and the arc segment in the trajectory by the change law of the trajectory coordinates. These feature points are the corner feature points, which are the dividing points where the straight line segment ends and the arc segment begins.
[0060] The motor controller uses the path segment between two adjacent corner feature points as the inertial sensitive zone. The inertial sensitive zone refers to the area within this path segment where the motion direction or speed of the X and Y axes is prone to change. It calculates the theoretical remaining time for the lagging axis (Z-axis) to traverse the midpoint and end point of this inertial sensitive zone. The theoretical remaining time refers to the theoretical time required for the lagging axis (Z-axis) to move from its current position to the Z-axis position corresponding to the midpoint and end point of the inertial sensitive zone, based on preset motion parameters, starting from the current sampling time. The calculation process is as follows: The motor controller first obtains the current position of the lagging axis (Z-axis), the Z-axis positions corresponding to the midpoint and end point of the inertial sensitive zone, and the preset motion parameters (rated motion speed, acceleration, deceleration) of the lagging axis (Z-axis). It then calculates the displacement of the lagging axis (Z-axis) from its current position to the midpoint and end point. Based on this displacement and the preset motion parameters, it calculates the time required to complete each displacement segment through kinematic analysis. This time is the theoretical remaining time for the lagging axis (Z-axis) to reach the midpoint and end point of the inertial sensitive zone.
[0061] In one embodiment, assuming the lag axis is the Z-axis, the planar composite displacement trajectory of the non-lag X-axis and Y-axis in the current segment path planning data is "straight line segment 1 - circular arc segment - straight line segment 2". Through corner identification, corner feature point A at the connection between straight line segment 1 and the circular arc segment, and corner feature point B at the connection between the circular arc segment and straight line segment 2 are obtained. The circular arc segment between adjacent corner feature points A and B is the inertial sensitive zone. It is known that the vertical displacement range of the Z-axis corresponding to this inertial sensitive zone is 8 to 16 mm. Therefore, the Z-axis position corresponding to the midpoint of the inertial sensitive zone is 12 mm, and the endpoint (the Z-axis position corresponding to corner feature point B) is 16 mm. The preset motion parameters of the lag axis (Z-axis) are a rated speed of 10 mm / s and an acceleration of 20 mm / s. 2 Deceleration 20 mm / s 2 The Z-axis has currently completed a displacement of 7 mm, and the current position is 7 mm. It has been determined that the Z-axis movement from the current position to the midpoint (12 mm) and the endpoint (16 mm) is in a uniform velocity phase. The formula for calculating the time of motion in the uniform velocity phase is: Theoretical remaining time = Displacement / Rated speed. Specifically, the displacement of the Z-axis to the midpoint is 12 - 7 = 5 mm, and the theoretical remaining time is 5 mm / 10 mm / second = 0.5 seconds; the displacement of the Z-axis to the endpoint is 16 - 7 = 9 mm, and the theoretical remaining time is 9 mm / 10 mm / second = 0.9 seconds.
[0062] Step 205: The fourth tolerance threshold is a value pre-stored in the motor controller to determine whether the deviation of the hysteresis axis (Z-axis) position at the midpoint of the inertial sensitive zone exceeds a reasonable range. The third rate threshold is a value pre-stored in the motor controller to determine whether the rate of change of the hysteresis axis (Z-axis) position deviation at the midpoint of the inertial sensitive zone exceeds a reasonable range. Both thresholds are set based on the accuracy requirements of 3D printing, the performance parameters of the closed-loop stepper motor, and the motion characteristics of the inertial sensitive zone.
[0063] The motor controller sequentially checks whether the relevant parameters of the lagging axis (Z-axis) at the midpoint and end point of the inertial sensitive zone meet the set conditions according to the movement progress of the lagging axis (Z-axis): First, it checks whether the lagging axis (Z-axis) has reached the midpoint of the inertial sensitive zone. If it has, and the position deviation of the lagging axis (Z-axis) is greater than the fourth tolerance threshold, and the rate of change of position deviation exceeds the third rate threshold, it indicates that the lag of the lagging axis (Z-axis) exceeds the reasonable range and is still rapidly increasing. It is necessary to adjust the delay of the non-lagging X-axis and non-lagging Y-axis. The motor controller then determines the theoretical remaining time corresponding to the midpoint as the waiting delay of the non-lagging X-axis and non-lagging Y-axis, and the non-lagging X-axis and non-lagging Y-axis use the same waiting delay to ensure that the horizontal movement of the two is coordinated and consistent.
[0064] If the lagging axis (Z-axis) has crossed the midpoint of the inertial sensitive zone but has not reached the end point of the inertial sensitive zone, it is determined that the position deviation of the lagging axis (Z-axis) when reaching the end point of the inertial sensitive zone has not converged to zero, and the direction of the position deviation is opposite to the direction of movement of the lagging axis (Z-axis). This indicates that the lagging state of the lagging axis (Z-axis) has not been improved and a reverse deviation has occurred. Delay adjustments are made to the non-lagging X-axis and non-lagging Y-axis. The motor controller then determines the theoretical remaining time corresponding to the end point as the waiting delay amount for the non-lagging X-axis and non-lagging Y-axis.
[0065] If neither of the above two conditions is met, that is, the relevant parameters of the lagging axis (Z-axis) at the midpoint and end point of the inertia-sensitive zone do not meet the set conditions, it indicates that the degree of lag of the lagging axis (Z-axis) is within a reasonable range or has been controlled. There is no need to adjust the delay of the non-lagging X-axis and non-lagging Y-axis. The motor controller then determines that the waiting delay of the non-lagging X-axis and non-lagging Y-axis is zero.
[0066] Continuing with the embodiment based on step 205, the fourth tolerance threshold is preset to 0.04 mm and the third rate threshold to 0.03 mm / s. When the motor controller detects that the lagging axis (Z-axis) reaches the midpoint (12 mm) of the inertial sensitive zone, the position deviation is 0.05 mm, which is greater than the fourth tolerance threshold of 0.04 mm, and the rate of change of position deviation is 0.035 mm / s, which exceeds the third rate threshold of 0.03 mm / s. Therefore, the motor controller determines the theoretical remaining time of 0.5 seconds corresponding to the midpoint as the waiting delay for both the non-lagging X-axis and the non-lagging Y-axis. If the lagging axis (Z-axis) crosses the midpoint and reaches the end point (16 mm) of the inertial sensitive zone, the position deviation is 0.02 mm (not converged to zero), and the direction of the position deviation is opposite to the upward movement direction of the Z-axis, then the theoretical remaining time of 0.9 seconds corresponding to the end point is determined as the waiting delay for both the non-lagging X-axis and the non-lagging Y-axis. If none of the above conditions are met, then the waiting delay is zero.
[0067] Step 206: The motor controller calculates the extrusion pulse ratio corresponding to each unit height increase of the Z-axis. The unit height is set to 1 mm. The calculation method is: the total number of extrusion pulses of the non-hysteretic E-axis divided by the total vertical lifting stroke of the hysteretic axis (Z-axis). This ratio reflects the number of pulses corresponding to the material that the E-axis needs to extrude for each 1 mm increase of the Z-axis, ensuring that the extrusion amount of the E-axis matches the lifting height of the Z-axis, thus ensuring uniform printing layer thickness.
[0068] Subsequently, the motor controller segments the total number of extrusion pulses of the non-hysteretic E-axis according to the extrusion pulse ratio, obtaining the first-level node, the second-level node, and the third-level node. Specifically, the first-level node refers to the E-axis extrusion pulse count corresponding to 1 / 4 of the total vertical stroke of the Z-axis; the second-level node refers to the E-axis extrusion pulse count corresponding to 1 / 2 of the total vertical stroke of the Z-axis; and the third-level node refers to the E-axis extrusion pulse count corresponding to 3 / 4 of the total vertical stroke of the Z-axis.
[0069] The motor controller calculates the theoretical remaining time for the lagging axis (Z-axis) to reach the three level nodes respectively. The calculation method is the same as the calculation method of the theoretical remaining time in step 205, and will not be repeated here.
[0070] In one embodiment, assuming the total number of extrusion pulses for the non-hysteretic E-axis in the current path planning data is 4000, and the total vertical lifting stroke of the hysteretic axis (Z-axis) is 20 mm, the extrusion pulse ratio corresponding to each 1 mm rise of the Z-axis is 4000 / 20 mm = 200 pulses / mm. The motor controller segments the total number of extrusion pulses for the E-axis: the first level node is the number of pulses corresponding to a 5 mm rise (20 mm * 1 / 4) of the Z-axis, i.e., 5 mm * 200 pulses / mm = 1000 pulses; the second level node is the number of pulses corresponding to a 10 mm rise (20 mm * 1 / 2) of the Z-axis, i.e., 10 mm * 200 pulses / mm = 2000 pulses; and the third level node is the number of pulses corresponding to a 15 mm rise (20 mm * 3 / 4) of the Z-axis, i.e., 15 mm * 200 pulses / mm = 3000 pulses. The preset motion parameters for the hysteretic axis (Z-axis) are a rated speed of 10 mm / s and an acceleration of 20 mm / s. 2 Deceleration 20 mm / s 2 The Z-axis has completed a displacement of 3 mm, and the current position is 3 mm. It has been determined that the Z-axis movement from the current position to all three level nodes is in a uniform velocity phase, with the theoretical remaining time equal to the displacement divided by the rated speed. Specifically, the displacement from the Z-axis to the first level node (5 mm) is 5 - 3 mm = 2 mm, with a theoretical remaining time of 2 mm / 10 mm / second = 0.2 seconds; the displacement to the second level node (10 mm) is 10 - 3 mm = 7 mm, with a theoretical remaining time of 7 mm / 10 mm / second = 0.7 seconds; and the displacement to the third level node (15 mm) is 15 - 3 mm = 12 mm, with a theoretical remaining time of 12 mm / 10 mm / second = 1.2 seconds.
[0071] The cumulative position lag refers to the sum of the position deviations of the lag axis (Z-axis) from the start of the current segment path movement to the current sampling time. It is used to reflect the cumulative degree of lag of the lag axis (Z-axis) and is generated by the motor controller based on the cumulative position deviations of multiple consecutive sampling times.
[0072] The first cumulative threshold is a value pre-stored in the motor controller to determine whether the cumulative lag of the lagging axis (Z-axis) position exceeds a reasonable range. It is set according to the accuracy requirements of 3D printing, the performance parameters of the closed-loop stepper motor, and the coordination requirements of E-axis extrusion and Z-axis lifting.
[0073] The motor controller sequentially checks whether the relevant parameters of the lagging axis (Z-axis) at each level node meet the set conditions according to the movement progress of the lagging axis (Z-axis): First, determine whether the lagging axis (Z-axis) has reached the first-level node. If it has, and the lagging axis (Z-axis) shows position lag accumulation (i.e., the position lag accumulation is greater than zero) and the accumulation exceeds the first accumulation threshold, it indicates that the lag accumulation of the lagging axis (Z-axis) has affected the coordination between E-axis extrusion and Z-axis lifting. The non-lagging E-axis needs to be delayed. The motor controller then determines the theoretical remaining time corresponding to the first-level node as the waiting delay amount for the non-lagging E-axis.
[0074] If the lagging axis (Z-axis) has passed the first-level node but has not reached the second-level node, it is determined that the position lag accumulation of the lagging axis (Z-axis) when reaching the second-level node continues to increase (i.e., the current accumulation is greater than the accumulation when reaching the first-level node). This indicates that the lag accumulation of the lagging axis (Z-axis) is intensifying. The non-lagging E-axis is then delayed, and the motor controller determines the theoretical remaining time corresponding to the second-level node as the waiting delay of the non-lagging E-axis.
[0075] If the lagging axis (Z-axis) has passed the second-level node but has not reached the third-level node, it is determined that the position deviation of the lagging axis (Z-axis) when reaching the third-level node has not converged to zero (i.e., the absolute value of the position deviation is still greater than zero and does not show a trend of gradually approaching zero). This indicates that the lagging state of the lagging axis (Z-axis) has not been improved. The non-lagging E-axis is then delayed and adjusted. The motor controller then determines the theoretical remaining time corresponding to the third-level node as the waiting delay of the non-lagging E-axis.
[0076] If none of the above three conditions are met, that is, the relevant parameters of the lag axis (Z-axis) at each level node do not meet the set conditions, it means that the lag accumulation of the lag axis (Z-axis) is within a reasonable range or has been controlled, and there is no need to adjust the delay of the non-lag E-axis. In this case, the waiting delay of the non-lag E-axis is determined to be zero.
[0077] Continuing with the embodiment of step 207, the first accumulation threshold is 0.1 mm. When the lag axis (Z-axis) is detected to reach the first-level node (1000 pulses), position lag accumulation occurs, and the accumulation amount is 0.12 mm, which exceeds the first accumulation threshold of 0.1 mm. The theoretical remaining time of 0.2 seconds corresponding to the first-level node is determined as the waiting delay amount of the non-lag E-axis. If the lag axis (Z-axis) crosses the first-level node and reaches the second-level node (2000 pulses), the cumulative position lag is 0.18 mm, continuously increasing from 0.12 mm at the first-level node. The theoretical remaining time of 0.7 seconds corresponding to the second-level node is determined as the waiting delay. If the lag axis (Z-axis) crosses the second-level node and reaches the third-level node (3000 pulses), the position deviation is 0.03 mm, failing to converge to zero. The theoretical remaining time of 1.2 seconds corresponding to the third-level node is determined as the waiting delay. If none of the above conditions are met, the waiting delay is zero.
[0078] This invention specifically determines the waiting delay for each non-lagging axis, avoiding multi-axis timing misalignment caused by blind delay and insufficient coordination between lagging and non-lagging axes due to untimely delay. It ensures the coordination consistency of horizontal movement of the X and Y axes and vertical lifting of the Z axis, as well as the matching of extrusion amount of the E axis and lifting height of the Z axis. This optimizes the synchronization accuracy of multi-axis coordinated movement of the 3D printer, reduces problems such as printing trajectory distortion, uneven layer thickness, and abnormal filament extrusion caused by timing misalignment, and thus improves the surface quality of 3D printed parts.
[0079] Optionally, steps 207 to 209 include: Step 207: If the lagging axis is the E-axis, for the X-axis or Y-axis, the motor controller obtains the combined planar displacement of the non-lagging X-axis and non-lagging Y-axis in the current segment path planning data. The combined planar displacement refers to the total displacement in the printing plane formed by superimposing the horizontal displacement of the non-lagging X-axis and the horizontal displacement of the non-lagging Y-axis. This displacement is pre-generated and stored by the path planning algorithm, and the motor controller can directly call it.
[0080] The motor controller segments the planar composite displacement according to the preset motion parameters (rated speed, acceleration, and deceleration) of the non-hysteresis X-axis and Y-axis, and divides it into three key stage position points: the end point of the acceleration stage, the midpoint of the uniform speed stage, and the start point of the deceleration stage. The acceleration phase endpoint refers to the point where the non-lag X-axis and Y-axis accelerate from their initial positions to their rated speed according to a preset acceleration. The calculation method is as follows: calculate the displacement required to accelerate to the rated speed using the acceleration formula; the position corresponding to this displacement is the acceleration phase endpoint. The uniform motion phase midpoint refers to the middle point of the non-lag X-axis and Y-axis during the uniform motion phase. The calculation method is as follows: subtract the acceleration and deceleration phase displacements from the total planar composite displacement to obtain the uniform motion phase displacement. Add half of the uniform motion phase displacement to the acceleration phase displacement; the corresponding position is the uniform motion phase midpoint. The deceleration phase start point refers to the starting point where the non-lag X-axis and Y-axis decelerate from their initial positions to their final stop according to a preset deceleration. The calculation method is as follows: subtract the deceleration phase displacement from the total planar composite displacement; the corresponding position is the deceleration phase start point.
[0081] The motor controller calculates the theoretical remaining time for the lagging axis (E-axis) to reach the three stage position points. The theoretical remaining time refers to the theoretical time required for the lagging axis (E-axis) to move from the current position to the corresponding E-axis extrusion position of the three stage position points, based on the current sampling time and according to the preset motion parameters. The calculation process is as follows: obtain the current position of the lagging axis (E-axis), the E-axis extrusion position corresponding to the three stage position points (obtained by converting the relationship between the planar composite displacement and the E-axis extrusion amount), and the preset motion parameters of the lagging axis (E-axis) (rated extrusion speed, acceleration, deceleration). Calculate the displacement of the lagging axis (E-axis) from the current position to each stage position point (i.e., the actual extrusion displacement corresponding to the number of extrusion pulses). Then, based on this displacement and the preset motion parameters, calculate the time required to complete each segment of displacement through kinematic analysis. This time is the theoretical remaining time for the lagging axis (E-axis) to reach the stage position point.
[0082] In one embodiment, assuming the lag axis is the E-axis, the total planar composite displacement of the non-lag X-axis and Y-axis in the current segment path planning data is 40 mm, and the preset motion parameters of the non-lag X-axis and Y-axis are a rated speed of 50 mm / s and an acceleration of 100 mm / s. 2 Deceleration 100 mm / s 2Calculate the position points for each stage: The displacement during the acceleration stage is (rated speed * rated speed) / (2 * acceleration) = (50 * 50) / (2 * 100) = 12.5 mm, meaning the final plane displacement at the end of the acceleration stage is 12.5 mm; the displacement during the deceleration stage is equal to that during the acceleration stage, which is 12.5 mm; the displacement during the constant speed stage is 40 - 12.5 - 12.5 mm = 15 mm, meaning the final plane displacement at the midpoint of the constant speed stage is 12.5 mm + (15 mm / 2) = 20 mm; the final plane displacement at the start of the deceleration stage is 40 - 12.5 mm = 27.5 mm. The preset motion parameters for the hysteresis axis (E-axis) are a rated extrusion speed of 15 mm / s and an acceleration of 30 mm / s. 2 Deceleration 30 mm / s 2 The E-axis has completed a 5 mm extrusion displacement, and its current position is 5 mm. It has been determined that the movement of the E-axis from its current position to all three stage positions is in a constant velocity phase. The formula for calculating the motion time in the constant velocity phase is: Theoretical remaining time = Displacement / Rated speed. Specifically, the displacement of the E-axis to the end of the acceleration phase (corresponding to an extrusion displacement of 8 mm) is 8 - 5 mm = 3 mm, and the theoretical remaining time is 3 mm / 15 mm / second = 0.2 seconds; the displacement to the midpoint of the constant velocity phase (corresponding to an extrusion displacement of 10 mm) is 10 - 5 mm = 5 mm, and the theoretical remaining time is 5 mm / 15 mm / second ≈ 0.333 seconds; the displacement to the start of the deceleration phase (corresponding to an extrusion displacement of 12 mm) is 12 - 5 mm = 7 mm, and the theoretical remaining time is 7 mm / 15 mm / second ≈ 0.467 seconds.
[0083] Step 208: The fifth tolerance threshold is a value pre-stored in the motor controller to determine whether the deviation of the starting position of the lagging axis (E-axis) during the deceleration phase exceeds a reasonable range. It is set according to the accuracy requirements of 3D printing, the performance parameters of the closed-loop stepper motor, and the coordinated motion requirements of the X-axis, Y-axis, and E-axis.
[0084] The motor controller sequentially checks whether the relevant parameters of the lagging axis (E-axis) at each stage position point meet the set conditions according to the movement progress of the lagging axis (E-axis): First, it checks whether the lagging axis (E-axis) has reached the end of the acceleration stage. If it has, and the position deviation of the lagging axis (E-axis) has not converged to zero (i.e., the absolute value of the position deviation is still greater than zero and does not show a trend of gradually approaching zero), and the position deviation change rate is negative (indicating that the lag of the lagging axis is slowing down, but there is still a deviation), it indicates that the deviation state of the lagging axis (E-axis) has affected the coordination of the X-axis, Y-axis and E-axis. It is necessary to adjust the delay for the non-lagging X-axis and non-lagging Y-axis. The motor controller then determines the theoretical remaining time corresponding to the end of the acceleration stage as the waiting delay for the non-lagging X-axis and non-lagging Y-axis, and the non-lagging X-axis and non-lagging Y-axis use the same waiting delay to ensure that the horizontal movement of the two is coordinated.
[0085] If the lagging axis (E-axis) has passed the end of the acceleration phase but has not reached the midpoint of the constant velocity phase, it is determined that the position deviation of the lagging axis (E-axis) when reaching the midpoint of the constant velocity phase has increased (i.e., the absolute value of the current position deviation is greater than the absolute value of the deviation when reaching the end of the acceleration phase). This indicates that the degree of deviation of the lagging axis (E-axis) is intensifying. A delay adjustment is made to the non-lagging X-axis and non-lagging Y-axis, and the theoretical remaining time corresponding to the midpoint of the constant velocity phase is determined as the waiting delay of the non-lagging X-axis and non-lagging Y-axis.
[0086] If the lagging axis (E-axis) has passed the midpoint of the uniform speed stage but has not reached the starting point of the deceleration stage, it is determined that the position deviation of the lagging axis (E-axis) at the starting point of the deceleration stage exceeds the fifth tolerance threshold. This indicates that the deviation of the lagging axis (E-axis) has exceeded the reasonable range. The non-lagging X-axis and non-lagging Y-axis are then adjusted by delay. The motor controller then determines the theoretical remaining time corresponding to the starting point of the deceleration stage as the waiting delay amount for the non-lagging X-axis and non-lagging Y-axis.
[0087] If none of the above three conditions are met, that is, the relevant parameters of the lagging axis (E-axis) at each stage position point do not meet the set conditions, it means that the deviation of the lagging axis (E-axis) is within a reasonable range or has been controlled. There is no need to adjust the delay of the non-lagging X-axis and non-lagging Y-axis. The motor controller then determines that the waiting delay of the non-lagging X-axis and non-lagging Y-axis is zero.
[0088] Continuing with the embodiment based on step 209, the fifth tolerance threshold is 0.05 mm. When the motor controller detects that the lagging axis (E-axis) has reached the end of the acceleration phase, the position deviation is 0.03 mm (not converged to zero), and the position deviation change rate is -0.01 mm / s (negative). Therefore, the motor controller determines the theoretical remaining time of 0.2 seconds corresponding to the end of the acceleration phase as the waiting delay for both the non-lagging X-axis and the non-lagging Y-axis.
[0089] If the lag axis (E-axis) crosses the end of the acceleration phase and reaches the midpoint of the constant velocity phase, and the position deviation is 0.04 mm (increased from 0.03 mm at the end of the acceleration phase), then the theoretical remaining time of 0.333 seconds corresponding to the midpoint of the constant velocity phase is determined as the waiting delay. If the lag axis (E-axis) crosses the midpoint of the constant velocity phase and reaches the start of the deceleration phase, and the position deviation is 0.06 mm (exceeding the fifth tolerance threshold of 0.05 mm), then the theoretical remaining time of 0.467 seconds corresponding to the start of the deceleration phase is determined as the waiting delay. If none of the above conditions are met, then the waiting delay is zero.
[0090] Step 209: The motor controller segments the total vertical lifting stroke based on the motion characteristics of the non-hysteresis Z-axis and the pressure change pattern during printing, dividing it into three key pressure points: the end of the pressure build-up zone, the midpoint of the pressure stabilization zone, and the start of the pressure release zone. The pressure build-up zone refers to the stage from when the Z-axis begins to rise until the printhead contacts the printing filament and establishes a stable extrusion pressure; the end of this zone is the end of the pressure build-up zone, corresponding to one-quarter of the total vertical lifting stroke. The pressure stabilization zone refers to the stage where the Z-axis is in a stable lifting state and the extrusion pressure remains constant; the midpoint of this zone is the midpoint of the pressure stabilization zone, corresponding to one-half of the total vertical lifting stroke. The pressure release zone refers to the stage where the Z-axis is about to stop rising and the extrusion pressure gradually decreases to zero; the start of this zone is the start of the pressure release zone, corresponding to three-quarters of the total vertical lifting stroke.
[0091] The motor controller calculates the theoretical remaining time for the lagging axis (E-axis) to pass through these three pressure position points. The calculation method is the same as that in step 209, and will not be repeated here.
[0092] In one embodiment, assuming the total vertical lifting stroke of the non-hysteresis Z-axis in the current segment path planning data is 20 mm, the motor controller divides it into the end point of the pressure build-up zone (5 mm, 20 mm * 1 / 4), the midpoint of the pressure stabilization zone (10 mm, 20 mm * 1 / 2), and the starting point of the pressure release zone (15 mm, 20 mm * 3 / 4). The preset motion parameters for the hysteresis axis (E-axis) are a rated extrusion speed of 15 mm / s and an acceleration of 30 mm / s. 2 Deceleration 30 mm / s 2The E-axis has completed a 3 mm extrusion displacement, and its current position is 3 mm. It is determined that the movement of the E-axis from its current position to the three pressure points is in a constant-speed phase. The theoretical remaining time = displacement / rated speed. Specifically, the displacement of the E-axis to the end point of the pressure build-up zone (corresponding to a 6 mm extrusion displacement) is 6 - 3 = 3 mm, with a theoretical remaining time of 3 mm / 15 mm / s = 0.2 seconds; the displacement to the midpoint of the pressure stabilization zone (corresponding to an 8 mm extrusion displacement) is 8 - 3 = 5 mm, with a theoretical remaining time of 5 mm / 15 mm / s ≈ 0.333 seconds; and the displacement to the starting point of the pressure release zone (corresponding to a 10 mm extrusion displacement) is 10 - 3 = 7 mm, with a theoretical remaining time of 7 mm / 15 mm / s ≈ 0.467 seconds.
[0093] The sixth tolerance threshold is a value pre-stored in the motor controller to determine whether the deviation of the lagging axis (E-axis) at the end position of the pressure build-up zone exceeds a reasonable range. It is set according to the accuracy requirements of 3D printing, the performance parameters of the closed-loop stepper motor, and the pressure coordination requirements of Z-axis lifting and E-axis extrusion.
[0094] The motor controller sequentially checks whether the relevant parameters of the lagging axis (E-axis) at each pressure position point meet the set conditions according to the movement progress of the lagging axis (E-axis): First, it checks whether the lagging axis (E-axis) has passed the end point of the pressure establishment zone. If it has passed, and the position deviation of the lagging axis (E-axis) is positive (i.e., the position deviation is positive, indicating that the extrusion of the E-axis is ahead of the lifting and lowering progress of the Z-axis), and the position deviation exceeds the sixth tolerance threshold, it indicates that the deviation of the lagging axis (E-axis) has affected the pressure coordination between the lifting and lowering of the Z-axis and the extrusion of the E-axis. The non-lagging Z-axis needs to be delayed and adjusted. The motor controller then determines the theoretical remaining time corresponding to the end point of the pressure establishment zone as the waiting delay amount of the non-lagging Z-axis.
[0095] If the lag axis (E-axis) has passed the end point of the pressure establishment zone but has not reached the midpoint of the pressure stabilization zone, it is determined that the position deviation of the lag axis (E-axis) when reaching the midpoint of the pressure stabilization zone has not decreased (i.e., the absolute value of the current position deviation is greater than or equal to the absolute value of the deviation when passing the end point of the pressure establishment zone). This indicates that the deviation state of the lag axis (E-axis) has not been improved. A delay adjustment is made to the non-lag Z-axis, and the theoretical remaining time corresponding to the midpoint of the pressure stabilization zone is determined as the waiting delay of the non-lag Z-axis.
[0096] If the lag axis (E-axis) has crossed the midpoint of the pressure stabilization zone but has not reached the starting point of the pressure release zone, it is determined that the position deviation of the lag axis (E-axis) when reaching the starting point of the pressure release zone has not converged to zero. This indicates that the deviation state of the lag axis (E-axis) is still not under control. If a delay adjustment is made to the non-lag Z-axis, the theoretical remaining time corresponding to the starting point of the pressure release zone is determined as the waiting delay of the non-lag Z-axis.
[0097] If none of the above three conditions are met, that is, the relevant parameters of the hysteresis axis (E-axis) at each pressure position point do not meet the set conditions, it indicates that the deviation of the hysteresis axis (E-axis) is within a reasonable range or has been controlled, and there is no need to adjust the delay of the non-hysteresis Z-axis. In this case, the waiting delay of the non-hysteresis Z-axis is determined to be zero.
[0098] Continuing with the embodiment based on step 211, the sixth tolerance threshold is 0.04 mm. When the motor controller detects that the position deviation of the lag axis (E-axis) is 0.05 mm (positive offset) when it passes the end of the pressure build-up zone, and exceeds the sixth tolerance threshold of 0.04 mm, the theoretical remaining time of 0.2 seconds corresponding to the end of the pressure build-up zone is determined as the waiting delay for the non-lag Z-axis. If the position deviation of the lag axis (E-axis) is still 0.05 mm (not reduced) when it passes the end of the pressure build-up zone and reaches the midpoint of the pressure stabilization zone, the theoretical remaining time of 0.333 seconds corresponding to the midpoint of the pressure stabilization zone is determined as the waiting delay; if the position deviation of the lag axis (E-axis) is 0.03 mm (not converged to zero) when it passes the midpoint of the pressure stabilization zone and reaches the start of the pressure release zone, the theoretical remaining time of 0.467 seconds corresponding to the start of the pressure release zone is determined as the waiting delay; if none of the above conditions are met, the waiting delay is zero. This invention specifically determines the waiting delay for each non-lagging axis, avoiding multi-axis timing misalignment caused by blind delay and insufficient coordination between lagging and non-lagging axes due to untimely delay. It ensures the coordination consistency between the horizontal movement of the X and Y axes and the extrusion of the E axis, as well as the matching between the vertical lifting of the Z axis and the extrusion pressure of the E axis. This optimizes the synchronization accuracy of the multi-axis coordinated movement of the 3D printer, reduces problems such as printing trajectory distortion, uneven layer thickness, and abnormal filament extrusion caused by timing misalignment, and thus improves the surface quality of the 3D printed parts.
[0099] Optionally, the processes of steps 401 to 403 include: Step 401: Perform position offset analysis based on the final position and target endpoint position of each closed-loop stepper motor to obtain the synchronization residual error of each closed-loop stepper motor.
[0100] Optionally, after each closed-loop stepper motor has completed its coordinated motion according to the control instructions in step 30 and reached the theoretical synchronization time, the motor controller collects the final position of each closed-loop stepper motor after its motion is completed. The final position refers to the actual position of the corresponding motion axis when each closed-loop stepper motor stops moving. This position is collected by the position detection module (such as an encoder) built into each closed-loop stepper motor, and after collection, the position detection module feeds back to the motor controller in real time.
[0101] The motor controller performs position offset analysis based on the acquired final positions and corresponding target endpoint positions of each closed-loop stepper motor, and calculates the synchronization residual error of the corresponding motion axis of each closed-loop stepper motor. The synchronization residual error refers to the difference between the final position and the target endpoint position of the corresponding motion axis of each closed-loop stepper motor, reflecting the degree of deviation between the actual position of each motion axis and the preset target position after the motion is completed. That is, the synchronization residual error of each closed-loop stepper motor = final position - target endpoint position.
[0102] In one embodiment, it is assumed that in the current path planning data, the target endpoint positions of the motion axes (horizontal motion axis 1, horizontal motion axis 2, vertical motion axis, and extrusion axis) corresponding to the four closed-loop stepper motors are 100 mm, 80 mm, 5 mm, and 20 mm, respectively. After each closed-loop stepper motor completes its movement, the final positions collected by the motor controller through the position detection module are 99.996 mm, 80.003 mm, 4.998 mm, and 20.002 mm, respectively. According to the algorithm for calculating the synchronization residual error, the synchronization residual error of each closed-loop stepper motor is calculated as follows: Synchronization residual error of horizontal motion axis 1 = 99.996 mm - 100 mm = -0.004 mm; Synchronization residual error of horizontal motion axis 2 = 80.003 mm - 80 mm = 0.003 mm; Synchronization residual error of vertical motion axis = 4.998 mm - 5 mm = -0.002 mm; Synchronization residual error of extrusion axis = 20.002 mm - 20 mm = 0.002 mm.
[0103] Step 402: If the synchronization residual error of at least one closed-loop stepper motor is greater than the position tolerance threshold, then it is determined that the synchronization error condition is not met.
[0104] Optionally, the motor controller determines the synchronization residual error of each closed-loop stepper motor individually. The determination method involves comparing the absolute value of the synchronization residual error of each closed-loop stepper motor with a position tolerance threshold to determine whether the synchronization residual error of a single closed-loop stepper motor exceeds the position tolerance threshold. If the motor controller determines that the absolute value of the synchronization residual error of at least one closed-loop stepper motor is greater than the position tolerance threshold, it indicates that the position deviation of the corresponding motion axis of that closed-loop stepper motor has exceeded the preset reasonable range, and the synchronization accuracy of the multi-axis coordinated motion has not met the requirements. Therefore, it is determined that the synchronization error condition is not currently met.
[0105] Step 403: If the synchronization residual error of each closed-loop stepper motor is less than or equal to the position tolerance threshold, then determine whether the synchronization error condition is met based on the motion completion timestamp of each motion axis.
[0106] Optionally, if the synchronization residual error of each closed-loop stepper motor is less than or equal to the position tolerance threshold, then the synchronization error condition is determined based on the motion completion timestamp of each motion axis, as in steps 4031 to 4034.
[0107] The embodiments of the present invention realize dual determination of the synchronization accuracy of multi-axis cooperative motion, taking into account both the accuracy of positional deviation and the synchronization of motion completion time. This effectively avoids the problems of insufficient time synchronization and printing trajectory distortion caused by determining the positional deviation alone, ensuring that the multi-axis cooperative motion of each path reaches the preset synchronization accuracy requirements, thereby improving the molding quality of 3D printed parts.
[0108] Optionally, the process of steps 4031 to 4034 includes: Step 4031: If the time difference between the motion completion timestamp of the X-axis and the motion completion timestamp of the Y-axis is greater than the plane synchronization time difference threshold, then it is determined that the synchronization error condition is not met.
[0109] Optionally, the motion completion timestamp refers to the specific time point when the closed-loop stepper motor completely stops moving and reaches its final position. The planar synchronization time difference threshold refers to the threshold pre-stored in the motor controller, used to measure the synchronization of the motion completion times of the two horizontal motion axes, the X-axis and the Y-axis, and is used to limit the maximum allowable difference in the motion completion times of the X-axis and the Y-axis to ensure the synchronization of the horizontal linkage of the two axes.
[0110] The motor controller calculates the time difference between the completion timestamps of the X-axis and Y-axis movements. The calculation algorithm is: Time difference = X-axis completion timestamp - Y-axis completion timestamp. If the calculated time difference is negative, its absolute value is taken as the final time difference (i.e., the time difference is the absolute difference between the completion timestamps of the two axes). The motor controller compares the calculated time difference with a planar synchronization time difference threshold. If the time difference is greater than the planar synchronization time difference threshold, it indicates that the difference in the completion times of the X-axis and Y-axis movements exceeds the preset reasonable range, and the time synchronization of the horizontal linkage between the two axes does not meet the requirements. In this case, the motor controller directly determines that the synchronization error condition is not met.
[0111] Step 4032, otherwise, determine whether the Z-axis motion completion timestamp is later than the planar linkage completion timestamp.
[0112] Optionally, the completion timestamp of planar linkage refers to the latest timestamp when both the X-axis and Y-axis horizontal motion axes have completed their movements and reached their final positions. That is, the maximum value of the X-axis motion completion timestamp and the Y-axis motion completion timestamp is taken, because the planar linkage motion is only considered complete when both horizontal motion axes have stopped moving. The calculation algorithm is: Planar linkage completion timestamp = max(X-axis motion completion timestamp, Y-axis motion completion timestamp).
[0113] If the time difference between the completion of the X-axis and Y-axis motions is less than or equal to the plane synchronization time difference threshold, the motor controller determines the order of the Z-axis motion completion timestamp and the plane linkage completion timestamp. The determination method is to directly compare the values of the two timestamps to determine whether the Z-axis completed the motion later than the plane linkage.
[0114] Step 4033: If the completion time stamp of the Z-axis motion is earlier than the completion time stamp of the planar linkage, then it is determined that the synchronization error condition is not met. Otherwise, it is determined whether the phase lead-lag relationship between the completion time stamp of the E-axis motion and the completion time stamp of the planar linkage conforms to the preset extrusion following relationship.
[0115] Optionally, if the motor controller determines that the completion time stamp of the Z-axis movement is earlier than the completion time stamp of the planar linkage, it means that the vertical movement of the Z-axis is completed before the planar linkage of the horizontal movement axis. This will cause the print head to complete the vertical lifting and lowering in advance, while the horizontal movement has not yet ended, which will lead to problems such as uneven printing layer thickness and trajectory misalignment. In this case, the motor controller directly determines that the synchronization error condition is not met.
[0116] If the motor controller determines that the Z-axis motion completion timestamp is not earlier than the planar linkage completion timestamp (i.e., the Z-axis motion completion timestamp is equal to or later than the planar linkage completion timestamp), it indicates that the coordination between the vertical movement of the Z-axis and the planar linkage meets the preset requirements. It then determines whether the phase lead-lag relationship between the E-axis (extrusion axis) motion completion timestamp and the planar linkage completion timestamp conforms to the preset extrusion following relationship. The phase lead-lag relationship refers to the order and time difference between the E-axis motion completion timestamp and the planar linkage completion timestamp. The preset extrusion following relationship stipulates that the E-axis motion completion time must maintain a reasonable phase relationship with the planar linkage completion time; specifically, the E-axis motion completion timestamp must be slightly later than the planar linkage completion timestamp, and the time difference must be within the preset extrusion following time difference range. This ensures that the filament extrusion coordinates with the horizontal and vertical movements, avoiding printing defects caused by filament extrusion being ahead or behind.
[0117] Step 4034: If the preset extrusion following relationship is not met, then the synchronization error condition is determined not to be met. Otherwise, the synchronization error condition is determined to be met.
[0118] Optionally, the phase lead-lag relationship refers to the time difference between the E-axis motion completion time stamp and the planar linkage completion time stamp. If the time difference is positive, it indicates that the E-axis motion completion time is later than the planar linkage completion time, which is a lag relationship; if the time difference is negative, it indicates that the E-axis motion completion time is earlier than the planar linkage completion time, which is a lead relationship. The motor controller compares the phase lead-lag relationship with the preset extrusion following relationship. If the comparison result does not conform to the preset extrusion following relationship (i.e., the E-axis leads the planar linkage completion time by too much, or lags the planar linkage completion time by too much, exceeding the preset extrusion following time difference range), it indicates that the coordination between the E-axis consumable extrusion and the planar linkage and vertical motion does not meet the requirements, and the synchronization error condition is determined not to be met.
[0119] If the comparison result meets the preset extrusion following relationship (i.e., the completion time stamp of the E-axis motion is slightly later than the completion time stamp of the planar linkage, and the time difference is within the preset extrusion following time difference range), it means that the position deviation of each motion axis (X-axis, Y-axis, Z-axis, E-axis) is within a reasonable range, and the synchronization and coordination of the motion completion time meet the preset requirements, thus confirming that the synchronization error condition is met.
[0120] The embodiments of the present invention make up for the defect of only judging positional deviation and ignoring time synchronization, ensuring that each motion axis is not only accurately positioned, but also that the motion completion time meets the coordination requirements. This effectively avoids problems such as printing trajectory distortion, uneven layer thickness, and abnormal material extrusion caused by insufficient time synchronization, improves the synchronization accuracy of multi-axis coordination in 3D printers, and thus improves the surface quality of 3D printed parts.
[0121] Furthermore, the closed-loop stepper motor multi-machine synchronous motion control system for 3D printers provided by the present invention will be described below. The closed-loop stepper motor multi-machine synchronous motion control system for 3D printers described below can be referred to in correspondence with the closed-loop stepper motor multi-machine synchronous motion control method for 3D printers described above.
[0122] Optionally, refer to Figure 2 , Figure 2 This is a schematic diagram of the structure of a closed-loop stepper motor multi-machine synchronous motion control system for 3D printers provided by the present invention. The closed-loop stepper motor multi-machine synchronous motion control system for 3D printers includes a position deviation analysis module 210, a delay mapping module 220, a cooperative motion control module 230, and a model printing control module 240, which are used to implement the methods of steps 10 to 40 above.
[0123] The embodiments of the present invention solve the technical problem of spatial trajectory distortion caused by the lack of real-time closed-loop feedback dynamic adjustment in multi-axis linkage, realize the synchronization of each motion axis in the multi-axis linkage process of 3D printer, thereby improving the surface quality of 3D printed parts.
[0124] Please see Figure 3 , Figure 3 An embodiment diagram of an electronic device provided in accordance with the present invention. For example... Figure 3 As shown, an embodiment of the present invention provides an electronic device 300, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320. When the processor 320 executes the computer program 311, it implements the processes of steps 10 to 40.
[0125] Please see Figure 4 , Figure 4 An embodiment diagram of a computer-readable storage medium provided in accordance with an embodiment of the present invention is shown. Figure 4 As shown, this embodiment provides a computer-readable storage medium 400 on which a computer program 311 is stored. When the computer program 311 is executed by a processor, it implements the processes of steps 10 to 40.
[0126] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the closed-loop stepper motor multi-machine synchronous motion control method for 3D printers provided by the above methods, which includes steps 10 to 40.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A closed-loop stepper motor multi-machine synchronous motion control method for 3D printers, characterized in that, The 3D printer includes at least a motor controller and closed-loop stepper motors connected to the X, Y, Z, and E axes, wherein the motor controller is connected to each of the closed-loop stepper motors; the method includes: Motion analysis is performed on the target endpoint position and preset motion parameters of each motion axis in the current segment path planning data of the model to be printed. The theoretical synchronization time for each motion axis to reach the target endpoint position at the same time is obtained. Position deviation analysis is performed on the current position of each closed-loop stepper motor and the theoretical expected position corresponding to the current sampling time to obtain the position deviation of each motion axis. The motion axis corresponding to the largest position deviation is taken as the lag axis. Based on the position deviation change trend of the lag axis, the control cycle of the non-lag axis is delayed and mapped to obtain the waiting delay amount. The first original motion timing of the non-lagging axis is updated based on the waiting delay amount to obtain the updated motion timing. Based on the updated motion timing and the second original motion timing of the lagging axis, each closed-loop stepper motor is driven to perform coordinated motion until the theoretical synchronization time is reached. Based on the final position and target endpoint position after the movement of each closed-loop stepper motor, the residual synchronization error is determined until the synchronization error condition is met, and then the next segment of path planning data is executed.
2. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to claim 1, characterized in that, Determine the waiting delay for each non-hysteresis axis, including: If the lagging axis is the X-axis or Y-axis, for the non-lagging Z-axis, the total vertical rise and fall distance of the non-lagging Z-axis in the current segment path planning data is divided into quarter-height nodes, half-height nodes, and three-quarter-height nodes, and the theoretical remaining time for the lagging axis to reach the three height nodes is calculated respectively. Based on the aforementioned position deviation trend, if the position deviation of the lagging axis when reaching the quarter-height node is greater than the first tolerance threshold, then the theoretical remaining time corresponding to the quarter-height node is determined as the waiting delay of the non-lagging Z-axis; if the lagging axis crosses the quarter-height node and the position deviation when reaching the half-height node is greater than the second tolerance threshold, then the theoretical remaining time corresponding to the half-height node is determined as the waiting delay of the non-lagging Z-axis; if the lagging axis crosses the half-height node and the position deviation when reaching the three-quarters-height node is greater than the third tolerance threshold, then the theoretical remaining time corresponding to the three-quarters-height node is determined as the waiting delay of the non-lagging Z-axis; otherwise, the waiting delay of the non-lagging Z-axis is determined to be zero. For the non-hysteresis E-axis, the waiting delay of the non-hysteresis E-axis is determined based on the total number of extrusion pulses in the current segment path planning data.
3. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to claim 2, characterized in that, The determination of the waiting delay of the non-hysteresis E-axis based on the total number of extrusion pulses in the current segment path planning data includes: The total number of extrusion pulses is divided into the end point of the first pulse interval, the end point of the middle pulse interval, and the end point of the last pulse interval, and the theoretical remaining time for the lag axis to reach the end point of each of the three pulse intervals is calculated. Based on the aforementioned position deviation change trend, if the position deviation change rate of the lag axis when reaching the end of the preceding pulse interval is positive and the value exceeds the first rate threshold, then the theoretical remaining time corresponding to the end of the preceding pulse interval is determined as the waiting delay of the non-lag E-axis; if the lag axis crosses the end of the preceding pulse interval and the position deviation change rate when reaching the end of the middle pulse interval is positive and the value exceeds the second rate threshold, then the theoretical remaining time corresponding to the end of the middle pulse interval is determined as the waiting delay of the non-lag E-axis; if the lag axis crosses the end of the middle pulse interval and the position deviation when reaching the end of the following pulse interval does not converge to zero, then the theoretical remaining time corresponding to the end of the following pulse interval is determined as the waiting delay of the non-lag E-axis; otherwise, the waiting delay of the non-lag E-axis is determined to be zero.
4. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to claim 1, characterized in that, Determine the waiting delay for each non-hysteresis axis, including: If the lag axis is the Z-axis, for the X-axis or Y-axis, corner identification is performed based on the planar composite displacement trajectory of the non-lag X-axis and non-lag Y-axis in the current segment path planning data. The corner feature points at the connection between the straight segment and the arc segment are obtained, and the path segment between adjacent corner feature points is taken as the inertial sensitive area. The theoretical remaining time for the lag axis to cross the midpoint and end point of the inertial sensitive area is calculated. Based on the aforementioned position deviation change trend, if the position deviation of the lag axis when crossing the midpoint of the inertial sensitive zone is greater than the fourth tolerance threshold and the rate of change of position deviation exceeds the third rate threshold, then the theoretical remaining time corresponding to the midpoint is determined as the waiting delay for the non-lag X-axis and non-lag Y-axis; if the lag axis crosses the midpoint and the position deviation when reaching the end point of the inertial sensitive zone does not converge to zero and the direction is opposite to the direction of motion, then the theoretical remaining time corresponding to the end point is determined as the waiting delay for the non-lag X-axis and non-lag Y-axis; otherwise, the waiting delay for the non-lag X-axis and non-lag Y-axis is determined to be zero. For the non-hysteresis E-axis, the waiting delay of the non-hysteresis E-axis is determined based on the total number of extrusion pulses in the current segment path planning data.
5. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to claim 4, characterized in that, For the non-hysteresis E-axis, the waiting delay of the non-hysteresis E-axis is determined based on the total number of extrusion pulses in the current segment path planning data, including: The total number of extrusion pulses is divided into segments according to the proportion of extrusion pulses corresponding to each unit height increase of the Z-axis, to obtain the first-level node, the second-level node, and the third-level node, and the theoretical remaining time for the lag axis to reach the three-level nodes is calculated respectively. Based on the aforementioned position deviation trend, if the lag axis experiences position lag accumulation upon reaching the first-level node and the accumulated amount exceeds the first accumulation threshold, then the theoretical remaining time corresponding to the first-level node is determined as the waiting delay of the non-lag E-axis. If the lag axis crosses the first-level node and the accumulated position lag continues to increase upon reaching the second-level node, then the theoretical remaining time corresponding to the second-level node is determined as the waiting delay of the non-lag E-axis. If the lag axis crosses the second-level node and the position deviation does not converge to zero upon reaching the third-level node, then the theoretical remaining time corresponding to the third-level node is determined as the waiting delay of the non-lag E-axis. Otherwise, the waiting delay of the non-lag E-axis is determined to be zero.
6. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to claim 1, characterized in that, Determine the waiting delay for each non-hysteresis axis, including: If the lag axis is the E-axis, for the X-axis or Y-axis, the planar composite displacement of the non-lag X-axis and non-lag Y-axis in the current segment path planning data is segmented to obtain the end point of the acceleration stage, the midpoint of the uniform speed stage, and the start point of the deceleration stage, and the theoretical remaining time for the lag axis to reach the three stage position points is calculated respectively. Based on the aforementioned position deviation change trend, if the position deviation of the lagging axis does not converge to zero when reaching the end of the acceleration phase and the position deviation change rate is negative, then the theoretical remaining time corresponding to the end of the acceleration phase is determined as the waiting delay for the non-lagging X-axis and non-lagging Y-axis; if the lagging axis crosses the end of the acceleration phase and the position deviation increases when reaching the midpoint of the constant velocity phase, then the theoretical remaining time corresponding to the midpoint of the constant velocity phase is determined as the waiting delay for the non-lagging X-axis and non-lagging Y-axis; if the lagging axis crosses the midpoint of the constant velocity phase and the position deviation exceeds the fifth tolerance threshold when reaching the start of the deceleration phase, then the theoretical remaining time corresponding to the start of the deceleration phase is determined as the waiting delay for the non-lagging X-axis and non-lagging Y-axis; otherwise, the waiting delay for the non-lagging X-axis and non-lagging Y-axis is determined to be zero. For the non-hysteresis Z-axis, the waiting delay of the non-hysteresis E-axis is determined based on the total vertical rise and fall of the non-hysteresis Z-axis in the current segment path planning data.
7. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to claim 6, characterized in that, The determination of the waiting delay of the non-hysteresis E-axis based on the total vertical ascent and descent distance of the non-hysteresis Z-axis in the current segment path planning data includes: If the hysteresis axis is the E-axis, the total vertical lifting stroke is divided into the end point of the pressure build-up zone, the midpoint of the pressure stabilization zone, and the start point of the pressure release zone, and the theoretical remaining time for the hysteresis axis to pass through the three pressure position points is calculated. Based on the aforementioned position deviation trend, if the position deviation of the hysteresis axis at the end of the pressure establishment zone has a positive offset and exceeds the sixth tolerance threshold, then the theoretical remaining time corresponding to the end of the pressure establishment zone is determined as the waiting delay of the non-hysteresis Z-axis; if the hysteresis axis crosses the end of the pressure establishment zone and the position deviation does not decrease when it reaches the midpoint of the pressure stabilization zone, then the theoretical remaining time corresponding to the midpoint of the pressure stabilization zone is determined as the waiting delay of the non-hysteresis Z-axis; if the hysteresis axis crosses the midpoint of the pressure stabilization zone and the position deviation does not converge to zero when it reaches the start of the pressure release zone, then the theoretical remaining time corresponding to the start of the pressure release zone is determined as the waiting delay of the non-hysteresis Z-axis. Otherwise, determine the waiting delay of the non-hysteretic Z-axis to be zero.
8. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to any one of claims 1 to 7, characterized in that, Determining whether the synchronization error condition is met includes: Position offset analysis is performed based on the final position and target endpoint position of each closed-loop stepper motor to obtain the synchronization residual error of each closed-loop stepper motor. If the synchronization residual error of at least one closed-loop stepper motor is greater than the position tolerance threshold, then the synchronization error condition is determined not to be met. If the synchronization residual error of each closed-loop stepper motor is less than or equal to the position tolerance threshold, then the synchronization error condition is determined based on the motion completion timestamp of each motion axis.
9. The closed-loop stepper motor multi-machine synchronous motion control method for 3D printers according to claim 8, characterized in that, The determination of whether the synchronization error condition is met based on the motion completion timestamps of each motion axis includes: If the time difference between the motion completion timestamp of the X-axis and the motion completion timestamp of the Y-axis is greater than the plane synchronization time difference threshold, then the synchronization error condition is determined not to be met. Otherwise, determine whether the Z-axis motion completion timestamp is later than the planar linkage completion timestamp; If the completion time stamp of the Z-axis motion is earlier than the completion time stamp of the planar linkage, then the synchronization error condition is not met; otherwise, determine whether the phase lead-lag relationship between the completion time stamp of the E-axis motion and the completion time stamp of the planar linkage conforms to the preset extrusion following relationship. If the preset extrusion following relationship is not met, then the synchronization error condition is determined not to be met; otherwise, the synchronization error condition is determined to be met.
10. A closed-loop stepper motor multi-machine synchronous motion control system for 3D printers, characterized in that, For implementing the closed-loop stepper motor multi-machine synchronous motion control method as described in any one of claims 1 to 9; the 3D printer includes at least a motor controller and closed-loop stepper motors connected to the X-axis, Y-axis, Z-axis and E-axis, wherein the motor controller is connected to each closed-loop stepper motor respectively; the system includes: The position deviation analysis module is used to perform motion analysis based on the target endpoint position and preset motion parameters of each motion axis in the current segment path planning data of the model to be printed, to obtain the theoretical synchronization time for each motion axis to reach the target endpoint position at the same time, and to perform position deviation analysis based on the current position of each closed-loop stepper motor and the theoretical expected position corresponding to the current sampling time, to obtain the position deviation of each motion axis. The delay mapping module is used to delay the control cycle of the non-lag axis based on the position deviation change trend of the lag axis, with the motion axis with the maximum position deviation as the lag axis, to obtain the waiting delay amount. The cooperative motion control module is used to update the first original motion timing of the non-lagging axis based on the waiting delay amount to obtain the updated motion timing, and drive each closed-loop stepper motor to perform cooperative motion based on the updated motion timing and the second original motion timing of the lagging axis until the theoretical synchronization time is reached. The model printing control module is used to determine the synchronization residual error based on the final position and target endpoint position after the movement of each closed-loop stepper motor. Once the synchronization error condition is met, the next segment of path planning data is executed.