Ethernet control automation system, method, device, storage medium and product

By introducing a first-level slave station into the EtherCAT system for dynamic planning, motion control commands with smaller cycles are generated, which solves the problem of abnormal movement of servo equipment caused by master station clock drift and improves the stability and reliability of the system.

CN118363345BActive Publication Date: 2024-10-11ZKHM CNC SOFTWARE (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410798174.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-11
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

In the traditional EtherCAT system, due to the large clock drift of the master station, there is a difference in the instruction time received by the servo equipment, which affects its synchronization and movement accuracy, may lead to abnormal movement and communication interruption, and affects the stability and accuracy of the system. .

Method used

The first-level slave station is introduced to analyze the first motion control command issued by the master station, extract the motion parameters of the servo equipment, and generate the second motion control command through dynamic programming. Its issuance period is shorter than the first motion control command and is passed to The secondary slave station controls the servo equipment to avoid abnormal movement caused by clock drift.

Benefits of technology

It effectively avoids abnormal movement of servo equipment caused by clock drift, improves the stability and reliability of the system, ensures that servo equipment receives more precise and timely control instructions, and improves the smoothness and naturalness of movement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118363345B_ABST
    Figure CN118363345B_ABST
Patent Text Reader

Abstract

The present application discloses an Ethernet control automation system, method, device, storage medium and product, and relates to the field of industrial automation technology. The disclosed Ethernet control automation system includes: a master station, a primary slave station and a secondary slave station, wherein the primary slave station is respectively connected to the master station and the secondary slave station in communication; the primary slave station is used to: parse the first motion control command issued by the master station to obtain the motion parameters of the servo device; perform dynamic planning based on the motion parameters of the servo device to obtain the second motion control command, wherein the issuing cycle of the second motion control command is less than the first motion control command; issue the second motion control command to the secondary slave station, so that the secondary slave station can control the servo device according to the second motion control command. The present application can avoid the abnormal movement of the servo device caused by the clock drift of the Ethercat master station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial automation technology, and in particular to Ethernet control automation systems, methods, devices, storage media and products. Background Art

[0002] EtherCAT (Ethernet for Control Automation Technology) is a real-time industrial Ethernet technology that is widely used in industrial automation fields that require high-speed, real-time communication, such as robot control, industrial automation, test and measurement, motion control, etc. In these applications, EtherCAT master and slave stations achieve real-time control and monitoring of servo equipment through high-speed, low-latency data exchange.

[0003] With the development of industrial automation, the requirements for the real-time and stability of servo equipment in applications are getting higher and higher. In the traditional Ethercat system, due to the large clock drift of the master station, there are differences in the command time received by each servo device, which in turn affects their synchronization and motion accuracy. When the clock drift is serious, it may even cause communication interruption, making it impossible for the servo device to move according to the predetermined trajectory and speed, thereby generating errors. When the error accumulates to a certain extent, the servo device may experience obvious jitter or abnormal movement, affecting the stability and accuracy of the entire system.

[0004] In summary, how to avoid the clock drift of the Ethercat master station and cause abnormal movement of the servo device has become a technical problem that needs to be solved urgently in this field. Summary of the invention

[0005] The main purpose of the present application is to provide an Ethernet control automation system, method, device, storage medium and product, aiming to avoid abnormal movement of servo devices caused by clock drift of the Ethercat master station.

[0006] To achieve the above object, the present application proposes an Ethernet control automation system, which includes a master station, a primary slave station and a secondary slave station, wherein the primary slave station is communicatively connected with the master station and the secondary slave station respectively;

[0007] The primary slave station is used for:

[0008] Parsing the first motion control command issued by the master station to obtain motion parameters of the servo device;

[0009] Performing dynamic planning based on the motion parameters of the servo device to obtain a second motion control command, wherein the issuing period of the second motion control command is shorter than that of the first motion control command;

[0010] The second motion control command is sent to the secondary slave station, so that the secondary slave station controls the servo device according to the second motion control command.

[0011] In one embodiment, the primary slave station includes a first interface, a second interface, and a third interface;

[0012] The first interface is used for communication connection with the master station and other primary slave stations;

[0013] The second interface and the third interface are respectively used for communication connection with the secondary slave station.

[0014] In one embodiment, the primary slave station is further used for:

[0015] Scanning the second interface and the third interface to determine device information of the connected secondary slave station;

[0016] The device information is stored as a device list, wherein the device list includes device type, device connection interface and communication protocol.

[0017] In one embodiment, the primary slave station further includes a slave station control unit and a master control unit, and the slave station control unit is communicatively connected to the master control unit;

[0018] The slave control unit is used to send the first motion control command to the master control unit;

[0019] The main control unit is used to parse the first motion control command, obtain the motion parameters of the servo device, perform dynamic planning based on the motion parameters of the servo device, obtain the second motion control command, and send the second motion control command to the secondary slave station.

[0020] In one embodiment, the primary slave station further includes a configuration file read and write interface, a storage unit, a mode selection unit, and an external crystal oscillator;

[0021] The configuration file reading and writing interface is used to read and write the configuration file input externally, so that the primary slave station can match the secondary slave station according to the configuration file and complete the initialization work of the secondary slave station;

[0022] The storage unit is used for the reading and writing function of the configuration file and the firmware upgrade function;

[0023] The mode selection unit is used to switch the working mode of the second interface, and the second interface is an RJ45 interface;

[0024] The external crystal oscillator is used to provide a clock signal for the system.

[0025] In addition, to achieve the above purpose, the present application also proposes a servo device control method, which is applied to a primary slave station in an Ethernet control automation system, wherein the system further includes a master station and a secondary slave station that are communicatively connected to the primary slave station, and the servo device control method includes:

[0026] Parsing the first motion control command issued by the master station to obtain motion parameters of the servo device;

[0027] Performing dynamic planning based on the motion parameters of the servo device to obtain a second motion control command, wherein the issuing period of the second motion control command is shorter than that of the first motion control command;

[0028] The second motion control command is sent to the secondary slave station, so that the secondary slave station controls the servo device according to the second motion control command.

[0029] In one embodiment, before the step of parsing the first motion control command sent by the master station, the step further includes:

[0030] The secondary slave station is matched according to the configuration information input externally, and the initialization of the secondary slave station is completed.

[0031] In addition, to achieve the above objectives, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the servo device control method as described above.

[0032] In addition, to achieve the above purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the servo device control method as described above are implemented.

[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the servo device control method described above are implemented.

[0034] The present application proposes an Ethernet control automation system, which includes a master station, a first-level slave station and a second-level slave station. The first-level slave station is respectively connected to the master station and the second-level slave station for communication. In the system, the first-level slave station is used to parse a first motion control command from the master station to obtain motion parameters of a servo device. Then, the first-level slave station performs dynamic planning based on the motion parameters of the servo device to generate a second motion control command, and the issuance cycle of the second motion control command is shorter than the first motion control command issued by the master station. Then, the first-level slave station sends the second motion control command to the second-level slave station so that the second-level slave station can control the motion of the servo device according to the second motion control command, thereby ensuring that the servo device receives more precise and timely control instructions.

[0035] In this way, the first-level slave station effectively optimizes the command transmission in the system. In particular, for the clock drift problem that may exist in the master station, the first-level slave station can use its dynamic planning capability to adjust the first motion control command, thereby avoiding abnormal movement of the servo equipment due to clock drift and improving the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] Figure 1 A schematic diagram of the system structure provided for the first embodiment of the Ethernet control automation system of the present application;

[0039] Figure 2 A schematic diagram of the hardware structure of a primary slave station provided in Example 1 of the Ethernet control automation system of the present application;

[0040] Figure 3 A flow chart of the second embodiment of the servo device control method of the present application;

[0041] Figure 4 Another flowchart diagram provided for the second embodiment of the servo device control method of the present application;

[0042] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the servo device control method in the embodiment of the present application.

[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0046] The main solution of the embodiment of the present application is: to provide an Ethernet control automation system, the system includes a master station, a first-level slave station and a second-level slave station, the first-level slave station is respectively communicated with the master station and the second-level slave station; the first-level slave station is used to: parse the first motion control command issued by the master station to obtain the motion parameters of the servo device; perform dynamic planning based on the motion parameters of the servo device to obtain the second motion control command, wherein the issuance period of the second motion control command is less than the first motion control command; issue the second motion control command to the second-level slave station, so that the second-level slave station controls the servo device according to the second motion control command.

[0047] In traditional Ethercat systems, due to the large clock drift of the master station, there are differences in the command time received by each servo device, which in turn affects their synchronization and movement accuracy. When the clock drift is serious, it may even cause communication interruption, making it impossible for the servo device to move according to the predetermined trajectory and speed, thereby generating errors. When the error accumulates to a certain extent, the servo device may experience obvious jitter or abnormal movement, affecting the stability and accuracy of the entire system.

[0048] An embodiment of the present application provides a solution by introducing a first-level slave station into the system. The first-level slave station effectively optimizes the command transmission in the system. In particular, for the clock drift problem that may exist in the master station, the first-level slave station can use its dynamic programming capability to adjust the first motion control command, thereby avoiding abnormal movement of the servo device that may be caused by clock drift, and improving the stability and reliability of the system.

[0049] It should be noted that, in order to facilitate understanding and explanation of this embodiment, the traditional EtherCAT system is first described:

[0050] The EtherCAT system consists of a master station (Master) and multiple slave stations (Slave). The master station is the core part of the EtherCAT system, responsible for data collection, distribution, and system management and control. The master station does not need a special communication controller, and a standard Ethernet controller can be used. The master station packages all the data for the slave station and puts it into a packet. The packet will pass through all the slave stations in the order of connection. Each slave station will process the packet and finally return to the master station. In this way, an exchange of communication data is completed, and such communication will be completed once in each cycle.

[0051] The slave is the execution part of the EtherCAT system, responsible for receiving data sent by the master and performing corresponding operations. The EtherCAT slave uses a dedicated control chip, such as ESC (EtherCAT Slave Controller). The slave exchanges data through ESC hardware, bringing ultra-low communication delay.

[0052] In traditional EtherCAT systems, the clock stability of the master station's operating system (such as Windows, Linux, etc.) has a direct impact on the EtherCAT communication cycle. If the master station's operating system has a large clock drift (i.e., the difference between the actual time and the system time), this will cause the EtherCAT communication cycle to be unstable; when the EtherCAT system carries multiple servo devices, each servo device requires precise synchronization and instructions to ensure the accuracy of its movement. If the master station's clock drift is large, this will cause differences in the instruction time received by each servo motor, thereby affecting their synchronization and motion accuracy. In extreme cases, this clock drift may cause communication interruption, that is, some motors cannot receive instructions or feedback data in time; further, communication interruption or packet loss will cause the servo motor to fail to receive the expected instructions or send correct feedback data, which will prevent the motor from moving according to the predetermined trajectory and speed, thereby generating errors. When the error accumulates to a certain extent, the servo motor may experience obvious jitter or abnormal movement, affecting the stability and accuracy of the entire system.

[0053] In addition, servo drives produced by different manufacturers may use different communication protocols. These protocols may differ in data format, transmission method, error handling, etc. When servo drives using different communication protocols need to be connected to the EtherCAT bus, protocol conversion modules are required. These modules can convert the original protocol of the servo drive to the EtherCAT protocol, thereby achieving communication with the EtherCAT master station. The use of protocol conversion modules will undoubtedly increase development costs and production costs, and increase the complexity of communication, which may lead to an increase in communication overhead.

[0054] Based on this, the embodiment of the present application provides an Ethernet control automation system, referring to Figure 1 , Figure 1 This is a schematic diagram of the system structure of the first embodiment of the Ethernet control automation system of the present application.

[0055] In this embodiment, the Ethernet control automation system includes a master station, a primary slave station and a secondary slave station, wherein the primary slave station is respectively connected to the master station and the secondary slave station for communication;

[0056] The primary slave station is used for:

[0057] Parsing the first motion control command issued by the master station to obtain motion parameters of the servo device;

[0058] Performing dynamic planning based on the motion parameters of the servo device to obtain a second motion control command, wherein the issuing period of the second motion control command is shorter than that of the first motion control command;

[0059] The second motion control command is sent to the secondary slave station, so that the secondary slave station controls the servo device according to the second motion control command.

[0060] It should be noted that in the EtherCAT system of this embodiment, the master station is usually a control device, such as a PLC (Programmable Logic Controller) or a PC (Personal Computer), and the master station is responsible for sending control commands and receiving data from the slave stations; the primary slave station is located between the master station and the secondary slave station in the EtherCAT system, and is used to receive the control commands of the master station, perform necessary processing, and send the processed commands to the secondary slave station; the secondary slave station is a component of the EtherCAT system that is directly connected to the servo device or other actuator, which receives the control commands of the primary slave station and controls the movement of the servo device accordingly; the motion control command is an instruction used to instruct the servo device how to move.

[0061] After receiving the first motion control command sent by the master station, the first-level slave station will immediately parse it and extract the servo device motion parameters therein. The parameters may specifically be speed, acceleration, position and other parameters related to the servo device motion.

[0062] Then, the first-level slave station dynamically plans the motion parameters of the servo device obtained through analysis to generate a more accurate and efficient second motion control command based on the current system status, the actual performance of the servo device and the control requirements. The issuance cycle of the second motion control command is usually shorter than the first motion control command to ensure that the servo device can be controlled more frequently and accurately.

[0063] After dynamic planning, the primary slave station sends the generated second motion control command to the secondary slave station, so that after receiving these commands, the secondary slave station will control the servo device to perform corresponding movements according to the instructions therein.

[0064] There may be multiple primary slave stations, one primary slave station may be connected to multiple secondary slave stations, and one secondary slave station may be connected to multiple servo devices. The number of devices is not specifically limited in this embodiment.

[0065] In this way, the first-level slave station can be used as a multi-axis slave station, receiving control commands for multiple servo devices issued by the master station, re-planning them, and then distributing them to the second-level slave stations connected to each servo device, ensuring that the control intention of the master station can be accurately and efficiently transmitted to the servo device, thereby achieving precise control of the servo device.

[0066] At the same time, by converting the first motion control command into a second motion control command with a smaller sending cycle (such as 125us or shorter), the secondary slave station can update and execute these commands more frequently, thereby achieving more precise control, ensuring that the system can more finely control each motion step of the servo device, avoiding abnormal movement of the servo device due to clock drift of the master station, and achieving a smoother and more natural motion trajectory.

[0067] In a feasible implementation manner, the primary slave station includes a first interface, a second interface and a third interface;

[0068] The first interface is used for communication connection with the master station and other primary slave stations;

[0069] The second interface and the third interface are respectively used for communication connection with the secondary slave station.

[0070] It should be noted that the first interface is preferably an EtherCAT interface, the EtherCAT interface includes two interfaces, ECAT RJ45 network port 1 and ECAT RJ45 network port 2, the second interface is preferably an RJ45 interface, and the third interface is preferably a CAN interface.

[0071] The primary slave station is connected to the master station and other primary slave stations through the first interface, and is connected to different secondary slave stations through the second interface and the third interface.

[0072] Specifically, when the system includes multiple first-level slaves, the EtherCAT port of the master station in the system can be connected to the EtherCAT IN port (i.e., ECAT RJ45 network port 1) of the first first-level slave, and the EtherCAT OUT port (i.e., ECAT RJ45 network port 2) of the first first-level slave can be connected to the EtherCAT IN port of the next first-level slave, and so on, to form a chain connection.

[0073] In this way, compared with the traditional EtherCAT slave station that can only receive data sent by the master station and perform corresponding operations, the first-level slave station in this embodiment is compatible with the servo master station function. In addition to receiving data as a slave station, it can also send control commands to other second-level slave stations through its other interfaces (such as RJ45 interface, CAN interface) to achieve high-precision motion control.

[0074] In a feasible implementation manner, the primary slave station is further used for:

[0075] Scanning the second interface and the third interface to determine device information of the connected secondary slave station;

[0076] The device information is stored as a device list, wherein the device list includes device type, device connection interface and communication protocol.

[0077] In the pre-op stage (preparation stage before startup or initialization) of the primary slave, the primary slave performs various initialization operations, such as scanning hardware interfaces, loading configuration parameters, checking device status, etc. In this embodiment, the primary slave scans the configured second and third interfaces and the EtherCAT / Profinet dip switches in the pre-op stage to detect the secondary slaves connected to the peripheral interface. The primary slave numbers the detected secondary slaves and adds them to the device list.

[0078] The device information recorded in the device list includes the device type (such as servo drive, I / O module, etc.), the device connection interface (that is, whether the device is connected to the primary slave through the second interface or the third interface), and the communication protocol (such as EtherCAT, CAN, etc.).

[0079] In a feasible implementation manner, the primary slave station further includes a slave station control unit and a main control unit, and the slave station control unit is communicatively connected with the main control unit;

[0080] The slave control unit is used to send the first motion control command to the master control unit;

[0081] The main control unit is used to parse the first motion control command, obtain the motion parameters of the servo device, perform dynamic planning based on the motion parameters of the servo device, obtain the second motion control command, and send the second motion control command to the secondary slave station.

[0082] The slave control unit (i.e., ESC unit) is used to receive and forward the first motion control commands from the master station. Once these commands are received, the ESC unit will immediately send them to the master control unit for further processing and analysis.

[0083] The main control unit receives the first motion control command from the ESC unit, extracts the motion parameters of the servo device, and performs dynamic planning to generate a more accurate and efficient second motion control command based on the current system status, the actual performance of the servo device, and the control requirements. Then, the main control unit sends the generated second motion control command to the secondary slave station.

[0084] In a feasible implementation manner, the primary slave station further includes a configuration file read and write interface, a storage unit, a mode selection unit and an external crystal oscillator;

[0085] The configuration file reading and writing interface is used to read and write the configuration file input externally, so that the primary slave station can match the secondary slave station according to the configuration file and complete the initialization work of the secondary slave station;

[0086] The primary slave station is equipped with a dedicated configuration file reading and writing interface, preferably a USB 3.0 interface, which allows users or system administrators to read and write configuration files through external devices (such as PCs, tablets, etc.). The configuration file contains configuration information for the secondary slave station, such as device type, communication parameters, working mode, etc. The primary slave station will match the secondary slave station according to these configuration files and automatically complete the initialization of the secondary slave station to ensure the stable operation of the entire system.

[0087] The storage unit is used for the reading and writing function of the configuration file and the firmware upgrade function;

[0088] The storage unit is a component in the primary slave station used to store data and firmware. It not only supports the reading and writing functions of the configuration files, so that the primary slave station can be configured and operated accordingly according to the configuration files; it also supports the firmware upgrade function, allowing users to write new firmware versions to the primary slave station through external devices, thereby realizing system upgrades and updates, making the primary slave station more flexible and scalable.

[0089] The mode selection unit is used to switch the working mode of the second interface, and the second interface is an RJ45 interface;

[0090] The mode selection unit is a control unit in the first-level slave station for switching the working mode of the second interface. In the present embodiment, the second interface is an RJ45 interface, which supports a variety of communication protocols and working modes. The mode selection unit can flexibly switch the working mode of the second interface according to system requirements or user settings to adapt to different application scenarios and communication requirements.

[0091] The external crystal oscillator is used to provide a clock signal for the system.

[0092] The external crystal oscillator is a component used to provide a clock signal in the primary slave station. It can provide a stable and accurate clock signal for the entire system, ensuring that each module and component can work according to the predetermined timing. This improves the stability and reliability of the system and reduces faults and errors caused by unstable clock signals.

[0093] For example, in a feasible embodiment, the hardware structure diagram of the primary slave station is as follows: Figure 2 As shown, the primary slave station mainly includes an ECS communication unit (i.e., a slave station control unit) and a slave station master control unit, wherein the master control unit adopts an ARM solution, wherein the ESC communication unit and the ARM use FSMC (Flexible Static Memory Controller) or SPI (Serial Peripheral Interface) communication. The ESC communication unit is an FPGA (Field-Programmable Gate Array), which integrates two Fast Ethernet PHYs (Physical Layers) that support 100Mbps full-duplex operation; the periphery of the slave station master control unit includes an RJ45 network interface, a CAN interface, a USB3.0 interface, a storage unit, and an external crystal oscillator. The RJ45 and CAN interfaces are used as communication interfaces for the secondary slave station, the USB 3.0 interface is used as a configuration file read and write interface, the storage unit is mainly used for the configuration file read and write function and the firmware upgrade function, the external crystal oscillator provides an accurate clock for the entire system, and the mode selection unit is used to switch the working mode of the RJ45.

[0094] In summary, the secondary slave station in the embodiment of the present application acts as an independent bus system, and its communication with the master station is independent and is not directly affected by the communication delay or jitter of the master station, so that the secondary slave station can operate more stably and reliably, and its performance depends more on its own real-time performance and processing capabilities. At the same time, the first-level slave station converts the parsed first motion control command into a second motion control command with a smaller period value, so that the secondary slave station can update and execute commands more frequently, thereby improving the real-time performance of the system. Even if there is a slight delay or jitter in the master station, due to the high real-time performance of the slave station, this effect can be alleviated to a certain extent.

[0095] In addition, by configuring multiple hardware interfaces in the first-level slave station, the system can support a variety of different servo devices and communication protocols, thereby adapting to different application scenarios and requirements and achieving better compatibility and collaboration with servo devices.

[0096] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and no further description will be given later. On this basis, the embodiment of the present application provides a servo device control method, referring to Figure 3 , Figure 3 This is a flow chart of the servo device control method of the present application.

[0097] In this embodiment, the servo device control method is applied to a primary slave station in an Ethernet control automation system in Embodiment 1, and the system further includes a master station and a secondary slave station that are communicatively connected to the primary slave station.

[0098] In this embodiment, the servo device control method includes steps S10 to S30:

[0099] Step S10, parsing the first motion control command issued by the master station to obtain motion parameters of the servo device;

[0100] After receiving the first motion control command sent by the master station, the first-level slave station will immediately parse it and extract the servo device motion parameters therein. The parameters may specifically be speed, acceleration, position and other parameters related to the servo device motion.

[0101] Step S20, performing dynamic programming based on the motion parameters of the servo device to obtain a second motion control command, wherein the issuing period of the second motion control command is shorter than that of the first motion control command;

[0102] The first-level slave station dynamically plans the servo device motion parameters obtained through analysis to generate a more accurate and efficient second motion control command based on the current system status, the actual performance of the servo device and the control requirements. The issuance cycle of the second motion control command is usually shorter than the first motion control command to ensure that the servo device can be controlled more frequently and accurately.

[0103] Step S30 , sending the second motion control command to the secondary slave station, so that the secondary slave station controls the servo device according to the second motion control command.

[0104] After dynamic planning, the primary slave station sends the generated second motion control command to the secondary slave station, so that after receiving these commands, the secondary slave station will control the servo device to perform corresponding movements according to the instructions therein.

[0105] In a feasible embodiment, before step S10, step S40 is also included:

[0106] Step S40, matching the secondary slave station according to the externally input configuration information, and completing the initialization of the secondary slave station.

[0107] The primary slave station will match the secondary slave station according to the external input configuration file, and automatically complete the initialization of the secondary slave station to ensure the stable operation of the entire system.

[0108] For example, to help understand the implementation process of the servo device control method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 4 , Figure 4 A brief flow chart of a servo device control method is provided, specifically:

[0109] First, after the system is started or reset, the first-level slave will deploy all hardware parts during the initialization phase to ensure that each component is in the correct initial state; then, the first-level slave enters the preop (preparation for operation) phase, at which time the first-level slave will dynamically scan all connected peripheral device interfaces to determine changes in the devices connected to the interfaces. The scanned devices will be renumbered and added to the RAM (random access memory) for subsequent management and control; then, the device file of the memory unit is read through the dip switch, the device description file is parsed, and the parsed information is matched with the second-level slave connected to the peripheral device interface to complete the initialization of the second-level slave.

[0110] Then, during the initialization process, the first-level slave will set the watchdog timer (a mechanism to prevent the system from freezing) and dynamically detect changes in devices on the bus. When the master sends the safeop (safe operation mode) and op (operation) mode commands, the first-level slave, as a multi-axis slave supporting the CIA402 protocol, will respond and perform the corresponding operations; after receiving the servo enable command sent by the master, the first-level slave will enable the corresponding second-level slave device to start executing the motion control command. After that, the slave will parse the motion control command sent by the master, obtain the speed, acceleration, position and other motion-related parameters, and dynamically plan them according to the parsing results, convert them into values ​​with a smaller cycle, and send them to the corresponding second-level devices under the second-level bus with a cycle of 125us or less, so as to maintain the subordinate second-level slaves to maintain the periodic position mode or periodic speed mode, that is, the data frame sent in the unit cycle of the master is interpolated with a 125us or shorter cycle in the slave for the servo device controlled by the cycle. In addition, when the master exits the current cycle, the enable is canceled synchronously.

[0111] In this way, the time of the master control unit of the first-level slave station is affected by the Ethercat bus DC synchronization of the entire system. At the same time, this time is also used for the time synchronization of the second-level slave station, that is, the time of all servo devices in the entire system is synchronized.

[0112] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the servo device control method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0113] An embodiment of the present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the servo device control method in the above-mentioned embodiment 1.

