Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
12 Feb 2020 18:32 #157205 by Nico2017
Hi,

I think this is because the first step which use mercurial (hg) did not completely succeed. Restart from the install EtherCAT step 0
Make sure you got:

sudo apt-get install quilt

before. But this is more likely due to the mercurial hg options. At the first step doing:
cd ec-debianize
./get_source.sh
Read carefully the output. There might be an error indicated even if it is not clearly flagging it. This might implies hg extensions which use the qpush command which requires the mq extension. To add an extension in mercurial, follow the suggested help displayed on the terminal, creating a ~/.hgrc , ie on your home directory. Then edit this file as a text file:
[extensions]
mq =
Retry step ./get_source.sh till you got a complete success of this step. I have noticed that this might work or not depending how you did the git cloning with or without root privilege. Same thing with the creation of the .hgrc file. You might have also to
sudo ./get_source.sh
as this is copying some files in specific locations.

Let me know how it this help, at least send the output of the ./get_source.

Once this step is successful you can carry on the installation

Thank you,
Nicolas
The following user(s) said Thank You: Stormholt

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

More
13 Feb 2020 05:53 #157268 by Sockheaven
Ahh thankyou!
I clearly was not paying attention, it didn't fail catastrophically so i kept moving along.

Ok, i got further to the step where i need to copy "lcec_conf" into my project directory (where ini/hal files are) and add the following text to my post gui hal file:
loadusr -W lcec_conf ethercat-conf.xml

After i add that and re-start the project, i get an error screen:
custom_postgui.hal:5: execv(lcec_conf): No such file or directory

I copied the file without any extension (h/c/o) i assume that was correct. The lcec_conf is in the same directory as my ini/hal files...
Thanks!
-Paul

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

More
19 Feb 2020 21:22 #157898 by Sockheaven
Ahh - I figured out what my problem was.

In case there are any other "green users" out there that got stymied by this - the example doesn't have a full file path, once added the full file path to lcec_conf and the xml file it loaded fine. and the HAL METER showed the devices from the config file.

On to trying to create a linuxcnc-ethercat driver for an AKD Servo Drive!

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

More
25 Feb 2020 04:43 #158434 by Sockheaven
I'm struggling to connect my device (Kollmorgen AKD) via ethercat.
Using the Hal Meter, the LCEC module is identifying a link and a slave, and lights are blinking but I think i'm missing a step.

I have not compiled a driver, to get started i was trying to get the AKD into a Free Mapping mode by configuring a bunch of SDOs but I cant quite tell at which point the communication is not configured/misconfigured.

