Skip to content

Commit bbec544

Browse files
committed
added more info about ethercat protocos
1 parent a004cde commit bbec544

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

docs/ethercat/index.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ INFO:
2424

2525
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.
2626

27+
<img src="../images/pdos.png" width="500">
28+
2729
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.
2830

31+
<img src="../images/mailbox_pdo.png" width="450">
32+
2933
NOTE:
3034
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](https://github.com/pollen-robotics/poulpe_ethercat_controller/tree/develop/ethercat_controller/Cargo.toml) file.
3135

@@ -42,9 +46,35 @@ INFO:
4246
- **FoE** - Fiile over Ethercat
4347

4448

45-
The SDO communication is used to read and write the data to the slave devices with a handshake. 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.
49+
### CoE communicaiton (SDO communication)
50+
51+
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.
52+
53+
<img src="../images/ethercat_sdo.png" width="500">
54+
55+
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.
56+
57+
Example of writing the value `1234` to the SDO index `0x100` and subindex `1` of the slave with id `0`:
58+
```shell
59+
ethercat download -p0 0x100 1 -t uint32 1234
60+
```
61+
To read the value of the SDO index `0x100` and subindex `1` of the slave with id `0`:
62+
```shell
63+
ethercat upload -p0 0x100 1 -t uint32
64+
```
65+
66+
67+
### FoE communication
68+
69+
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).
70+
In poulpe firmware, FoE is supported by the `firmware_Poulpe` version 1.5.x and only in `PREOP` (pre-operational) state.
71+
72+
<img src="../images/ethercat_foe.png" width="500">
4673

47-
The FoE communication is used to upload the files to the slave devices, in particular to upload the firmware to the slave devices. In poulpe firmware, it is supported by the `firmware_Poulpe` version 1.5.x and only in `PREOP` (pre-operational) state.
74+
Example of writing the file `file.bin` to the slave with id `0`:
75+
```shell
76+
ethercat foe_write -p0 file.bin --verbose
77+
```
4878

4979
## Communication configuration
5080

docs/ethercat/update_firmware_over_ethercat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ stat -c %s firmware.bin
2929
Then you can send the SDO request with the following command (ex. 1000 bytes):
3030

3131
```shell
32-
ethercat sdo_write -p0 0x100 1 -t uint32 1000 # it will write the value 1000 to the SDO index 0x100 and subindex 1 of the slave with id 0
32+
ethercat download -p0 0x100 1 -t uint32 1000 # it will write the value 1000 to the SDO index 0x100 and subindex 1 of the slave with id 0
3333
```
3434

3535
<details markdown="1"><summary><b>Read the number of bytes received by the poulpe board</b></summary>
3636

3737
You can also test how many bytes are already written to the poulpe board by reading the SDO index `0x100` and subindex `1`:
3838

3939
```shell
40-
ethercat sdo_read -p0 0x100 1 -t uint32 # it will read the value of the SDO index 0x100 and subindex 1 of the slave with id 0
40+
ethercat upload -p0 0x100 1 -t uint32 # it will read the value of the SDO index 0x100 and subindex 1 of the slave with id 0
4141
```
4242

4343
You should have exactly the same number of bites as the file size that you have written to the board.

docs/images/mailbox_pdo.png

28.4 KB
Loading

docs/images/pdos.png

38.7 KB
Loading

0 commit comments

Comments
 (0)