[etherlab-users] I'd like to ask a couple of questions about IgH ethercat master and AKD

Sebastien Blanchet blanchet at iram.fr
Tue Feb 3 12:53:19 CET 2015


Dear Xinhuan Gan,

The AKD XML description file is unneeded for Ethercat master 1.5.2 unlike 
TwinCAT. I never used the AKD drive XML file in my Linux project.
Therefore, IMHO, it does not worth updating the SII EEPROM with data from 
TwinCAT. Instead, it is safer to update the servo drive firmware with latest 
version.

To use the AKD servo drive with ethercat master, you have to setup the AKD drive 
with SDO commands at startup to define the PDO mapping.
http://www.iram.fr/~blanchet/ethercat/akd/free-pdo/akd_free_pdo.c

When your program reads successfully the cyclic values from the setup-and-mapped 
PDO, you have done half of the work (even if the motor does not move yet).

The remaining task is programming the DS402 state machine.
Unfortunately, there is no example in the "AKD EtherCAT Commmunication" manual 
from Kollmorgen. Indeed, there are commented examples only in the "AKD CAN-BUS 
COMMUNICATION" manual from Kollmorgen.
In my printed copy (AKD CAN-BUS Communication, Edition: F, March 2012, Part 
Number 903-200004-00), it is in section 7.2.6 "Example: Torque Mode via PDO", 
page 143.

Finally, the right sequence for the command register is:
0x80   (AKD_CMD_CLR_ERROR)
0x06   (AKD_CMD_DIS_QSTOP)
0x07   (AKD_CMD_ENA_SWION)
0x0F   (AKD_CMD_ENA_OP)

In parallel, the status register answers:
0x218  (AKD_STATUS_ERROR)
0x250  (AKD_STATUS_SWION_DIS)
0x231  (AKD_STATUS_RDY_SWION)
0x233  (AKD_STATUS_SWION_ENA)

For example, if you want to program the following behavior:
"Start the motor automatically, but if there is an error, wait for the operator 
sets a flag to purge the pending errors and then restart automatically the motor"

so the code may look like

#define AKD_STATUS_MASK 0xEFF

#define AKD_STATUS_SWION_DIS   0x250
#define AKD_STATUS_RDY_SWION   0x231
#define AKD_STATUS_SWION_ENA   0x233
#define AKD_STATUS_ERROR       0x218

#define AKD_CMD_ENA_QSTOP      0x00
#define AKD_CMD_DIS_QSTOP      0x06
#define AKD_CMD_ENA_SWION      0x07
#define AKD_CMD_ENA_OP         0x0F
#define AKD_CMD_CLR_ERROR      0x80

// ...
// Note: 'shm' is an object in shared memory, to uncouple control program and
// fieldbus driver. Thereby, one program reads/writes the fieldbus bus,
// and another one takes the decisions and update setpoints.
// Thus, the code works with both EtherCAT or CANOpen.

     bool clearError = false;
     if ( shm->clearError ) {
         shm->clearError = 0;
         shm->status = AKD_STATUS_ERROR;
         clearError = true;
     }

     // update command word according to status
     uint16_t status = shm->status & AKD_STATUS_MASK;
     uint16_t command = shm->command;

     if (status == AKD_STATUS_SWION_DIS
             and command != AKD_CMD_DIS_QSTOP) {
         command = AKD_CMD_DIS_QSTOP;

     } else if (status == AKD_STATUS_RDY_SWION
             and command != AKD_CMD_ENA_SWION ) {
         command = AKD_CMD_ENA_SWION;

     } else if ( status == AKD_STATUS_SWION_ENA
             and command != AKD_CMD_ENA_OP ) {
         command = AKD_CMD_ENA_OP;

     } else if ( status == AKD_STATUS_ERROR
             and command != AKD_CMD_CLR_ERROR ) {
         if (clearError) {
             command = AKD_CMD_CLR_ERROR;
         }
     } else {

     }

     shm->command = command;
// ...

best regards,
-- 
Sebastien BLANCHET


On 02/02/2015 09:00 PM, Xinhua Gan wrote:
> Dear Sebastien,
>
> I am a new user of IgH ethercat master 1.5.2 and working on communicating
> with Kollmorgen AKD drive. I know you are the expert on both. You actually
> answered my first question that I sent out through etherlab_users list. Now I
> have set up master code 1.5.2 and AKD drive. both are communicating each other.
> I can send SDOs to make the motor run and still learning how to do the PDOs.
>
> One thing I am not very clear is AKD drive XML file. So my questions are:
>
> 1) On TwinCAT, as instructed, I can import this XML file and save it under
> /Twincat/user/IO directory so TwinCAT will setup AKD drive based on this file.
> Where should I put it when I use etherlab master 1.5.2?
> 2) Do we really need XML file on ethercat master?
> 3) I read one comment on etherlab website as follows, should I do this as
> instructed on AKD drive?
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> There are almost definitely information missing in the "Slave Information
> Interface" (SII) of your slave. Unfortunately, some slave vendors aren't aware,
> that they have to provide their slaves' SII with nearly the same information as
> in the slave device description XML files (see table below). An EtherCAT Master
> / configuration tool can determine the slave configuration by reading out the
> SII or by using the XML Device Description.
> For example, the "SyncManager" category is inevitable for the master to know the
> physical addresses of the sync managers to configure the PDO mapping and the PDO
> exchange. The below table is an excerpt of the EtherCAT Knowledge Base
> <http://www.ethercat.org/infosys.html>(chapter EtherCAT Technology Description /
> EEPROM / SII), defining which information is optional (O), and which is
> mandatory (M).
> Device Types	No Process Data, Mailbox	Fixed Process Data, No Mailbox	Fixed
> Process Data, No Object Dictionary	Fixed Process Data, Object Dictionary
> Variable Process Data, Object Dictionary
> Info Structure
> (128 Byte)	ESC Info	M	M	M	M	M
> Identity	M	M	M	M	M
> Bootstrap Mbx Info	O		O	O	O
> Standard Mbx Info	M		M	M	M
> Categories	Strings (10)	O	O	O	O	O
> General (30)	M	M	M	M	M
> SyncManager (41)	O	M	M	M	M
> FMMU (40)	O	O	O	O	M
> PDO (50, 51)		M	M	O (same as OD)
>
> A quick solution for the missing information is to generate the SII contents
> from the slave description XML file using Beckhoff's TwinCAT, and write them to
> the slave. This is actually the task of the vendor, an you should tell him to do
> so in the future! Add the slave to a new project, then select "EtherCAT",
> "Advanced settings", "ESC Access", "EĀ²PROM", "Hex Editor", "Save to file...".
> There is an issue, when the EEPROM size in the XML file is wrongly specified too
> small, TwinCAT won't export the category data. Try increasing the value in the
> slave configuration XML and repeating the export in that case.
> You can the write the SII contents file to the slave using the EtherCAT master
> (from version 1.4):
>
> ethercat sii_write -p/slave-position/  /file/
>
> Before version 1.4:
>
> cp/file/  /sys/ethercat/master/X//slave/slave-position//sii
>
> Please let the master scan the bus again after doing so.
> ================================================================================================================================================
>
> 4) I asked Kollmorgen technical support. Their answers are "AKD drive does not
> support SII, you have to use XML file that we provide". How can I use it? should
> I write a patch to let master use this file as TwinCAT does?
>
>
> Thank you for your help in advance and look forward to hearing from you.
>
> Sincerely
>
> Xinhua Gan
>
> RivoStar LLC
> System Design Engineer
> Dublin, OH 43017
> USA
>
>





More information about the Etherlab-users mailing list