Basic knowledge of EtherCAT protocol (1)
Fieldbus has become an integrated component of automation technology, and has now been widely used through a large number of practical experiments and tests.
It is precisely because of the popularization of fieldbus technology that PC-based control systems can be widely used.
EtherCAT (Ethernet Control Automation Technology) is an open-architecture fieldbus system based on Ethernet. CAT in the name of EtherCAT is the acronym for ControlAutomationTechnology (Control Automation Technology). It was originally developed by Beckhoff Automation GmbH (Beckhoff Automation GmbH).
1. Overview of EtherCAT
①.Characteristic
Synchronization accuracy
Precise synchronization is particularly important in the distribution process where simultaneous actions are widely required. For example, when several servo axes are performing simultaneous linkage tasks, they have very high requirements for data synchronization.
Accurate calibration of distributed clocks is the most effective solution for synchronization. On the contrary, if full synchronization is adopted, the quality of the synchronized data will be greatly affected when there is an error in the communication. In the communication system, the step-by-step calibration clock has the error tolerance to a certain extent.
In EtherCAT, data exchange is completely based on pure hardware devices. Because the communication utilizes the logical ring network structure and full-duplex fast Ethernet and has the actual ring network structure, the "master clock" can simply and accurately determine the operating compensation for each "slave clock", and vice versa. The distributed clock is adjusted based on this value, which means that it can provide a very accurate clock base with a signal jitter of less than 1 microsecond within the network.
As shown in the figure below, the signal time jitter between 300 EtherCAT stations is only 20ns:
High availability
EtherCAT can achieve cable redundancy through simple measures. By connecting the last station in the network with the Ethernet port in the master station device, the linear topology can be expanded to ring redundant topology.
When the cable is damaged or the site failure occurs, the additional software detection in the main station stack will detect it and immediately switch to the redundant line operation, and each site does not need to change for this, and will not even realize that the network communication is working. Run in redundant circuit.
Rapidity
EtherCAT is based on standard Ethernet frame transmission, and the data capacity of a single frame can reach 1486 Bytes. Compared with the traditional field bus, its data transmission rate has been greatly improved. It can be 10Mbit/s or 100Mbit/s, and even relying on the supplementary EtherCAT G technology, the transmission rate can reach 1000Mbit/s. So EtherCAT has great advantages in terms of the amount of transmitted data.
Topological flexibility
EtherCAT has no device capacity limitation, and the maximum number of slave devices can reach 65535. Therefore, there is no need for a switch in the network. Only the topology between the devices can make EtherCAT data directly reach each slave.
EtherCAT supports almost all topological structures: star, linear, tree, daisy chain, etc., and supports various communication media such as cables and optical fibers. It also supports hot-swappable features to ensure flexible connections between devices Sex.
2.ISO/OSI Reference Model
EtherCAT only uses the three-layer protocol of the physical layer, link layer, and application layer, which is the same as most traditional fieldbuses, but compared to other real-time Ethernet protocols, such as PROFINET, EtherNet/IP, etc., its protocol stack is more streamlined.
This is also one of the important reasons why the real-time performance of the EtherCAT protocol is superior to other real-time Ethernet protocols.
3.EtherCAT master-slave architecture
The EtherCAT network adopts a master-slave architecture. The network configuration is configured on the PC host. The corresponding EMI (EtherCAT Master Information Files) and ESI (EtherCAT Slave Information Files) files need to be used. The dedicated configuration software (usually in the master station configuration software) Central Integration) After configuration, the ENI (EtherCAT Network Information Files) file is generated and downloaded to the master station, and the master station will identify the entire network based on the file.
The internal composition of the EtherCAT slave device in the picture is a process of implementing the OSI model of the EtherCAT protocol: RJ45 network port and PHY physical layer chip are used to implement the physical layer protocol; ESC is used to implement the link layer protocol, usually Beckhoff The official ET1100 chip is implemented; MCU is used to implement the application layer protocol, requiring the manufacturer to write the program code according to the corresponding protocol, or directly use the protocol stack code to achieve.
4.Message frame transmission mode
The EtherCAT message frame can only be sent by the master station. In a communication cycle, the master station sends an Ethernet data frame to each slave station. After the data frame arrives at the slave station, each slave station extracts the corresponding data from the data frame according to the addressing. And write the feedback data into the data frame. When the data frame is sent to the last slave station, it returns, and returns to the master station through the first slave station.