Ethercat-based multi-axis compliant interpolation synchronization method

By using EtherCAT's multi-axis compliant interpolation synchronization method and employing a cubic S-curve model to handle interpolation allowances, the problem of motor vibration during multi-axis manufacturing equipment operation on curved sections was solved, achieving higher cutting accuracy and speed.

CN117331347BActive Publication Date: 2026-05-29ZHEJIANG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV OF TECH
Filing Date
2023-10-11
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, when multi-axis manufacturing equipment is running on curved sections, the end interpolation cycle may have insufficient margin, leading to problems such as motor vibration and mechanical equipment vibration.

Method used

A multi-axis compliant interpolation synchronization method based on EtherCAT is adopted. By calculating the interpolation margin and using a simplified cubic S-curve model for margin distribution, the smoothness and synchronization of the interpolation cycle are ensured.

Benefits of technology

This solves the problem of insufficient interpolation margin at the end, improves cutting accuracy and running speed, reduces motor vibration, and ensures the smoothness and synchronization of the interpolation cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117331347B_ABST
    Figure CN117331347B_ABST
Patent Text Reader

Abstract

This invention relates to the field of EtherCAT bus control, and more particularly to a multi-axis compliant interpolation synchronization method based on EtherCAT. This invention calculates the maximum distribution quantity d. max The maximum distribution L during the increasing phase of the distribution is below. ac The maximum distribution L during the decreasing phase of the distribution de According to L ac +L de With l rem The invention determines the starting segment number N0, ending segment number N1, ending segment number N2, and total interpolation segment number N3 based on the magnitude of the distribution increase. It then calculates the required main axis distribution for the first N interpolation cycles and uses this calculated main axis distribution to calculate the slave axis distribution. This invention improves the speed smoothness of the cutting machine, reduces interpolation cycles while maintaining cutting accuracy, increases operating speed during intermediate interpolation cycles, and does not affect the vibration caused by corner speed changes at the transition points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This relates to the field of EtherCAT bus control, and in particular to a multi-axis compliant interpolation synchronization method based on EtherCAT. Background Technology

[0002] As industry competition intensifies, the market demand for multi-axis manufacturing equipment such as cutting machines, die-cutting machines, and engraving machines is increasing daily. With the rising demand for related products, the processing and manufacturing industry faces greater challenges, necessitating technological innovation to meet these market demands. In the industrial sector, EtherCAT (Ethernet Automation Technology) is a high-performance bus that offers excellent real-time high-speed communication in the field. EtherCAT is faster and has lower latency than traditional pulse communication, making it more suitable for applications requiring rapid response from multi-axis manufacturing equipment. EtherCAT network control facilitates centralized control and monitoring, significantly simplifying system wiring and debugging, and offering greater scalability. EtherCAT network slave nodes use dedicated control chips, while the master station uses a standard Ethernet controller. In the EtherCAT periodic synchronous position mode of the servo drive, the controller of this invention sends position information to the servo drive every 1ms, controlling the position information within a 1ms interpolation cycle.

[0003] SOEM is a simple EtherCAT master communication program. The SOEM protocol stack is developed in the portable C language, supporting mutual portability on common systems such as Windows and Linux. Furthermore, SOEM does not impose any strict design architecture, so it can be ported to embedded operating systems.

[0004] In the original technology, if the speed at the end point is 0 when running on a straight line segment between two points, there will be no jitter and the middle running smoothly, which can ensure that there is no residual value in the last interpolation cycle. However, if running on a curved segment, the distance left to travel in the last interpolation cycle may be less than one interpolation step in the acceleration or deceleration segment, which will cause the motor to jitter and thus cause the mechanical equipment to jitter. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by developing an algorithm based on EtherCAT that improves compliance by addressing the end-interpolation margin, and to propose a multi-axis compliant interpolation synchronization method based on EtherCAT.

[0006] To achieve the above objectives, this invention provides a multi-axis compliant interpolation synchronization method based on EtherCAT, comprising:

[0007] Calculate the total time for the straight section based on the total length of the spindle's straight section and the current feed rate. Then, calculate the ratio of the total time for the straight section to the interpolation cycle. When the ratio is a decimal, record the interpolation margin for the last interpolation cycle as l. rem ;

