EtherCAT (Ethernet for Control Automation Technology) is an Ethernet communication technology/protocol by Beckhoff designed for speed, simplicity and reliability.
In short, it is an Ethernet-based fieldbus system. In basic terms, this means that it is specialised way to link up devices in such a way that they can communicate with each other in an efficient way, such that it can be used for real-time computing. This is very useful in a lot of situations, one of them being when we want to work with haptic feedback, requiring ~1000Hz refresh rates.
A stack of data (a telegram) is passed around each node in the system. Each slave device reads out the data it needs, and inserts its data in the frame as it moves down-stream. The last node in a segment detects an open port and sends the message back to the master. This whole process happens within about a millisecond.
In order for this to work, we need to give a set of instructions with the model we want to run in order for the system to understand how to communicate with each device. Specifically, we need:
We need to give these xml files to our program so that it knows what data to send/receive from where. Once the program runs, the EtherCAT master parameterizes each EtherCAT slave during the start-up phase to define which process data (Process Data Objects, PDOs) it wants to transfer to or from this slave (size in bits/bytes, source location, transmission type). This data is then sent & received each cycle and is modified according to your program. The slave devices use this data for whatever it needs, e.g. to make a linear motor move, and send whatever data is requested, e.g. position sensor data.
Working with EtherCAT is rather different from working with most other communication technology. If you’re going to be working with it, it’ll be useful to get a basic understanding of how it works before actually working with it.
In order to work with EtherCAT and Simulink Real-Time, you have to first generate the network descriptor file, namely the ENI file, which describes the topology, characteristics (e.g. Distributed Clock, EoE, FoE, CoE, PDO), and cycle time of the network.
In order to set up the ENI file, depending on the Matlab version you have installed, you have to use different software:
See also:
In order to actually make the configured do something, we’ll need to give it a set of instructions to run on (a model or a program). This can be done in a number of different ways: