In the era of Industry 4.0, M2M (Machine to Machine) communication protocols play a pivotal role in connecting devices. Communication protocols must be capable of high-speed data communication, high bandwidth and easy implementation, and be flexible and error-free. To those requirements, Beckoff automation introduced Ethernet for Control Automation Technology (EtherCAT) in 2004 for the industrial environment. This spotlight gives you a brief idea about EtherCAT system architecture, its advantages, and system functionality of an EtherCAT network.
EtherCAT is an open industrial protocol. In automation technology, in particular, EtherCAT is often used as a real-time Ethernet communication.
It offers the following advantages:
- Can read or write up to 12,000 digital I/Os in 350 µs.
- Communication is faster as devices send multiple messages in a single frame and propagation delay is less.
- Gateways are used to provide the connection between the EtherCAT network and the Internet.
- EtherCAT slave devices will support any TCP/IP application program such as HTTP and HTTPS.
- Master devices issue the message and receive the response in a single frame, resulting in simplified masters.
- The network performance is independent of the microcontroller or microprocessor in slave devices.
- Supports all network topologies like Bus, Ring, Mesh, Star, and Tree.
EtherCAT is based on master-slave architecture. Although it supports all type of network topologies (Star, Ring, Bus, and Mesh), Ring and Bus topologies are widely used as they are easy to configure. A typical EtherCAT network (As shown in Figure-1) is consists of one or more Master Controller and multiple slaves connected using different physical media. Often these are Ethernet Cable, 100 BASE-TXI Twisted Pair Cable or 100BASE-FX Fiber. It also supports Low Voltage Differential Signaling (LVDS) but without galvanic isolation.
Figure .1: Basic EtherCAT system Architecture
A) Master Controller: The master controller is a combination of EtherCAT hardware and software running on a full-fledged Computer or SBCs. It provides the user interface through an HMI (Human Machine Interface). It monitors the communication process and takes care of diagnostics. This device has a standard Ethernet Network Interface Card (NIC) which helps to connect with the network. The EtherCAT Network Interface (ENI) file contained in the master, describes the network information and device initialization commands. Device initialization commands include starting up the network to cyclic updates the process data. A network interface tool is used to create a Network information file based on the information provided by the EtherCAT Slave Information files. The master controller has 4Kb of a specified memory location in it to store the slave address.
B) Slave Device: The slave device is used as an end-application, which includes sensors and actuators. The Slave devices can be implemented on a Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Microcontroller, or Microprocessor. These slave devices require an EEPROM (Electrically Erasable Program Read-Only Memory) to store the slave information interface. The EEPROM consists of hardware configuration information for slave devices. This information is loaded to the slave controller registers during power-up. This device has a Slave information File (ESI), which provides the functionality and settings to the master controller. Slave devices can have:
- Up to 32 Bit digital I/O
- Serial Peripheral Interface (SPI)
- 8/16-bit synchronous/asynchronous Microcontroller Interface (MCI)
The slave devices use Standard PHYs to implement the hardware functions for sending and receiving Ethernet frames. It interfaces the line modulation at one end and a binary packet signaling at the other end. The slave devices also have a pulse transformer to provide galvanic isolation between network and slave device. The Slave device has communication software and device-specific software. These help to handle process data exchange with the slave application, and an optional TCP/IP stack if the device supports Ethernet-over-EtherCAT (EoE).
How EtherCAT Communication Works?
During the network boot-up process, the master checks the network configuration and compares it with planned topology. It calculates the propagation delay from each node. The total network cycle time is computed using the sum of all slave devices response times. Only master devices can create a frame. Slave devices can read or write the process data into that frame. The Master assigns Ethernet header, EtherCAT header, slave address for individual Process Data Objects (PDOs), Process Data, Working Count, and CRC to create a complete message frame. The Network Interface Card sends that frame to the first slave device.
The slave can have up to 4 ports. Port 0 must be used as an input. The EEPROM stores slave identity information as well as information about the slave's functionality corresponding to the ESI file. Slave devices will pass the EtherCAT frame to the next node before processing the frame since it is uses processing-on-fly. Slave devices can read or write the Process Data Objects. A slave device can send data for another slave device downstream in the network. Where the receiving slave is not downstream of the sending slave, then the master receive that information and post in the next message frame. If the last node in a segment detects an open port in the network, it returns the message frame to the EtherCAT master.
Accurate synchronization is essential in the real-time process. EtherCAT network synchronization between devices depends on hardware. The first slave device provides a reference clock for the synchronization between all other slave devices.
The diagnosis of a system is a critical factor at commissioning time. When a problem occurs in an EtherCAT network, the master controller will check the actual configuration of the I/O terminals to the specified configuration. It helps to recognize individual terminals. The EtherCAT message frame has Work Count and CRC fields for error detection.
EtherCAT uses standard IEEE 802.3 Ethernet frames. Figure.2 shows the EtherCAT frame structure. It consists of 14 Bytes of Ethernet header, 2 Bytes of EtherCAT header, up to 1498 process data and the 4 Bytes of checksum (CRC).
Figure.2: EtherCAT Frame Format
- Ethernet Header: It consists of 48 bits of destination MAC, 48 bits of source MAC and EtherType, for example, 0x08A4 specifies for EtherCAT
- EtherCAT Header: The first 11 bits represent the data length. The second portion of the EtherCAT header is a reserved bit, which is followed by a type integer. The 4-bit type integer defines the type of message, ensuring correct interpretation, for example, 0x01 indicates CoE (CAN over EtherCAT).
- Process Data Objects (PDO): Actual message or variables for network devices are available in this field. One frame can have up to 1498 byte messages for different slave devices. The first 10 bytes consists of Command, data size, Read, Write permissions and slave address with an offset within the EtherCAT Slave Controller (ESC) address space.
- Working Counter (WC): The Working Counter is used for the cable redundancy check. The master device sends a 16-bit working counter with a default value "0" in the message frame. The slave device copies the message in its memory and increments the WC. This count helps the master controller to identify how many slaves had processed that data. If the Working Count is not matching the expected number, the master should resend the frame.
- Cyclic Redundancy Check (CRC): This field is used to identify the Bit error in the message frame. The slave devices check the moving message frame for Bit faults with a checksum. If there is an error in the message frame, the slave increases the error count. The master can detect where the failure occurred in the system using Modes Error Count.
Automation equipment vendors can utilize EtherCAT to improve performance and flexibility. EtherCAT provides a wide variety of standard application layer implementations including CoE (CANopen over EtherCAT), EoE (Ethernet over EtherCAT), FoE (File Transfer over EtherCAT), SoE (Servo Drive over EtherCAT), and FSoE (Safety over EtherCAT).