[0008] Given the maximum distribution d max According to the maximum distribution d max Calculate the maximum distribution L during the increasing phase of the distribution. ac The maximum distribution L during the decreasing phase of the distribution de Determine L ac +L de With l rem The size of L ac +L de >l rem Then recalculate the maximum distribution d. max And recalculate based on the maximum distribution d max Calculate the maximum distribution L during the increasing phase of the distribution. ac The maximum distribution L during the decreasing phase of the distribution de ;

[0009] According to L ac +L de With l rem The magnitude of the distribution is determined to identify the starting segment N0, the ending segment N1, the ending segment N2, and the total number of interpolation segments N3.

[0010] Based on the maximum distribution d max Calculate the number of segments starting to increase the distribution N0, the number of segments ending to increase the distribution N1, the number of segments ending the maximum distribution N2, and the total number of interpolation segments N3. Calculate the main axis distribution required for the first N interpolation cycles of the main axis and add the N main axis distributions to the main axis interpolation step size of the first N interpolation cycles respectively.

[0011] Calculate the slave axis distribution using the calculated master axis distribution, and add the N slave axis distributions to the slave axis interpolation step size of the first N interpolation cycles.

[0012] Furthermore, the maximum distribution L during the increasing distribution phase ac The maximum distribution L during the decreasing phase of the distribution de The calculation formula is as follows:

[0013]

[0014] Where, Δd ac Δd represents the increment during the increasing phase of the distribution. de This indicates the decrease in the distribution during the decreasing phase.

[0015] Furthermore, if L ac +L de >l rem Then recalculate the maximum distribution d. max Calculated according to the following formula:

[0016]

[0017] Where, Δd ac This represents the increment during the increasing phase of the distribution.

[0018] Furthermore, the statement based on L ac +L de With l rem The determination of the magnitude of the distribution determines the number of segments N0 at the beginning of the increasing distribution, the number of segments N1 at the end of the increasing distribution, the number of segments N2 at the end of the maximum distribution, and the total number of interpolation segments N3, including:

[0019] If l rem ≥L ac +L de Then, calculate N0, N1, N2, and N3 using the following formula:

[0020]

[0021]

[0022] Where ΔN1 represents the number of segments required for the distribution quantity to increase, ΔN3 represents the number of segments required for the distribution quantity to decrease, and ΔN2 represents the number of segments required for the maximum distribution quantity. max Indicates when l rem ≥L ac +L de The maximum distribution quantity at time Δd max This represents the maximum difference between adjacent distribution quantities, and L represents the total length of the straight line segment.

[0023] If L ac +L de >l rem If ΔN2 = 0, then calculate N0, N1, N2, and N3 using the following formulas:

[0024]

[0025]

[0026] Where, d max Indicates when L ac +L de >l rem The maximum distribution at that time.

[0027] Furthermore, the step of calculating the spindle distribution required for the first N interpolation cycles, and adding the N spindle distributions to the spindle interpolation step size for the first N interpolation cycles, includes the following steps:

[0028] Step 1: Create an array S[N] of size N. If l rem ≥L ac +L de If l rem <L ac +L de Then proceed to step 7;

[0029] Step 2: Let i=1, temp=0, decimal_temp=0;

[0030] Step 3: Determine the size of n relative to N0, N1, N2, and N3. If N0 < n ≤ N1, proceed to step 4; if N1 ≤ n ≤ N2, proceed to step 5; if N2 ≤ n ≤ N3, proceed to step 6; if n > N3, proceed to step 11.

[0031] Step 4: Calculation

[0032] Where S[i] represents the principal axis distribution of the i-th interpolation period, and n represents the i-th segment of N3 divided into N segments under the three sigmoid distributions, n=(i / N)*N3;

[0033] Add the decimal part of S[i] to decimal_temp. If decimal_temp ≥ 1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, then S[i] is rounded down.

[0034] temp = temp + S[i], i = i + 1, Repeat step 3;

[0035] Step 5: Calculate S[i] = d max (n-N1)+L ac -temp adds the decimal part of S[i] to decimal_temp. If decimal_temp ≥ 1, S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, S[i] is rounded down.

[0036] temp = temp + S[i], i = i + 1, Repeat step 3;

[0037] Step 6: Calculation Where L2=d max *(N2-N1)+L ac ;

