Ethercat HAL driver

More
7 years 9 months ago #124628 by Grotius
Replied by Grotius on topic Ethercat HAL driver
@Reid,

The erhercat master version is selected from the ethercat download site. There are several download options and versions over there available.. Maybe in combination with the ec debianize software it is unclarified to read back the exact source route. Its important to tell some info about sources in readme files. But if it works users will not complain. Its the same story as dist-upgrade.

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #124650 by shameless
Replied by shameless on topic Ethercat HAL driver
Hi!
I see your post which was sent on 26 Jun 2013, you got your computer worked with the r8169 driver, so was your network card r8169? Cause I got a problem, when I use the r8169 driver to work with my network card(8186/8112/8111), it does work, but when I stop the ethercat, I can't restart the ethercat, for the eth0 lost. And the mac cannot be attached. The only solution to this problem is that reboot the computer.
So is there any better way to solve it?
Thanks very much.

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago - 7 years 9 months ago #124660 by rodw
Replied by rodw on topic Ethercat HAL driver
I may be a bit off as I don't have an Ethercat but I had similar problems with a Mesa 7i76e. My solution was to write a bash script to shut down and restart the network. I' have found it very useful and used it today!

create a file called netstart.sh that contains
Code:
sudo service network-manager stop sudo rm /var/lib/NetworkManager/NetworkManager.state sudo service network-manager start

This is for Linux Mint and I found Debian might need different commands.

so when it happens, I just type "bash netstart.sh" from the command line (which is usually just a couple of up arrow presses as it gets used a bit!
Last edit: 7 years 9 months ago by rodw.

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #124669 by shameless
Replied by shameless on topic Ethercat HAL driver
Thank you , but it doesn't work for mine. I tried this method, I notice that my wlan0 down and up, and nothing happen to my eth0.
Maybe when I stop my ethercat master, it doesn't release the eth0. And I type "ifconfig" from the command line, there is no "eth0", but if I type "ifconfig -a", there's "eth0", but the mac is "00:00:00:00:00:00". It seems need to modify the driver.
Thank you again!

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #126289 by rwistort
Replied by rwistort on topic Ethercat HAL driver
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

Please Log in or Create an account to join the conversation.

More
7 years 8 months ago #126295 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi Reid,

If you look at attached files, that's a servo drive c & h file for the beckhoff servo.
What i do if the driver is not available, i modify existing files until i get it to work.
I think there is also a delta servo file somewhere.
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.260 seconds
Powered by Kunena Forum