[etherlab-users] Problems with Danhaer S400 drives.

Gianluca Medini Eurosoft Srl gianluca at eurosoft.191.it
Thu Jul 2 17:24:56 CEST 2009


Dear all, I'm trying to use Danhaer S400 drive with EC master.
I'm relatively new user of master in rtai so probably I'm making some mistake.
Before I've used beckhoff terminal EL1002 EL2002 with no problem also with PDO.

I've tried this piece of code :

const static ec_pdo_entry_reg_t domain_out_regs[] = {

{DigOutSlavePos, Beckhoff_EL2002, 0x7000, 1, &off_dig_out},

{Drive1, Drive400, 0x6062, 0,&DriveTargetPos1},

{Drive1, Drive400, 0x606b, 0,&DriveTargetVel1},

{Drive1,Drive400,0x6040,0,&DriveControlWord1},

{Drive1,Drive400,0x2802,0,&DriveLatchControlWord1},

{}

};


const static ec_pdo_entry_reg_t domain_in_regs[] = {

{Drive1, Drive400, 0x6064, 0,&DriveCurrentPosition1},

{Drive1, Drive400, 0x6041, 0,&DriveStatusWord1},

{Drive1, Drive400, 0x2901, 0,&DriveLatchStatusWord1},

{Drive1, Drive400, 0x2902, 0,&DriveLatchPosition1},

{}

};

static ec_pdo_entry_info_t drive_input_pdo_entries[]=

{

{ 0x6064,0,32 }, // Position actual value

{ 0x6041,0,16 }, // Status word

{ 0x2901,0,16 }, // Latch status word

{ 0x2902,0,32 }, // Latch register

};

static ec_pdo_entry_info_t drive_output_pdo_entries[]=

{

{ 0x6062,0,32 }, // Position demand value

{ 0x606b,0,32 }, // Velocity demand value

{ 0x6040,0,16 }, // Control word

{ 0x2802,0,16 }, // Latch control word

};

static ec_pdo_info_t drive_output_pdo[]=

{

{ 0x1706, 4,drive_output_pdo_entries},

};

static ec_pdo_info_t drive_input_pdo[]=

{

{ 0x1b06 , 4,drive_input_pdo_entries},

};

static ec_sync_info_t drive_syncs[]=

{

{ 2 , EC_DIR_OUTPUT, 1,drive_output_pdo },

{ 3 ,EC_DIR_INPUT, 1,drive_input_pdo },

{ 0xff },

};



Externally before making insmod of the .ko I use ethercat tool for setting objects (pdo used) in the same order than Beckhoff Twincat.

/ethercat-1.4.0/tool/ethercat download -p 3 0x1C12 0 -t int8 0x0

/ethercat-1.4.0/tool/ethercat download -p 3 0x1C13 0 -t int8 0x0

/ethercat-1.4.0/tool/ethercat download -p 3 0x1C12 1 -t uint16 0x1706

/ethercat-1.4.0/tool/ethercat download -p 3 0x1C12 0 -t int8 0x01

/ethercat-1.4.0/tool/ethercat download -p 3 0x1C13 1 -t uint16 0x1b06

/ethercat-1.4.0/tool/ethercat download -p 3 0x1C13 0 -t int8 0x01

/ethercat-1.4.0/tool/ethercat download -p 3 0x6060 0 -t uint16 0xfa

/ethercat-1.4.0/tool/ethercat download -p 3 0x60C2 1 -t int8 0x01

/ethercat-1.4.0/tool/ethercat download -p 3 0x60C2 2 -t uint8 0xfd



This the output of dmesg  : 

EtherCAT: Starting EtherCAT-IDLE thread.

EtherCAT: Released master 0.

ec_rtai_sample: Unloading.

EtherCAT: Slave states: PREOP.

ec_rtai_sample: Starting...

EtherCAT: Requesting master 0...

EtherCAT: Successfully requested master 0.

ec_rtai_sample: Registering domain...

ec_rtai_sample: Domain registered

ec_rtai_sample: Registering PDO entries...

ec_rtai_sample: Activating master...

EtherCAT: Domain0: Logical address 0x00000000, 25 byte, expected working counter 5.

EtherCAT: Datagram domain0-0: Logical offset 0x00000000, 25 byte, type LRW.

EtherCAT: Master thread exited.

EtherCAT: Starting EtherCAT-OP thread.

ec_rtai_sample: Master activated

ec_rtai_sample: Starting cyclic sample thread...

ec_rtai_sample: RT timer started with 1193/1193 ticks.

ec_rtai_sample: Initialized.

ec_rtai_sample: 4 slave(s).

ec_rtai_sample: AL states: 0x02.

ec_rtai_sample: Link is up.

EtherCAT WARNING: 1 datagram UNMATCHED!

EtherCAT WARNING: PDOs configured for SM2, but slave 3 does not provide the sync manager information!

EtherCAT WARNING: PDOs configured for SM3, but slave 3 does not provide the sync manager information!

EtherCAT ERROR: Failed to determine PDO sync manager for FMMU on slave 3!

EtherCAT: Domain 0: Working counter changed to 2/5.

EtherCAT: Slave states: PREOP, OP.

ec_rtai_sample: AL states: 0x0A.

If I comment the entries in the vectors domain_in_regs domain_out_regs regardig drives I get this message : 

ec_rtai_sample: Registering domain...

ec_rtai_sample: Domain registered

ec_rtai_sample: Registering PDO entries...

ec_rtai_sample: Activating master...

EtherCAT: Domain0: Logical address 0x00000000, 1 byte, expected working counter 1.

EtherCAT: Datagram domain0-0: Logical offset 0x00000000, 1 byte, type LWR.

EtherCAT: Master thread exited.

EtherCAT: Starting EtherCAT-OP thread.

ec_rtai_sample: Master activated

ec_rtai_sample: Starting cyclic sample thread...

ec_rtai_sample: RT timer started with 1193/1193 ticks.

ec_rtai_sample: Initialized.

ec_rtai_sample: 4 slave(s).

ec_rtai_sample: AL states: 0x02.

ec_rtai_sample: Link is up.

EtherCAT WARNING: 1 datagram UNMATCHED!

EtherCAT WARNING: PDOs configured for SM2, but slave 3 does not provide the sync manager information!

EtherCAT WARNING: PDOs configured for SM3, but slave 3 does not provide the sync manager information!

EtherCAT ERROR: Failed to set SAFEOP state, slave 3 refused state change (PREOP + ERROR).

EtherCAT ERROR: AL status message 0x0017: "Invalid sync manager configuration".

EtherCAT: Acknowledged state PREOP on slave 3.

EtherCAT: Domain 0: Working counter changed to 1/1.

EtherCAT: Slave states: PREOP, OP.

ec_rtai_sample: AL states: 0x0A.

the drive give the error 0x17, incorrect PDO'S configuration.

Obviosly using twincat software everithing works fine.

Thank you for any kind of help.

Gianluca Medini

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20090702/271d6352/attachment-0002.htm>


More information about the Etherlab-users mailing list