Double-shaft servo drive motor control device and method based on EtherCat communication
Through the dual-axis servo drive motor control device based on EtherCat communication, the real-time communication and signal conditioning functions of the microcontroller and network transformer, combined with the dual-axis synchronous control algorithm, the response delay and parameter inconsistent of the dual-axis servo drive in synchronization control are solved, and high-precision synchronous control and stable operation are achieved.
Patent Information
- Application Number
- CN202510036997.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-22
AI Technical Summary
The existing dual-axis servo drivers have problems with response delay and inconsistent parameters in the dual-axis synchronization control, which makes it difficult to achieve synchronization accuracy, especially when the performance is degraded or failure occurs during long continuous operation.
The dual-axis servo drive motor control device based on EtherCat communication is adopted, and the real-time communication between the EtherCat master station and the microcontroller is achieved through the network transformer's signal conditioning and isolation function to achieve high-precision synchronous control. The microcontroller collects the encoder feedback information, combines the dual-axis synchronization control algorithm, dynamically adjusts the operating parameters of the servo motor, and monitors the operating status of the servo motor in real time through the status feedback output.
It improves the operating stability and synchronization accuracy of the dual-axis servo motor under complex operating conditions, enhances the safety and abnormal detection capabilities of the system, improves the operating efficiency and flexibility, and significantly improves the reliability and stability of the system.
Smart Images