[0114] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players: portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0115] like Figure 5 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0116] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0117] The electronic device provided in the embodiment of the present application adopts the servo device control method in the above embodiment, which can avoid the clock drift of the Ethercat master station and cause abnormal movement of the servo device. Compared with the prior art, the beneficial effects of the electronic device provided in the embodiment of the present application are the same as the beneficial effects of the servo device control method provided in the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the servo device control method in the previous embodiment, which will not be repeated here.

[0118] It should be understood that the various parts disclosed in the embodiments of the present application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0119] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0120] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the servo device control method in the above embodiment.

[0121] The computer-readable storage medium provided in the embodiment of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0122] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0123] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: parses the first motion control command issued by the master station to obtain the motion parameters of the servo device; performs dynamic planning based on the motion parameters of the servo device to obtain the second motion control command, wherein the issuance period of the second motion control command is less than that of the first motion control command; and issues the second motion control command to the secondary slave station so that the secondary slave station controls the servo device according to the second motion control command.

[0124] The computer program code for performing the operation of the embodiment of the present application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0127] The readable storage medium provided in the embodiment of the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned servo device control method, and can avoid the clock drift of the Ethercat master station and cause abnormal movement of the servo device. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiment of the present application are the same as the beneficial effects of the servo device control method provided in the above-mentioned embodiment, and will not be repeated here.

