[etherlab-users] I'd like to ask a couple of questions about IgH ethercat master and AKD
Dusty Clark
springender at gmail.com
Tue Feb 3 20:31:16 CET 2015
Sebastien, Xinhua,
I have used AKD drives sucessfully in a telescope drive project, basing the
code in part on Sebastien's example. In that project, the motor is run in
velocity mode with a custom PID wrapped around it to form a cascaded
position-velocity loop, where the position loop is closed by reading an
absolute tape encoder on-axis.
To move the motor, you indeed need to use the DS402 state machine command
once you have the PDOs set up the way you want. The DS402 communications
are described in the Kollmorgen manual, available as a pdf here:
http://www.kollmorgen.com/zu-za/products/drives/servo/akd/_manuals/kollmorgen-akd-canopen-communications-manual-en-rev-n-fw-1-13/
Armed with the EtherCAT manual from Kollmorgen and the CANOpen manual, you
can determine the PDO mapping and what you have to write/read to put the
drive in motion. In my case, I created a state machine that walked the
drive into operational mode based on flags from the operator, and if a
limit or emergency stop condition is detected, the AKD firmware will put
the drive in a switched-off state that likewise needs to be handled by the
operation-control state machine (mainly by detecting the change in drive
state and restarting the motion-request sequence)...of course in an
emergency stop condition, you will want your users to check things out and
clear any unsafe conditions before attempting a restart, which your
application code can implement, of course.
Regards,
Dusty Clark
Naeglin Rim Services, LLC
On Tue, Feb 3, 2015 at 4:53 AM, Sebastien Blanchet <blanchet at iram.fr> wrote:
> 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
>>
>>
>>
>
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20150203/6ae12967/attachment-0004.htm>
More information about the Etherlab-users
mailing list