Closed human2154 closed 2 years ago
Thanks for the detailed information. You do not however mention your OS version. Is it a preempt-rt patched linux kernel? What version? What is the hardware you running this test on?
SOEM will not magically make your system real-time with no jitter. You first have to check the real-time capability of your system. Are there any sources of jitter? Is your NIC configured to have the lowest latency? Did you move the real time task to its own isolated CPU? What are the priorities of your NIC interrupts? On what CPU are they handled? How are the C states of your system configured? Do your run drivers (for example NVIDIA) that are known to cause latency spikes?
Further I would advice to read other posts here on the subject. You are not the first one asking this question.
First, thank you for applying. And I will check another issue too. My goal is to control my motor without noise sound. But there's some noise from e-cat jitter.
So I delete almost codes, and ecatthread
just work ec_receive
and ec_send
codes.
In the main
function, It just calls simpletest
, makes EtherCAT thread, and does nothing.
There are no more other functions in the code, it is just made for testing jitter.
My master device spec is like this. -Ubuntu 16.04 -ROS kinetic -Kernel : xenomai 4.9.146 -Ethernet Controller : Intel® 82574L Gigabit Ethernet Controller -CPU : i5 10400 -RAM : 8Gb -GPU : CPU Built-in graphics card. -Slave : ELMO Platinum motor controller
SOEM (Simple Open EtherCAT Master)
Slaveinfo
Starting slaveinfo
ec_init on rteth0 succeeded.
1 slaves found and configured.
Calculated workcounter 3
Slave:1
Name:ModuleSlotsDrive
Output size: 48bits
Input size: 48bits
State: 4
Delay: 0[ns]
Has DC: 1
DCParentport:0
Activeports:1.0.0.0
Configured address: 1001
Man: 0000009a ID: 01100002 Rev: 00120025
SM0 A:1000 L: 256 F:00010026 Type:1
SM1 A:1400 L: 256 F:00010022 Type:2
SM2 A:1800 L: 6 F:00010064 Type:3
SM3 A:1c00 L: 6 F:00010020 Type:4
FMMU0 Ls:00000000 Ll: 6 Lsb:0 Leb:7 Ps:1800 Psb:0 Ty:02 Act:01
FMMU1 Ls:00000006 Ll: 6 Lsb:0 Leb:7 Ps:1c00 Psb:0 Ty:01 Act:01
FMMUfunc 0:1 1:2 2:3 3:0
MBX length wr: 256 rd: 256 MBX protocols : 0e
CoE details: 2f FoE details: 01 EoE details: 01 SoE details: 00
Ebus current: 0[mA]
only LRD/LWR:0
CoE Object Description found, 492 entries.
Index: 1000 Datatype: 0007 Objectcode: 07 Name: Device type
Sub: 00 Datatype: 0007 Bitlength: 0020 Obj.access: 0007 Name: Device type
Value :0x00020192 131474
Index: 1001 Datatype: 0005 Objectcode: 07 Name: Error register
Sub: 00 Datatype: 0005 Bitlength: 0008 Obj.access: 0007 Name: Error register
Value :0x24 36
Additionally, when I delete the DC code it has no same jitter. But it makes weird data every second and this data makes noise too. In the figure's red box, there's some weird datas.
Your last graph is not about noise or timing jitter, it is skipping a complete cycle. It could be related to interrupt coalescing of our NIC driver. How do your NIC settings look like with ethtool?
What you could do to figure this out is to instrument the PDO loop. Take time stamps of the send_processdata and receive_processdata. Also check receive_processdata for timeouts (WKC < 0). This would show if the problem is with the tx or rx stack.
@human2154 , can we close this issue?
Thank you for applying my issue. The reason of this jitter is sleep functions. I change my Thread sleep and DC sleep functions, and solve this problem. Thank you for your interest.
Thank you for applying my issue. The reason of this jitter is sleep functions. I change my Thread sleep and DC sleep functions, and solve this problem. Thank you for your interest.
Can I know how you changed your thread sleep and dc sleep functions? Is there anything wrong using the default clock_nanosleep
function ? I'm having this problem too.
Hello. I'm a beginner at EtherCAT. And thank you for developing SOEM.
I have some problems with Ethercat timing. And please help me to solve this problem. I use 'simpletest' code to initialize my EtherCAT slave 'ELMO Platinum Motor controller' and want to use it in 1kHz. And I use 'hilscher netANALYZER' for analysis Timing. And I refer #146 issue for solve my problem.
I use default 'simpletest' code -> I can't read & write slave's data
I add
ec_slave[slc].blockLRW = 1;
after PDO mapping and the timing shows in below figure. -> At the below right graph, There are two lines at 0us and 1000us. It means the data send twice.I changed all of
ec_send_processdata();
andec_config_map(&IOmap);
toec_send_overlap_processdata();
andec_config_overlap_map(&IOmap);
at 'simpletest' and 'ecatthread' -> I can not initialize my slaveI remove the
ec_slave[slc].blockLRW = 1;
-> I can read&write data And It works 1kHz! -> But another issue happened. The timing has periodic noise like nail marks. And it is shown in the below right figure. -> This EtherCAT noise disturbed the motor control signal and It makes a periodic noisy sound at my motor. (The cycle of Ecat noise and sound-noise are the same.)This is my
ethercatthread
and changedsimpletest
code. Am I changed wrong aboutLRW
andoverlap
function? Please help me. Thank you.