- Configuring LinuxCNC
- Advanced Configuration
- EtherCAT
- Raspberry Pi 5 EtherCAT master servo thread period
Raspberry Pi 5 EtherCAT master servo thread period
12 Feb 2024 15:22 - 12 Feb 2024 15:31 #293152
by zmrdko
Raspberry Pi 5 EtherCAT master servo thread period was created by zmrdko
Hi,
i would like to share some research findings.
I have acquired RPi 5 since I wanted to check linuxcnc performance on this new single board PC.
The performance leap compared to RPi 4 is staggering. I tried to hook up Delta B3 EtherCAT drives, which was pretty straight-forward.
Browsing youtube for linuxcnc ethercat videos I come across this one:
So I thought that I should try this on raspberry pi 5. 125000ns was too much, but 250000ns was mostly OK.
But with this cycle times, servo drives started to have troubles with getting to OP mode.
Guys at etherlab found out, that ethercat master driver generic (DEVICE_MODULES="generic") is only good for 1000000ns threads/cycle time.
To reach better cycle times, I was told to try "genet" driver wich is working fine on Raspberry Pi 4. (RPi5 and RPi4 has the same ethernet chip BCM54213PE)
But the final verdict is, that RPi5 uses macb driver (Cadence GEM) and not genet.
Thats why we are stuck with generic device module.
Link to etherlab issue thread:
gitlab.com/etherlab.org/ethercat/-/issues/104
i would like to share some research findings.
I have acquired RPi 5 since I wanted to check linuxcnc performance on this new single board PC.
The performance leap compared to RPi 4 is staggering. I tried to hook up Delta B3 EtherCAT drives, which was pretty straight-forward.
Browsing youtube for linuxcnc ethercat videos I come across this one:
So I thought that I should try this on raspberry pi 5. 125000ns was too much, but 250000ns was mostly OK.
But with this cycle times, servo drives started to have troubles with getting to OP mode.
Guys at etherlab found out, that ethercat master driver generic (DEVICE_MODULES="generic") is only good for 1000000ns threads/cycle time.
To reach better cycle times, I was told to try "genet" driver wich is working fine on Raspberry Pi 4. (RPi5 and RPi4 has the same ethernet chip BCM54213PE)
But the final verdict is, that RPi5 uses macb driver (Cadence GEM) and not genet.
Thats why we are stuck with generic device module.
Link to etherlab issue thread:
gitlab.com/etherlab.org/ethercat/-/issues/104
Last edit: 12 Feb 2024 15:31 by zmrdko. Reason: formatting
The following user(s) said Thank You: CORBETT
Please Log in or Create an account to join the conversation.
12 Feb 2024 16:44 #293154
by 0x2102
Replied by 0x2102 on topic Raspberry Pi 5 EtherCAT master servo thread period
Install ethtool and run this in Terminal:
sudo apt install ethtool
ip a
sudo ethtool -c "NIC CARD NAME" and post your output.
In essence you are trying reduce the settings (buffer) as much as you can.
You can change the settings with:
sudo ethtool -C "NIC CARD NAME" "NEW SETTING".
Some drivers allow to reduce to 0, some others require a higher minimum number.
sudo apt install ethtool
ip a
sudo ethtool -c "NIC CARD NAME" and post your output.
In essence you are trying reduce the settings (buffer) as much as you can.
You can change the settings with:
sudo ethtool -C "NIC CARD NAME" "NEW SETTING".
Some drivers allow to reduce to 0, some others require a higher minimum number.
The following user(s) said Thank You: CORBETT
Please Log in or Create an account to join the conversation.
12 Feb 2024 18:22 #293157
by zmrdko
Replied by zmrdko on topic Raspberry Pi 5 EtherCAT master servo thread period
Hi!
thanks for reply.
see output in attachment
thanks for reply.
see output in attachment
Please Log in or Create an account to join the conversation.
12 Feb 2024 19:00 #293161
by rodw
Replied by rodw on topic Raspberry Pi 5 EtherCAT master servo thread period
Regarding Bjarnes comments on your issue about debian could you advise if you are using the image on the Downloads page?
Please Log in or Create an account to join the conversation.
12 Feb 2024 21:04 #293171
by 0x2102
Replied by 0x2102 on topic Raspberry Pi 5 EtherCAT master servo thread period
Now try to reducing those two settings:
sudo ethtool -C eth0 rx-usecs 0
sudo ethtool -C eth0 tx-usecs 0
If that errors out, try 1 or the lowest number the driver accepts.
sudo ethtool -C eth0 rx-usecs 0
sudo ethtool -C eth0 tx-usecs 0
If that errors out, try 1 or the lowest number the driver accepts.
The following user(s) said Thank You: CORBETT
Please Log in or Create an account to join the conversation.
13 Feb 2024 04:39 - 13 Feb 2024 04:43 #293192
by CORBETT
Replied by CORBETT on topic Raspberry Pi 5 EtherCAT master servo thread period
@0x2102
Hey man, thanks for posting that. I haven’t had this problem before, but I like learning new info in case I ever do!!! Nice…
@ zmrdko
Thanks for sharing your info. I knew the “generic” component was slower as Dominik had stated so years ago, and I always try to avoid hardware that is not already in the driver…
Hey man, thanks for posting that. I haven’t had this problem before, but I like learning new info in case I ever do!!! Nice…
@ zmrdko
Thanks for sharing your info. I knew the “generic” component was slower as Dominik had stated so years ago, and I always try to avoid hardware that is not already in the driver…
Last edit: 13 Feb 2024 04:43 by CORBETT.
Please Log in or Create an account to join the conversation.
13 Feb 2024 22:54 #293274
by zmrdko
Replied by zmrdko on topic Raspberry Pi 5 EtherCAT master servo thread period
Hey @rodw
I think I stated it somewhere in the thread over ther, but I used this image:
rpi-5-debian-bookworm-6.1.61-rt15-arm64-ext4-2023-11-17-1520.img.xz
from linuxcnc.org/downloads/
I think I stated it somewhere in the thread over ther, but I used this image:
rpi-5-debian-bookworm-6.1.61-rt15-arm64-ext4-2023-11-17-1520.img.xz
from linuxcnc.org/downloads/
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
13 Feb 2024 23:04 #293275
by zmrdko
Replied by zmrdko on topic Raspberry Pi 5 EtherCAT master servo thread period
@CORBETT
good point - I myself try to search here, which hardware work.
I bought some used hp prodesk, just to find out that it has realtek NIC, which has problems with latency.
Now I bought two dell optiplexes and they have intel NIC and much more settings available in BIOS regarding latency tuning.
But with new raspberry pi 5, someone has to find out first
Anyway, last comment from Bjarne says, that it is possible to port macb driver and suggested to compare some existing drivers (orig vs ethercat) to see what it takes.
However this is beyond my knowledge, so we have to find someone who is capable and willing to do it.
Or I can ask for quote at IGH.
good point - I myself try to search here, which hardware work.
I bought some used hp prodesk, just to find out that it has realtek NIC, which has problems with latency.
Now I bought two dell optiplexes and they have intel NIC and much more settings available in BIOS regarding latency tuning.
But with new raspberry pi 5, someone has to find out first
Anyway, last comment from Bjarne says, that it is possible to port macb driver and suggested to compare some existing drivers (orig vs ethercat) to see what it takes.
However this is beyond my knowledge, so we have to find someone who is capable and willing to do it.
Or I can ask for quote at IGH.
Please Log in or Create an account to join the conversation.
14 Feb 2024 00:04 #293280
by rodw
Replied by rodw on topic Raspberry Pi 5 EtherCAT master servo thread period
It may be worth trying this!
forum.linuxcnc.org/9-installing-linuxcnc...i-5?start=110#293279
forum.linuxcnc.org/9-installing-linuxcnc...i-5?start=110#293279
The following user(s) said Thank You: zmrdko
Please Log in or Create an account to join the conversation.
14 Feb 2024 00:30 - 14 Feb 2024 00:31 #293283
by zmrdko
I set bot values to 0.
Do you have any suggestion, how to verify, if its working?
I tried 250 000 ns thread and it did not make any difference (random first drive failing to get to OP)
Replied by zmrdko on topic Raspberry Pi 5 EtherCAT master servo thread period
Thanks for suggestion.Now try to reducing those two settings:
sudo ethtool -C eth0 rx-usecs 0
sudo ethtool -C eth0 tx-usecs 0
If that errors out, try 1 or the lowest number the driver accepts.
I set bot values to 0.
Do you have any suggestion, how to verify, if its working?
I tried 250 000 ns thread and it did not make any difference (random first drive failing to get to OP)
Last edit: 14 Feb 2024 00:31 by zmrdko.
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- EtherCAT
- Raspberry Pi 5 EtherCAT master servo thread period
Time to create page: 0.240 seconds