[0038] Add the decimal part of S[i] to decimal_temp. If decimal_temp ≥ 1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, then S[i] is rounded down.

[0039] temp = temp + S[i], i = i + 1, Repeat step 3;

[0040] Step 7: Let i=1, temp=0, decimal_temp=0;

[0041] Step 8: Determine the size of n relative to N0, N1, and N3; if N0 < n ≤ N1, proceed to step 9; if N1 < n ≤ N3, proceed to step 10; if n > N3, proceed to step 11.

[0042] Step 9: Calculation Then, add the decimal part of S[i] to decimal_temp. If decimal_temp≥1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp<1, then S[i] is rounded down.

[0043] temp = temp + S[i], i = i + 1, Repeat step 8;

[0044] Step 10: Calculation Then, add the decimal part of S[i] to decimal_temp. If decimal_temp≥1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp<1, then S[i] is rounded down.

[0045] temp = temp + S[i], i = i + 1, Repeat step 8;

[0046] Step 11: Add the N spindle distribution values ​​to the spindle interpolation step size of the first N interpolation cycles.

[0047] Furthermore, the step of calculating the slave axis distribution using the calculated master axis distribution and adding the N slave axis distributions to the slave axis interpolation step size of the first N interpolation cycles includes:

[0048] Step 1: Create an array S′[N] of the same size as the principal axis S[N], and obtain the array S[N] and the principal axis interpolation margin l. rem and the interpolation margin l′ rem , let i=1, decimal_temp=0;

[0049] Step 2: Determine the size of i and N. If i ≤ N, proceed to step 3; if i > N, proceed to step 4.

[0050] Step 3: Calculation Add the decimal part of S′[i] to decimal_temp. If decimal_temp ≥ 1, then S′[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, then S′[i] is rounded down.

[0051] i = i + 1, repeat step 2;

[0052] Step 4: Add the N slave axis distribution values ​​in the calculated array S′[N] to the slave axis interpolation step size of the first N interpolation cycles.

[0053] Compared with the prior art, the significant advantages of this invention are: the algorithm can solve the problem that the position command pulse in the last interpolation cycle is less than one interpolation step, while reducing the interpolation by one interpolation cycle and ensuring cutting accuracy. At the same time, it increases the running speed in the middle interpolation cycle and does not affect the jitter caused by the change in corner speed at the connection between the front and back. Attached Figure Description

[0054] Figure 1 This is a flowchart of a multi-axis compliant interpolation synchronization method based on EtherCAT according to the present invention;

[0055] Figure 2 A schematic diagram of the motion trajectory for applying the multi-axis compliant interpolation synchronization method based on EtherCAT of this invention;

[0056] Figure 3 The number of interpolation pulses per interpolation cycle for the unprocessed X-axis;

[0057] Figure 4 The number of interpolation pulses per interpolation cycle for the unprocessed Y-axis;

[0058] Figure 5 The number of interpolation pulses per interpolation cycle for the X-axis processed by isosceles trapezoidal shape;

[0059] Figure 6 The number of interpolation pulses per interpolation cycle for the Y-axis processed by isosceles trapezoidal shape;

[0060] Figure 7This refers to the number of interpolation pulses per interpolation cycle on the X-axis processed by this invention.

[0061] Figure 8 This refers to the number of interpolation pulses per interpolation cycle on the Y-axis processed by this invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0063] The present invention provides a multi-axis compliant interpolation synchronization method based on EtherCAT, which can be applied to interpolating the x-axis and y-axis motion trajectories of multi-axis manufacturing equipment.

[0064] The application scope of this invention includes multi-axis manufacturing equipment, AC servo drive components, and control components. In this embodiment, the multi-axis manufacturing equipment includes x-axis and y-axis gantry frames and support platforms. This embodiment uses the x-axis and y-axis as examples for illustration, but it does not imply that the method protected by this invention is limited to two-axis control.

[0065] The AC servo motor operates in synchronous position mode, outputting position according to the pulse signals given by the controller, and outputting the corresponding photoelectric encoder values, angular velocity values, and torque values ​​of the servo drive. The controller section includes: a SOEMEtherCAT master control board, which includes a display module, an Ethernet control module, an SD card module, and a USB flash drive module. Users can operate the cutting machine and interact with it through the display module. The SD card module and USB flash drive module are used to store the graphic position information of the material to be cut. The master control board connects to the AC servo drive slaves via the Ethernet control module and a network cable. It is used to initialize the EtherCAT network, synchronize the master and slave clocks of the control board and the AC servo drive slaves, send position information to each AC servo drive slave, and receive reference clocks, angular velocity values, and position information from the AC servo drives.

