- Posts: 40
- Thank you received: 10
Ethercat HAL driver
- cgc
- Offline
- Senior Member
-
Less
More
10 years 6 months ago #73885
by cgc
Replied by cgc on topic Ethercat HAL driver
<master idx="0" appTimePeriod="24770000" refClockSyncCycles="1">
"24770000", this is a very long time period, ~25ms
the servo period is more faster, servo_period_nsec=1000000, ~1ms
"24770000", this is a very long time period, ~25ms
the servo period is more faster, servo_period_nsec=1000000, ~1ms
The following user(s) said Thank You: Cpk_Rbt
Please Log in or Create an account to join the conversation.
- Cpk_Rbt
- Offline
- Senior Member
-
Less
More
- Posts: 53
- Thank you received: 4
10 years 6 months ago - 10 years 6 months ago #73903
by Cpk_Rbt
Replied by Cpk_Rbt on topic Ethercat HAL driver
cgc,
I changed the ~25ms period to match the servo period at 1ms. It still hung up after running for a few minutes, so I changed them both to 25ms instead.
Andy,
I tried typing the HAL commands into the terminal one by one and tried to look at the kernel.log. It came back "file not found" but I am able to see some information using dmesg instead.
From dmesg output:
Edit: I changed the periods back to 1ms and it did not display the "did not sync after 5000ms" message, but it did freeze the computer almost immediately.
I changed the ~25ms period to match the servo period at 1ms. It still hung up after running for a few minutes, so I changed them both to 25ms instead.
Andy,
I tried typing the HAL commands into the terminal one by one and tried to look at the kernel.log. It came back "file not found" but I am able to see some information using dmesg instead.
From dmesg output:
Code:
EtherCAT WARNING 0-0: Slave did not sync after 5028 ms.
Edit: I changed the periods back to 1ms and it did not display the "did not sync after 5000ms" message, but it did freeze the computer almost immediately.
Last edit: 10 years 6 months ago by Cpk_Rbt.
Please Log in or Create an account to join the conversation.
- wazjebk
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 3
10 years 6 months ago #73905
by wazjebk
Replied by wazjebk on topic Ethercat HAL driver
Hi,
I had the same problem and than I changed the driver in ethercat configuration for my network card chip and after that I had no more problems.
Best regards.
I had the same problem and than I changed the driver in ethercat configuration for my network card chip and after that I had no more problems.
Best regards.
The following user(s) said Thank You: Cpk_Rbt
Please Log in or Create an account to join the conversation.
- Cpk_Rbt
- Offline
- Senior Member
-
Less
More
- Posts: 53
- Thank you received: 4
10 years 6 months ago - 10 years 6 months ago #73912
by Cpk_Rbt
Replied by Cpk_Rbt on topic Ethercat HAL driver
wazjebk,
Thanks for the tip!
It looks like my network card is a Realtek RTL8111/8168B. I didn't see a driver option for that in the EtherCAT master, so I picked the r8169 driver.
In case anyone else has this problem in the future, I achieved the best results by re-installing the ethercat master using some flags on the configure step:
Thanks for the tip!
It looks like my network card is a Realtek RTL8111/8168B. I didn't see a driver option for that in the EtherCAT master, so I picked the r8169 driver.
In case anyone else has this problem in the future, I achieved the best results by re-installing the ethercat master using some flags on the configure step:
Code:
./configure --enable-r8169 --disable-generic --disable-e100 --disable-e1000 --disable-8139too
Last edit: 10 years 6 months ago by Cpk_Rbt.
Please Log in or Create an account to join the conversation.
- Cpk_Rbt
- Offline
- Senior Member
-
Less
More
- Posts: 53
- Thank you received: 4
10 years 6 months ago - 10 years 6 months ago #73936
by Cpk_Rbt
Replied by Cpk_Rbt on topic Ethercat HAL driver
Communications are now working between the master, HAL driver, and drive. Thanks everyone for the help!
HAL script:
When I run the above script, I can run show pin lcec at the halcmd and it shows the current value of the motor position. Sometimes the value is 0, but if I run the command again it will update to the actual position.
The values next to lcec.read-all.time and lcec.write-all.time change every time I run show pin lcec, but the motor position never does.
If I quit and restart the hal script, it will update the position again (just the once) and then no more.
Checking dmesg shows the following:
The "Slave did not sync after 5000ms" has me thinking that the watchdog timeout is not configured correctly. I have the divider at 0 and intervals at 1000, which I don't think is right, but I don't know what to put there instead. I tried changing the divider to 2498 based on a different configuration guide, but then get spam in dmesg about "Failed to set watchdog divider"
Thank you for reading through the wall of text! If you have any thoughts at this point, I would really appreciate it.
HAL script:
Warning: Spoiler!
loadusr -W lcec_conf ethercat_config_n.xml
loadrt lcec
loadrt trivkins
loadrt motmod base_period_nsec=0 servo_period_nsec=1000000 num_joints=1
addf lcec.read-all servo-thread
addf lcec.write-all servo-thread
start
loadrt lcec
loadrt trivkins
loadrt motmod base_period_nsec=0 servo_period_nsec=1000000 num_joints=1
addf lcec.read-all servo-thread
addf lcec.write-all servo-thread
start
When I run the above script, I can run show pin lcec at the halcmd and it shows the current value of the motor position. Sometimes the value is 0, but if I run the command again it will update to the actual position.
The values next to lcec.read-all.time and lcec.write-all.time change every time I run show pin lcec, but the motor position never does.
If I quit and restart the hal script, it will update the position again (just the once) and then no more.
Checking dmesg shows the following:
Warning: Spoiler!
[ 9766.176591] I-pipe: head domain RTAI registered.
[ 9766.176612] RTAI[hal]: compiled with gcc version 4.7.2 (Debian 4.7.2-5) .
[ 9766.176999] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[ 9766.177010] SYSINFO: CPUs 2, LINUX APIC IRQ 2312, TIM_FREQ 8333188, CLK_FREQ 1599883000, CPU_FREQ 1599883000
[ 9766.177019] RTAI_APIC_TIMER_IPI: RTAI DEFINED 2314, VECTOR 2314; LINUX_APIC_TIMER_IPI: RTAI DEFINED 2312, VECTOR 2312
[ 9766.177029] TIMER NAME: lapic; VARIOUSLY FOUND APIC FREQs: 8333188, 8333188, 8209250
[ 9766.197663] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 9766.197774] , <uses LINUX SYSCALLs>, kstacks pool size = 524288 bytes.
[ 9766.197788] RTAI[sched]: hard timer type/freq = APIC/8333188(Hz); default timing: oneshot; linear timed lists.
[ 9766.197798] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1599883000 hz.
[ 9766.197805] RTAI[sched]: timer setup = 999 ns, resched latency = 2943 ns.
[ 9766.217638] RTAI[math]: loaded.
[ 9766.376310] EtherCAT: Requesting master 0...
[ 9766.376326] EtherCAT: Successfully requested master 0.
[ 9766.376685] EtherCAT 0: Domain0: Logical address 0x00000000, 12 byte, expected working counter 3.
[ 9766.376695] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 12 byte, type LRW.
[ 9766.376753] EtherCAT 0: Master thread exited.
[ 9766.376769] EtherCAT 0: Starting EtherCAT-OP thread.
[ 9771.490315] EtherCAT WARNING 0-0: Slave did not sync after 5000 ms.
[ 9771.501319] EtherCAT 0: Domain 0: Working counter changed to 2/3.
[ 9771.516337] EtherCAT 0: Slave states on main device: OP.
[ 9772.505173] EtherCAT 0: Domain 0: Working counter changed to 3/3.
[ 9766.176612] RTAI[hal]: compiled with gcc version 4.7.2 (Debian 4.7.2-5) .
[ 9766.176999] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[ 9766.177010] SYSINFO: CPUs 2, LINUX APIC IRQ 2312, TIM_FREQ 8333188, CLK_FREQ 1599883000, CPU_FREQ 1599883000
[ 9766.177019] RTAI_APIC_TIMER_IPI: RTAI DEFINED 2314, VECTOR 2314; LINUX_APIC_TIMER_IPI: RTAI DEFINED 2312, VECTOR 2312
[ 9766.177029] TIMER NAME: lapic; VARIOUSLY FOUND APIC FREQs: 8333188, 8333188, 8209250
[ 9766.197663] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 9766.197774] , <uses LINUX SYSCALLs>, kstacks pool size = 524288 bytes.
[ 9766.197788] RTAI[sched]: hard timer type/freq = APIC/8333188(Hz); default timing: oneshot; linear timed lists.
[ 9766.197798] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1599883000 hz.
[ 9766.197805] RTAI[sched]: timer setup = 999 ns, resched latency = 2943 ns.
[ 9766.217638] RTAI[math]: loaded.
[ 9766.376310] EtherCAT: Requesting master 0...
[ 9766.376326] EtherCAT: Successfully requested master 0.
[ 9766.376685] EtherCAT 0: Domain0: Logical address 0x00000000, 12 byte, expected working counter 3.
[ 9766.376695] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 12 byte, type LRW.
[ 9766.376753] EtherCAT 0: Master thread exited.
[ 9766.376769] EtherCAT 0: Starting EtherCAT-OP thread.
[ 9771.490315] EtherCAT WARNING 0-0: Slave did not sync after 5000 ms.
[ 9771.501319] EtherCAT 0: Domain 0: Working counter changed to 2/3.
[ 9771.516337] EtherCAT 0: Slave states on main device: OP.
[ 9772.505173] EtherCAT 0: Domain 0: Working counter changed to 3/3.
The "Slave did not sync after 5000ms" has me thinking that the watchdog timeout is not configured correctly. I have the divider at 0 and intervals at 1000, which I don't think is right, but I don't know what to put there instead. I tried changing the divider to 2498 based on a different configuration guide, but then get spam in dmesg about "Failed to set watchdog divider"
Thank you for reading through the wall of text! If you have any thoughts at this point, I would really appreciate it.
Last edit: 10 years 6 months ago by Cpk_Rbt.
Please Log in or Create an account to join the conversation.
- cgc
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 10
10 years 6 months ago #73942
by cgc
Replied by cgc on topic Ethercat HAL driver
please disable this line for test:
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
regards Frank
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/>
regards Frank
Please Log in or Create an account to join the conversation.
Time to create page: 0.473 seconds