Kevin/Gavin,
                Thanks for the quick replies.   It makes sense that the EoE 
could be the problem (yes the AKD2G supports EoE).   Electrical is modifying 
some HW so can’t test it until late next week.   Will see how it goes.

Thanks,
Mike W

From: Gavin Lambert <gavin.lamb...@tomra.com>
Sent: Monday, March 3, 2025 3:48 PM
To: Kevin Wormington <kwor...@gmail.com>; Mike Walker <mwal...@breault.com>
Cc: etherlab-users@etherlab.org
Subject: RE: [Etherlab-users] Ethercat Master and AKD2G Flexible PDOs

Caution: This is an external email and originated from outside your 
organization. Take extra caution clicking links or opening attachments. Review 
cybersecurity policy for guidance on email security and handling requirements.

The problem with mixing CoE and EoE support in the same device in Etherlab is 
that the current code assumes that it will receive mailbox responses in 
sequence (i.e. if it posts a CoE request the only possible thing it can read 
from the mailbox is the matching CoE response).  This assumption is reasonably 
valid as long as only one mailbox protocol is in use at a time, but as soon as 
multiple protocols are supported that goes out the window, because slaves are 
allowed to interleave responses from separate protocols, especially when the 
slave supports unsolicited responses.

This was fixed in my unofficial 
patchset<https://sourceforge.net/u/uecasm/etherlab-patches/ci/default/tree/#readme>
 (also available in a few other places<https://github.com/ribalda/ethercat>) by 
properly multiplexing the mailboxes (among other things), but unfortunately 
this is currently only available for 1.5.x and while some patches have been 
merged to 1.6, these aren’t among them.

Gavin Lambert

Software Engineer



[cid:image001.png@01DB8C8D.36EB28A0]
 [tomra facebook] <https://www.facebook.com/TOMRA.Food/>  [tomra linkedin] 
<https://www.linkedin.com/company/tomra-food/>  [tomra twitter] 
<https://twitter.com/TOMRAFood>  [tomra youtube] 
<https://www.youtube.com/playlist?list=PLDD3B1A7BAE919EC6>  [tomra instragram] 
<https://www.instagram.com/tomrafood/>
 TOMRA Food (ANZ) Limited | 4 Henderson Place | PO Box 13 516 | Onehunga 1061 | 
New Zealand
 Phone: +64 96 34 00 88 | https://www.tomra.com/food
The information contained in this communication and any attachment is 
confidential and may be legally privileged. It should only be read by the 
person(s) to whom it is addressed. If you have received this communication in 
error, please notify the sender and delete the communication.
From: Kevin Wormington
Sent: Tuesday, 4 March 2025 10:42 am
To: Mike Walker <mwal...@breault.com<mailto:mwal...@breault.com>>
Cc: etherlab-users@etherlab.org<mailto:etherlab-users@etherlab.org>
Subject: Re: [Etherlab-users] Ethercat Master and AKD2G Flexible PDOs

Hi Mike,

I have seen a similar issue with LinuxCNC with Ethercat 1.6.x if the slave 
device supports EoE.  The fix was to rebuild the Etherlab master without EoE 
support.  I posted a few times but didn't ever really get a good answer as to 
why this happens and/or if the EoE support even works on a Linux RT_PREEMPT 
kernel.

But anyway, the same fix might work for you if you don't need EoE support.

Kevin

On Mon, Mar 3, 2025 at 12:53 PM Mike Walker 
<mwal...@breault.com<mailto:mwal...@breault.com>> wrote:
All,
                Trying to track down an issue with setting up “Flexible PDOs” 
on the Kollmorgan AKD2Gs.   I have tried various methods to get these to be 
configured reliably, but nothing yet.

The baseline code calls ecrt_domain_reg_pdo_entry_list(mDomain,domain1_regs), 
and that works around 90% of the time.   However, it fails ~10% of the time.    
This problem makes life “fun” when you have 6 motor controllers with each one 
randomly not configuring properly.

In looking at the logs on the master with dmesg, we get a timeout on waiting 
for SDO responses.  Also, looking at the SDO logs inside the AKD2G (but still 
working that angle), it also appears that either SDOs are not being received 
from the master (or the AKD2G is ignoring them??).

I have even written scripts that does the SDOs setup by hand (ie    ethercat 
-p0 --type uint8 download 0x1C12 0 0), and I also get random results of getting 
the configuration setup correctly.

The CStruct is as follows:

ec_pdo_entry_info_t akd2g_pdo_entries_current[] = {
    /* RxPdo 0x1600 */
    { 0x5003, 0x05, 32 }, /* current  */
    { 0x6040, 0x00, 16 }, /* DS402 command word */
};

ec_pdo_entry_info_t akd2g_pdo_entries_received[] = {
    /* TxPDO 0x1a00 */
    { 0x6063, 0x00, 32 }, /* position */
    { 0x6041, 0x00, 16 }, /* DS402 Status Word*/

    /* TxPDO 0x1a01 */
    { 0x606c, 0x00, 32 }, /* actual velocity, in milli rpm */
    { 0x500A, 0x01, 32 }, /* actual current */
    { 0x60E4, 0x01, 32 }, /* Feedback 1 Position */
};

ec_pdo_info_t akd2g_pdos_current[] = {
    { 0x1600, 2, akd2g_pdo_entries_current + 0 },
    { 0x1a00, 2, akd2g_pdo_entries_received + 0 },
    { 0x1a01, 3, akd2g_pdo_entries_received + 2 },
};

ec_sync_info_t akd2g_syncs_current[] = {
    { 0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE },
    { 1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE },
    { 2, EC_DIR_OUTPUT, 1, akd2g_pdos_current + 0, EC_WD_DISABLE },
    { 3, EC_DIR_INPUT, 2, akd2g_pdos_current + 1, EC_WD_DISABLE },
    { 0xFF }
};

Still working to get a Wireshark dump (on a headless system), so working 
through this to see if it tells me anything.

Questions:

  1.  Has anybody experienced similar issues and how they where able to resolve 
this?
  2.  I have tried things that where mentioned in other posts like increasing 
EC_WAIT_SDO_DICT from 3 to 30 seconds.   Any other settings I should be looking 
at?
  3.  I am currently using version 1.5.x.   I looked at the release notes for 
1.6 and didn’t see anything that looked obvious.   Anything in the update that 
may help?
  4.  It seems (as a stop gap) that if I attempt to configure all 6 motor 
controllers, eventually it will work.   The method right now is to:

     *   Ecrt_release_master(mMaster)
     *   Run a script that will restart ethercat (ie. 
/usr/local/etc/init.d/ethercat restart)
     *   But when I attempt to get the master (ecrt_master_activate(mMaster)), 
domain (ie. ecrt_domain_data(mDomain)) all is good
     *   BUT FAILS on ecrt_domain_reg_pdo_entry_list(mDomain, domain_regs)
     *   Anybody have some actual or sudo code that would allow for me to try 
again…either fall all motor controllers or the specific motor controller that 
didn’t setup the PDOs correctly?


Thanks in advance for anything you can provide,
Mike W

--
Etherlab-users mailing list
Etherlab-users@etherlab.org<mailto:Etherlab-users@etherlab.org>
https://lists.etherlab.org/mailman/listinfo/etherlab-users
-- 
Etherlab-users mailing list
Etherlab-users@etherlab.org
https://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to