I have crossed the Atlantic in a row boat, and I am drowning within sight of the docks.
I am trying to get my Estun ProNET servo drive to work, but I cannot seem to get it into OP mode.
I've installed the latest ec-debianize and linuxcnc-ethercat from source on my 4.1.42-rt50 #1 SMP PREEMPT RT machine.
The ethercat command line works normally, and I have exactly 1 slave on the bus.
I have tried the control word sequence x06, then x07, then x0F, as suggested long ago in this forum. No dice.
ethercat master # looks normal, I think
Code:
Master0
Phase: Idle
Active: no
Slaves: 1
Ethernet devices:
Main: 68:05:ca:8a:b4:79 (attached)
Link: UP
Tx frames: 965040
Tx bytes: 57905664
Rx frames: 965039
Rx bytes: 57905604
Tx errors: 0
Tx frame rate [1/s]: 244 244 244
Tx rate [KByte/s]: 14.3 14.3 14.3
Rx frame rate [1/s]: 244 244 244
Rx rate [KByte/s]: 14.3 14.3 14.3
Common:
Tx frames: 965040
Tx bytes: 57905664
Rx frames: 965039
Rx bytes: 57905604
Lost frames: 0
Tx frame rate [1/s]: 244 244 244
Tx rate [KByte/s]: 14.3 14.3 14.3
Rx frame rate [1/s]: 244 244 244
Rx rate [KByte/s]: 14.3 14.3 14.3
Loss rate [1/s]: 0 0 0
Frame loss [%]: 0.0 0.0 0.0
Distributed clocks:
Reference clock: Slave 0
Application time: 0
2000-01-01 00:00:00.000000000
ethercat slaves -v # looks normal, I think
Code:
=== Master 0, Slave 0 ===
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x0000060a
Product code: 0x00000001
Revision number: 0x00000001
Serial number: 0x00000000
DL information:
FMMU bit operation: yes
Distributed clocks: yes, 32 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 3516425216 0 0
1 MII down closed no - - - -
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x0000/0, TX: 0x0000/0
Standard RX: 0x1000/128, TX: 0x1080/128
Supported protocols: CoE
General:
Group: EC100
Image name:
Order number: ESTUN ProNet
Device name: ESTUN ProNet
CoE details:
Enable SDO: no
Enable SDO Info: no
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: yes
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 0 mA
When I load linuxcnc, the hal pins I expect to see are there, and there are no lcec warnings except "installed driver for 1 slaves", and
dmsg shows:
Code:
[ 4580.426854] EtherCAT: Requesting master 0...
[ 4580.426859] EtherCAT: Successfully requested master 0.
[ 4580.427075] EtherCAT 0: Domain0: Logical address 0x00000000, 22 byte, expected working counter 3.
[ 4580.427078] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 22 byte, type LRW.
[ 4580.429442] EtherCAT 0: Master thread exited.
[ 4580.429446] EtherCAT 0: Starting EtherCAT-OP thread.
and then, when I exit linuxcnc, dmsg continues:
[ 4596.339951] EtherCAT 0: Master thread exited.
[ 4596.339959] EtherCAT 0: Starting EtherCAT-IDLE thread.
[ 4596.340100] EtherCAT 0: Releasing master...
[ 4596.340102] EtherCAT 0: Released.
22 is the total number of bytes in my PDO datagram and, as I understand it, LRW is a read/write transaction, and working counter 3 means neither read nor write worked.
I tried to force it with the command line:
Code:
~/linuxcnc-ethercat/examples/c3pr> ethercat state -p0 OP
~/linuxcnc-ethercat/examples/c3pr> dmesg | tail -20
[ 6533.740591] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[ 6533.740836] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[ 6533.741343] EtherCAT 0-0: Acknowledged state PREOP.
Something ain't right.
I've set up the PDOs 3 ways, and they all result in the LRW problem, and the drive stays in PREOP.
- I scanned the drive with twinCAT3 and then used the lcec generic driver in hal
- I used the ethercat command line to set up the PDO's using a shell script, and then used the lcec generic driver in hal
- I set up the PDOs with a shell script, wrote a custom 'PN4' lcec driver consistent with 'ethercat cstruct' output, and used type="PN4" in my hal xml.
Here is the hal configuration xml I used with the generic driver on a twinCAT-configured slave:
Code:
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
<slave idx="0" type="generic" vid="0000060A" pid="00000001" configPdos="true">
<syncManager idx="0" dir="out"> <!-- MboxOut -->
</syncManager>
<syncManager idx="1" dir="in"> <!-- MboxIn -->
</syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1602">
<pdoEntry idx="6040" subIdx="0" bitLen="16" halPin="pn4.control" halType="u32" />
<pdoEntry idx="607A" subIdx="0" bitLen="32" halPin="pn4.velcmd" halType="u32" />
<pdoEntry idx="60FE" subIdx="1" bitLen="32" halPin="pn4.phyout" halType="u32" />
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1A02">
<pdoEntry idx="6041" subIdx="0" bitLen="16" halPin="pn4.status" halType="u32" />
<pdoEntry idx="6064" subIdx="0" bitLen="32" halPin="pn4.velact" halType="u32" />
<pdoEntry idx="6077" subIdx="0" bitLen="16" halPin="pn4.toract" halType="u32" />
<pdoEntry idx="60FD" subIdx="0" bitLen="32" halPin="pn4.diginp" halType="u32" />
</pdo>
</syncManager>
<dcConf assignActivate="300" sync0Cycle="1" sync0Shift="0"/>
<!--watchdog divider="" intervals=""/-->
</slave>
</master>
</masters>
I have been hacking with Linuxcnc for years, but this is my first ethercat project.
Can anyone help?
Thanks
Reid