[0066] like Figure 1 As shown, the controller records the initial position, end position, feed speed, and number of interpolation cycles for the straight line segment. In this embodiment, the interpolation cycle is 1ms. Taking a straight line on the machine tool plane as an example, based on the starting and ending coordinates of the line, the total length L of the straight line segment can be calculated as follows:

[0067]

[0068] In the above formula, x0, y0 are the coordinates of the starting point of the line; x N ,y N These are the coordinates of the endpoint of the line.

[0069] The time required for the linear trajectory along the x-axis and y-axis to move is t. 总 :

[0070]

[0071] In the formula, V is the current feed rate.

[0072] Based on the total time t 总 Given an interpolation period T = 1 ms, calculate the ratio M of the total time of the straight line segment to the interpolation period;

[0073]

[0074] In most cases, such as the acceleration and deceleration sections in a cutting machine curve, time t 总 It will not be an integer multiple of the interpolation period T, when t 总 When M is an integer multiple of the interpolation period T, and M is an integer, then interpolation margin processing is not required; interpolation is performed directly. 总 When M is not an integer multiple of the interpolation period T, it is a decimal. We can see that after rounding M, a small straight segment will remain, which is less than the interpolation period distance covered by the current feed speed. A significant difference between the last interpolation period and the previous one can cause motor vibration. Furthermore, the last interpolation period of a program segment may not be equal to the interpolation step size, requiring special handling. The interpolation margin of the last segment is denoted as l. rem After each interpolation cycle, a judgment is made: l rem <VT, when l rem When <VT, it can be determined that linear interpolation has entered the last interpolation cycle.

[0075] After determining that linear interpolation has entered the last interpolation cycle, there are generally two options for this last interpolation cycle: amortize the margin or leave the margin unchanged.

[0076] See Figure 2-8 When the margin is not processed in the last interpolation cycle, if the remaining length of the last interpolation cycle is small and differs greatly from the previous interpolation cycle (by multiples of 10), the distance traveled in the last interpolation cycle segment within 1ms will have a large difference compared to the previous interpolation step size and the first interpolation step size of the next connecting segment. This will cause the motor and machine tool to vibrate in the last interpolation cycle of the current segment.

[0077] When the margin is amortized for the last interpolation cycle, if the last interpolation cycle is large and the difference between it and the previous interpolation cycle is small, amortizing the first N interpolation cycles (N=M-1) will result in a large difference in the interpolation step size at the junction of the straight line segment before and the current straight line segment in the curve segment, and also a large difference in the interpolation step size at the junction of the straight line segment after and the current straight line segment in the curve segment. This will cause vibration of the motor and machine tool in the first and last interpolation cycles of the straight line segment.

[0078] To maximize machining accuracy and speed while satisfying acceleration and deceleration characteristics and achieving smooth speed distribution, this algorithm uses a continuously smooth S-shaped curve of acceleration as the model for interpolation margin distribution. Because traditional S-shaped speed control curves have seven segments, making the algorithm complex and cumbersome, and considering the computing power and memory resources of the master station control chip, this invention uses a simplified cubic S-shaped curve as the interpolation margin distribution model. This not only ensures continuity and smoothness in the interpolation margin distribution process but also facilitates implementation and improves efficiency.

[0079] The acceleration and deceleration process model based on a cubic S-curve is divided into three continuous stages:

[0080] During the acceleration phase t∈[T0,T1], the acceleration increases from 0 to its maximum and then decreases back to 0, while the velocity increases from 0 to its maximum.

[0081] During the uniform velocity phase t∈[T1,T2], the acceleration is 0, and the velocity value remains at its maximum value.

[0082] During the deceleration phase, t∈[T2,T3], the process of the deceleration phase is the reverse of that of the acceleration phase.

[0083] The following formulas for calculating velocity and displacement can be derived:

[0084] Formula for velocity versus time (vt):

[0085]

[0086] Displacement versus time (St) formula:

[0087]

