HAL EtherCAT: one slave fine, two identical slaves issue

More
07 Jan 2020 00:29 - 07 Jan 2020 00:44 #154188 by Nico2017
Hi all,
I am facing a puzzling situation trying to use the EtherCAT driver for linuxcnc. I have several identical controller units (which are my EtherCAT slaves) to power some IR lamps. They are controlled thanks wired command (analog and digital coming from some AO and DO EtherCAT cards controlled by linuxcnc). Those power controllers have to be in OP state to be running and deliver a voltage on the output.

When trying to launch linuxcnc with one controller unit only, it loads fine and the slave goes into OP mode. Here is the ethercat-config.xml file used:
Warning: Spoiler!

The file looks fine, only thing is there is a bunch of non defined pdos assignments as I have not done it with TwinCAT yet. However the slave still manage to get to the OP state.

When I daisy chain the second controller unit after the first slave and update the ethercat-con.xml file, at best linuxcnc starts, the first slave goes into OP state, but the second slave does not go into OP state. At worst my whole computer froze. Here is the second ethercat-config.xml, which is just a dupliacte of the firt one where I doubled the slave, just changing its index and its name. When I run TwinCAT from windows on those slaves, they go without any issue into OP state when free run mode is launched.

Warning: Spoiler!


I runned the dmesg to get more information. I attached two files, the SuccessCNCLaunch1Eth.txt which is the first situation when the slave goes into OP mode. The second file is when I try to launch with two slaves where the second one stays in SAFEOP and is shown with an E when I run ethercat slave.

File Attachment:

File Name: SuccessCNC...1Eth.txt
File Size:2 KB

File Attachment:

File Name: FailLCNCLa...2Eth.txt
File Size:9 KB


So everything works fine with TwinCAT with several slave. Everything runs fine with one slave under linuxcnc ethercat. But it does not work when I have several slave of this type on linuxcnc ethercat.

I am wondering if it could be:
  • a timeout issue, as the bus scanning time looks high with those slaves. At this stage I am still not sure how to perfectly use the distributed clock and watchdog command lines instructions. So maybe I should use a distributed clock when there is several of these slaves.
  • the fact that the slaves are identical somehow, could possibly be an issue. There are some wheels on the supposed to be adjusted to change the slave index, however any time I am changing it, it usually create more issue than solve it.

If anyone has been experiencing the same kind of situation, any help would be much appreciated.

Nicolas
Attachments:
Last edit: 07 Jan 2020 00:44 by Nico2017.

Please Log in or Create an account to join the conversation.

More
07 Jan 2020 20:50 #154255 by chimeno
Hi Nico2017,
I think you have badly configured some of the PDOs, the PDOs of a device also affect the next device if they are not correct, the first thing is to check that all the records are correct, if they are the unmodified generics? The way to act is to disconnect and reconnect the power supply and read the register using the
sudo ethercat pdos -p0
command, check all the device registers.

TWINCAT3 also works, but since you can configure so many options and parameters, it is sometimes a bit difficult if they are a bit complicated devices, a saluation is to read the device once the voltage is restored / restarted to see what it tells us about its PDOs

regards
Chimeno
The following user(s) said Thank You: Nico2017

Please Log in or Create an account to join the conversation.

More
07 Jan 2020 23:34 #154280 by Nico2017
Hi chimeno,
thanks for your guidelines, I trippled check the pdos and xml file, they are all matching. The issue seems to be more coming from the DC synchronization option as I got a 0x0030 AL status message in the dmesg. So I am trying to make sense of the DC conf line in the xml file. However, l though I found something which might be of interest. When I run in TwinCAT I am in free run mode. Is there an equivalent option that can be added into the .xml config file for linuxcnc ethercat to get such a free run mode?

I am thinking about this as reading again my slave manual it is indicated that:

"Slave main application must be synchronized on network main (electrical network AC mains) to be able to perform all RMS measurement on a whole half period and manage firing accurately. Therefore it can't be synchronized on any EtherCAT communication cycle and EtherCAT process data exchange is performed in Free run mode"

.

Thank you,

Nicolas

Please Log in or Create an account to join the conversation.

More
08 Jan 2020 22:17 - 08 Jan 2020 22:18 #154353 by chimeno
Hi Nico2017
Not all devices work in DC-MODE, so that they work in this mode you also have to configure your own PDO, which device does it support? Do you have any manuals?

index 1C32: 01 and 1C33: 01
Current synchronization mode:
• 0: Free Run
• 1: Synchronous with SM 2 event
• 2: DC-Mode - Synchronous with SYNC0 Event
• 3: DC-Mode - Synchronous with SYNC1 event
Last edit: 08 Jan 2020 22:18 by chimeno.
The following user(s) said Thank You: Nico2017

Please Log in or Create an account to join the conversation.

More
08 Jan 2020 22:44 - 08 Jan 2020 22:45 #154357 by Nico2017
Hi Chimeno,

Reading from TwinCAT and the documentation, the slave actually only support the Free Run mode as index 1C32: 01 and 1C33:01 are both at 0x00.
When nothing is specified in the ethercat-conf.xml file for a given slave line (no DcConf field), is it running in free run mode?

Also is the watchdog field independent from the free run / DC mode?

Thank you for your help,

Nicolas
Last edit: 08 Jan 2020 22:45 by Nico2017.

Please Log in or Create an account to join the conversation.

More
08 Jan 2020 22:58 #154358 by chimeno

Hi Chimeno,

