Multi-axis synchronous motion control method and system based on EtherCAT bus
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-08-14
AI Technical Summary
[0006]相关技术中,运动控制器的轨迹规划与总线通信通常分属不同的任务,二者之间通过数据缓冲区衔接,在总线通信出现波动时,数据缓冲区容易出现数据的延迟或者溢出,影响位置指令输出的连续性
Smart Images

Figure CN122569153A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to the fields of industrial automation and motion control technology; in particular, a multi-axis synchronous motion control method and system based on EtherCAT bus. Background Technology
[0002] Motion controllers are used for trajectory planning of multiple motion axes and for issuing position commands to the drivers of each axis. They are widely used in CNC machine tools, robots, and electronic assembly equipment. In multi-axis coordinated motion scenarios, the motion controller needs to issue position commands to the drivers of each axis at the same time reference and ensure that the actual actions of each axis are consistent. Deviations in the timing of actions between multiple axes will be directly reflected in deviations in the motion trajectory.
[0003] In related technologies, motion controllers typically employ an architecture where the host computer, motion control card, and servo driver are separate, or they utilize a software-based motion controller based on a general-purpose real-time operating system. When implemented using a general-purpose real-time operating system, task scheduling suffers from microsecond-level jitter, and at higher interpolation frequencies, trajectory tracking errors are difficult to eliminate.
[0004] In related technologies, the EtherCAT bus provides a distributed clock mechanism, which aligns the local clocks of each slave station on the bus to the same time base and generates a synchronization signal accordingly, so that each slave station on the bus is triggered at the same time. With the help of this mechanism, the motion controller can ensure that the position commands of each axis arrive at their respective drivers at the same time the synchronization signal is triggered.
[0005] However, the fact that position commands from all axes arrive at the drivers at the same time does not mean that each axis will actually move at the same time. Each driver has its own response delay between receiving the position command and driving the corresponding axis to move, and these response delays are usually not the same for different drivers. The distributed clock mechanism aligns the clocks of each slave station with the trigger time of the synchronization signal, but it does not eliminate the differences in response delays between drivers. Therefore, the actual time when each axis moves after the synchronization signal is triggered is still inconsistent, and residual synchronization deviations exist between multiple axes.
[0006] In related technologies, trajectory planning and bus communication of motion controllers are usually separate tasks, connected by a data buffer. When fluctuations occur in bus communication, the data buffer is prone to data delays or overflows, affecting the continuity of position command output.
[0007] It should be noted that the above background information is only used to help understand the technical concept of this application and should not be regarded as an admission that there are already technical solutions in the related art that are the same as or similar to this application. Summary of the Invention
[0008] The main objective of this application is to provide a multi-axis synchronous motion control method and system based on EtherCAT bus, so as to reduce the deviation of the actual action time of the multi-axis after the synchronization signal is triggered, and reduce the impact of bus communication fluctuations on the continuity of position command output.
[0009] To achieve the above objectives, in a first aspect, embodiments of this application provide a multi-axis synchronous motion control method based on an EtherCAT bus, applied to a motion controller, wherein the motion controller is connected to drivers of multiple axes via an EtherCAT bus, and the method includes: Acquire motion commands and pre-read the motion commands into the trajectory buffer; Send ranging frames to each of the aforementioned drivers, and obtain the corresponding delay parameters for each axis based on the response time returned by each of the aforementioned drivers; Within each EtherCAT communication cycle, position commands for each axis are generated based on the motion commands in the trajectory buffer; The advance amount of each axis is determined according to the corresponding delay parameters of each axis, and the position command of the corresponding axis is compensated according to the advance amount to obtain the compensated position command of each axis. At the moment the synchronization signal is triggered during the EtherCAT communication cycle, the corresponding compensated position command is synchronously output to each of the drivers.
[0010] In the above method, based on the distributed clock mechanism of the EtherCAT bus which aligns the clocks of each slave station and ensures that the position commands of each axis arrive at the driver at the same synchronization signal trigger time, the method further addresses the problem of inconsistent actual movement times caused by different response delays of each driver. This is achieved by sending ranging frames to each driver and obtaining the corresponding delay parameters for each axis based on the return response time. Then, within each EtherCAT communication cycle, an advance is applied to the position commands of the corresponding axes according to the corresponding delay parameters, ensuring that axes with larger response delays receive their position commands relatively earlier. This makes the actual movement times of each axis more consistent, thereby reducing residual synchronization deviations between multiple axes. Simultaneously, by pre-reading motion commands into the trajectory buffer, the impact of bus communication fluctuations on position command generation can be isolated, thus improving the continuity of position command output.
[0011] In some implementations, pre-reading the motion command into the trajectory buffer includes: The number of motion command segments that the trajectory buffer can store is determined as the buffer depth of the trajectory buffer; The motion commands are stored segment by segment into the trajectory buffer according to the buffer depth; When the number of motion command segments in the trajectory buffer is lower than the buffer depth, the subsequent motion commands are read in advance.
[0012] This allows a certain number of motion command segments to be maintained in the trajectory buffer, thus enabling continuous motion commands to be provided to the position command generation stage even when bus communication fluctuates.
[0013] In some implementations, generating position commands for each axis based on motion commands in the trajectory buffer includes: Perform cubic spline smoothing on adjacent motion command segments in the trajectory buffer to obtain the smoothed trajectory; Based on the preset maximum acceleration and the rate of change of acceleration with respect to time, velocity planning is performed on the smoothed trajectory to obtain the position commands of each axis within the current EtherCAT communication cycle.
[0014] By smoothing adjacent motion command segments and limiting acceleration and jerk, high-frequency jitter caused by the connection of tiny line segments can be reduced, thereby reducing mechanical vibration.
[0015] In some implementations, sending ranging frames to each of the drivers and obtaining the corresponding delay parameters for each axis based on the response time of each driver includes: During the initialization phase, the ranging frames are sent multiple times to each of the aforementioned drivers; Record the time of each driver's multiple response to the ranging frame; Based on the statistical values of the time corresponding to the corresponding axis, determine the delay parameter of the axis; Associate the delay parameters of each axis with the corresponding axis identifier to obtain the corresponding delay parameters of each axis.
[0016] By sending ranging frames multiple times and taking statistical values, the impact of occasional communication fluctuations on delay parameters can be reduced, thereby improving the stability of the corresponding delay parameters of each axis.
[0017] In some implementations, after compensating the position commands of the corresponding axes according to the advance amount to obtain the compensated position commands of each axis, the method further includes: Obtain the preset phase offset compensation amount for the corresponding axis; The phase offset compensation amount is used to perform phase compensation on the compensated position command of the axis to obtain the phase-compensated position command; The phase-compensated position command is used as the compensated position command for this axis.
[0018] Since the phase difference between the output signals of each axis can be further corrected by applying advance based on the corresponding delay parameters of each axis and then performing phase compensation based on the phase offset compensation, the phase difference between the output signals of each axis can be further reduced.
[0019] In some implementations, the step of synchronously outputting the corresponding compensated position command to each of the drivers at the trigger time of the synchronization signal in the EtherCAT communication cycle includes: Determine the speed feedforward value for each axis within the current EtherCAT communication cycle; At the moment the synchronization signal is triggered, the compensated position command and the speed feedforward value of the corresponding axis are synchronously output to the driver of the corresponding axis.
[0020] Since the speed feedforward value is output at the same time as the position command after compensation, the speed direction feedforward information can be provided to the driver, thereby reducing the axis following error.
[0021] In some implementations, after generating the position commands for each axis, the process further includes: Obtain the torque or current feedback from each axis driver; The load change of the corresponding shaft is determined based on the torque or current. The feedforward compensation amount for the shaft is determined based on the load change. The feedforward compensation amount is used to compensate for subsequent position commands on the axis.
[0022] By predicting load changes based on torque or current feedback and compensating for subsequent position commands, the deviation of the actual position of the shaft caused by load changes can be reduced.
[0023] In some implementations, the method further includes: Obtain the target position deviation output by the vision sensor; Convert the target position deviation into the position deviation of the corresponding axis; The position command of the corresponding axis is compensated based on the position deviation.
[0024] By incorporating the target position deviation output by the vision sensor into the position command compensation, the movement of each axis can be corrected by following the visual feedback, thereby reducing the deviation between the actual end position and the target position.
[0025] In some implementations, the method further includes: During each EtherCAT communication cycle, the tracking error of each axis is collected; Compare the following error of the corresponding axis with the reference error of that axis; When the change in the following error of the corresponding axis relative to the reference error exceeds a preset condition, a warning message for that axis is output.
[0026] By comparing the following error during the movement and outputting early warning information when its change is abnormal, the system can alert the corresponding axis to potential abnormalities before the fault escalates.
[0027] To achieve the above objectives, in a second aspect, embodiments of this application also provide a multi-axis synchronous motion control system based on an EtherCAT bus, including a motion controller connected to drivers of multiple axes via an EtherCAT bus; the motion controller includes: The instruction pre-reading module is used to acquire motion instructions and pre-read the motion instructions into the trajectory buffer. The delay modeling module is used to send ranging frames to each of the drivers and obtain the corresponding delay parameters for each axis based on the response time of each driver. The instruction generation module is used to generate position instructions for each axis based on the motion instructions in the trajectory buffer during each EtherCAT communication cycle. The compensation module is used to determine the advance amount of each axis according to the corresponding delay parameters of each axis, and to compensate the position command of the corresponding axis according to the advance amount to obtain the compensated position command of each axis. The synchronization output module is used to synchronously output the corresponding compensated position command to each of the drivers at the time of the synchronization signal triggering of the EtherCAT communication cycle. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a flowchart of the multi-axis synchronous motion control method based on EtherCAT bus provided in the first embodiment of this application; Figure 2 This is a flowchart of obtaining the corresponding delay parameters of each axis in the first embodiment of this application; Figure 3 This is a flowchart of the dynamic feedforward processing in the multi-axis synchronous motion control method provided in the second embodiment of this application; Figure 4 This is a flowchart of the visual feedback processing in the multi-axis synchronous motion control method provided in the third embodiment of this application; Figure 5 This is a flowchart of the abnormal early warning processing in the multi-axis synchronous motion control method provided in the fourth embodiment of this application; Figure 6 This is a schematic diagram of the structure of the multi-axis synchronous motion control system based on EtherCAT bus provided in the fifth embodiment of this application; Figure 7This is a schematic diagram of the hardware structure of the motion controller in the fifth embodiment of this application.
[0030] Explanation of reference numerals in the attached figures: 100, Motion controller; 110, Instruction prefetching module; 120, Delay modeling module; 130, Instruction generation module; 140, Compensation module; 150, Synchronization output module; 210, ARM core; 220, FPGA core; 221, Hardware motion planning engine; 230, EtherCAT slave controller; 300, Driver. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this application to help readers better understand this application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in this application can be implemented. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0032] The first embodiment of this application relates to a multi-axis synchronous motion control method based on EtherCAT bus, applied to a motion controller.
[0033] Before introducing the method flow of this embodiment, the hardware environment in which this method operates will be described first. In one implementation, the motion controller acts as the master station of the EtherCAT bus, connecting multiple axis drivers via the EtherCAT bus. Each driver acts as a slave station of the EtherCAT bus, driving its corresponding axis to generate motion. The motion controller can adopt a structure combining an ARM core and an FPGA core: the ARM core is used for tasks such as parsing motion commands, configuring control parameters, and human-machine interaction; the FPGA core is used for motion planning and position command generation, compensation, and synchronous output, and is connected to the EtherCAT bus via an EtherCAT slave controller, thereby exchanging data with each driver. The host computer, the drivers of each axis, and the load driven by the drivers are objects in the connection environment relative to the motion controller. It should be noted that the above hardware environment is only one operating environment for the method of this embodiment and is not a limitation on the method. Any motion controller capable of performing the following steps can be used to implement the method of this embodiment.
[0034] In the aforementioned hardware environment, multi-axis coordinated motion demands consistency in the timing of each axis's movements. On one hand, the distributed clock mechanism of the EtherCAT bus can align the clocks of each slave station to the same time base and generate a synchronization signal accordingly, ensuring that position commands for each axis arrive at their respective drivers at the same synchronization signal trigger time. However, there is a response delay between each driver receiving the position command and driving the corresponding axis to produce an actual movement, and the response delays of different drivers are usually not the same. The distributed clock mechanism does not eliminate this difference in response delay; therefore, the actual timing of movement for each axis after the synchronization signal triggers is still inconsistent, resulting in residual synchronization deviations among the multiple axes. On the other hand, communication fluctuations occur during the process of motion commands being sent from the host computer to the motion controller. If the generation of position commands directly depends on the real-time motion commands, these communication fluctuations will affect the continuity of position command output. The method in this embodiment is used to reduce the aforementioned residual synchronization deviations and minimize the impact of communication fluctuations on the continuity of position command output.
[0035] The multi-axis synchronous motion control method based on EtherCAT bus provided in this embodiment includes: acquiring motion commands and pre-reading the motion commands into a trajectory buffer; sending ranging frames to each of the drivers, determining the delay parameters of each axis based on the response time of each driver, and establishing corresponding delay parameters for each axis; generating position commands for each axis based on the motion commands in the trajectory buffer within each EtherCAT communication cycle; determining the lead amount for each axis based on the corresponding delay parameters of each axis, and compensating the position commands of the corresponding axes according to the lead amount to obtain the compensated position commands for each axis; and synchronously outputting the corresponding compensated position commands to each driver at the synchronization signal trigger time of the EtherCAT communication cycle.
[0036] The following is combined with Figure 1 The method flow of this embodiment will be described in detail. For example... Figure 1 As shown, the method includes steps S1 to S5.
[0037] Step S1: Obtain motion commands and pre-read the motion commands into the trajectory buffer.
[0038] Motion commands refer to instructions used to describe the motion trajectory of each axis. For example, they can be instructions containing straight line segments and circular arc segments, or spline curve parameters describing a spatial path. This embodiment does not limit the specific form of the motion commands. The trajectory buffer is a storage area used to store pre-read motion commands. In one implementation, the trajectory buffer can be located within the FPGA core of the motion controller. After acquiring the motion commands, the motion controller does not immediately use them for generating position commands in the current cycle. Instead, it first pre-reads the motion commands and stores them in the trajectory buffer. The position command generation stage then reads the motion commands from the trajectory buffer. In this way, when bus communication fluctuates, the position command generation stage can still read the pre-read motion commands from the trajectory buffer, thereby isolating the impact of communication fluctuations on position command generation.
[0039] The buffer depth (FIFO depth) of the trajectory buffer indicates the maximum number of motion command segments that the trajectory buffer can pre-store. In some embodiments, the buffer depth of the trajectory buffer is configurable, meaning that the number of motion command segments that the trajectory buffer can hold can be set by the user in the parameter configuration. For example, a larger buffer depth can be configured for high-speed machining, dense trajectories with small line segments, or when a longer look-ahead distance is required; a smaller buffer depth can be configured for ordinary point-to-point motion, limited memory resources, or when a faster response is required. After determining the buffer depth of the trajectory buffer, the motion controller stores the motion commands segment by segment into the trajectory buffer according to the buffer depth; and when the number of motion command segments in the trajectory buffer is lower than the buffer depth, it continues to pre-read subsequent motion commands, so that the trajectory buffer always maintains a certain number of motion command segments. As an example, the buffer depth can be 256 segments; as another example, the buffer depth can be 128 segments; as yet another example, the buffer depth can also be determined based on the average length of the motion command segments and the EtherCAT communication cycle, so that the motion duration corresponding to the pre-read motion commands in the trajectory buffer is not less than a preset duration. The values mentioned above are for illustrative purposes only and should not be construed as limiting the buffer depth.
[0040] Step S2: Send ranging frames to each of the drivers, and obtain the corresponding delay parameters for each axis based on the response time of each driver.
[0041] In this context, the ranging frame refers to the frame actively sent by the motion controller to the driver to measure the driver's response delay. It's important to note that this measurement step relies on the distributed clock mechanism of the EtherCAT bus: the distributed clock mechanism aligns the clocks of all slave stations to the same time base. The motion controller records the transmission time of the ranging frame under this unified time base and records the reception time after receiving the driver's response to the ranging frame. The difference between the reception and transmission times is used as the driver's return response time. Because the transmission and reception times are under the same time base, the resulting return response time reflects the corresponding driver's response delay. In other words, the distributed clock mechanism aligns the clocks and provides a unified time base for measurement, while the ranging frame is used to measure the response delay of each driver. Both mechanisms respectively perform the functions of clock alignment and delay measurement.
[0042] As an example, a ranging frame can be a frame carrying a timestamp field; as another example, a ranging frame can be a frame carrying an incrementing sequence number, which the motion controller uses to distinguish the responses of different drives; as yet another example, a ranging frame can be a frame that reuses reserved fields from an EtherCAT process data frame. These examples are only for illustrating possible forms of ranging frames and should not be construed as limiting the range of frames.
[0043] Delay parameters are parameters used to describe the response delay of a corresponding axis. The corresponding delay parameters for each axis refer to the correspondence between the axis's identifier and its delay parameter. In one implementation, the process for establishing the corresponding delay parameters for each axis is as follows: Figure 2 As shown, it includes steps S21 to S24.
[0044] Step S21: During the initialization phase, the ranging frames are sent multiple times to each of the aforementioned drivers. The initialization phase refers to the stage where the motion controller performs parameter configuration and self-checks before executing motion commands.
[0045] Step S22: Record the time of each driver's multiple response to the ranging frame.
[0046] Step S23: Determine the delay parameter for the corresponding axis based on the statistical values of the time corresponding to that axis. The statistical values can be, for example, the average or median of multiple response times, or the average after removing outliers. Using statistical values can reduce the impact of occasional communication fluctuations on the delay parameter.
[0047] Step S24: Associate the delay parameters of each axis with the corresponding axis identifier to obtain the corresponding delay parameters for each axis. The axis identifier can be, for example, the station address of the driver on the EtherCAT bus.
[0048] It should be noted that this embodiment uses the establishment of corresponding delay parameters for each axis during the initialization phase as an example for illustration. In one implementation, the motion controller can also resend ranging frames and update the corresponding delay parameters for each axis according to preset conditions during operation to adapt to possible changes in response delay.
[0049] Step S3: In each EtherCAT communication cycle, position commands for each axis are generated based on the motion commands in the trajectory buffer.
[0050] The EtherCAT communication cycle refers to the cycle in which the EtherCAT bus performs one process data exchange; for example, it can be 1 millisecond. The position command refers to the position that the corresponding axis should reach within the current cycle. Within each EtherCAT communication cycle, the motion controller reads motion commands from the trajectory buffer and generates the position commands for each axis within the current cycle through interpolation calculations.
[0051] In some implementations, the motion controller performs cubic spline smoothing on adjacent motion command segments in the trajectory buffer to obtain a smoothed trajectory. Then, based on a preset maximum acceleration and the rate of change of acceleration over time (Jerk), velocity planning is performed on the smoothed trajectory to obtain the position commands for each axis within the current EtherCAT communication cycle. The maximum acceleration and the rate of change of acceleration over time can be set by the user in the parameter configuration. Smoothing adjacent motion command segments and limiting acceleration and the rate of change of acceleration can reduce high-frequency jitter caused by the connection of small line segments, thereby reducing mechanical vibration. It should be noted that this embodiment does not limit the types of curves supported by interpolation; in addition to straight lines and arcs, it can also support spiral curves and spline curves.
[0052] Step S4: Determine the advance amount of each axis according to the corresponding delay parameters of each axis, and compensate the position command of the corresponding axis according to the advance amount to obtain the compensated position command of each axis.
[0053] In this context, lead time refers to the amount of time advanced to align the actual movement timing of the corresponding axis. The motion controller determines the lead time for each axis based on its corresponding delay parameter. The axis with the larger response delay indicated by the delay parameter has a larger lead time. The position command of the corresponding axis is compensated according to the lead time, so that the axis with the larger response delay receives the position command relatively earlier, thereby compensating for its response delay on the driver side and making the actual movement timing of each axis more consistent.
[0054] In some implementations, after receiving the compensated position commands for each axis, the motion controller acquires the preset phase offset compensation amount for the corresponding axis and performs phase compensation on the compensated position command for that axis based on the phase offset compensation amount, using the phase-compensated position command as the compensated position command for that axis. The phase offset compensation amount is used to further correct the phase difference between the output signals of each axis. As one implementation, the motion controller can set a phase offset compensation register for each axis within its FPGA core. This register stores the phase offset compensation amount for the corresponding axis. Users can write the phase offset compensation amount to the corresponding axis's phase offset compensation register based on the inherent phase delay of each driver. Thus, by applying a lead based on the corresponding delay parameters of each axis, and further performing phase compensation based on the phase offset compensation amount in the phase offset compensation register, the phase difference between the output signals of each axis can be further corrected, thereby further reducing the phase difference between the output signals of each axis.
[0055] Step S5: At the moment of the synchronization signal triggering in the EtherCAT communication cycle, the corresponding compensated position command is synchronously output to each of the drivers.
[0056] The synchronization signal refers to the signal provided by the EtherCAT bus for aligning the action times of each slave station. As an example, the synchronization signal can be a synchronization signal generated by the EtherCAT distributed clock. At the moment the synchronization signal is triggered, the motion controller synchronously outputs the corresponding compensated position command to each driver, ensuring that each driver receives the position command on the same time base.
[0057] In some implementations, the motion controller determines the velocity feedforward value for each axis within the current EtherCAT communication cycle, and synchronously outputs the compensated position command and the velocity feedforward value for that axis to the corresponding axis's driver at the moment the synchronization signal is triggered. The velocity feedforward value provides the driver with feedforward information on the velocity direction, which can reduce the axis's following error.
[0058] It should be noted that when the motion controller is applied to multi-joint robots and similar applications, the motion command can be the target pose of the end effector in the workspace. When generating position commands for each axis, the motion controller can first obtain the target value corresponding to each joint based on the target pose through inverse kinematics calculation, and then generate the position command for each axis accordingly. The inverse kinematics calculation can be performed by a processing unit with corresponding computing capabilities in the motion controller. This embodiment does not limit the specific entity performing the inverse kinematics calculation.
[0059] Through steps S1 to S5 above, this embodiment, based on the clock alignment of the EtherCAT distributed clock mechanism, applies an advance amount to the position command of each axis in each EtherCAT communication cycle according to the corresponding delay parameters of each axis established by the ranging frame, so that the actual action time of each axis after the synchronization signal is triggered tends to be consistent, which can reduce the residual synchronization deviation between multiple axes; and by pre-reading the motion command to the trajectory buffer, the impact of bus communication fluctuations on the continuity of position command output can be reduced.
[0060] The second embodiment of this application further explains the process by which the motion controller compensates for subsequent position commands based on driver feedback, building upon the first embodiment. This embodiment adds a dynamic feedforward processing step to the position commands generated for each axis generated in the first embodiment. This processing step is as follows: Figure 3 As shown, it includes steps S6 to S9.
[0061] Step S6: Obtain the torque or current feedback from each axis driver. The torque or current can be fed back to the motion controller from the driver via the EtherCAT bus.
[0062] Step S7: Determine the load change of the corresponding shaft based on the torque or current. The load change represents the change in the load borne by the corresponding shaft.
[0063] Step S8: Determine the feedforward compensation amount for the shaft based on the load change.
[0064] Step S9: Compensate the subsequent position commands of the axis according to the feedforward compensation amount.
[0065] Through steps S6 to S9, the motion controller predicts load changes based on torque or current feedback and compensates for subsequent position commands, thereby reducing the deviation of the actual position of the axis caused by load changes. In one application scenario, for a multi-joint robotic arm, the load borne by each joint varies under different postures. Through the dynamic feedforward processing described above, the deviation of the actual position of the end effector caused by load changes under different postures can be reduced.
[0066] The third embodiment of this application further explains the process of incorporating visual feedback to compensate for position commands in the motion controller, based on the first embodiment. This embodiment adds a visual feedback processing step to the position commands generated for each axis generated in the first embodiment. This processing step is as follows: Figure 4 As shown, it includes steps S10 to S12.
[0067] Step S10: Obtain the target position deviation output by the vision sensor.
[0068] Step S11: Convert the target position deviation into the position deviation of the corresponding axis.
[0069] Step S12: Compensate the position command of the corresponding axis according to the position deviation.
[0070] Among them, the vision sensor can be, for example, a camera connected via an interface, and the target position deviation refers to the deviation of the target detected by the vision sensor from the desired position.
[0071] Through steps S10 to S12, the motion controller incorporates the target position deviation output by the vision sensor into the position command compensation, enabling the motion of each axis to be corrected according to the visual feedback, thereby reducing the deviation between the actual end position and the target position. In one implementation, the motion controller can coordinate the data acquisition of the vision sensor with the EtherCAT communication cycle, that is, acquire the target position deviation output by the vision sensor once every one or every few EtherCAT communication cycles, so that the visual feedback and the position command compensation are time-coordinated.
[0072] The fourth embodiment of this application further explains the abnormal warning processing of the motion controller during motion, based on the first embodiment. This embodiment adds an abnormal warning processing procedure to the first embodiment. This processing procedure is as follows: Figure 5 As shown, steps S13 to S15 are included.
[0073] Step S13: Within each EtherCAT communication cycle, collect the following error of each axis. The following error refers to the deviation between the actual position of the corresponding axis and the position command.
[0074] Step S14: Compare the following error of the corresponding axis with the reference error of the axis. The reference error refers to the following error of the corresponding axis under normal operating conditions, which can be collected and recorded during normal operation of the equipment.
[0075] Step S15: When the change in the following error of the corresponding axis relative to the reference error exceeds a preset condition, output the warning information for that axis.
[0076] Through steps S13 to S15, the motion controller compares the following error during motion and outputs a warning message when the change in the error is abnormal, thus indicating potential abnormalities in the corresponding axis before the fault escalates. In one implementation, in addition to collecting the following error, the motion controller can also collect the current waveforms of each axis driver and compare them with the reference current waveform of the corresponding axis. The warning message can have different types depending on the deviation between the following error and the current waveform. For example, when the change in the following error continues to increase, the warning message can indicate wear of the mechanical components of the corresponding axis; when the current waveform shows a specific pattern of fluctuation, the warning message can indicate loose mechanical connections of the corresponding axis. The types of warning messages described above are merely examples and should not be construed as limiting the scope of warning messages.
[0077] The fifth embodiment of this application relates to a multi-axis synchronous motion control system based on EtherCAT bus, the structure of which is as follows: Figure 6 As shown, the system includes a motion controller 100, which is connected to multiple axis drivers 300 via an EtherCAT bus. The drivers 300 and the loads they drive are objects within the connection environment of the motion controller 100. The motion controller 100 includes a command pre-reading module 110, a delay modeling module 120, a command generation module 130, a compensation module 140, and a synchronization output module 150.
[0078] The instruction pre-reading module 110 is used to acquire motion instructions and pre-read the motion instructions into the trajectory buffer. The input of the instruction pre-reading module 110 is the motion instruction, and the output is the pre-read motion instruction in the trajectory buffer. It provides the pre-read motion instruction to the instruction generation module 130.
[0079] The delay modeling module 120 is used to send ranging frames to each of the drivers 300 and obtain the corresponding delay parameters for each axis based on the response time of each driver 300. The input of the delay modeling module 120 is the response time of each driver 300 to the ranging frame, and the output is the corresponding delay parameters for each axis. It provides the corresponding delay parameters for each axis to the compensation module 140.
[0080] The instruction generation module 130 is used to generate position instructions for each axis based on the motion instructions in the trajectory buffer during each EtherCAT communication cycle. The input of the instruction generation module 130 is the motion instructions in the trajectory buffer, and the output is the position instructions for each axis, which is then provided to the compensation module 140.
[0081] The compensation module 140 is used to determine the advance amount of each axis according to the corresponding delay parameters of each axis, and to compensate the position command of the corresponding axis according to the advance amount, so as to obtain the compensated position command of each axis. The input of the compensation module 140 is the corresponding delay parameters of each axis and the position command of each axis, and the output is the compensated position command of each axis, which provides the compensated position command of each axis to the synchronization output module 150.
[0082] The synchronization output module 150 is used to synchronously output the corresponding compensated position command to each of the drivers 300 at the time of the synchronization signal triggering in the EtherCAT communication cycle. The input of the synchronization output module 150 is the compensated position command of each axis, and the output is the compensated position command issued to each driver 300 at the time of the synchronization signal triggering.
[0083] In some implementations, the instruction generation module 130 is further configured to perform cubic spline smoothing on adjacent motion instruction segments in the trajectory buffer, and limit the velocity corresponding to the position instruction according to a preset maximum acceleration and the rate of change of acceleration with respect to time. In some implementations, the motion controller 100 also includes a dynamic feedforward module, which is configured to acquire the torque or current fed back from each axis driver 300, determine the load change of the corresponding axis based on the torque or current, and compensate for subsequent position instructions of the axis based on the load change.
[0084] In one implementation, the hardware structure of the motion controller 100 is as follows: Figure 7 As shown, the system includes an ARM core 210, an FPGA core 220, and an EtherCAT slave controller 230. The EtherCAT slave controller 230 connects multiple axis drivers 300 via an EtherCAT bus. The ARM core 210 parses motion commands and configures control parameters to perform tasks such as parameter configuration and human-machine interaction. The FPGA core 220 has a hardware motion planning engine 221, which is connected to the EtherCAT slave controller 230. The functions of the aforementioned command pre-reading module 110, delay modeling module 120, command generation module 130, compensation module 140, and synchronization output module 150 can be implemented by the hardware motion planning engine 221. The hardware motion planning engine 221 can perform parallel processing of multi-axis position commands based on a pipeline and exchange data with each driver 300 via the EtherCAT slave controller 230. It should be noted that the above hardware structure is only one implementation of the motion controller 100 and is not a limitation on the motion controller 100. The modules in the motion controller 100 can also be implemented by other devices with corresponding processing capabilities.
[0085] To facilitate understanding, the application of the above system will be further explained below with two application scenarios. In one application scenario, the above system is applied to a three-axis vertical milling machine. The user inputs motion commands containing straight line segments and circular arc segments into the motion controller 100. The command pre-reading module 110 pre-reads the motion commands into the trajectory buffer. The command generation module 130 performs cubic spline smoothing and velocity planning on adjacent motion command segments to generate position commands for each axis. The compensation module 140 applies advance to the position commands of each axis according to the corresponding delay parameters of each axis. The synchronization output module 150 synchronously outputs the compensated position commands to the drivers 300 of the three axes at the moment of synchronization signal triggering. In a machining test in this scenario, compared with the scheme without the above advance compensation, the surface roughness of the curved surface machining decreased from Ra 0.8μm to Ra 0.2μm, and the machining efficiency improved by approximately 25%.
[0086] In another application scenario, the above system is applied to a six-axis robot, which connects a vision sensor to six axis actuators 300 via an EtherCAT bus. The motion controller 100 receives the target pose provided by the vision sensor, performs inverse kinematics calculations to obtain the target values corresponding to each joint, and generates position commands for each axis using the command generation module 130. Simultaneously, the motion controller 100 compensates for subsequent position commands based on the torque or current feedback from each axis actuator 300 via a dynamic feedforward module, reducing positional deviations caused by load changes in different postures of the robotic arm. In a grasping test in this scenario, the average positioning accuracy was ±0.1mm, and the single grasping cycle time was reduced from approximately 1.5 seconds in related schemes to approximately 0.8 seconds.
[0087] It should be noted that the values in the two application scenarios above are test results obtained under the corresponding test conditions, and they may vary depending on the equipment, workpiece, parameter configuration and test conditions. They should not be construed as limiting the technical effect of this application.
[0088] The multi-axis synchronous motion control system based on EtherCAT bus provided in this embodiment is based on the same technical concept as the multi-axis synchronous motion control method based on EtherCAT bus provided in the first embodiment. The relevant technical details have been described in the first embodiment and will not be repeated in this embodiment. The relevant technical details in the first embodiment can also be applied to this embodiment.
[0089] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0090] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will also readily understand that the various embodiments of this application have different focuses, and for the sake of convenience and brevity, the same or similar parts may not be repeated in different embodiments. Therefore, parts not described or not described in detail in one embodiment can be referred to the descriptions in other embodiments.
[0091] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0092] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0093] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0094] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0095] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A multi-axis synchronous motion control method based on EtherCAT bus, applied to a motion controller, wherein the motion controller is connected to drivers of multiple axes via EtherCAT bus, characterized in that... The method includes: Acquire motion commands and pre-read the motion commands into the trajectory buffer; Distance frames are sent to the drivers of each axis respectively, and the corresponding delay parameters of each axis are obtained based on the response time of each driver. Within each EtherCAT communication cycle, position commands for each axis are generated based on the motion commands in the trajectory buffer; The advance amount of each axis is determined according to the corresponding delay parameters of each axis, and the position command of the corresponding axis is compensated according to the advance amount to obtain the compensated position command of each axis. At the moment the synchronization signal is triggered during the EtherCAT communication cycle, the corresponding compensated position command is synchronously output to each of the drivers.
2. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, The step of pre-reading the motion command into the trajectory buffer includes: The number of motion command segments that the trajectory buffer can store is determined as the buffer depth of the trajectory buffer; The motion commands are stored segment by segment into the trajectory buffer according to the buffer depth; When the number of motion command segments in the trajectory buffer is lower than the buffer depth, subsequent motion commands are read in advance to isolate the impact of EtherCAT bus communication fluctuations on the generation of position commands.
3. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, The step of generating position commands for each axis based on the motion commands in the trajectory buffer includes: Perform cubic spline smoothing on adjacent motion command segments in the trajectory buffer to obtain the smoothed trajectory; Based on the preset maximum acceleration and the rate of change of acceleration with respect to time, velocity planning is performed on the smoothed trajectory to obtain the position commands of each axis within the current EtherCAT communication cycle.
4. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, The step of sending ranging frames to each of the aforementioned drivers and obtaining the corresponding delay parameters for each axis based on the response time returned by each of the aforementioned drivers includes: During the initialization phase, the ranging frames are sent multiple times to each of the aforementioned drivers; Record the time of each driver's multiple response to the ranging frame; The inherent response delay of the axis is determined based on the statistical value of the time corresponding to the corresponding axis. Associate the inherent response delay of each axis with the corresponding axis identifier to obtain the corresponding delay parameter for each axis.
5. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, After compensating the position commands of the corresponding axes according to the advance amount to obtain the compensated position commands of each axis, the method further includes: Obtain the preset phase offset compensation amount for the corresponding axis; The phase offset compensation amount is used to perform phase compensation on the compensated position command of the axis to obtain the phase-compensated position command; The phase-compensated position command is used as the compensated position command for that axis to reduce the phase difference between the output signals of each axis.
6. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, The step of synchronously outputting the corresponding compensated position command to each driver at the trigger time of the synchronization signal in the EtherCAT communication cycle includes: Determine the speed feedforward value for each axis within the current EtherCAT communication cycle; At the moment the synchronization signal is triggered, the compensated position command and the speed feedforward value of the corresponding axis are synchronously output to the driver of the corresponding axis.
7. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, After generating the position commands for each axis, the process also includes: Obtain the torque or current feedback from each axis driver; The load change of the corresponding shaft is determined based on the torque or current. The feedforward compensation amount for the shaft is determined based on the load change. The feedforward compensation amount is used to compensate for subsequent position commands on the axis.
8. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, Also includes: Obtain the target position deviation output by the vision sensor; Convert the target position deviation into the position deviation of the corresponding axis; The position command of the corresponding axis is compensated based on the position deviation to obtain a position command that incorporates visual feedback.
9. The multi-axis synchronous motion control method based on EtherCAT bus as described in claim 1, characterized in that, Also includes: During each EtherCAT communication cycle, the tracking error of each axis is collected; Compare the following error of the corresponding axis with the reference error of that axis; When the change in the following error of the corresponding axis relative to the reference error exceeds a preset condition, a warning message for that axis is output.
10. A multi-axis synchronous motion control system based on EtherCAT bus, characterized in that, The motion controller includes a motion controller that is connected to drivers of multiple axes via an EtherCAT bus; the motion controller includes: The instruction pre-reading module is used to acquire motion instructions and pre-read the motion instructions into the trajectory buffer. The delay modeling module is used to send ranging frames to each of the drivers and obtain the corresponding delay parameters for each axis based on the response time of each driver. The instruction generation module is used to generate position instructions for each axis based on the motion instructions in the trajectory buffer during each EtherCAT communication cycle. The compensation module is used to determine the advance amount of each axis according to the corresponding delay parameters of each axis, and to compensate the position command of the corresponding axis according to the advance amount to obtain the compensated position command of each axis. The synchronization output module is used to synchronously output the corresponding compensated position command to each of the drivers at the time of the synchronization signal triggering of the EtherCAT communication cycle.