[0088] Among them, the acceleration a during the acceleration phase ac Acceleration a during the deceleration phase de and maximum speed v max Set by the control system; normally, the maximum acceleration during acceleration is equal to the maximum acceleration during deceleration; v s and v e These are the initial speed and the final speed, respectively.

[0089] Because it is necessary to deal with lrem After performing the interpolation margin distribution, the (vt) and (St) formulas for the acceleration and deceleration processes of the three S-shaped curves are differentiated to obtain the (dn) and (Ln) formulas:

[0090] Formula for the distribution of each main axis segment and the number of segments (dn):

[0091]

[0092] Formula for total spindle distribution and number of segments (Ln):

[0093]

[0094] After differentiation, to avoid a smooth transition between the first and last interpolation cycles and the preceding and following line segments, d is defined as follows: s =d e =0,d s and d e These are the principal axis distribution values ​​for the first interpolation cycle and the last interpolation cycle, respectively. From this condition, we can obtain...

[0095] Formula for the distribution of each main axis segment and the number of segments (dn):

[0096]

[0097] Formula for total spindle distribution and number of segments (Ln):

[0098]

[0099] After deriving the formulas for the total principal axis distribution and the number of segments (Ln), the principal axis distribution for each segment can be obtained by d(n) = L(n) - L(n-1). In the subsequent steps, the principal axis distribution for each interpolation cycle is calculated by the formula d(n) = L(n) - L(n-1).

[0100] Among them, the increment Δd in the increasing stage of the distribution quantity ac The decrease in the distribution quantity during the decreasing stage is Δd de and the maximum distribution d max This is a fixed value set by the control system; typically, the increment during the increasing phase of the distribution is equal to the decrease during the decreasing phase, i.e., Δd. ac =Δd de After differentiation, the following conditions must be met:

[0101] L(N) = l rem

[0102] Let L be the maximum distribution during the increasing phase of the distribution. ac The maximum distribution during the decreasing phase is L.de Then there are several possibilities:

[0103] 1)L ac +L de ≤l rem The change process of the principal axis distribution is increasing—remaining unchanged—decreasing.

[0104] L ac and L de The calculation formula is as follows:

[0105]

[0106] Because of d s =d e =0; therefore, we can conclude that:

[0107]

[0108] 2)L ac +L de >l rem The change process of the principal axis distribution is increasing-decreasing.

[0109] Interpolation margin l rem Not enough, the principal axis distribution has not yet reached the given maximum distribution d. max This means the decreasing process begins and continues until the last segment. In this case, because the principal axis distribution cannot reach the maximum distribution, the maximum distribution needs to be recalculated.

[0110]

[0111] Because of d s =d e =0; therefore, we can conclude that:

[0112]

[0113] Furthermore, the formulas for calculating the number of segments required for an increasing distribution ΔN1, the number of segments required for a decreasing distribution ΔN3, and the number of segments required for the maximum distribution ΔN2 can be derived:

[0114]

[0115] Because of d s =d e =0; therefore, we can conclude that:

[0116]

[0117] Where, d max Indicates when l rem ≥L ac +L deThe maximum distribution quantity at time Δd max It represents the maximum phase difference between adjacent distribution quantities.

[0118] The number of segments N0 at the start of the increasing distribution, the number of segments N1 at the end of the increasing distribution (the number of segments at the start of the maximum distribution), the number of segments N2 at the end of the maximum distribution, and the total number of interpolation segments N3 are calculated using the following formulas:

[0119]

[0120] Based on the above formula derivation, the next step is to calculate the interpolation allowance for each segment of the spindle:

[0121] Step 1: Obtain parameters (interpolation margin l) rem Maximum distribution d max , represents the maximum phase difference Δd between adjacent distribution quantities. max and the number of interpolation segments N).

[0122] Step 2: Create an array S[N] of size N, and calculate the maximum distribution d input. max L below ac With L de And determine L ac +L de With l rem The size of l rem ≥L ac +L de If l rem <L ac +L de Then proceed to step 8.

[0123] Step 3: Calculate N1, N2, and N3, and let... (i=1), temp=0, decimal_temp=0.

[0124] Step 4: Determine the size of n relative to N0, N1, N2, and N3. If N0 < n ≤ N1, proceed to step 5; if N1 ≤ n ≤ N2, proceed to step 6; if N2 ≤ n ≤ N3, proceed to step 7; if n > N3, proceed to step 12.