[0128] The present application also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the servo device control method as described above are implemented.

[0129] The computer program product provided by the present application can solve the technical problem of servo device control. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the servo device control method provided by the above embodiment, which will not be repeated here.

[0130] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. An Ethernet control automation system, characterized in that: The system comprises a master station, a primary slave station and a secondary slave station, wherein the primary slave station is communicatively connected with the master station and the secondary slave station respectively; The primary slave station is used for: Parsing the first motion control command issued by the master station to obtain motion parameters of the servo device; Performing dynamic planning based on the motion parameters of the servo device to obtain a second motion control command, wherein the issuing period of the second motion control command is shorter than that of the first motion control command; Sending the second motion control command to the secondary slave station, so that the secondary slave station controls the servo device according to the second motion control command; The first-level slave station includes a first interface, a second interface and a third interface; The first interface is used for communication connection with the master station and other primary slave stations; The second interface and the third interface are respectively used for communication connection with the secondary slave station; The first-level slave station also includes a configuration file read and write interface, a storage unit, a mode selection unit and an external crystal oscillator; The configuration file reading and writing interface is used to read and write the configuration file input externally, so that the primary slave station can match the secondary slave station according to the configuration file and complete the initialization work of the secondary slave station; The storage unit is used for the reading and writing function of the configuration file and the firmware upgrade function; The mode selection unit is used to switch the working mode of the second interface, and the second interface is an RJ45 interface; The external crystal oscillator is used to provide a clock signal for the system.