Reading from TwinCAT and the documentation, the slave actually only support the Free Run mode as index 1C32: 01 and 1C33:01 are both at 0x00.
When nothing is specified in the ethercat-conf.xml file for a given slave line (no DcConf field), is it running in free run mode?
yes

Also is the watchdog field independent from the free run / DC mode?
I think so, while accessing the PDO record before watchdog time, I will review it anyway.
Thank you for your help,

Nicolas


greeting
Chimeno
The following user(s) said Thank You: Nico2017

Please Log in or Create an account to join the conversation.

More
14 Jan 2020 04:09 - 14 Jan 2020 04:13 #154801 by Nico2017
Hi all,
still stuck in the same situation where I cannot make those slaves working when in series. Those are the EPack power controller from Eurotherm.

Attached is:
  • the provided xml file from the manufacturer describing the slave and PDOs for TwinCAT:

    File Attachment:

    File Name: Eurotherm_...ECAT.xml
    File Size:134 KB
  • the xml file for the linuxcnc EtherCAT of a single EPack

    File Attachment:

    File Name: ethercat-c...Pack.xml
    File Size:4 KB
    which works and manage to get the EPack in OP state but not sure about the value refClockSyncCycles="4" especially if the slave only operates in free run mode
  • the xml file for the linuxcnc EtherCAT for two daisy chained EPacks

    File Attachment:

    File Name: ethercat-c...ack2.xml
    File Size:7 KB
    which loads but does not get any of the EPacks into OP mode, rather in SAFEOP with an E displayed in ethercat slave command. This also sometime crashes my OS when closing linuxcnc after having a configuration running them
  • my postgui file to load the ethercat from the .ini file:
    loadusr -W lcec_conf ethercat-confEPack2.xml
    loadrt lcec
    addf lcec.read-all servo-thread
    addf lcec.write-all servo-thread
  • servo thread is 1000000ns

The master idx difference is not the issue as I have tried on both of my master, having two Ethernet port on my computer.

Any help to find out what could be possibly the issue in the .xml, as it is probably the case, would be really appreciated.

Thanks a lot,

Nicolas
Attachments:
Last edit: 14 Jan 2020 04:13 by Nico2017.

Please Log in or Create an account to join the conversation.

More
20 Jan 2020 22:06 #155279 by chimeno

Hi all,
but not sure about the value refClockSyncCycles="4" especially if the slave only operates in free run mode[/li]

Hi Nico2017
this means refClockSyncCycles = "4" every time the ethercat frame cycle is restarted, it only matters in DC mode, it has to be synchronized with the SYNC0 and SYNC1 cycles, because number 4 ??

which loads but does not get any of the EPacks into OP mode, rather in SAFEOP with an E displayed in ethercat slave command. This also sometime crashes my OS when closing linuxcnc after having a configuration running them


I still believe that you have a problem in the configuration on one of the devices or in the PDOs, for example, this is a bit weird:
<pdo idx="1601">
<pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Test" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Gap2" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Gap3" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Gap4" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Gap5" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Gap6" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Gap7" halType="bit"/>
</pdo>
I don't have this device and I can't see it at a glance, can you pass me the simple project of the two devices for TWINCAT3? Do these devices have different configurable addresses?

I hope you can solve it soon
regards
Chimeno
The following user(s) said Thank You: Nico2017

Please Log in or Create an account to join the conversation.

More
22 Jan 2020 19:49 - 22 Jan 2020 20:00 #155447 by Nico2017
Hi Chimeno,
please find attached the TwinCAT project with the default pdos between two EPacks.

File Attachment:

File Name: TwinCATPro...LCNC.zip
File Size:6 KB


What would be the different options for refClockSyncCycles="4"? Can it be removed if all slave are in free run mode?

Thank you again for your help,

Nicolas
Attachments:
Last edit: 22 Jan 2020 20:00 by Nico2017.
The following user(s) said Thank You: chimeno

Please Log in or Create an account to join the conversation.

More
22 Jan 2020 21:50 - 22 Jan 2020 23:12 #155464 by Nico2017
Hi again,
I have tried my final configuration with the Epacks on one master (master 1) and the other slaves on the other one (master 0) as I think there might be a conflict about the synchronisation mode between the different slaves.

The behaviour is kind of random:
  • it manages to launch the program one time out of three without issue, the other times it either freeze the OS or I have to restart the computer
  • when closing linuxcnc when it was sucessfully launcer, it stays blocked and does not close properly.

I wonder if it is a realtime ethercat related issue which make the OS or linuxcnc not closing properly. Or maybe the fact that I am using two masters.

Attached is a log file after starting with success and after non proper closing:

File Attachment:

File Name: logTurnOff.txt
File Size:99 KB


The config file that I am currently running is:

File Attachment:

File Name: ethercat-config.xml
File Size:20 KB
. I have removed the <pdoEntry idx="0000" subIdx="00" bitLen="16" halPin="Gap2" halType="bit"/> which are not mandatory on the EPacks as suggested by Chimeno, linked in master 1. Running master 1 slaves only works perfectly and close linuxcnc nicely too. I have also removed the refClockSyncCycles="4" for master 1. So maybe the issue also comes from using two masters.

If anyone has an idea about why I have kind of an unstable behaviour with this EherCAT bus topology, that would be really helpful.

Thank you again,
Nicolas
Attachments:
Last edit: 22 Jan 2020 23:12 by Nico2017.

Please Log in or Create an account to join the conversation.

Time to create page: 0.110 seconds
Powered by Kunena Forum