Figure CN119865083A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dual-axis servo drive control based on EtherCat communication, and in particular to a dual-axis servo drive motor control device and method based on EtherCat communication. Background Art
[0002] Servo drive technology plays a vital role in the field of modern industrial automation. As the manufacturing industry continues to increase its requirements for production efficiency and product quality, high-performance, high-reliability servo drive systems have become the first choice for many companies. In particular, for equipment that requires precise control of multi-axis linkage, such as CNC machine tools and robots, dual-axis servo drives are more widely used. These drives not only need to have high-speed data processing capabilities, but also need to be able to achieve high-precision position control and real-time fault detection functions to ensure stable operation and efficient operation of the system.
[0003] However, the existing dual-axis servo drives still have some shortcomings, especially in dual-axis synchronous control. Although some drives have adopted more complex synchronous control algorithms, in actual applications, it is still difficult to achieve ideal synchronization accuracy due to certain response delays or parameter inconsistencies between the axes. Especially in the case of long-term continuous operation, these problems may gradually accumulate, causing the dual-axis servo motor to degrade in performance or even fail. Summary of the invention
[0004] In order to ensure the operating stability of a dual-axis servo motor under complex working conditions, the present application provides a dual-axis servo drive motor control device and method based on EtherCat communication.
[0005] The above-mentioned invention objective of the present application is achieved through the following technical solutions: A dual-axis servo drive motor control device based on EtherCat communication, the dual-axis servo drive motor control device based on EtherCat communication comprises an EtherCat master station, a network port, a network transformer, a microcontroller, a first IPM module, a second IPM module, a first servo motor, a second servo motor, a first encoder and a second encoder, the EtherCat master station is connected to the network transformer through the network port, the output end of the network transformer is connected to the input end of the microcontroller, the first output end of the microcontroller is connected to the input end of the first IPM module, the output end of the first IPM module is connected to the first servo motor, the output end of the first servo motor is connected to the first encoder, the output end of the first encoder is connected to the input end of the microcontroller, the second output end of the microcontroller is connected to the input end of the second IPM module, the output end of the second IPM module is connected to the second servo motor, the output end of the second servo motor is connected to the second encoder, the output end of the second encoder is connected to the input end of the microcontroller, and the state feedback output end of the microcontroller is connected to the EtherCat master station through the network port.
[0006] By adopting the above technical solution, through the real-time communication between the EtherCat master station and the microcontroller, combined with the signal conditioning and isolation function of the network transformer, the stability and anti-interference ability of the communication signal can be effectively improved, thereby ensuring the reliable operation of the system in a complex industrial environment. The feedback information of the first encoder and the second encoder is collected by the microcontroller and combined with the dual-axis synchronous control algorithm, the operating parameters of the first servo motor and the second servo motor can be dynamically adjusted, thereby realizing high-precision synchronous control of the dual-axis servo motor. The operating information of the servo motor is transmitted to the EtherCat master station in real time through the state feedback output terminal of the microcontroller, which can realize the servo motor. Real-time monitoring of the operating status can improve the safety and abnormality detection capability of the system. The first servo motor and the second servo motor are driven respectively by the first IPM module and the second IPM module, which can effectively realize the independent control of the dual-axis servo, thereby improving the flexibility and operating efficiency of the system. Through the introduction of dual closed-loop control, combined with the position information and speed information fed back by the encoder in real time, the target operating parameters can be further optimized, thereby improving the dynamic response performance and positioning accuracy of the servo motor. By comparing the abnormal state detection module with the preset abnormal threshold, the operating abnormality of the servo motor can be quickly identified and protection operations can be performed, thereby significantly improving the reliability and stability of the system.
[0007] In a preferred example, the present application can be further configured as follows: the dual-axis servo drive motor control device based on EtherCat communication also includes: when the EtherCat master station sends control information to the network port, the microcontroller calculates the first target operating parameter information and the second target operating parameter information according to the control information, combined with the first servo motor feedback information fed back by the first encoder and the second servo motor feedback information fed back by the second encoder, respectively; the microcontroller generates the first operating parameter information after synchronization optimization according to the first target operating parameter information, and outputs the first operating parameter information after synchronization optimization to the first IPM module; the first IPM module calculates the first target operating parameter information according to the first target operating parameter information; The first operating parameter information generates a first drive signal, and the first drive signal is used to drive the first servo motor to operate. The microcontroller generates the second operating parameter information after synchronization optimization according to the second target operating parameter information, and outputs the second operating parameter information after synchronization optimization to the second IPM module. The second IPM module generates a second drive signal according to the second operating parameter information after synchronization optimization, and drives the second servo motor to operate through the second drive signal. During the operation of the servo motor, the microcontroller simultaneously feeds back the first servo motor operating information and the second servo motor operating information to the EtherCat master station for real-time monitoring of the operating status of the first servo motor and the second servo motor.
[0008] By adopting the above technical solution, the microcontroller combines the first servo motor feedback information fed back by the first encoder and the second servo motor feedback information fed back by the second encoder, and calculates the first target operating parameter information and the second target operating parameter information according to the control information, so as to realize precise control of the first servo motor and the second servo motor, thereby ensuring the optimization of the operating parameters and the stability of the operating state. The first drive signal and the second drive signal generated by the synchronously optimized operating parameter information can realize high-precision motion control in the process of driving the servo motor to operate, further improving the synchronization and dynamic response performance of the system. The operating information of the servo motor is fed back to the EtherCat master station in real time through the microcontroller, so that the operating state of the servo motor can be monitored in real time, which is convenient for timely identification of abnormal conditions in operation and rapid processing, thereby improving the safety and reliability of the entire system. By combining dual-axis independent control with synchronous optimization, it is possible to effectively cope with load changes and task switching requirements in complex industrial scenarios, thereby improving the operating efficiency and applicability of the dual-axis servo system.
[0009] In a preferred example, the present application can be further configured as follows: the dual-axis servo drive motor control method based on EtherCat communication includes: Acquire the control information, and based on the control information, collect feedback information of the first servo motor and feedback information of the second servo motor; According to the control information, combined with the feedback information of the first servo motor and the feedback information of the second servo motor, the first target operating parameter information and the second target operating parameter information are calculated respectively; Based on the first target operating parameter information and the second target operating parameter information, the relative position information and the relative speed information between the first servo motor and the second servo motor are analyzed by a dual-axis synchronous control algorithm to calculate a dynamic compensation amount; According to the dynamic compensation amount, synchronously optimizing the first target operating parameter information and the second target operating parameter information to generate the synchronously optimized first operating parameter information and the synchronously optimized second operating parameter information; Generate the first drive signal according to the first operating parameter information after the synchronous optimization, and drive the operation of the first servo motor based on the first drive signal; generate the second drive signal according to the second operating parameter information after the synchronous optimization, and drive the operation of the second servo motor based on the second drive signal; During the operation of the servo motor, the first servo motor operation information and the second servo motor operation information are acquired in real time, and the first servo motor operation information and the second servo motor operation information are fed back to the EtherCat master station at the same time.
[0010] By adopting the above technical solution, accurate monitoring and dynamic adjustment of the operating status of the first servo motor and the second servo motor can be achieved. The first target operating parameter information and the second target operating parameter information calculated based on the control information combined with the servo motor feedback information can effectively improve the accuracy and stability of the servo motor operation. The relative position information and speed information between the servo motors are dynamically analyzed by the dual-axis synchronous control algorithm, and the dynamic compensation amount is calculated, which can ensure the high synchronization and coordination of the dual servo motors during operation. The operating parameter information generated by synchronous optimization of the target operating parameters can further improve the dynamic adaptability of the operating parameters, thereby meeting the needs of different loads and task switching in complex industrial scenarios. By generating drive signals and controlling the operation of the dual servo motors respectively, it is ensured that the servo motors can perform motion control with high precision according to the optimized operating parameters. By feeding back the operating information of the servo motors to the EtherCat master station in real time, real-time monitoring and fault diagnosis of the operating status of the servo motors are achieved, thereby greatly improving the safety and operation efficiency of the system. The overall technical solution can significantly improve the control performance, synchronization and reliability of the dual-axis servo system through accurate operating parameter calculation, synchronous optimization and dynamic compensation.
[0011] In a preferred example, the present application may be further configured as follows: the first target operating parameter information and the second target operating parameter information are respectively calculated based on the control information and in combination with the first servo motor feedback information and the second servo motor feedback information, including: Acquire target position information and target speed information from the control information, acquire real-time position information of the first servo motor and real-time speed information of the first servo motor from the feedback information of the first servo motor, and acquire real-time position information of the second servo motor and real-time speed information of the second servo motor from the feedback information of the second servo motor; Calculating a first position deviation according to the target position information and the real-time position information of the first servo motor, and calculating a first speed deviation according to the target speed information and the real-time speed information of the first servo motor; Calculating a second position deviation according to the target position information and the real-time position information of the second servo motor, and calculating a second speed deviation according to the target speed information and the real-time speed information of the second servo motor; Based on the first position deviation and the first speed deviation, the first target operating parameter information is calculated through a servo motor position loop and speed loop control model; Based on the second position deviation and the second speed deviation, the second target operating parameter information is calculated through the servo motor position loop and speed loop control model.
[0012] By adopting the above technical solution, the target position information and target speed information can be compared with the real-time position information and speed information of the first servo motor and the second servo motor, and the position deviation and speed deviation can be calculated respectively, so as to realize real-time monitoring and accurate evaluation of the operating status of the servo motor. The first target operating parameter information and the second target operating parameter information are obtained by combining the position deviation and speed deviation through the servo motor position loop and speed loop control model, so as to ensure the control accuracy and response speed of the servo motor. The control model can adaptively adjust the calculation parameters to adapt to the load and speed changes during the operation of the servo motor, so as to improve the dynamic performance and stability of the control system. In addition, by independently calculating the target operating parameter information of the two servo motors, the synchronous operation and dynamic coordination of the dual-axis servo motor can be realized, so as to ensure the high efficiency and reliability in complex industrial scenarios.
[0013] In a preferred example, the present application can be further configured as follows: based on the first target operating parameter information and the second target operating parameter information, the relative position information and relative speed information between the first servo motor and the second servo motor are analyzed by a dual-axis synchronous control algorithm to calculate the dynamic compensation amount, including: The dual-axis synchronous control algorithm obtains the dynamic compensation amount based on the following formula: The dynamic compensation amount = α·(Δposition)+β·(Δspeed)+γ·(Δtarget), wherein the Δposition is the relative position deviation, the Δspeed is the relative speed deviation, the Δtarget is the target operating parameter deviation, the α is the weight coefficient of the position deviation, the β is the weight coefficient of the speed deviation, and the γ is the dynamic adjustment coefficient of the target operating state difference.
[0014] By adopting the above technical scheme, the relative position deviation, relative speed deviation and target operating parameter deviation can be comprehensively considered through the dual-axis synchronous control algorithm, and different deviations are weighted by using weight coefficients α, β and dynamic adjustment coefficient γ, so as to calculate and obtain an accurate dynamic compensation amount. The dynamic compensation amount can adjust the operating status between the servo motors in real time, eliminate the synchronization error in the operation of the dual-axis servo motor, and ensure the high-precision synchronization of the dual-axis servo motor during operation. Through the dynamic adjustment coefficient γ, the control strategy can be optimized in real time according to the difference in the dual-axis operating status, so as to adapt to complex working conditions such as load changes and speed changes, and significantly improve the dynamic response performance and stability of the control system.
[0015] In a preferred example, the present application may be further configured as follows: the first target operating parameter information and the second target operating parameter information are synchronously optimized according to the dynamic compensation amount to generate the first operating parameter information after synchronous optimization and the second operating parameter information after synchronous optimization, including: The first operating parameter information after synchronous optimization is obtained by the following calculation formula: X=L+(α1·the Δ position+β1·the Δ speed+γ1·Δ first target), wherein X is the first operating parameter information after the synchronous optimization, L is the first target operating parameter information, Δ first target is the first target operating parameter deviation, and α1, β1 and γ1 are the weight coefficient of the first position deviation, the weight coefficient of the second speed deviation and the dynamic adjustment coefficient of the first target operating state difference respectively; The second operating parameter information after synchronous optimization is obtained by the following calculation formula: M=N+(α2·the Δposition+β2·the Δspeed+γ2·Δsecond target), wherein M is the second operating parameter information after the synchronous optimization, N is the second target operating parameter information, Δsecond target is the second target operating parameter deviation, and the α2, β2 and γ2 are respectively the weight coefficient of the second position deviation, the weight coefficient of the second speed deviation and the dynamic adjustment coefficient of the second target operating state difference.
[0016] By adopting the above technical scheme, the first operating parameter information and the second operating parameter information after synchronous optimization can be calculated respectively based on the synchronous optimization algorithm, and the first target operating parameter information and the first target operating parameter deviation are combined, and the weight coefficients α1, β1 and the dynamic adjustment coefficient γ1 are used to perform weighted calculation on the influencing factors, thereby achieving accurate synchronous optimization of the first operating parameter; similarly, by combining the second target operating parameter information and the second target operating parameter deviation, the weight coefficients α2, β2 and the dynamic adjustment coefficient γ2 are used to synchronously optimize the second operating parameter to ensure that the operating state of the dual-axis servo motor is highly coordinated; the optimization method can adaptively adjust the parameter weights, and correct the position, speed and target state differences in real time, thereby improving the synchronization accuracy and dynamic response performance of the dual-axis servo motor, and meeting the requirements of high precision and high stability of servo control under complex working conditions.
[0017] In a preferred example, the present application may be further configured as follows: during the operation of the servo motor, the first servo motor operation information and the second servo motor operation information are acquired in real time, and the first servo motor operation information and the second servo motor operation information are fed back to the EtherCat master station at the same time, and further comprising: Compare and judge the first servo motor operation information with a preset abnormal threshold, and if the first servo motor operation information is abnormal, generate first abnormal information; Compare and judge the second servo motor operation information with the preset abnormal threshold, and if the second servo motor operation information is abnormal, generate second abnormal information; First control response information is generated according to the first abnormal information, and second control response information is generated according to the second abnormal information.
[0018] By adopting the above technical solution, the operating information of the first servo motor and the second servo motor can be compared with the preset abnormal threshold in real time, so as to quickly detect the abnormal situation of the operating state of the servo motor and ensure that the system can respond in time; by generating the first abnormal information and the second abnormal information, the abnormal state can be classified and recorded, and accurate abnormal type and real-time status data can be provided; based on the first control response information and the second control response information generated by the abnormal information, the operating parameters of the servo motor can be dynamically adjusted according to the abnormal type, such as limiting current, adjusting speed or suspending operation, so as to effectively avoid further damage to the equipment caused by the abnormal state and improve the safety and reliability of the system operation.
[0019] In a preferred example, the present application may be further configured as follows: the first control response information includes: Based on the first control response information, determining a first abnormality type of the first servo motor; When it is detected that the first abnormal type is that the first operating current exceeds the preset current range, the current parameter is adjusted to reduce the driving force of the first servo motor; when it is detected that the first abnormal type is that the first operating temperature exceeds the preset temperature range, the first speed parameter is adjusted to reduce the operating intensity of the first servo motor, or the operation of the first servo motor is suspended; when it is detected that the first abnormal type is that the first position deviation exceeds the preset position range, the first position parameter is adjusted to be within the preset position range; If the first abnormal state duration of the first servo motor exceeds a preset abnormal state duration, first protection operation information is generated, and based on the first protection operation information, the operating state information of the second servo motor is adjusted through the dual-axis synchronous control algorithm.
[0020] By adopting the above technical scheme, the abnormal type of the first servo motor can be quickly confirmed through the first control response information, and the cause of the abnormality can be accurately located, such as current exceeding the limit, temperature being too high or position deviation, so as to provide a basis for subsequent response operations, and the current parameters, speed parameters or position parameters can be dynamically adjusted according to different abnormal types, which can effectively reduce the impact of the abnormal state on the operation of the equipment, such as reducing mechanical stress by reducing the driving force when the current exceeds the limit, preventing the equipment from overheating by reducing the operating intensity or suspending the operation when the temperature is too high, and restoring the normal operating trajectory by position correction when the position deviation exceeds the limit. When the abnormal state continues to exceed the preset time threshold, the protection mechanism is further triggered by generating the first protection operation information, and the operating state information of the second servo motor is dynamically adjusted by using the dual-axis synchronous control algorithm to ensure that when the first servo motor is limited or stops running, the second servo motor can operate independently and stably, thereby improving the operating reliability and fault tolerance of the dual-axis system. The scheme can flexibly adjust the operating parameters of the servo motor according to the abnormal situation, while ensuring the overall stability and operating efficiency of the system.
[0021] In a preferred example, the present application may be further configured as follows: the second control response information includes: Based on the second control response information, determining a second abnormality type of the second servo motor; When it is detected that the second abnormal type is that the second operating current exceeds the preset current range, the current parameter is adjusted to reduce the driving force of the second servo motor; when it is detected that the second abnormal type is that the second operating temperature exceeds the preset temperature range, the second speed parameter is adjusted to reduce the operating intensity of the second servo motor, or the operation of the second servo motor is suspended; when it is detected that the second abnormal type is that the second position deviation exceeds the preset position range, the second position parameter is adjusted to be within the preset position range; If the second abnormal state duration of the second servo motor exceeds the preset abnormal state duration, second protection operation information is generated, and based on the second protection operation information, the operating state information of the first servo motor is adjusted through the dual-axis synchronous control algorithm.
[0022] By adopting the above technical solution, the abnormal type of the second servo motor can be quickly confirmed through the second control response information, such as the operating current exceeds the preset range, the operating temperature is too high or the position deviation exceeds the allowable range, so as to accurately locate the cause of the abnormality and take targeted response measures. When the second abnormal type is detected as the current exceeds the preset range, the driving force of the servo motor is reduced by adjusting the current parameters, and the stress caused by the mechanical load is effectively reduced. When the temperature abnormality is detected, the operating intensity is reduced by adjusting the speed parameters, or the operation of the servo motor is suspended when necessary to prevent the equipment from being damaged due to overheating. When the position deviation is detected, it is corrected to the allowable range by dynamically adjusting the position parameters to ensure the accuracy of the servo motor's running trajectory. If the abnormal state continues to exceed the preset time threshold, the second protection operation information is generated, and the operating state of the first servo motor is dynamically adjusted through the dual-axis synchronous control algorithm, and the target operating parameters of the first servo motor are optimized to meet the synchronous operation requirements of the second servo motor under abnormal conditions, thereby ensuring the overall stability and reliability of the system. The technical solution can effectively realize dynamic adjustment and protection operations under abnormal conditions, and significantly improve the safety and operation efficiency of the dual-axis servo system.
[0023] In a preferred example, the present application may be further configured as follows: the first abnormal information generates first control response information, and the second abnormal information generates second control response information, and then further includes: When the abnormal state of the first servo motor is relieved, re-enabling the operation drive signal of the first servo motor; Re-adjusting the operating parameters of the first servo motor and the second servo motor by the dual-axis synchronous control algorithm to restore the dual-axis synchronous operation; When the abnormal state of the second servo motor is relieved, re-enabling the operation drive signal of the second servo motor; The operating parameters of the first servo motor and the second servo motor are readjusted by the dual-axis synchronous control algorithm to restore the dual-axis synchronous operation.
[0024] By adopting the above technical scheme, when the abnormal state of the first servo motor or the second servo motor is released, its operating drive signal can be re-enabled, and the normal output of the driving signal can be restored by initialization, so as to ensure that the servo motor can quickly resume operation. At the same time, the operating parameters of the first servo motor and the second servo motor are readjusted by the dual-axis synchronous control algorithm, and the dynamic compensation amount is calculated and the target operating parameters are optimized by using the position information and speed information collected in real time, so as to realize the synchronous operation of the dual-axis servo motor. After the abnormal state is released, the speed and position parameters of the two servo motors are dynamically adjusted to effectively eliminate the synchronization deviation caused by the abnormal state, and restore the overall stability and coordination of the system. The scheme can quickly respond to the recovery process of the abnormal state, and at the same time, the dual-axis synchronous control algorithm is used to ensure the operating accuracy and efficiency of the system after the abnormality is released, thereby improving the reliability and dynamic adaptability of the dual-axis servo system.
[0025] In summary, the present application includes at least one of the following beneficial technical effects: 1. Through the real-time communication between the EtherCat master station and the microcontroller, combined with the signal conditioning and isolation function of the network transformer, the stability and anti-interference ability of the communication signal can be effectively improved, thereby ensuring the reliable operation of the system in a complex industrial environment. The microcontroller collects the feedback information of the first encoder and the second encoder and combines it with the dual-axis synchronous control algorithm to dynamically adjust the operating parameters of the first servo motor and the second servo motor, thereby realizing high-precision synchronous control of the dual-axis servo motor. The operating information of the servo motor is transmitted to the EtherCat master station in real time through the state feedback output end of the microcontroller, which can realize real-time monitoring of the operating state of the servo motor, thereby improving the safety and abnormality detection ability of the system. The first servo motor and the second servo motor are driven by the first IPM module and the second IPM module respectively, which can effectively realize independent control of the dual-axis servo, thereby improving the flexibility and operation efficiency of the system. Through the introduction of dual closed-loop control, combined with the position information and speed information fed back by the encoder in real time, the target operating parameters can be further optimized, thereby improving the dynamic response performance and positioning accuracy of the servo motor. By comparing the abnormal state detection module with the preset abnormal threshold, the operation abnormality of the servo motor can be quickly identified and the protection operation can be performed, thereby significantly improving the reliability and stability of the system. 2. The relative position deviation, relative speed deviation and target operating parameter deviation can be comprehensively considered through the dual-axis synchronous control algorithm, and different deviations can be weighted by using weight coefficients α, β and dynamic adjustment coefficient γ, so as to calculate accurate dynamic compensation. The dynamic compensation can adjust the operating state between the servo motors in real time, eliminate the synchronization error in the operation of the dual-axis servo motor, and ensure the high-precision synchronization of the dual-axis servo motor during operation. Through the dynamic adjustment coefficient γ, the control strategy can be optimized in real time according to the difference in the dual-axis operating state, so as to adapt to complex working conditions such as load changes and speed changes, and significantly improve the dynamic response performance and stability of the control system; 3. When the abnormal state of the first servo motor or the second servo motor is released, its operating drive signal can be re-enabled, and the normal output of the driving signal can be restored by initialization to ensure that the servo motor can quickly resume operation. At the same time, the operating parameters of the first servo motor and the second servo motor are readjusted through the dual-axis synchronous control algorithm, and the dynamic compensation amount is calculated and the target operating parameters are optimized using the real-time acquired position information and speed information, thereby realizing the synchronous operation of the dual-axis servo motor. After the abnormal state is released, the speed and position parameters of the two servo motors are dynamically adjusted to effectively eliminate the synchronization deviation caused by the abnormal state and restore the overall stability and coordination of the system. This solution can quickly respond to the recovery process of the abnormal state, and at the same time ensure the operating accuracy and efficiency of the system after the abnormality is released through the dual-axis synchronous control algorithm, thereby improving the reliability and dynamic adaptability of the dual-axis servo system. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flow chart of a dual-axis servo drive motor control device based on EtherCat communication in one embodiment of the present application.
[0027] Figure 2 This is a flowchart of an implementation of a dual-axis servo drive motor control device based on EtherCat communication in one embodiment of the present application; Figure 3 It is a flow chart of a dual-axis servo drive motor control method based on EtherCat communication in one embodiment of the present application; Figure 4 It is a flowchart for implementing step S121 in a dual-axis servo drive motor control method based on EtherCat communication in one embodiment of the present application; Figure 5 It is a flowchart for implementing step S13 in a dual-axis servo drive motor control method based on EtherCat communication in one embodiment of the present application; Figure 6 It is a flowchart for implementing step 14 in a dual-axis servo drive motor control method based on EtherCat communication in one embodiment of the present application; Figure 7 It is a flowchart for implementing step S16 in a dual-axis servo drive motor control method based on EtherCat communication in an embodiment of the present application; Figure 8 It is a flowchart for implementing step S163 in a dual-axis servo drive motor control method based on EtherCat communication in an embodiment of the present application; Fig. 9 It is another implementation flow chart of step S163 in a dual-axis servo drive motor control method based on EtherCat communication in one embodiment of the present application; Fig.10 This is an implementation flow chart after step S163 in a dual-axis servo drive motor control method based on EtherCat communication in one embodiment of the present application. DETAILED DESCRIPTION
[0028] The present application is further described in detail below in conjunction with the accompanying drawings.
[0029] In one embodiment, if Figure 1 As shown, the present application discloses a dual-axis servo drive motor control device based on EtherCat communication, a dual-axis servo drive motor control device based on EtherCat communication includes an EtherCat master station, a network port, a network transformer, a microcontroller, a first IPM module, a second IPM module, a first servo motor, a second servo motor, a first encoder and a second encoder. The EtherCat master station is connected to the network transformer through the network port, the output end of the network transformer is connected to the input end of the microcontroller, the first output end of the microcontroller is connected to the input end of the first IPM module, the output end of the first IPM module is connected to the first servo motor, the output end of the first servo motor is connected to the first encoder, the output end of the first encoder is connected to the input end of the microcontroller, the second output end of the microcontroller is connected to the input end of the second IPM module, the output end of the second IPM module is connected to the second servo motor, the output end of the second servo motor is connected to the second encoder, the output end of the second encoder is connected to the input end of the microcontroller, and the state feedback output end of the microcontroller is connected to the EtherCat master station through the network port.
[0030] In this embodiment, the functions of the EtherCat master station, network port, network transformer, microcontroller, first IPM module, second IPM module, first servo motor, second servo motor, first encoder and second encoder complement each other, and through the connection of their respective signal input and output ports, a complete control logic is formed that can realize dual-axis synchronous servo drive control.
[0031] Specifically, the EtherCat master station is connected to the network transformer through the network port to send control information to the network transformer. The function of the network transformer is to perform signal conditioning and electrical isolation on the control information to ensure the stability and anti-interference ability of the signal. The conditioned control information is transmitted from the output end of the network transformer to the input end of the microcontroller. After receiving the conditioned control information from the network transformer, the microcontroller starts to execute the control logic. First, the microcontroller calculates the first target operating parameter information and the second target operating parameter information according to the control information combined with the first servo motor operating state information fed back by the first encoder and the second servo motor operating state information fed back by the second encoder. The first target operating parameter information is calculated according to the real-time position, speed, target position and target speed of the first servo motor, and the second target operating parameter information is calculated according to the real-time position, speed, target position and target speed of the second servo motor. The microcontroller performs synchronous optimization on the first target operating parameter information, generates the first operating parameter information after synchronous optimization, and transmits it to the input end of the first IPM module through the first output end. After receiving the first operating parameter information after synchronous optimization, the first IPM module generates a first drive signal according to the parameter, and outputs the control information to the input end of the first servo motor. The first servo motor is precisely controlled according to the first drive signal, and its real-time operating state information is fed back to the first encoder. The first encoder collects the real-time operating state information of the first servo motor and transmits it to the microcontroller for subsequent dynamic adjustment. Similarly, the microcontroller synchronously optimizes the second target operating parameter information, generates the second operating parameter information after synchronous optimization, and transmits it to the input end of the second IPM module through the second output end. After receiving the second operating parameter information after synchronous optimization, the second IPM module generates a second drive signal according to the parameter, and outputs the control information to the input end of the second servo motor. The second servo motor is precisely controlled according to the second drive signal, and its real-time operating state information is fed back to the second encoder. The second encoder collects the real-time operating state information of the second servo motor and transmits it to the microcontroller for subsequent dynamic adjustment. Based on the feedback information of the first servo motor and the second servo motor, the microcontroller analyzes the relative position information and relative speed information between the two through the dual-axis synchronous control algorithm, and calculates the dynamic compensation amount. The dynamic compensation amount is used to optimize the first target operating parameter information and the second target operating parameter information, thereby generating synchronously optimized operating parameter information to ensure the synchronous operation of the two servo motors. The microcontroller monitors the operating status information of the first servo motor and the second servo motor in real time and compares it with a preset abnormal threshold.If an abnormal state is detected (such as overcurrent, overvoltage, undervoltage, overheating or position deviation out of range), the microcontroller will generate corresponding abnormal information (such as the first abnormal information or the second abnormal information) and perform the following operations: adjust the operating parameters of the servo motor (such as current limit, target speed or target position). If the abnormal state persists, stop the abnormal servo motor, cut off the control information, and feedback the abnormal information to the host computer through the EtherCat master station. The operating state of the other servo motor is dynamically adjusted through the dual-axis synchronous control algorithm to ensure its independent and stable operation. When it is detected that the abnormal state is relieved, the microcontroller re-enables the operating control information of the servo motor and readjusts the operating parameters of the servo motor through the dual-axis synchronous control algorithm to restore the synchronous operation of the two servo motors.
[0032] Furthermore, if Figure 2 As shown, in step S10, a dual-axis servo drive motor control device based on EtherCat communication also includes when the EtherCat master station sends control information to the network port, the microcontroller calculates the first target operating parameter information and the second target operating parameter information according to the control information, combined with the first servo motor feedback information fed back by the first encoder and the second servo motor feedback information fed back by the second encoder, respectively, the microcontroller generates the first operating parameter information after synchronization optimization according to the first target operating parameter information, and outputs the first operating parameter information after synchronization optimization to the first IPM module, the first IPM module generates a first drive signal according to the first operating parameter information after synchronization optimization, and drives the first servo motor to operate through the first drive signal, the microcontroller generates the second operating parameter information after synchronization optimization according to the second target operating parameter information, and outputs the second operating parameter information after synchronization optimization to the second IPM module, the second IPM module generates a second drive signal according to the second operating parameter information after synchronization optimization, and drives the operation of the second servo motor through the second drive signal, and during the operation of the servo motor, the microcontroller simultaneously feeds back the first servo motor operation information and the second servo motor operation information to the EtherCat master station for real-time monitoring of the operating status of the first servo motor and the second servo motor.
[0033] Specifically, when the EtherCat master station sends control information to the network port, the control information is transmitted to the microcontroller after signal conditioning and electrical isolation processing by the network transformer. After receiving the control information, the microcontroller collects the real-time feedback information (including position and speed) of the first servo motor from the first encoder and the real-time feedback information of the second servo motor from the second encoder. The microcontroller calculates the first target operating parameter information and the second target operating parameter information according to the received control information and the feedback information of the first servo motor and the second servo motor. The first target operating parameter information is calculated by the target position information, the target speed information and the real-time position information and real-time speed information of the first servo motor through the position loop and speed loop control model. The second target operating parameter information is calculated by the target position information, the target speed information and the real-time position information and real-time speed information of the second servo motor through the position loop and speed loop control model. The microcontroller combines the first target operating parameter information and the second target operating parameter information, analyzes the relative position information and relative speed information between the first servo motor and the second servo motor through the dual-axis synchronous control algorithm, and calculates the dynamic compensation amount. According to the dynamic compensation amount, the microcontroller synchronously optimizes the first target operating parameter information and the second target operating parameter information, and generates the first operating parameter information after synchronous optimization and the second operating parameter information after synchronous optimization respectively. The microcontroller transmits the first operating parameter information after synchronous optimization to the first IPM module, and the first IPM module generates a first drive signal according to the first operating parameter information, and drives the first servo motor to operate through the drive signal. The microcontroller transmits the second operating parameter information after synchronous optimization to the second IPM module, and the second IPM module generates a second drive signal according to the second operating parameter information, and drives the second servo motor to operate through the drive signal. During the operation of the servo motor, the operating status information of the first servo motor and the second servo motor (including real-time position, speed, current and other parameters) is fed back to the microcontroller through the encoder. The microcontroller compares the operating status information with the preset target operating parameters to determine whether there is an abnormality, and feeds back the operating information and abnormal information to the EtherCat master station in real time through the network port for real-time monitoring of the system operating status. When the microcontroller detects that any servo motor has an operating abnormality (such as overcurrent, overheating, excessive position deviation, etc.), it generates corresponding abnormal information and adjusts the operating parameters of the abnormal servo motor according to the type of abnormality (such as limiting current, reducing speed, adjusting target position, etc.). If the abnormality persists, the microcontroller cuts off the drive signal of the abnormal servo motor, stops its operation, and dynamically adjusts the operating parameters of the normal servo motor through the dual-axis synchronous control algorithm to ensure that the first servo motor or the second servo motor operates independently and stably. After the abnormality is recovered, the microcontroller re-enables the drive signal of the abnormal servo motor and restores the synchronous operation state of the dual-axis servo motor through the synchronous control algorithm.When the abnormality is resolved, the microcontroller recalculates the synchronous optimization parameters of the servo motor and restores the synchronous operation of the servo motor.
[0034] like Figure 3 As shown, a dual-axis servo drive motor control method based on EtherCat communication is applied to a dual-axis servo drive motor control device based on EtherCat communication. A dual-axis servo drive motor control method based on EtherCat communication includes: S11: Acquire control information, and based on the control information, collect feedback information of the first servo motor and feedback information of the second servo motor.
[0035] Specifically, by receiving control information, the command signal from the EtherCat master station can be received through the network port. The command signal is transmitted to the microcontroller after signal conditioning and electrical isolation by the network transformer. The microcontroller parses the frame structure of the received signal and extracts the target operating parameters therefrom, including target position information and target speed information. After extracting the target operating parameters, the microcontroller obtains the first servo motor feedback information and the second servo motor feedback information respectively by calling the internal acquisition module.
[0036] S12: Calculate first target operating parameter information and second target operating parameter information according to the control information and in combination with feedback information of the first servo motor and feedback information of the second servo motor.
[0037] Specifically, the microcontroller extracts target position information and target speed information from the control information, combines the real-time position information and real-time speed information in the feedback information of the first servo motor, and adopts a difference calculation method to respectively calculate the position information difference and speed information difference of the first servo motor, wherein the position information difference is the target position information minus the real-time position information, and the speed information difference is the target speed information minus the real-time speed information. The difference calculation is completed by the arithmetic operation unit of the microcontroller, and the obtained position information difference and speed information difference are used as input parameters. The first target operating parameter information is calculated through the control model. For the second servo motor, the microcontroller adopts the same difference calculation method, combines the target operating parameters with the feedback information of the second servo motor to calculate the position information difference and speed information difference, and then calculates the second target operating parameter information through the control model. The control model allocates the influence weights of position and speed through a weight function, so that the target operating parameter information is more in line with actual application requirements.
[0038] S13: Based on the first target operating parameter information and the second target operating parameter information, the relative position information and the relative speed information between the first servo motor and the second servo motor are analyzed by a dual-axis synchronous control algorithm to calculate a dynamic compensation amount.
[0039] Specifically, the microcontroller extracts target position information and target speed information from the first target operating parameter information, compares them with the target position information and target speed information in the second target operating parameter information, and calculates relative position information and relative speed information. The relative position information is calculated by subtracting the second target position information from the first target position information, and the relative speed information is calculated by subtracting the second target speed information from the first target speed information. The calculated relative position information and relative speed information are passed as input parameters to the dual-axis synchronous control algorithm. The algorithm performs weighted analysis on the relative information according to a preset weight coefficient and a real-time dynamic adjustment coefficient to obtain a dynamic compensation amount.
[0040] S14: synchronously optimizing the first target operating parameter information and the second target operating parameter information according to the dynamic compensation amount, and generating the synchronously optimized first operating parameter information and the synchronously optimized second operating parameter information.
[0041] Specifically, the first target operating parameter information and the second target operating parameter information are adjusted by the dynamic compensation amount, wherein the position information adjustment value of the dynamic compensation amount is applied to the target position information of the first target operating parameter information, and the adjusted target position information is calculated as the target position information + the position information adjustment value in the dynamic compensation amount, and the speed information adjustment value of the dynamic compensation amount is applied to the target speed information, and the adjusted target speed information is calculated as the target speed information + the speed information adjustment value in the dynamic compensation amount, and the same adjustment method is applied to the second target operating parameter information, and the second target operating parameter information is synchronously optimized respectively by the position information adjustment value and the speed information adjustment value of the dynamic compensation amount, and after the adjustment is completed, the synchronously optimized first operating parameter information and the synchronously optimized second operating parameter information are generated.
[0042] S15: Generate a first drive signal according to the first operating parameter information after synchronous optimization, and drive the operation of the first servo motor based on the first drive signal; generate a second drive signal according to the second operating parameter information after synchronous optimization, and drive the operation of the second servo motor based on the second drive signal.
[0043] Specifically, the optimized position information and the optimized speed information in the first operating parameter information after synchronous optimization generate a corresponding first drive signal through the signal generation module of the microcontroller, and the drive signal is generated by pulse width modulation (PWM), wherein the optimized speed information is used to adjust the frequency of the PWM signal, and the optimized position information is used to adjust the duty cycle of the PWM signal. The generated first drive signal is transmitted to the first servo motor through the first IPM module to control the speed and position of the first servo motor. The second operating parameter information after synchronous optimization generates a second drive signal in the same way, and the second drive signal is transmitted to the second servo motor through the second IPM module to complete the operation control of the second servo motor.
[0044] S16: During the operation of the servo motor, the first servo motor operation information and the second servo motor operation information are acquired in real time, and the first servo motor operation information and the second servo motor operation information are fed back to the EtherCat master station at the same time.
[0045] Specifically, real-time operation information is output to the microcontroller through the encoder of the servo motor, the pulse signal of the encoder is converted into real-time position information through a pulse decoder, and the analog signal is converted into real-time speed information through an analog-to-digital conversion circuit. The microcontroller integrates the real-time position information and speed information into an operation information data packet. After the data packet is packaged and verified through the network protocol, it is transmitted to the EtherCat master station through the network port. The transmission process uses a checksum to verify data integrity. At the same time, the microcontroller updates the servo motor status flag after the data is sent. The flag information includes whether it is in normal operation or whether an abnormality is detected. The transmission frequency of the data packet is determined by the synchronization signal of the EtherCat master station to ensure the real-time nature of the operation information.
[0046] In one embodiment, if Figure 4 As shown, in step S12, the first target operating parameter information and the second target operating parameter information are calculated respectively according to the control information, combined with the feedback information of the first servo motor and the feedback information of the second servo motor, including: S121: Obtain target position information and target speed information from the control information, obtain real-time position information and real-time speed information of the first servo motor from the feedback information of the first servo motor, and obtain real-time position information and real-time speed information of the second servo motor from the feedback information of the second servo motor.
[0047] Specifically, the target position information and the target speed information are obtained by receiving and parsing the data packet in the control information through the microcontroller, the frame structure of the data packet includes an identification bit, a target position information field and a target speed information field, the microcontroller extracts the target position information and the target speed information through a field parsing algorithm and stores them in a register, the real-time position information and the real-time speed information of the first servo motor are collected through the encoder of the first servo motor, the pulse signal output by the encoder is decoded by the pulse decoder of the microcontroller to obtain the real-time position information, the analog signal is converted into a digital signal through an analog-to-digital converter and then parsed to obtain the real-time speed information, and the feedback information of the second servo motor is collected and decoded in the same manner as the first servo motor to obtain the real-time position information of the second servo motor and the real-time speed information of the second servo motor.
[0048] S122: Calculate a first position deviation according to the target position information and the real-time position information of the first servo motor, and calculate a first speed deviation according to the target speed information and the real-time speed information of the first servo motor.
[0049] Specifically, the first position deviation is calculated by numerically differentiating the target position information from the real-time position information of the first servo motor. The differential operation is performed by the arithmetic operation unit of the microcontroller, and the calculation formula is first position deviation = target position information - real-time position information. The calculation method of the first speed deviation is similar to the position deviation, and is achieved by numerically differentiating the target speed information from the real-time speed information of the first servo motor. The calculation formula is first speed deviation = target speed information - real-time speed information.
[0050] S123: Calculate a second position deviation according to the target position information and the real-time position information of the second servo motor, and calculate a second speed deviation according to the target speed information and the real-time speed information of the second servo motor.
[0051] Specifically, the second position deviation is achieved by numerically differentiating the target position information from the real-time position information of the second servo motor. The differential calculation formula is second position deviation = target position information - real-time position information of the second servo motor. The calculation process is completed by the arithmetic operation unit in the microcontroller. The second speed deviation is achieved by numerically differentiating the target speed information from the real-time speed information of the second servo motor. The calculation formula is second speed deviation = target speed information - real-time speed information of the second servo motor.
[0052] S124: Based on the first position deviation and the first speed deviation, first target operating parameter information is calculated through the servo motor position loop and speed loop control model.
[0053] Specifically, the first target operating parameter information is calculated through the position loop and speed loop control model of the servo motor. First, the microcontroller passes the first position deviation and the first speed deviation as input parameters to the control model. The control model is composed of differential equations, which describes the mathematical relationship between the servo motor operating parameters and the deviation information. The position loop control part obtains preliminary target position information by performing proportional integral differential (PID) adjustment calculation on the first position deviation, and the speed loop control part obtains preliminary target speed information by performing similar PID adjustment calculation on the first speed deviation. The final first target operating parameter information is obtained by performing a linear combination of the preliminary target position information and the target speed information. The weight coefficient of the linear combination is dynamically adjusted by the real-time operating status of the servo motor to ensure that the output operating parameter information can meet the current operating requirements.
[0054] S125: Based on the second position deviation and the second speed deviation, the second target operating parameter information is calculated through the servo motor position loop and speed loop control model.
[0055] Specifically, the microcontroller passes the second position deviation and the second speed deviation as input parameters to the position loop and speed loop control model. The position loop control part obtains preliminary target position information through PID adjustment calculation, and the speed loop control part obtains preliminary target speed information through PID adjustment calculation. The adjustment parameters of the position loop and the speed loop are dynamically adjusted according to the real-time operating status of the second servo motor to ensure the accuracy of the calculation. The final second target operating parameter information is obtained by performing a weighted linear combination of the preliminary target position information and the target speed information. The dynamic load characteristics of the second servo motor are taken into account in the calculation process, so that the target operating parameter information can be more in line with actual operating requirements.
[0056] In one embodiment, if Figure 5 As shown, in step S13, based on the first target operating parameter information and the second target operating parameter information, the relative position information and relative speed information between the first servo motor and the second servo motor are analyzed by a dual-axis synchronous control algorithm to calculate the dynamic compensation amount, including: S131: The dual-axis synchronous control algorithm obtains the dynamic compensation value based on the following formula: The dynamic compensation amount = α·(Δposition)+β·(Δspeed)+γ·(Δtarget), wherein Δposition is the relative position deviation, Δspeed is the relative speed deviation, Δtarget is the target operating parameter deviation, α is the weight coefficient of the position deviation, β is the weight coefficient of the speed deviation, and γ is the dynamic adjustment coefficient of the target operating state difference.
[0057] Specifically, firstly, the target operating parameter information and real-time feedback information of the first servo motor and the second servo motor are extracted, and the relative position deviation and the relative speed deviation are calculated. The relative position deviation Δposition is the target position information of the first servo motor minus the target position information of the second servo motor, the relative speed deviation Δspeed is the target speed information of the first servo motor minus the target speed information of the second servo motor, and the relative target operating parameter deviation Δtarget is the target operating parameter information of the first servo motor minus the target operating parameter information of the second servo motor. For the weight coefficients α, β and the dynamic adjustment coefficient γ, the microcontroller dynamically adjusts them through the real-time data of the operating status. α adjusts the weight of the position deviation according to the current load change of the servo motor, β adjusts the weight of the speed deviation through the acceleration information collected in real time, and γ automatically adjusts its influence weight according to the synchronization difference between the two axes. Finally, the dynamic compensation amount is calculated by combining the weighted combination of the relative position deviation, the relative speed deviation and the relative target operating parameter deviation.
[0058] In one embodiment, if Figure 6As shown, in step S14, the first target operating parameter information and the second target operating parameter information are synchronously optimized according to the dynamic compensation amount to generate the synchronously optimized first operating parameter information and the synchronously optimized second operating parameter information, including: S141: The first operating parameter information after synchronous optimization is obtained by the following calculation formula: X=L+(α1·the Δ position+β1·the Δ speed+γ1·Δ first target), wherein X is the first operating parameter information after synchronous optimization, L is the first target operating parameter information, Δ first target is the first target operating parameter deviation, α1, β1 and γ1 are the weight coefficient of the first position deviation, the weight coefficient of the second speed deviation and the dynamic adjustment coefficient of the first target operating state difference, respectively.
[0059] Specifically, the microcontroller first extracts the first target operating parameter information L and the first target operating parameter deviation Δfirst target, and calls the dynamic adjustment module at the same time to obtain the weight coefficients α1, β1 and the dynamic adjustment coefficient γ1 in the optimization formula, α1 is dynamically set according to the real-time acquired first servo motor position deviation change trend, β1 is adjusted based on the real-time speed change of the first servo motor, and γ1 is dynamically adjusted according to the stability of the operating state of the first servo motor. Subsequently, the microcontroller calculates each item according to the formula X=L+(α1×Δfirst target)+(β1×Δfirst target)+(γ1×Δfirst target), wherein the weight adjustment and target parameter deviation calculation of each item are completed by the floating-point operation unit. To ensure the accuracy of the result, the result of each calculation will correct the accumulated error through the truncation error correction algorithm. After the final calculation is completed, the first operating parameter information X obtained after synchronous optimization is stored in the register of the microcontroller for subsequent generation of the first drive signal.
[0060] S142: The second operating parameter information after synchronous optimization is obtained by the following calculation formula: M=N+(α2·the Δposition+β2·the Δspeed+γ2·Δsecond target), wherein M is the second operating parameter information after synchronous optimization, N is the second target operating parameter information, Δsecond target is the second target operating parameter deviation, α2, β2 and γ2 are respectively the weight coefficient of the second position deviation, the weight coefficient of the second speed deviation and the dynamic adjustment coefficient of the second target operating state difference.
[0061] Specifically, the microcontroller extracts the second target operating parameter information N and the second target operating parameter deviation Δsecond target, and the dynamic adjustment module outputs weight coefficients α2, β2 and dynamic adjustment coefficient γ2 respectively, wherein α2 is adjusted based on the real-time position change trend of the second servo motor, β2 is set according to the real-time speed change range of the second servo motor, and γ2 is adjusted by analyzing the synchronization difference between the target operating parameters and the real-time operating state of the second servo motor. The microcontroller calculates step by step according to the formula M=N+(α2×Δsecond target)+(β2×Δsecond target)+(γ2×Δsecond target). Double-precision floating-point operations are used in the calculation process to ensure that the product result of the weight coefficient and the target parameter deviation is accurate. At the same time, the real-time update status of the dynamic adjustment coefficient is monitored to ensure that each operation is based on the latest weights and parameters. After the calculation is completed, the obtained synchronized optimized second operating parameter information M is written into the register of the microcontroller as a basis for generating a second drive signal.
[0062] In one embodiment, if Figure 7 As shown, in step S16, that is, during the operation of the servo motor, the first servo motor operation information and the second servo motor operation information are obtained in real time, and the first servo motor operation information and the second servo motor operation information are fed back to the EtherCat master station at the same time, and also include: S161: Compare and judge the first servo motor operation information with a preset abnormal threshold value. If the first servo motor operation information is abnormal, generate first abnormal information.
[0063] Specifically, through the real-time data acquisition module of the microcontroller, the operation information of the first servo motor, including real-time position information, real-time speed information and current information, is compared item by item with the preset abnormal threshold value stored in the memory of the microcontroller. The abnormal threshold value is calibrated through experiments and set according to the design characteristics of the first servo motor. The comparison process adopts item-by-item differential calculation to subtract the corresponding abnormal threshold value from the real-time operation information. If the difference exceeds the allowable deviation range, the operation information is determined to be abnormal. For example, when the real-time speed exceeds the preset speed threshold, it is marked as a speed abnormality, or when the current information exceeds the preset current limit, it is marked as an overcurrent abnormality. The microcontroller generates first abnormal information according to the detected abnormality type.
[0064] S162: Compare and judge the second servo motor operation information with a preset abnormal threshold value. If the second servo motor operation information is abnormal, generate second abnormal information.
[0065] Specifically, through the abnormality detection module of the microcontroller, the operating information of the second servo motor, including real-time position information, real-time speed information and current information, is compared one by one with the preset abnormality threshold. The specific operation is to calculate the deviation value for each item of operating information. The calculation formula of the deviation value is the operating information minus the corresponding abnormality threshold. If the deviation value exceeds the preset range, the abnormality mark is triggered. For example, when the deviation of the real-time position information exceeds the preset position deviation range, it is marked as a position deviation abnormality, or when the current information is continuously higher than the current threshold, it is marked as an overcurrent abnormality. The microcontroller generates a second abnormality information based on the detected abnormal item.
[0066] S163: Generate first control response information according to the first abnormal information, and generate second control response information according to the second abnormal information.
[0067] Specifically, the first abnormal information is transmitted to the control response module through the abnormal processing module, and the microcontroller determines the specific content of the control response based on the abnormal type of the first abnormal information. If the abnormal type is an overcurrent abnormality, the control response module dynamically adjusts the current limit value of the first servo motor to reduce the driving force by reducing the current parameter. If the abnormal type is a speed abnormality, the target speed parameter is dynamically reduced to reduce the operating intensity. If the abnormal type is a position deviation abnormality, the target position information is dynamically adjusted to restore the deviation value to an allowable range. At the same time, when the duration of the abnormal state exceeds a preset time threshold, the control response module generates a protection operation instruction, including suspending the operation of the first servo motor or cutting off its control signal. For the second abnormal information, the control response module uses the same logic for processing and adjusts the operating parameters of the second servo motor according to the abnormal type. If the abnormal state of the second servo motor continues to exceed the preset time threshold, a protection operation instruction is generated to suspend the operation of the second servo motor.
[0068] In one embodiment, if Figure 8 As shown, in step S163, the first control response information includes: S1631: Based on the first control response information, confirm the first abnormality type of the first servo motor.
[0069] Specifically, the microcontroller reads the exception identification field in the first control response information and parses the exception type identifiers one by one, wherein the exception identifiers are generated based on the comparison result between the first servo motor operation information and the preset exception threshold, including the current exception identifier, the temperature exception identifier and the position deviation exception identifier. The microcontroller determines the specific exception type based on the activation status of the identifier.
[0070] S1632: When the first abnormal type is detected as the first operating current exceeding the preset current range, the current parameter is adjusted to reduce the driving force of the first servo motor; when the first abnormal type is detected as the first operating temperature exceeding the preset temperature range, the first speed parameter is adjusted to reduce the operating intensity of the first servo motor, or the operation of the first servo motor is suspended; when the first abnormal type is detected as the first position deviation exceeding the preset position range, the first position parameter is adjusted to within the preset position range.
[0071] Specifically, the microcontroller calls the corresponding parameter adjustment module according to the judgment result of the first abnormal type. If the first abnormal type is that the first operating current exceeds the preset current range, the microcontroller dynamically reduces the current parameter of the first servo motor. The specific operation is to select a limit value lower than the current operating current from the current limit control table, and apply the new limit value to the operation process by updating the drive signal of the first servo motor, thereby reducing the driving force. If the first abnormal type is that the first operating temperature exceeds the preset temperature range, the microcontroller reduces the operation intensity of the first servo motor by reducing the target speed parameter. The adjustment method is to multiply the current speed parameter by the reduction coefficient and then transmit it to the drive signal generation module. If the temperature abnormality lasts for a long time, the operation of the first servo motor is suspended, and the drive signal is cut off by a stop signal. If the first abnormal type is that the first position deviation exceeds the preset position range, the microcontroller adjusts the target position information to the allowable deviation range by performing position correction on the current target position information. After the adjustment is completed, the target position information is updated in real time to the operation control module of the first servo motor to restore normal operation.
[0072] S1633: If the first abnormal state duration of the first servo motor exceeds the preset abnormal state duration, first protection operation information is generated, and based on the first protection operation information, the operating state information of the second servo motor is adjusted through a dual-axis synchronous control algorithm.
[0073] Specifically, the microcontroller monitors the duration of the abnormal state of the first servo motor through the abnormality detection module. If the duration of the abnormal state exceeds a preset time threshold, the first protection operation information is immediately generated. The protection operation information includes an instruction to suspend the operation of the first servo motor and the parameters for adjusting the operating state of the second servo motor. The microcontroller calls the dual-axis synchronous control algorithm to re-analyze the target operating parameter information and real-time operating state information of the second servo motor, and adjusts the operating parameters of the second servo motor through dynamic compensation. For example, when the first servo motor is suspended, the target speed of the second servo motor is increased to complete the compensation task of independent operation, or the target position of the second servo motor is adjusted to adapt to the new working mode. The adjusted operating state information is updated to the second servo motor in real time through the drive signal.
[0074] In one embodiment, if Fig. 9As shown, in step S163, the second control response information includes: S1634: Based on the second control response information, confirm the second abnormality type of the second servo motor.
[0075] Specifically, the microcontroller reads the abnormal identification field in the second control response information and parses the abnormal identifiers one by one, wherein the activation state of the abnormal identifier is determined by the comparison result of the operating information of the second servo motor with the preset abnormal threshold, specifically including the current abnormality identifier, the temperature abnormality identifier and the position deviation abnormality identifier. The microcontroller determines the second abnormality type based on the activated identifier.
[0076] S1635: When the second abnormal type is detected as the second operating current exceeding the preset current range, adjust the current parameter to reduce the driving force of the second servo motor; when the second abnormal type is detected as the second operating temperature exceeding the preset temperature range, adjust the second speed parameter to reduce the operating intensity of the second servo motor, or suspend the operation of the second servo motor; when the second abnormal type is detected as the second position deviation exceeding the preset position range, adjust the second position parameter to within the preset position range.
[0077] Specifically, the microcontroller calls the corresponding adjustment module according to the judgment result of the second abnormal type. If the second abnormal type is that the second operating current exceeds the preset current range, the microcontroller dynamically reduces the current parameter of the second servo motor. The specific operation is to select a lower limit value from the current limit table, and limit the current output by updating the drive signal of the second servo motor to reduce the driving force. If the second abnormal type is that the second operating temperature exceeds the preset temperature range, the microcontroller reduces the operating intensity by lowering the target speed parameter. The adjustment method is to multiply the current target speed parameter by the reduction coefficient and then pass it to the drive signal generation module. If the temperature abnormality lasts for more than the set value, the operation of the second servo motor is suspended and the drive signal output is directly stopped. If the second abnormal type is that the second position deviation exceeds the preset position range, the microcontroller corrects the target position information and adjusts the target position information to within the allowable deviation range.
[0078] S1636: If the duration of the second abnormal state of the second servo motor exceeds the preset abnormal state duration, second protection operation information is generated, and based on the second protection operation information, the operating state information of the first servo motor is adjusted through the dual-axis synchronous control algorithm.
[0079] Specifically, the microcontroller monitors the duration of the abnormal state of the second servo motor through the abnormal detection module. If the duration exceeds a preset abnormal state time threshold, second protection operation information is generated. The protection operation information includes an instruction to suspend the operation of the second servo motor and an instruction to adjust the operating parameters of the first servo motor. The microcontroller calls the dual-axis synchronous control algorithm to recalculate the operating state of the first servo motor to adapt to the shutdown or abnormal operation of the second servo motor, and adjusts the target speed and target position of the first servo motor through dynamic compensation. For example, when the second servo motor is suspended, the target speed of the first servo motor is appropriately reduced to maintain the stability of the synchronization system, or the target position is adjusted to compensate for the motion trajectory deviation caused by the shutdown of the second servo motor. The adjusted operating parameters act on the first servo motor through a real-time update mechanism.
[0080] In one embodiment, if Fig.10 As shown, after step S163, first control response information is generated according to the first abnormal information, and second control response information is generated according to the second abnormal information, and then the following is further included: S164: When the abnormal state of the first servo motor is resolved, re-enabling the operation drive signal of the first servo motor.
[0081] Specifically, the microcontroller monitors the operating status of the first servo motor in real time to determine whether the abnormal state is lifted. When it is detected that the real-time operating parameters of the first servo motor are restored to a preset normal range, the microcontroller marks the first servo motor as an "abnormal state lifted" state, and then calls the drive signal recovery module to generate a restored operating drive signal. During the recovery process, the target operating parameters of the first servo motor are reinitialized, and it is ensured that the generation of the drive signal meets the current operating requirements. By reopening the drive signal output port, the microcontroller applies the restored operating drive signal to the first servo motor to drive it to re-enter the normal operating state.
[0082] S165: Readjust the operating parameters of the first servo motor and the second servo motor through a dual-axis synchronous control algorithm to restore dual-axis synchronous operation.
[0083] Specifically, after detecting that the abnormal state of the first servo motor is lifted, the microcontroller calls the dual-axis synchronous control algorithm, firstly collects the real-time operating status information of the first servo motor and the second servo motor, including real-time position information, real-time speed information and current target operating parameters, and determines the current operating difference between the two axes by calculating the relative position information and the relative speed information. The dual-axis synchronous control algorithm generates a dynamic compensation amount according to the calculation result, and the microcontroller adjusts the target operating parameters of the first servo motor through the dynamic compensation amount, for example, by increasing the target speed parameter of the first servo motor to reduce the relative position difference between the two axes, or adjusting the target position parameter to achieve synchronous position control of the two axes. After the adjustment is completed, the microcontroller generates an updated drive signal and applies it synchronously to the first servo motor and the second servo motor to ensure that the operating trajectory and speed of the two axes are consistent, thereby restoring the dual-axis synchronous operation state.
[0084] S166: When the abnormal state of the second servo motor is resolved, re-enabling the operation drive signal of the second servo motor.
[0085] Specifically, the microcontroller monitors the operating status information of the second servo motor to determine whether its abnormal state is lifted. When it is detected that the operating parameters of the second servo motor are restored to the normal range, the second servo motor is marked as "abnormality lifted" state, and then the drive signal recovery module is called to regenerate an operating drive signal adapted to the current operating state. The recovery process includes correcting the target operating parameters of the second servo motor to ensure that the restored operating signal matches the overall operating state of the system. The microcontroller reactivates the drive signal output port of the second servo motor and applies the generated operating drive signal to the second servo motor to make it re-enter normal operating state.
[0086] S167: Readjust the operating parameters of the first servo motor and the second servo motor through a dual-axis synchronous control algorithm to restore dual-axis synchronous operation.
[0087] Specifically, after the abnormal state of the second servo motor is released, the microcontroller calls the dual-axis synchronous control algorithm, collects the target operating parameters and feedback information of the first servo motor and the second servo motor in real time, calculates the relative position information and the relative speed information respectively, and transmits the calculation results to the dynamic compensation module, and adjusts the target operating parameters of the first servo motor and the second servo motor through the dynamic compensation amount. The adjustment content includes dynamically optimizing the target speed and target position of the two servo motors to reduce the synchronization error between the two axes. For example, when the speed of the first servo motor is faster than that of the second servo motor, the target speed of the first servo motor is reduced or the target speed of the second servo motor is increased to achieve speed synchronization. The adjusted operating parameters act on the two servo motors through the updated drive signal to ensure that the operating trajectory and dynamic performance of the two servo motors remain consistent, thereby restoring the dual-axis synchronous operation state.
[0088] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0089] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A dual-axis servo drive motor control device based on EtherCat communication, characterized in that: The dual-axis servo drive motor control device based on EtherCat communication includes an EtherCat master station, a network port, a network transformer, a microcontroller, a first IPM module, a second IPM module, a first servo motor, a second servo motor, a first encoder and a second encoder. The EtherCat master station is connected to the network transformer through the network port, the output end of the network transformer is connected to the input end of the microcontroller, the first output end of the microcontroller is connected to the input end of the first IPM module, the output end of the first IPM module is connected to the first servo motor, the output end of the first servo motor is connected to the first encoder, the output end of the first encoder is connected to the input end of the microcontroller, the second output end of the microcontroller is connected to the input end of the second IPM module, the output end of the second IPM module is connected to the second servo motor, the output end of the second servo motor is connected to the second encoder, the output end of the second encoder is connected to the input end of the microcontroller, and the state feedback output end of the microcontroller is connected to the EtherCat master station through the network port.
2. A dual-axis servo drive motor control device based on EtherCat communication according to claim 1, characterized in that: The dual-axis servo drive motor control device based on EtherCat communication also includes that when the EtherCat master station sends control information to the network port, the microcontroller calculates the first target operating parameter information and the second target operating parameter information according to the control information, combined with the first servo motor feedback information fed back by the first encoder and the second servo motor feedback information fed back by the second encoder, respectively; the microcontroller generates the first operating parameter information after synchronization optimization according to the first target operating parameter information, and outputs the first operating parameter information after synchronization optimization to the first IPM module; the first IPM module generates a first drive signal according to the first operating parameter information after synchronization optimization, and drives the first servo motor to operate through the first drive signal; the microcontroller generates the second operating parameter information after synchronization optimization according to the second target operating parameter information, and outputs the second operating parameter information after synchronization optimization to the second IPM module; the second IPM module generates a second drive signal according to the second operating parameter information after synchronization optimization, and drives the second servo motor to operate through the second drive signal; during the operation of the servo motor, the microcontroller simultaneously feeds back the first servo motor operation information and the second servo motor operation information to the EtherCat master station for real-time monitoring of the operating status of the first servo motor and the second servo motor.
3. A dual-axis servo drive motor control method based on EtherCat communication, applied to a dual-axis servo drive motor control device based on EtherCat communication as claimed in any one of claims 1-2, characterized in that: The dual-axis servo drive motor control method based on EtherCat communication includes: Acquire the control information, and based on the control information, collect feedback information of the first servo motor and feedback information of the second servo motor; According to the control information, combined with the feedback information of the first servo motor and the feedback information of the second servo motor, the first target operating parameter information and the second target operating parameter information are calculated respectively; Based on the first target operating parameter information and the second target operating parameter information, the relative position information and the relative speed information between the first servo motor and the second servo motor are analyzed by a dual-axis synchronous control algorithm to calculate a dynamic compensation amount; According to the dynamic compensation amount, synchronously optimizing the first target operating parameter information and the second target operating parameter information to generate the synchronously optimized first operating parameter information and the synchronously optimized second operating parameter information; Generate the first drive signal according to the first operating parameter information after the synchronous optimization, and drive the operation of the first servo motor based on the first drive signal; generate the second drive signal according to the second operating parameter information after the synchronous optimization, and drive the operation of the second servo motor based on the second drive signal; During the operation of the servo motor, the first servo motor operation information and the second servo motor operation information are acquired in real time, and the first servo motor operation information and the second servo motor operation information are fed back to the EtherCat master station at the same time.
4. A dual-axis servo drive motor control method based on EtherCat communication according to claim 3, characterized in that: The first target operating parameter information and the second target operating parameter information are calculated based on the control information and in combination with the feedback information of the first servo motor and the feedback information of the second servo motor, respectively, including: Acquire target position information and target speed information from the control information, acquire real-time position information of the first servo motor and real-time speed information of the first servo motor from the feedback information of the first servo motor, and acquire real-time position information of the second servo motor and real-time speed information of the second servo motor from the feedback information of the second servo motor; Calculating a first position deviation according to the target position information and the real-time position information of the first servo motor, and calculating a first speed deviation according to the target speed information and the real-time speed information of the first servo motor; Calculating a second position deviation according to the target position information and the real-time position information of the second servo motor, and calculating a second speed deviation according to the target speed information and the real-time speed information of the second servo motor; Based on the first position deviation and the first speed deviation, the first target operating parameter information is calculated through a servo motor position loop and speed loop control model; Based on the second position deviation and the second speed deviation, the second target operating parameter information is calculated through the servo motor position loop and speed loop control model.
5. The dual-axis servo drive motor control method based on EtherCat communication according to claim 3 is characterized in that: The method of analyzing the relative position information and the relative speed information between the first servo motor and the second servo motor by a dual-axis synchronous control algorithm based on the first target operating parameter information and the second target operating parameter information to calculate the dynamic compensation amount includes: The dual-axis synchronous control algorithm obtains the dynamic compensation amount based on the following formula: The dynamic compensation amount = α·(Δposition)+β·(Δspeed)+γ·(Δtarget), wherein the Δposition is the relative position deviation, the Δspeed is the relative speed deviation, the Δtarget is the target operating parameter deviation, the α is the weight coefficient of the position deviation, the β is the weight coefficient of the speed deviation, and the γ is the dynamic adjustment coefficient of the target operating state difference.
6. A dual-axis servo drive motor control method based on EtherCat communication according to claim 3, characterized in that: The synchronously optimizing the first target operating parameter information and the second target operating parameter information according to the dynamic compensation amount to generate the synchronously optimized first operating parameter information and the synchronously optimized second operating parameter information includes: The first operating parameter information after synchronous optimization is obtained by the following calculation formula: X=L+(α1·the Δ position+β1·the Δ speed+γ1·Δ first target), wherein X is the first operating parameter information after the synchronous optimization, L is the first target operating parameter information, Δ first target is the first target operating parameter deviation, and α1, β1 and γ1 are the weight coefficient of the first position deviation, the weight coefficient of the second speed deviation and the dynamic adjustment coefficient of the first target operating state difference respectively; The second operating parameter information after synchronous optimization is obtained by the following calculation formula: M=N+(α2·the Δposition+β2·the Δspeed+γ2·Δsecond target), wherein M is the second operating parameter information after the synchronous optimization, N is the second target operating parameter information, Δsecond target is the second target operating parameter deviation, and the α2, β2 and γ2 are respectively the weight coefficient of the second position deviation, the weight coefficient of the second speed deviation and the dynamic adjustment coefficient of the second target operating state difference.
7. The dual-axis servo drive motor control method based on EtherCat communication according to claim 1, characterized in that: The method further comprises: acquiring the first servo motor operation information and the second servo motor operation information in real time during the operation of the servo motor, and simultaneously feeding back the first servo motor operation information and the second servo motor operation information to the EtherCat master station; Compare and judge the first servo motor operation information with a preset abnormal threshold, and if the first servo motor operation information is abnormal, generate first abnormal information; Compare and judge the second servo motor operation information with the preset abnormal threshold, and if the second servo motor operation information is abnormal, generate second abnormal information; First control response information is generated according to the first abnormal information, and second control response information is generated according to the second abnormal information.
8. The dual-axis servo drive motor control method based on EtherCat communication according to claim 7, characterized in that: The first control response information includes: Based on the first control response information, confirming a first abnormality type of the first servo motor; When it is detected that the first abnormal type is that the first operating current exceeds the preset current range, the current parameter is adjusted to reduce the driving force of the first servo motor; when it is detected that the first abnormal type is that the first operating temperature exceeds the preset temperature range, the first speed parameter is adjusted to reduce the operating intensity of the first servo motor, or the operation of the first servo motor is suspended; when it is detected that the first abnormal type is that the first position deviation exceeds the preset position range, the first position parameter is adjusted to be within the preset position range; If the first abnormal state duration of the first servo motor exceeds a preset abnormal state duration, first protection operation information is generated, and based on the first protection operation information, the operating state information of the second servo motor is adjusted through the dual-axis synchronous control algorithm.
9. The dual-axis servo drive motor control method based on EtherCat communication according to claim 7, characterized in that: The second control response information includes: Based on the second control response information, confirming a second abnormality type of the second servo motor; When it is detected that the second abnormal type is that the second operating current exceeds the preset current range, the current parameter is adjusted to reduce the driving force of the second servo motor; when it is detected that the second abnormal type is that the second operating temperature exceeds the preset temperature range, the second speed parameter is adjusted to reduce the operating intensity of the second servo motor, or the operation of the second servo motor is suspended; when it is detected that the second abnormal type is that the second position deviation exceeds the preset position range, the second position parameter is adjusted to be within the preset position range; If the second abnormal state duration of the second servo motor exceeds the preset abnormal state duration, second protection operation information is generated, and based on the second protection operation information, the operating state information of the first servo motor is adjusted through the dual-axis synchronous control algorithm.
10. A dual-axis servo drive motor control method based on EtherCat communication according to claim 7, wherein the first control response information is generated according to the first abnormal information, and the second control response information is generated according to the second abnormal information, and then further comprises: When the abnormal state of the first servo motor is relieved, re-enabling the operation control signal of the first servo motor; Re-adjusting the operating parameters of the first servo motor and the second servo motor by the dual-axis synchronous control algorithm to restore the dual-axis synchronous operation; When the abnormal state of the second servo motor is relieved, re-enabling the operation control signal of the second servo motor; The operating parameters of the first servo motor and the second servo motor are readjusted by the dual-axis synchronous control algorithm to restore the dual-axis synchronous operation.
Citation Information
Cited By
Motor motion control circuit and method based on EtherCAT protocol
CN120090530A
Servo control method based on EtherCAT bus and related equipment
CN120233802A