I started with a StepConf configuration (that's what i had been using with the parallel port). perhaps something isnt connected there?

Does anyone have a working ini/hal file they could post to use as an example?
The only extra commands i've added is the four lines:
loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
addf lcec.read-all servo-thread
addf lcec.write-all servo-thread

I used this page to try and do the SDO run-up:
www.kollmorgen.com/en-us/developer-netwo...ition-mode%E2%80%9D/

but there isnt a whole lot of documentation that ive seen...

File Attachment:

File Name: ecat_test.hal
File Size:4 KB

File Attachment:

File Name: ecat_test.ini
File Size:2 KB

File Attachment:

File Name: ethercat-conf.xml
File Size:11 KB
Attachments:

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

More
26 Feb 2020 20:30 - 26 Feb 2020 20:33 #158571 by Nico2017
Hi,
  • is at least linuxcnc launching witthe EtherCAT config file. If it is not launching can you attached a print out of the message after doing your
    linuxcnc file.ini
    command. Most common errors are related to the config-ethercat.xml file Have you check that the time period is matching the thread period you are associating it with, in your case the servo thread.
  • if it is launching, I guess your issue is the drive might not be communication correctly. You can first of all verify that the drive reached the OP state by doing :
    ethercat slave
    and read the status of the drive
  • If the slave is not in OP state, then you can use use
    sudo dmesg -T
    to try to find out a bit more why is the slave not going into OP

More importantly, I think you forgot the last mark for closing masters at the end of the ethercat config file:
</masters>

Let us know,
Nicolas
Last edit: 26 Feb 2020 20:33 by Nico2017.

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

More
27 Feb 2020 05:25 #158600 by Sockheaven
Thanks for the debugging tips! I was not aware of those commands.

I checked the XML file, the </master> object is closed at the second to last line, so i think that's ok.

Running "$ ethercat slave" I get:
0 0:0 PREOP + AKD EtherCAT Drive (CoE)

So this backs up that the drive appears to be remaining in the pre-op state that i saw in the HAL Meter.

Running "sudo dmesg -T" I get a load of text, i've filtered it to the ECat stuff:
ec_master: loading out-of-tree module taints kernel.
EtherCAT: Master driver 1.5.2 unknown
EtherCAT: 1 master waiting for devices.
ec_generic: EtherCAT master generic Ethernet device module 1.5.2 unknown
EtherCAT: Accepting 00:90:27:F0:09:41 as main device for master 0.
ec_generic: Binding socket to interface 3 (eth1).
EtherCAT 0: Starting EtherCAT-IDLE thread.
igb 0000:03:00.0 eth1: igb: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX
EtherCAT 0: Link state of ecm0 changed to UP.
EtherCAT 0: 1 slave(s) responding on main device.
EtherCAT 0: Slave states on main device: PREOP.
EtherCAT 0: Scanning bus.
EtherCAT 0: Bus scanning completed in 220 ms.
EtherCAT 0: Using slave main-0 as DC reference clock.
EtherCAT 0: Slave states on main device: INIT.
EtherCAT 0: Slave states on main device: PREOP.

Next, I open the LinuxCNC project and some new entries are appended:
EtherCAT: Requesting master 0...
EtherCAT: Successfully requested master 0.
EtherCAT 0: Domain0: Logical address 0x00000000, 12 byte, expected working counter 3.
EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 12 byte, type LRW at ffff9d2359435798.
EtherCAT 0: Master thread exited.
EtherCAT 0: Starting EtherCAT-OP thread.

looks like there is some kind of init error - not sure what it's trying to tell me, except that the main thread exited for some reason.

Maybe related...
I was curious about some of those SDOs, in the examples, sometimes the subIdx="complete" and other times the sub index is specified (what i'm normally used to). I was wondering what the "complete" meant.

I also wasnt sure why all the examples use syncManager 2/3 and 0/1 are always empty.

Any other observations or ideas about why the main thread is exiting would be greatly appreciated!
Thanks again!

-Paul

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

More
29 Feb 2020 14:28 #158813 by chimeno
Hi @Paul,
I was looking at your .xml configuration file and is this correct?
<slave idx="0" type="generic" vid="00000106" pid="00000001" configPdos="true">
can be this?
<slave idx="0" type="generic" vid="0000006a" pid="00414b44" configPdos="true">
if it helps you
greeting
Chimeno
The following user(s) said Thank You: Sockheaven

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

More
01 Mar 2020 03:17 #158864 by Sockheaven
Well you definitely saw something I didn't.. I see the translation from 106 to A6 being hex vs dec, but I don't even see where you pulled the PID from (to be frank, why that even mattered since I wasn't compiling my own objects - i figured those numbers just needed to match if i wrote my own module).

I now see after booting (pre linuxcnc) my dmesg -T output is:
igb 0000:03:00.0 eth1: igb: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX
EtherCAT 0: Link state of ecm0 changed to UP.
EtherCAT 0: 1 slave(s) responding on main device.
EtherCAT 0: Slave states on main device: PREOP.
EtherCAT 0: Scanning bus.
EtherCAT 0: Bus scanning completed in 228 ms.
EtherCAT 0: Using slave main-0 as DC reference clock.
EtherCAT 0: Slave states on main device: INIT.
EtherCAT 0: Slave states on main device: PREOP.

Then when starting LinuxCNC, there are new logs/errors:
EtherCAT: Requesting master 0...
EtherCAT: Successfully requested master 0.
EtherCAT 0: Domain0: Logical address 0x00000000, 12 byte, expected working counter 3.
EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 12 byte, type LRW at ffff974066a53cd8.
EtherCAT 0: Master thread exited.
EtherCAT 0: Starting EtherCAT-OP thread.
EtherCAT 0: Slave states on main device: INIT.
EtherCAT 0: Slave states on main device: PREOP.
EtherCAT ERROR 0-main-0: SDO download 0x1A00:01 (4 bytes) aborted.
EtherCAT ERROR 0-main-0: SDO abort message 0x06040041: "The object cannot be mapped into the PDO".
EtherCAT ERROR 0-main-0: SDO configuration failed.

So clearly having the VID/PID set correctly mattered, because now it made it as far as trying to run the init SDO list i had set in the XML file. It looks like something is failing, I'll check with the Apps group on Monday to see if they can identify what may be going wrong.

Thanks so much! Will post an update soon.

Best Regards,
Paul

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

More
02 Mar 2020 09:19 #158955 by Moronicsmurf
Sorry for going off topic in this thread..

But if using the EtherCAT stuff from beckhoff. Would the stepgen be completly pc based then instead of having a step generator in an FPGA like with the mesa cards?

One of the resons for using the fpga cards is that you can use crappier hardware in most cases and get away with it.. is it the same with Ethercat ?

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

More
02 Mar 2020 14:06 - 02 Mar 2020 14:07 #158970 by Todd Zuercher
I don't think you would be using step generation at all with EtherCAT. You would be sending velocity (or position) commands directly to the EtherCAT drive. (but I have no experience with EtherCAT.)
Last edit: 02 Mar 2020 14:07 by Todd Zuercher.

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

Time to create page: 0.114 seconds
Powered by Kunena Forum