[0125] Step 5: Calculate Next, let decimal_temp be added to the decimal part of S[i]. If decimal_temp ≥ 1, then S[i] is rounded down and incremented by 1, and decimal_temp is decremented by 1. If decimal_temp < 1, then S[i] is rounded down. temp = temp + S[i], i = i + 1. Repeat step 4.

[0126] Step 6: Calculate S[i] = d max (n-N1)+L ac The `-temp` directive adds the decimal part of `S[i]` to `decimal_temp`. If `decimal_temp` ≥ 1, `S[i]` is rounded down and incremented by 1, while `decimal_temp` is decremented by 1. If `decimal_temp` < 1, `S[i]` is rounded down. `temp = temp + S[i]`, `i = i + 1`. Repeat step 4.

[0127] Step 7: Where L2=d max *(N2-N1)+L ac Then, let decimal_temp be added to the decimal part of S[i]. If decimal_temp ≥ 1, then S[i] is rounded down and incremented by 1, and decimal_temp is decremented by 1. If decimal_temp < 1, then S[i] is rounded down. temp = temp + S[i], i = i + 1. Repeat step 4.

[0128] Step 8: Recalculate the maximum achievable distribution. At this time, ΔN2 = 0 and N1 = N2; calculate The new L ac and L de ;make (i=1), temp=0, decimal_temp=0.

[0129] Step 9: Determine the size of n relative to N0, N1, and N3; if N0 < n ≤ N1, proceed to step 10; if N1 < n ≤ N3, proceed to step 11; if n > N3, proceed to step 12.

[0130] Step 10: Next, let decimal_temp be added to the decimal part of S[i]. If decimal_temp ≥ 1, then S[i] is rounded down and incremented by 1, and decimal_temp is decremented by 1. If decimal_temp < 1, then S[i] is rounded down. temp = temp + S[i], i = i + 1. Repeat step 9.

[0131] Step 11: Next, let decimal_temp be added to the decimal part of S[i]. If decimal_temp ≥ 1, then S[i] is rounded down and incremented by 1, and decimal_temp is decremented by 1. If decimal_temp < 1, then S[i] is rounded down. temp = temp + S[i], i = i + 1. Repeat step 9.

[0132] Step 12: Add the N principal axis distribution values ​​in array S to the interpolation step size of the first N interpolation cycles respectively.

[0133] After calculating the corresponding spindle distribution, the next step is to process the interpolation allowance of the slave axis. Since the spindle distribution of each interpolation cycle of the spindle interpolation allowance has been obtained, the calculation of the slave axis can be performed directly using the calculated spindle distribution without using the cubic S-shaped model. The result obtained is not much different from the cubic S-shaped calculation and can achieve the synchronization effect.

[0134] Step 1: Create an array S′[N] of the same size as the principal axis S[N], and obtain the array S[N] and the principal axis interpolation margin l. rem and the interpolation margin l′ rem , let i=1, decimal_temp=0;

[0135] Step 2: Determine the size of i and N. If i ≤ N, proceed to step 3; if i > N, proceed to step 4.

