EtherCAT communication
There are several types of communicaiton supported by the EtherCAT protocol. The communication is divided into two main categories: - Real-time communication - Non real-time communication
Real-time communication
The real-time variables are exchanged over the network at a high frequency (typically 1kHz) using the PDO communication. There are two types of PDO communication supported by the crate
- Cyclic PDOs - buffered
- Mailbox PDOs - (optional)
Info
- PDO - Process Data Object
Cyclic PDOs are the most common way of exchanging the data over the network. The data is exchanged at a fixed frequency and the data is buffered, ensuring the continuitiy. If the data is not read in time, the data is overwritten with the new data.
Mailbox PDOs are used to ensure that the data is read and written properly. Mailbox enables a handshake between the master and the slave, ensuring that the data is read and written properly. If the data is not written in time, the master will not read the old data but will read zeros.
Note
In order to ensure the continuity, mailbox PDOs are buffered in software in the ethercat_controller
crate, with a timeout of 1s. If the data is not written in time, the master will consider the slave not operational and will fail. This procedure is enabled by default and can be disabled using the feature verify_mailbox_pdos
in its Cargo.toml file.
Non real-time communication - from firmware 1.5.x
The non real-time variables are exchanged over the network using the Mailbox protocol, based on CoE. There are two types of communication supported by the crate.
- SDO communication (Mailbox protocol with CoE)
- FoE communication for file upload - (Mailbox protocol with CoE)
Info
- SDO - Service Data Object
- CoE - Can Over Ethercat
- FoE - Fiile over Ethercat
CoE communicaiton (SDO communication)
The SDO communication is used to read and write the data to the slave devices with a handshake. Each time the master sends the read or write request, the slave device will respond with the confirmation. It is mostly used for configuring the slave devices and before starting the real-time communication. In poulpe firmware, it is supported by the firmware_Poulpe
version 1.5.x and the boards only respond to the SDO communication if they are in the PREOP
(pre-operational) state.
SDOs are indexed with a 16-bit index and an 8-bit subindex. The index is used to identify the object dictionary entry, and the subindex is used to identify the specific value within that entry.
Example of writing the value 1234
to the SDO index 0x100
and subindex 1
of the slave with id 0
:
0x100
and subindex 1
of the slave with id 0
:
FoE communication
The FoE communication is used to upload the files to the slave devices, in particular to upload the firmware to the slave devices. The FoE communication is based on the CoE communication and it sends the data over the network in data chunks. First chunk represents the write request and contains only the file name, while the rest of the chunks contain the data. Upon each chunk, the slave device will respond with the confirmation (acknowledgement).
In poulpe firmware, FoE is supported by the firmware_Poulpe
version 1.5.x and only in PREOP
(pre-operational) state.
Example of writing the file file.bin
to the slave with id 0
:
Communication configuration
The crate determins which kind of communication is available from the ESI XML file downloaded from the slave, and sets up the necessary infrastructure for the communication. See the poulpe configuration docs for more info on how to configure the poulpe boards for the EtherCAT network.
There are two versions of the natively supported firmware for the poulpe boards, that have slightly different communication structures:
firmware_Poulpe
version 1.0.x - firmware 1.0firmware_Poulpe
version 1.5.x - firmware 1.5
Note
Firmware 1.5.x version has the same PDO structure but it has been resturctured to support FoE and CoE communication.