Control method for synchronization of pulse axis and EtherCAT periodic axis
By enabling EtherCat time synchronization functions and dynamic adjustment of the pulse signal through the synchronization control method of the pulse shaft and EtherCat cycle shaft, solve the problem of decreased time offset and synchronization accuracy in existing technologies, and achieve high -precision and flexibility multi -axis. Link control.
Patent Information
- Application Number
- CN202411495727.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-28
AI Technical Summary
In actual application, the existing synchronization control method of pulse axis and EtherCAT periodic axis may have a slight time offset due to factors such as network delay, hardware differences and environmental interference, which affects the accuracy and consistency of multi-axis linkage and is fixed. The synchronization cycle is not flexible enough in dynamically changing application scenarios and cannot be adjusted in real time, resulting in a decrease in synchronization accuracy.
By installing and connecting hardware devices, configure network parameters, enable EtherCat time synchronization functions to ensure that the time benchmark of all stations is consistent, and monitor the speed of the EtherCat cycle axis in real time, dynamically adjust the pulse signal The position error of the shaft is used to calculate the control signal of the PID control algorithm, and adjust the position and speed of the pulse shaft.
The synchronization accuracy of the pulse shaft and the Ethercat cycle shaft is improved, the system's adaptability and flexibility are enhanced, the accuracy and consistency of multi -axis linkage are ensured, the cumulative error is reduced, and the overall accuracy of the system is improved.
Smart Images

Figure CN119376234A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automation control technology, in particular to a control method for synchronizing a pulse axis with an EtherCAT periodic axis. Background Art
[0002] The synchronous control method of pulse axis and EtherCAT periodic axis is an advanced control technology developed in the field of modern industrial automation, which aims to solve the time synchronization problem between traditional pulse control axis and periodic axis based on EtherCAT bus. With the increasing complexity of industrial automation systems, multi-axis linkage and high-precision motion control have become the core requirements of many application scenarios. Traditional pulse control axis usually controls position through pulse signal, while periodic axis based on EtherCAT bus relies on real-time communication network to achieve high-precision time synchronization and data exchange.
[0003] In the existing synchronous control method of pulse axis and EtherCAT periodic axis, in actual application, due to factors such as network delay, hardware difference and environmental interference, there may still be a slight time offset, which will affect the accuracy and consistency of multi-axis linkage. Relying on a fixed synchronization cycle, this may not be flexible enough in some dynamically changing application scenarios, and cannot be adjusted in real time according to actual needs, resulting in reduced synchronization accuracy. Therefore, a control method for synchronizing a pulse axis with an EtherCAT periodic axis is provided. Summary of the invention
[0004] The purpose of the present invention is to provide a control method for synchronizing a pulse axis with an EtherCAT periodic axis, so as to solve the problem that in the existing control method for synchronizing a pulse axis with an EtherCAT periodic axis proposed in the above background technology, in actual applications, due to factors such as network delay, hardware differences and environmental interference, there may still be a slight time offset, which will affect the accuracy and consistency of multi-axis linkage. Relying on a fixed synchronization cycle, this may not be flexible enough in some dynamically changing application scenarios, and cannot be adjusted in real time according to actual needs, resulting in a decrease in synchronization accuracy.
[0005] To achieve the above object, the present invention aims to provide a control method for synchronizing a pulse axis with an EtherCAT periodic axis, comprising the following steps:
[0006] S1. Install and connect hardware devices and configure network parameters;
[0007] S2. Enable the EtherCAT time synchronization function to ensure that the time base of all slaves is consistent and verify the synchronization accuracy;
[0008] S3, setting the initial position and target position of the pulse axis, introducing the friction factor to calculate the moving distance in each control cycle, and generating the corresponding pulse signal;
[0009] S4, monitor the speed of the EtherCAT periodic axis in real time, calculate the target pulse frequency of the pulse axis, and dynamically adjust the pulse signal so that the pulse axis speed follows the periodic axis;
[0010] S5. Detect the position error of the pulse shaft, apply the PID control algorithm to calculate the control signal, and adjust the position and speed of the pulse shaft.
[0011] As a further improvement of the technical solution, in S1, the specific steps of installing and connecting hardware devices and configuring network parameters are:
[0012] S2.1. Select and install the EtherCAT master station, slave station, and pulse axis actuator;
[0013] S2.2. Use the configuration tool Beckhoff TwinCAT to set the network parameters of the EtherCAT master and slave.
[0014] S2.3. Use the configuration tool Beckhoff TwinCAT to configure the interface parameters of the pulse axis;
[0015] S2.4. Use the Ping command to verify whether the communication between the master station and the slave station is normal.
[0016] As a further improvement of the technical solution, in S2, the EtherCAT time synchronization function is enabled to ensure that the time bases of all slaves are consistent and the specific steps of verifying the synchronization accuracy are as follows:
[0017] S3.1. Use the distributed clock DC mechanism to enable the time synchronization function in the configuration software of the master station;
[0018] S3.2, monitor the time synchronization status of each slave station through the diagnostic tool Network Configuration Tool of the configuration software;
[0019] S3.3. Evaluate the initial time synchronization accuracy based on the monitoring results of S3.2;
[0020] S3.4. Verify and test the time synchronization effect.
[0021] As a further improvement of the technical solution, in S3.3, the specific expression for evaluating the initial time synchronization accuracy is:
[0022] Calculate the average time deviation: Calculate the average time deviation of all slaves
[0023]
[0024] in, represents the average time deviation of all slaves; N represents the number of slaves; Δt i Indicates the time deviation of all slave stations; i indicates the slave station number;
[0025] Calculate the standard deviation of the time deviation: Calculate the standard deviation of the time deviation σ Δt :
[0026]
[0027] Among them, σ Δt Indicates the standard deviation of the time deviation.
[0028] As a further improvement of the technical solution, in S3.4, the specific steps of verifying and testing the time synchronization effect are:
[0029] To perform a static test:
[0030] Under static conditions, that is, when the system is not performing any movement or tasks, the time synchronization status of each slave station is continuously monitored;
[0031] Record and analyze changes in time offset and synchronization error;
[0032] To perform dynamic testing:
[0033] Under dynamic conditions, that is, when the system performs a predetermined movement or task, the time synchronization status of each slave station is continuously monitored;
[0034] Record and analyze changes in timing offsets and synchronization errors, especially at high speeds or under high loads;
[0035] Long-term stability test:
[0036] Conduct long-term stability testing to continuously monitor system operation for hours or days to ensure the long-term stability of time synchronization;
[0037] Record and analyze time drift and synchronization errors in long-term operations.
[0038] As a further improvement of the technical solution, in S3, the specific steps of setting the initial position and target position of the pulse axis, calculating the moving distance in each control cycle, and generating the corresponding pulse signal are:
[0039] S4.1. Define the initial position P of the pulse axis in the master program start and the target position P target ;
[0040] S4.2, based on the initial position and the target position, and introducing the friction factor, calculate the distance that the pulse axis needs to move in each control cycle;
[0041] S4.3, calculating the number of pulses to be sent according to the moving distance and the pulse equivalent;
[0042] Among them, the number of pulses that need to be sent is specifically:
[0043]
[0044] Where N represents the number of pulses to be sent; P p Indicates pulse equivalent;
[0045] S4.4. Generate a corresponding number of pulse signals in each control cycle T and send them to the pulse axis through the digital output port.
[0046] As a further improvement of the technical solution, in S4.2, the specific steps of introducing the friction factor to calculate the distance the pulse axis needs to move in each control cycle are:
[0047] Calculate the distance the pulse axis needs to move in each control cycle:
[0048] ΔP=P target -P start ;
[0049] Considering that friction will be generated when the pulse shaft moves, the friction factor is introduced to calculate the distance the pulse shaft needs to move in each control cycle:
[0050]
[0051] Among them, ΔP * Indicates the distance the pulse axis needs to move in each control cycle after the friction factor is introduced; N cycles Indicates the number of control cycles required to reach the target position; f factor represents the friction factor.
[0052] As a further improvement of the technical solution, in S4, the specific steps of real-time monitoring the speed of the EtherCAT periodic axis, calculating the target pulse frequency of the pulse axis, and dynamically adjusting the pulse signal so that the pulse axis speed follows the periodic axis are:
[0053] S5.1. Read the speed feedback value V of the periodic axis through the EtherCAT network current ;
[0054] S5.2. Define the target speed V of the pulse axis in the master program target ;
[0055] S5.3, according to the target speed Vtarget , Pulse equivalent P p And the friction factor f introduced factor , calculate the required pulse frequency;
[0056] According to the target speed V target , Pulse equivalent P p Calculated pulse frequency:
[0057]
[0058] After introducing the friction factor:
[0059] F * =F+k(V target -V current )×(1+f factor );
[0060] Among them, F * represents the pulse frequency after the friction factor is introduced; k represents the gain coefficient of the response speed.
[0061] S5.4, according to the current speed V current Dynamically adjust the output frequency of the pulse generator so that the speed of the pulse axis gradually approaches the target speed.
[0062] As a further improvement of the technical solution, in S5, the specific steps of detecting the position error of the pulse shaft, applying the PID control algorithm to calculate the control signal, and adjusting the position and speed of the pulse shaft are:
[0063] S6.1. Read the current position P of the pulse axis through the EtherCAT network actual ;
[0064] S6.2, according to the target position P target and the current position P actual , calculate the position error e;
[0065] Among them, the position error e = P target -P actual ;
[0066] S6.3, define the ratio K of the PID controller in the master program p , integral K i and differential K d parameter;
[0067] S6.4, according to the position error e, PID parameters and the introduced friction factor f factor , calculate the control signal;
[0068] S6.5. Apply the calculated control signal to the pulse axis to adjust its position and speed.
[0069] As a further improvement of the technical solution, in S6.4, the specific steps of calculating the control signal are:
[0070] Calculate the control signal based on the position error e and PID parameters:
[0071]
[0072] Among them, u(t) represents the control signal; e(t) represents the current error; K p Represents proportional gain; K i Indicates the integral gain; K d represents the differential gain; Indicates the rate of change of error; e integral represents the integral of the error;
[0073] After introducing the friction factor:
[0074] e integral *=e integral +e×(1+f factor )×δ t ;
[0075]
[0076] Among them, e integral * represents the integral of the error after the friction factor is introduced; δ t Indicates the time interval of the control cycle; u(t) * Represents the control signal after the friction factor is introduced.
[0077] Compared with the prior art, the present invention has the following beneficial effects:
[0078] 1. In the control method of synchronizing the pulse axis with the EtherCAT periodic axis, the stability and reliability of the system are ensured through correct hardware connection and network parameter configuration. The distributed clock (DC) function ensures that the time base of all slaves is consistent, which improves the synchronization accuracy of the system. By setting the initial position and target position, the precise control of the pulse axis is ensured. The friction factor is introduced to consider the nonlinear characteristics of the mechanical system, which improves the accuracy of control.
[0079] 2. In the control method for synchronizing the pulse axis with the EtherCAT periodic axis, the pulse frequency of the pulse axis is dynamically adjusted according to the speed of the periodic axis, thereby improving the adaptability and flexibility of the system. By dynamically adjusting the pulse signal, it is ensured that the speed of the pulse axis can accurately follow the speed of the periodic axis. By detecting the position error and adjusting the control signal in real time, the cumulative error is reduced and the accuracy of the system is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 The figure is a flow chart of the overall method of the present invention. DETAILED DESCRIPTION
[0081] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0082] Example:
[0083] See also Figure 1 As shown, this embodiment provides a control method for synchronizing a pulse axis with an EtherCAT periodic axis, comprising the following steps:
[0084] S1. Install and connect hardware devices and configure network parameters;
[0085] In this example, the specific steps for installing and connecting hardware devices and configuring network parameters are as follows:
[0086] S2.1. Select and install the EtherCAT master station, slave station, and pulse axis actuator;
[0087] Among them, the EtherCAT master station can use PLC or motion controller; the slave station can use servo drive; the pulse axis actuator can use stepper motor or servo motor;
[0088] S2.2. Use the configuration tool Beckhoff TwinCAT to set the network parameters of the EtherCAT master and slave.
[0089] Specifically, the steps involved in setting the network parameters of the EtherCAT master and slave are:
[0090] Make sure Beckhoff TwinCAT or other applicable configuration tool is installed; create a new project in TwinCAT and import the required library files and device description files (EDS); add EtherCAT master and slave devices in "Device Configuration" and select the appropriate device models; assign fixed IP addresses to the master and slave and make sure they are in the same subnet; for example, set the master IP address to 192.168.1.10 and the slave IP address to 192.168.1.11; configure network parameters such as subnet mask (usually 255.255.255.0) and gateway address (usually the IP address of the router); save the network configuration and download it to the master and slave devices.
[0091] S2.3. Use the configuration tool Beckhoff TwinCAT to configure the interface parameters of the pulse axis;
[0092] Specifically, the steps involved in configuring the interface parameters of the pulse axis are:
[0093] Select the appropriate pulse interface type in the device properties, such as Pulse+Direction or Quadrature Encoder; set the pulse equivalent (PPU) in the "Pulse Parameters" tab, for example, each pulse represents 1 degree of rotation; set the minimum and maximum pulse frequencies of the pulse axis, for example, the minimum pulse frequency is 10Hz and the maximum pulse frequency is 10kHz; specify the pin and level of the direction signal, for example, a high level indicates forward direction and a low level indicates reverse direction; select the pulse output mode, such as single pulse mode or double pulse mode; specify the high and low level voltage values of the pulse signal, for example, a high level is 5V and a low level is 0V; set the error handling method, such as stopping output, sending an alarm signal, etc.; save the interface parameter configuration of the pulse axis and download it to the slave device.
[0094] S2.4. Use the Ping command to verify whether the communication between the master station and the slave station is normal.
[0095] Specifically, the steps involved in using the Ping command to verify whether the communication between the master station and the slave station is normal are:
[0096] Make sure all devices are connected to the same network and the network cables are connected correctly and not damaged; open a command prompt or terminal on the master computer; enter ping 192.168.1.11 (assuming the slave IP address is 192.168.1.11) to verify that the communication between the master and the slave is normal. Make sure the slave can respond to the Ping request correctly, displaying a message similar to "Reply from192.168.1.11: bytes=32 time<1ms TTL=128".
[0097] S2. Enable the EtherCAT time synchronization function to ensure that the time base of all slaves is consistent and verify the synchronization accuracy;
[0098] In this example, the specific steps to enable the EtherCAT time synchronization function, ensure that the time base of all slaves is consistent, and verify the synchronization accuracy are as follows:
[0099] S3.1. Use the distributed clock DC mechanism to enable the time synchronization function in the configuration software of the master station;
[0100] Specifically, the Distributed Clock (DC) mechanism is an important function in the EtherCAT protocol, which is used to ensure that the time base of all slave devices in the network is consistent. Through the distributed clock mechanism, the master station can send accurate timestamps, and the slave stations adjust their own clocks according to these timestamps, thereby achieving time synchronization for the entire network.
[0101] S3.2, monitor the time synchronization status of each slave station through the diagnostic tool Network Configuration Tool of the configuration software;
[0102] Specifically, the Network Configuration Tool is a software tool for configuring, managing, and monitoring EtherCAT networks;
[0103] The usage is:
[0104] Launch the Network Configuration Tool:
[0105] Open the master configuration software, such as TwinCAT or Sysmac Studio, find and start the Network Configuration Tool.
[0106] Connect your device:
[0107] Make sure the master and all slave devices are properly connected to the EtherCAT network.
[0108] Select the correct network interface in the Network Configuration Tool and connect to the master device.
[0109] Configure network parameters:
[0110] In the "Network Configuration" tab, set the basic parameters of the EtherCAT network, such as baud rate, network topology, etc.
[0111] To enable the distributed clock feature:
[0112] Find the "Time Synchronization" or "Distributed Clock" option in the master station configuration interface and select the "Enable Distributed Clock (DC)" function.
[0113] Set the time synchronization period, usually between 1ms and 10ms. The specific value depends on application requirements.
[0114] Monitor time synchronization status:
[0115] In the Device List, select a slave device to view its detailed information.
[0116] In Device Properties, select the Distributed Clock tab to view detailed information such as Time Offset and Synchronization Error.
[0117] Record and analyze data:
[0118] Use the logging function of the Network Configuration Tool to log the time synchronization data of each slave station.
[0119] Analyze the recorded data to ensure that the time offset and synchronization errors are within acceptable limits.
[0120] S3.3. Evaluate the initial time synchronization accuracy based on the monitoring results of S3.2;
[0121] In this example, the specific expression for evaluating the initial time synchronization accuracy is:
[0122] Calculate the average time deviation: Calculate the average time deviation of all slaves
[0123]
[0124] in, represents the average time deviation of all slaves; N represents the number of slaves; Δti Indicates the time deviation of all slave stations; i indicates the slave station number;
[0125] Calculate the standard deviation of the time deviation: Calculate the standard deviation of the time deviation σ Δt :
[0126]
[0127] Among them, σ Δt Indicates the standard deviation of the time deviation.
[0128] Specifically, by calculating the average and standard deviation of the time deviations of all slaves, the initial accuracy of time synchronization can be quantified. Specifically, the average time deviation reflects the overall deviation level of time synchronization, while the standard deviation reflects the degree of dispersion of the time deviation. These two indicators help identify potential synchronization problems and provide a basis for subsequent optimization and adjustment. Through these evaluations, it can be ensured that time synchronization has reached the expected accuracy requirements before the system is officially put into operation.
[0129] S3.4. Verify and test the time synchronization effect.
[0130] In this example, the specific steps to verify and test the time synchronization effect are as follows:
[0131] To perform a static test:
[0132] Under static conditions, that is, when the system is not performing any movement or tasks, the time synchronization status of each slave station is continuously monitored;
[0133] Record and analyze changes in time offset and synchronization error;
[0134] To perform dynamic testing:
[0135] Under dynamic conditions, that is, when the system performs a predetermined movement or task, the time synchronization status of each slave station is continuously monitored;
[0136] Record and analyze changes in timing offsets and synchronization errors, especially at high speeds or under high loads;
[0137] Long-term stability test:
[0138] Conduct long-term stability testing to continuously monitor system operation for hours or days to ensure the long-term stability of time synchronization;
[0139] Record and analyze time drift and synchronization errors in long-term operations.
[0140] Specifically, through static testing, dynamic testing, and long-term stability testing, the performance of time synchronization under different conditions can be fully evaluated. Static testing ensures the stability of the system's time synchronization under no-load conditions; dynamic testing evaluates the system's time synchronization accuracy when performing predetermined movements or tasks, especially under high-speed movements or high-load conditions; long-term stability testing verifies the system's time synchronization performance during long-term operation to ensure the long-term reliability of the system. These test steps help to discover and solve potential problems, optimize system parameters, and ultimately achieve high-precision synchronous control of pulse axes and EtherCAT periodic axes.
[0141] S3, setting the initial position and target position of the pulse axis, introducing the friction factor to calculate the moving distance in each control cycle, and generating the corresponding pulse signal;
[0142] In this example, the specific steps of setting the initial position and target position of the pulse axis, calculating the moving distance in each control cycle, and generating the corresponding pulse signal are as follows:
[0143] S4.1. Define the initial position P of the pulse axis in the master program start and the target position P target ;
[0144] S4.2, based on the initial position and the target position, and introducing the friction factor, calculate the distance that the pulse axis needs to move in each control cycle;
[0145] In this example, the specific steps of introducing the friction factor to calculate the distance the pulse axis needs to move in each control cycle are:
[0146] Calculate the distance the pulse axis needs to move in each control cycle:
[0147] ΔP=P target -P start ;
[0148] Considering that friction will be generated when the pulse shaft moves, the friction factor is introduced to calculate the distance the pulse shaft needs to move in each control cycle:
[0149]
[0150] Among them, ΔP * Indicates the distance the pulse axis needs to move in each control cycle after the friction factor is introduced; N cycles Indicates the number of control cycles required to reach the target position; f factor represents the friction factor.
[0151] Specifically, the implementation steps are:
[0152] def calculate_movement_distance(start_position,target_position,cycles,friction_factor):
[0153] delta_p=(target_position-start_position) / cycles*(1+friction_factor)
[0154] return delta_p
[0155] #Example call
[0156] start_position=0#initial position
[0157] target_position=100#target position
[0158] cycles=100#Number of control cycles required to achieve the target
[0159] friction_factor=0.1#friction factor
[0160] delta_p=calculate_movement_distance(start_position,target_position,cycles,friction_factor)
[0161] print(f"The distance to be moved in each cycle: {delta_p}")
[0162] S4.3, calculating the number of pulses to be sent according to the moving distance and the pulse equivalent;
[0163] Among them, the number of pulses that need to be sent is specifically:
[0164]
[0165] Where N represents the number of pulses to be sent; P p Indicates pulse equivalent;
[0166] S4.4. Generate a corresponding number of pulse signals in each control cycle T and send them to the pulse axis through the digital output port.
[0167] S4, monitor the speed of the EtherCAT periodic axis in real time, calculate the target pulse frequency of the pulse axis, and dynamically adjust the pulse signal so that the pulse axis speed follows the periodic axis;
[0168] In this example, the specific steps for real-time monitoring of the speed of the EtherCAT periodic axis, calculating the target pulse frequency of the pulse axis, and dynamically adjusting the pulse signal so that the pulse axis speed follows the periodic axis are as follows:
[0169] S5.1. Read the speed feedback value V of the periodic axis through the EtherCAT network current ;
[0170] S5.2. Define the target speed V of the pulse axis in the master program target ;
[0171] S5.3, according to the target speed V target , Pulse equivalent P p And the friction factor f introduced factor , calculate the required pulse frequency;
[0172] According to the target speed V target , Pulse equivalent P p Calculated pulse frequency:
[0173]
[0174] After introducing the friction factor:
[0175] F * =F+k(V target -V current )×(1+f factor );
[0176] Among them, F * represents the pulse frequency after the friction factor is introduced; k represents the gain coefficient of the response speed;
[0177] Specifically, the implementation steps are:
[0178] def adjust_pulse_frequency(current_speed,target_speed,friction_factor,gain):
[0179] new_frequency=current_speed+gain*(target_speed-current_speed)*(1+friction_factor)
[0180] return new_frequency
[0181] #Example call
[0182] current_speed=50#Current speed
[0183] target_speed = 100 # target speed
[0184] friction_factor=0.1#friction factor
[0185] gain=0.5#Gain coefficient
[0186] new_frequency=adjust_pulse_frequency(current_speed,target_speed,friction_factor,gain)
[0187] print(f"New pulse frequency:{new_frequency}")
[0188] S5.4, according to the current speed V current Dynamically adjust the output frequency of the pulse generator so that the speed of the pulse axis gradually approaches the target speed.
[0189] S5. Detect the position error of the pulse shaft, apply the PID control algorithm to calculate the control signal, and adjust the position and speed of the pulse shaft.
[0190] In this example, the specific steps of detecting the position error of the pulse shaft, applying the PID control algorithm to calculate the control signal, and adjusting the position and speed of the pulse shaft are as follows:
[0191] S6.1. Read the current position of the pulse axis through the EtherCAT network actual ;
[0192] S6.2, according to the target position P target and the current position P actual , calculate the position error e;
[0193] Among them, the position error e = P target -P actual ;
[0194] S6.3, define the ratio K of the PID controller in the master program p , integral K i and differential K d parameter;
[0195] S6.4, according to the position error e, PID parameters and the introduced friction factor f factor , calculate the control signal;
[0196] In this example, the specific steps of calculating the control signal are:
[0197] Calculate the control signal based on the position error e and PID parameters:
[0198]
[0199] Among them, u(t) represents the control signal; e(t) represents the current error; K p Represents proportional gain; K i Indicates the integral gain; K d represents the differential gain; Indicates the rate of change of error; e integral represents the integral of the error;
[0200] After introducing the friction factor:
[0201] e integral *=e integral +e×(1+f factor )×δ t ;
[0202]
[0203] Among them, e integral * represents the integral of the error after the friction factor is introduced; δ t Indicates the time interval of the control cycle; u(t) * Represents the control signal after the friction factor is introduced.
[0204] Specifically, the implementation steps are:
[0205]
[0206]
[0207] S6.5. Apply the calculated control signal to the pulse axis to adjust its position and speed.
[0208] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only preferred examples of the present invention, and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. A control method for synchronizing a pulse axis with an EtherCAT periodic axis, characterized in that: The following steps are involved: S1. Install and connect hardware devices and configure network parameters; S2. Enable the EtherCAT time synchronization function and verify the synchronization accuracy; S3, setting the initial position and target position of the pulse axis, introducing the friction factor to calculate the moving distance in each control cycle, and generating the corresponding pulse signal; S4, monitor the speed of the EtherCAT periodic axis in real time, calculate the target pulse frequency of the pulse axis, and dynamically adjust the pulse signal so that the pulse axis speed follows the periodic axis; S5. Detect the position error of the pulse shaft, apply the PID control algorithm to calculate the control signal, and adjust the position and speed of the pulse shaft.
2. The control method for synchronizing a pulse axis with an EtherCAT periodic axis according to claim 1, characterized in that: In S1, the specific steps of installing and connecting hardware devices and configuring network parameters are as follows: S2.
1. Select and install the EtherCAT master station, slave station, and pulse axis actuator; S2.
2. Use the configuration tool Beckhoff TwinCAT to set the network parameters of the EtherCAT master and slave. S2.
3. Use the configuration tool Beckhoff TwinCAT to configure the interface parameters of the pulse axis; S2.
4. Use the Ping command to verify whether the communication between the master station and the slave station is normal.
3. The control method for synchronization of a pulse axis and an EtherCAT periodic axis according to claim 1, characterized in that: In S2, the EtherCAT time synchronization function is enabled to ensure that the time base of all slaves is consistent and the specific steps for verifying the synchronization accuracy are as follows: S3.
1. Use the distributed clock DC mechanism to enable the time synchronization function in the configuration software of the master station; S3.2, monitor the time synchronization status of each slave station through the diagnostic tool Network Configuration Tool of the configuration software; S3.
3. Evaluate the initial time synchronization accuracy based on the monitoring results of S3.2; S3.
4. Verify and test the time synchronization effect.
4. The control method for synchronizing a pulse axis with an EtherCAT periodic axis according to claim 3, characterized in that: In S3.3, the specific expression for evaluating the initial time synchronization accuracy is: Calculate the average time deviation: Calculate the average time deviation of all slaves in, represents the average time deviation of all slaves; N represents the number of slaves; Δt i Indicates the time deviation of all slave stations; i indicates the slave station number; Calculate the standard deviation of the time deviation: Calculate the standard deviation of the time deviation σ Δt : Among them, σ Δt Indicates the standard deviation of the time deviation.
5. The control method for synchronization of a pulse axis and an EtherCAT periodic axis according to claim 3, characterized in that: In S3.4, the specific steps for verifying and testing the time synchronization effect are: To perform a static test: Under static conditions, that is, when the system is not performing any movement or tasks, the time synchronization status of each slave station is continuously monitored; Record and analyze changes in time offset and synchronization error; To perform dynamic testing: Under dynamic conditions, that is, when the system performs a predetermined movement or task, the time synchronization status of each slave station is continuously monitored; Record and analyze changes in timing offsets and synchronization errors, especially at high speeds or under high loads; Long-term stability test: Conduct long-term stability testing to continuously monitor system operation for hours or days to ensure the long-term stability of time synchronization; Record and analyze time drift and synchronization errors in long-term operations.
6. The control method for synchronization of a pulse axis and an EtherCAT periodic axis according to claim 1, characterized in that: In S3, the specific steps of setting the initial position and target position of the pulse axis, calculating the moving distance in each control cycle, and generating the corresponding pulse signal are as follows: S4.
1. Define the initial position P of the pulse axis in the master program start and the target position P targte ; S4.2, based on the initial position and the target position, and introducing the friction factor, calculate the distance that the pulse axis needs to move in each control cycle; S4.3, calculating the number of pulses to be sent according to the moving distance and the pulse equivalent; Among them, the number of pulses that need to be sent is specifically: Where N represents the number of pulses to be sent; P p Indicates pulse equivalent; S4.
4. Generate a corresponding number of pulse signals in each control cycle T and send them to the pulse axis through the digital output port.
7. The control method for synchronization of a pulse axis and an EtherCAT periodic axis according to claim 6, characterized in that: In S4.2, the specific steps of introducing the friction factor to calculate the distance the pulse axis needs to move in each control cycle are: Calculate the distance the pulse axis needs to move in each control cycle: ΔP=P target -P start ; Considering that friction will be generated when the pulse shaft moves, the friction factor is introduced to calculate the distance the pulse shaft needs to move in each control cycle: Among them, ΔP * Indicates the distance the pulse axis needs to move in each control cycle after the friction factor is introduced; N cycles Indicates the number of control cycles required to reach the target position; f factor represents the friction factor.
8. The control method for synchronization of a pulse axis and an EtherCAT periodic axis according to claim 1, characterized in that: In S4, the specific steps of real-time monitoring the speed of the EtherCAT periodic axis, calculating the target pulse frequency of the pulse axis, and dynamically adjusting the pulse signal so that the pulse axis speed follows the periodic axis are: S5.
1. Read the speed feedback value V of the periodic axis through the EtherCAT network current ; S5.
2. Define the target speed V of the pulse axis in the master program target ; S5.3, according to the target speed V target , Pulse equivalent P p and the friction factor f factor , calculate the required pulse frequency; According to the target speed V target , Pulse equivalent P p Calculated pulse frequency: After introducing the friction factor: F * =F+k(V target -V current )×(1+f factor ); Among them, F * represents the pulse frequency after the friction factor is introduced; k represents the gain coefficient of the response speed; S5.4, according to the current speed V current Dynamically adjust the output frequency of the pulse generator so that the speed of the pulse axis gradually approaches the target speed.
9. The control method for synchronization of a pulse axis and an EtherCAT periodic axis according to claim 1, characterized in that: In S5, the specific steps of detecting the position error of the pulse shaft, applying the PID control algorithm to calculate the control signal, and adjusting the position and speed of the pulse shaft are: S6.
1. Read the current position P of the pulse axis through the EtherCAT network actual ; S6.2, according to the target position P target and the current position P actual , calculate the position error e; Among them, the position error e = P target -P actual ; S6.3, define the ratio K of the PID controller in the master program p , integral K i and differential K d parameter; S6.4, according to the position error e, PID parameters and the introduced friction factor f factor , calculate the control signal; S6.
5. Apply the calculated control signal to the pulse axis to adjust its position and speed.
10. The control method for synchronization of a pulse axis and an EtherCAT periodic axis according to claim 1, characterized in that: In S6.4, the specific steps of calculating the control signal are: Calculate the control signal based on the position error e and PID parameters: Among them, u(t) represents the control signal; e(t) represents the current error; K p Represents proportional gain; K i Indicates the integral gain; K d represents the differential gain; Indicates the rate of change of error; e integral represents the integral of the error; After introducing the friction factor: And integral * =and integral +e×(1+f factor )×δ t ; Among them, e intergral * represents the integral of the error after the friction factor is introduced; δ t Indicates the time interval of the control cycle; u(t) * Represents the control signal after the friction factor is introduced.