[0136] Step 3: Calculate Add the decimal part of S′[i] to decimal_temp. If decimal_temp ≥ 1, then S′[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, then S′[i] is rounded down. i = i + 1, and repeat step 2.

[0137] Step 4: Add the N slave axis distribution values ​​in the calculated array S′[N] to the slave axis interpolation step size of the first N interpolation cycles.

[0138] This method calculates the slave axis without repeating the three-dimensional S-shaped distribution algorithm of the master axis, reducing time and space complexity, and also ensuring the synchronization step size during interpolation.

[0139] The above algorithm can improve the speed smoothness of EtherCAT multi-axis manufacturing equipment, reduce one interpolation cycle while achieving cutting accuracy, and increase the running speed in the middle interpolation cycle without affecting the vibration caused by the corner speed change at the connection point.

[0140] This invention applies to communication between a controller and a servo driver and includes the following steps:

[0141] Step 1: Initialize the Ethernet control chip on the master station control board. Configure the Ethernet control chip's pin mode and pin transmission speed corresponding to the master station control board. Enable the pin bus clock, enable network adaptive function, disable feedback, disable retransmission function, disable automatic PDA / CRC removal function, disable receiving all frames, enable receiving all broadcast frames, disable mixed-mode address filtering, use perfect address filtering for multicast addresses, and use perfect address filtering for unicast addresses. Enable DMA configuration, configure the DMA bus clock, enable discarding TCP / IP error frames, enable forwarding mode for received data, enable store-and-forward mode for transmitted data, disable forwarding error frames, configure the maximum burst length for DMA transmission to 32 ticks, and the maximum burst length for DMA reception to 32 ticks. Initialize the MAC address in the Ethernet MAC. Initialize the Tx and Rx descriptor lists: chain mode, and enable MAC and DMA transmission and reception.

[0142] Step 2: After the Ethernet control chip and DMA are initialized, SOEM binds the socket to the ifname (NIC name), obtains the number of slave nodes and binds PDO structures to the slaves, configures the slave station address registers of each AC servo drive, configures the mailbox channel parameters, configures the motion parameters of each AC servo drive, configures the distributed clock synchronization related registers, realizes clock synchronization between slaves, performs clock error estimation and performs error compensation sub-data frames for each servo AC drive before each data frame is sent, and sets the synchronization period and frame period error; the master station control board performs write operations on the status control registers of the AC servo drive slaves, so that the slave drive status changes to running status, and sends a data frame every 1ms.

[0143] Step 3: The master control board and the servo drive slave station synchronize their master and slave clocks.

[0144] Step 4: When the start cutting command is executed, the cutting machine performs trajectory planning and speed planning based on the target file position information, calculates the interpolation data (i.e., the calculated position data) and stores it in the buffer area. It periodically sends the calculated position information in the buffer area with a 1ms interpolation cycle to the slave servo driver in CSP mode every 1ms.

[0145] The embodiments described above are merely illustrative of one or more implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the scope of protection of the present invention. Therefore, the scope of protection of this invention should be determined by the appended claims.

Claims

1. A multi-axis compliant interpolation synchronization method based on EtherCAT, characterized in that, The EtherCAT-based multi-axis compliant interpolation synchronization method includes: Calculate the total time for the straight section based on the total length of the spindle's straight section and the current feed rate. Then, calculate the ratio of the total time for the straight section to the interpolation cycle. When the ratio is a decimal, record the interpolation margin for the last interpolation cycle as l. rem ; Given the maximum distribution d max According to the maximum distribution d max Calculate the maximum distribution L during the increasing phase of the distribution. ac The maximum distribution L during the decreasing phase of the distribution de Determine L ac +L de With l rem The size of L ac +L de >l rem Then recalculate the maximum distribution d. max And recalculate based on the maximum distribution d max Calculate the maximum distribution L during the increasing phase of the distribution. ac The maximum distribution L during the decreasing phase of the distribution de ; According to L ac +L de With l rem The magnitude of the distribution is determined to identify the starting segment N0, the ending segment N1, the ending segment N2, and the total number of interpolation segments N3. Based on the maximum distribution d max Calculate the number of segments starting to increase the distribution N0, the number of segments ending to increase the distribution N1, the number of segments ending the maximum distribution N2, and the total number of interpolation segments N3. Calculate the main axis distribution required for the first N interpolation cycles of the main axis and add the N main axis distributions to the main axis interpolation step size of the first N interpolation cycles respectively. Calculate the slave axis distribution using the calculated master axis distribution, and add the N slave axis distributions to the slave axis interpolation step size of the first N interpolation cycles.

2. The multi-axis compliant interpolation synchronization method based on EtherCAT according to claim 1, characterized in that, The maximum distribution L during the increasing phase of the distribution ac The maximum distribution L during the decreasing phase of the distribution de The calculation formula is as follows: Where, Δd ac Δd represents the increment during the increasing phase of the distribution. de This indicates the decrease in the distribution during the decreasing phase.

3. The multi-axis compliant interpolation synchronization method based on EtherCAT according to claim 1, characterized in that, If L ac +L de >l rem Then recalculate the maximum distribution d. max Calculated according to the following formula: Where, Δd ac This represents the increment during the increasing phase of the distribution.

4. The multi-axis compliant interpolation synchronization method based on EtherCAT according to claim 1, characterized in that, According to L ac +L de With l rem The determination of the magnitude of the distribution determines the number of segments N0 at the beginning of the increasing distribution, the number of segments N1 at the end of the increasing distribution, the number of segments N2 at the end of the maximum distribution, and the total number of interpolation segments N3. include: If l rem ≥L ac +L de Then, calculate N0, N1, N2, and N3 using the following formula: Where ΔN1 represents the number of segments required for the distribution quantity to increase, ΔN3 represents the number of segments required for the distribution quantity to decrease, and ΔN2 represents the number of segments required for the maximum distribution quantity. max Indicates when l rem ≥L ac +L de The maximum distribution quantity at time Δd max This represents the maximum difference between adjacent distribution quantities, and L represents the total length of the straight line segment. If L ac +L de >l rem If ΔN2 = 0, then calculate N0, N1, N2, and N3 using the following formulas: Where, d max Indicates when L ac +L de >l rem The maximum distribution at that time.

5. The multi-axis compliant interpolation synchronization method based on EtherCAT according to claim 4, characterized in that, The step of calculating the spindle distribution required for the first N interpolation cycles and adding the N spindle distributions to the spindle interpolation step size for the first N interpolation cycles includes the following steps: Step 1: Create an array S[N] of size N. If l rem ≥L ac +L de If l rem <L ac +L de Then proceed to step 7; Step 2: Let i=1, temp=0, decimal_temp=0; Step 3: Determine the size of n relative to N0, N1, N2, and N3. If N0 < n ≤ N1, proceed to step 4; if N1 ≤ n ≤ N2, proceed to step 5; if N2 ≤ n ≤ N3, proceed to step 6; if n > N3, proceed to step 11. Step 4: Calculation Where S[i] represents the principal axis distribution of the i-th interpolation period, and n represents the i-th segment of N3 divided into N segments under the three sigmoid distributions, n=(i / N)*N3; Add the decimal part of S[i] to decimal_temp. If decimal_temp ≥ 1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, then S[i] is rounded down. temp = temp + S[i], i = i + 1, Repeat step 3; Step 5: Calculate S[i] = d max (n-N1)+L ac -temp adds the decimal part of S[i] to decimal_temp. If decimal_temp ≥ 1, S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, S[i] is rounded down. temp = temp + S[i], i = i + 1, Repeat step 3; Step 6: Calculation Where L2=d max *(N2-N1)+L ac ; Add the decimal part of S[i] to decimal_temp. If decimal_temp ≥ 1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, then S[i] is rounded down. temp = temp + S[i], i = i + 1, Repeat step 3; Step 7: Let i=1, temp=0, decimal_temp=0; Step 8: Determine the size of n relative to N0, N1, and N3; if N0 < n ≤ N1, proceed to step 9; if N1 < n ≤ N3, proceed to step 10; if n > N3, proceed to step 11. Step 9: Calculation Then, add the decimal part of S[i] to decimal_temp. If decimal_temp≥1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp<1, then S[i] is rounded down. temp = temp + S[i], i = i + 1, Repeat step 8; Step 10: Calculation Then, add the decimal part of S[i] to decimal_temp. If decimal_temp≥1, then S[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp<1, then S[i] is rounded down. temp = temp + S[i], i = i + 1, Repeat step 8; Step 11: Add the N spindle distribution values ​​to the spindle interpolation step size of the first N interpolation cycles.

6. The multi-axis compliant interpolation synchronization method based on EtherCAT according to claim 5, characterized in that, The step of calculating the slave axis distribution using the calculated master axis distribution and adding the N slave axis distributions to the slave axis interpolation step size of the first N interpolation cycles includes: Step 1: Create an array S′[N] of the same size as the principal axis S[N], and obtain the array S[N] and the principal axis interpolation margin l. rem and the interpolation margin l r ′ em , let i=1, decimal_temp=0; Step 2: Determine the size of i and N. If i ≤ N, proceed to step 3; if i > N, proceed to step 4. Step 3: Calculation Add the decimal part of S′[i] to decimal_temp. If decimal_temp ≥ 1, then S′[i] is rounded down and 1 is added, and decimal_temp is subtracted by 1. If decimal_temp < 1, then S′[i] is rounded down. i = i + 1, repeat step 2; Step 4: Add the N slave axis distribution values ​​in the calculated array S′[N] to the slave axis interpolation step size of the first N interpolation cycles.