2. The system according to claim 1, characterized in that The primary slave station is also used for: Scanning the second interface and the third interface to determine device information of the connected secondary slave station; The device information is stored as a device list, wherein the device list includes device type, device connection interface and communication protocol.

3. The system according to claim 1, characterized in that The first-level slave station also includes a slave station control unit and a main control unit, and the slave station control unit is communicatively connected with the main control unit; The slave control unit is used to send the first motion control command to the master control unit; The main control unit is used to parse the first motion control command, obtain the motion parameters of the servo device, perform dynamic planning based on the motion parameters of the servo device, obtain the second motion control command, and send the second motion control command to the secondary slave station.

4. A servo device control method, characterized in that: A primary slave station applied to an Ethernet control automation system, the system further comprising a master station and a secondary slave station in communication connection with the primary slave station, the method comprising: Parsing the first motion control command issued by the master station to obtain motion parameters of the servo device; Performing dynamic planning based on the motion parameters of the servo device to obtain a second motion control command, wherein the issuing period of the second motion control command is shorter than that of the first motion control command; Sending the second motion control command to the secondary slave station, so that the secondary slave station controls the servo device according to the second motion control command; The first-level slave station includes a first interface, a second interface and a third interface; the first interface is used for communication connection with the master station and other first-level slave stations; the second interface and the third interface are respectively used for communication connection with the second-level slave station; The first-level slave station also includes a configuration file read and write interface, a storage unit, a mode selection unit and an external crystal oscillator; the configuration file read and write interface is used to read and write external input configuration files so that the first-level slave station can match the second-level slave station according to the configuration files and complete the initialization of the second-level slave station; the storage unit is used for the configuration file read and write function and the firmware upgrade function; the mode selection unit is used to switch the working mode of the second interface, which is an RJ45 interface; the external crystal oscillator is used to provide a clock signal for the system.

5. The method according to claim 4, characterized in that Before the step of parsing the first motion control command issued by the master station, the step further includes: The secondary slave station is matched according to the configuration information input externally, and the initialization of the secondary slave station is completed.

6. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the servo device control method according to any one of claims 4 to 5.

7. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the servo device control method according to any one of claims 4 to 5 are implemented.

8. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the servo device control method according to any one of claims 4 to 5 are implemented.