Ethercat HAL driver

More
25 Nov 2020 17:01 - 25 Nov 2020 17:08 #190272 by tetw
Replied by tetw on topic Ethercat HAL driver

@Tetw,

I checked both the EL1104 and EL2004 are available for the Lcec.
Your file is correct, your Os and Ethercat bus is correct.

Have you tried another cat4 cable? What does $ ethercat cstruct
say to you in terminal with only the EK1100?

It is ethercat-conf.xml
At this location : /home/ **yourname** /Desktop/linuxcnc_axis/configs/sim.qtvcp_screens/

You are giving up a different story by :
/ethercat_lcec.xml


Thanks grotius,
solved error 0x6000 the problem was the cable.
in the previous post I was wrong to enter xml.
I tried to insert only "ES9100" but you don't see it (ethercat slaves ethercat cstruct )?
why in the terminal when I start halrun and load lcec it goes into error?
you have a link or file on how to write the xml file?

Attachments:
Last edit: 25 Nov 2020 17:08 by tetw.

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

More
26 Nov 2020 14:51 #190338 by Grotius
Replied by Grotius on topic Ethercat HAL driver
@Tetw,

We have tried to help you. If you installed the grotius iso and added just one line to the existing xml file your EL1104 was working.
On github there is a readme enclosed by the grotius iso. But reading takes too much time?
Your cable was a problem. Oke that is solved.

Your really have to begin study this topic first. If you don't know what "ethercat cstruct" means, you have to google it and
study this command until you succeed !

You don't read my comment's good enough, and you don't interact on my comment's, accept changing a cat4 cable.

I tried to insert only "ES9100" but you don't see it (ethercat slaves ethercat cstruct )?
why in the terminal when I start halrun and load lcec it goes into error?
you have a link or file on how to write the xml file?

This is a proof you have too study first. Don't waste our time please before studying our comments !!

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

More
07 Dec 2020 14:48 #191311 by jc2ktr
Hello theshade,

i try to use the same ECT60 driver as you, but don't get it to move, tried to use your config from the post. Do you think it is possible to share your Config with us?

greetings Sven

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

More
10 Dec 2020 18:11 - 10 Dec 2020 18:13 #191595 by jc2ktr

Dear @Chimeno,

I am still a little lost I think. I received the drives this morning and loaded the ECT60 description file in TWINCAT and I have managed to move the motors using the NC so this is good.


And I have a working config and pdo in twincat. It curently uses CSP (cyclic dynamic position mode). I tried to change to PP but it doesn't work when I do....

Now when I export the "startup" which is much more full of data...


it saves a very generic file with almost no info:
test.xml

File Attachment:

File Name: test.xml
File Size:0 KB

So I don't yet understand what I should export in xml from twincat..
Also I don't know how to export pdo's there is no export to xml in this window...



Sorry I can't understand what I need to do to export the two xml files from twincat...
I guess one is for PDOs and one for startup config.
1. Do I need to write the files by hand because export from twincat doesn't seem to work? Did you write the example files you sent me manually?
2. or how did you export them from twincat? Maybe I missunderstood and twincat is only for experimenting on the settings.

Thank you again so much in advance and sorry for being slow to understand.

So I edited manually the .xml from my current understanding:
I only added the PDO with SM2 and SM3... I don't know really know if the others pdo idx are useful, nor the reason they exist in twincat.
So I loaded this xml in linuxcnc and after a few trials I still do get errors which are probably due to the fact that I don't really know what to put in the DC sync config and ref clock sync cycles...
In twincat it seems to work at 2000us...



So I changed to:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
<dcConf assignActivate="500" sync0Cycle="2000000" sync0Shift="1000000"/>
according to the thread here:
forum.linuxcnc.org/38-general-linuxcnc-q...rcat-sync-dc-problem

but then I get this:
[ 2350.778194] EtherCAT WARNING: Datagram e64197b9 (master-fsm) was SKIPPED 1 time.
[ 2385.334576] EtherCAT: Requesting master 0...
[ 2385.334592] EtherCAT: Successfully requested master 0.
[ 2385.335248] EtherCAT 0: Domain0: Logical address 0x00000000, 18 byte, expected working counter 3.
[ 2385.335256] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 18 byte, type LRW.
[ 2385.335411] EtherCAT 0: Master thread exited.
[ 2385.335422] EtherCAT 0: Starting EtherCAT-OP thread.
[ 2385.335562] EtherCAT WARNING 0: 1 datagram UNMATCHED!
[ 2385.494210] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR).
[ 2385.496263] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
[ 2385.500254] EtherCAT 0-0: Acknowledged state PREOP.


Hello theshade & Chimeno,

i have the same ECT60 EtherCAT Driver and Motor, and have been trying for some time, to get it to work with Linuxcnc.
I am able to Enable the Drive in Linuxcnc and to read out the Encoder but i can´t get it to move.
In TwinCAT 3 i am able to move the drive in the NC:TASK but i don´t get it to work with LinuxCNC.

When i compare your TwinCAT Startup Tab for the Drive with mine yours have much more entrys. But i can´t export/import them.
Have you added them manually or how you got them inserted?

May i ask you to share youre Machine Config, HAL-Files etc with me/us?

I am no Programmer or anything else, at the moment i am stuck and get along.


Thank you and best Regards

Sven
Attachments:
Last edit: 10 Dec 2020 18:13 by jc2ktr. Reason: attachments added

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

More
11 Dec 2020 20:08 - 11 Dec 2020 20:13 #191688 by chimeno
Hello @jc2ktr
I don't have that unit,
Is the unit in OP mode?
You can read this post in linuxcnc
PositionActualValue
, then you only have to enable the unit
compare these signals with TWINCAT3 to see which ones you have to enable
complexEntry bitLen="1" halPin="SwitchON" halType="bit"/>
<complexEntry bitLen="1" halPin="EnableVoltage" halType="bit"/>
<complexEntry bitLen="1" halPin="NoQuickStop" halType="bit"/>
<complexEntry bitLen="1" halPin="EnableOperation" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit01" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit02" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit03" halType="bit"/>
<complexEntry bitLen="1" halPin="FaultReset" halType="bit"/>
<complexEntry bitLen="1" halPin="TimeOut" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit04" halType="bit"/>
<complexEntry bitLen="1" halPin="bit10" halType="bit"/>
<complexEntry bitLen="1" halPin="bit11" halType="bit"/>
<complexEntry bitLen="1" halPin="bit12" halType="bit"/>
<complexEntry bitLen="1" halPin="bit13" halType="bit"/>
<complexEntry bitLen="1" halPin="bit14" halType="bit"/>
<complexEntry bitLen="1" halPin="bit15" halType="bit"/>


in TWINCAT3 you have enabled the "distributed clock"
in your .xml file you don't have the line
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"

Gretting
Chimeno
Last edit: 11 Dec 2020 20:13 by chimeno. Reason: Edit
The following user(s) said Thank You: jc2ktr

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

More
12 Dec 2020 13:39 - 14 Dec 2020 15:21 #191727 by jc2ktr

Hello @jc2ktr
I don't have that unit,
Is the unit in OP mode?
You can read this post in linuxcnc
PositionActualValue
, then you only have to enable the unit
compare these signals with TWINCAT3 to see which ones you have to enable
complexEntry bitLen="1" halPin="SwitchON" halType="bit"/>
<complexEntry bitLen="1" halPin="EnableVoltage" halType="bit"/>
<complexEntry bitLen="1" halPin="NoQuickStop" halType="bit"/>
<complexEntry bitLen="1" halPin="EnableOperation" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit01" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit02" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit03" halType="bit"/>
<complexEntry bitLen="1" halPin="FaultReset" halType="bit"/>
<complexEntry bitLen="1" halPin="TimeOut" halType="bit"/>
<complexEntry bitLen="1" halPin="OpMode-bit04" halType="bit"/>
<complexEntry bitLen="1" halPin="bit10" halType="bit"/>
<complexEntry bitLen="1" halPin="bit11" halType="bit"/>
<complexEntry bitLen="1" halPin="bit12" halType="bit"/>
<complexEntry bitLen="1" halPin="bit13" halType="bit"/>
<complexEntry bitLen="1" halPin="bit14" halType="bit"/>
<complexEntry bitLen="1" halPin="bit15" halType="bit"/>


in TWINCAT3 you have enabled the "distributed clock"
in your .xml file you don't have the line
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"

Gretting
Chimeno


Hi @Chimeno,

the Post above was from @theshade a few pages before page 93 i think.
He has the same Driver and you helped him, that´s why i mentioned you too.

Ok, try to add the line to my ethercat-conf.xml

I can already enable the drive, when i set the line:

net x-enable => lcec.0.M701.EnableVoltage lcec.0.M701.EnableOperation lcec.0.M701.SwitchON lcec.0.M701.NoQuickStop

I think the Unit was in op mode, will try it later again.

Thank you

Edit 12/13/2020

All of Devices are in OP-Status in TwinCAT3.

I tried to use these LinuxCNC Profile for my machine ---> github.com/GuiHue/myfenjalinuxcnc

I edited the hal files to my needs, but i can't Start it it gives me following error on Startup.

Warning: Spoiler!


Edit 12/14/2020

after i did a dmesg i got this, see attached image(s)
Attachments:
Last edit: 14 Dec 2020 15:21 by jc2ktr. Reason: Text added 12/13/2020

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

More
16 Dec 2020 08:23 - 16 Dec 2020 08:26 #192110 by chimeno
Hello @jc2ktr
I will try to help you in everything I can,

I can already enable the drive, when i set the line:

net x-enable => lcec.0.M701.EnableVoltage lcec.0.M701.EnableOperation lcec.0.M701.SwitchON lcec.0.M701.NoQuickStop

I think the Unit was in op mode, will try it later again.


Is it possible that you have the driver configured in another mode? there are several modes, speed, position ..


the first thing is to try to solve error by mistake
1- error motmod: dlopen: /usr/lib/linuxcnc/modules/motmod.so: undefined symbol: kinematicsType
something seems to be wrongly compiled, you still have to compile linuxcnc again without ethercat configuration, if linuxcnc starts correctly, go to step 2
2- configure the 2 pre-configured devices EK100 / EL1809 / EL2004 and start linuxcnc and see that they work correctly.
3-create another configuration, just the generic one, and first try to get linuxcnc to start and put the device in OP, then if it starts to configure by trial and error.

Greeting
Chimeno
Last edit: 16 Dec 2020 08:26 by chimeno. Reason: Edit
The following user(s) said Thank You: jc2ktr

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

More
16 Dec 2020 19:23 #192157 by jc2ktr

Hello @jc2ktr
I will try to help you in everything I can,

I can already enable the drive, when i set the line:

net x-enable => lcec.0.M701.EnableVoltage lcec.0.M701.EnableOperation lcec.0.M701.SwitchON lcec.0.M701.NoQuickStop

I think the Unit was in op mode, will try it later again.


Is it possible that you have the driver configured in another mode? there are several modes, speed, position ..


the first thing is to try to solve error by mistake
1- error motmod: dlopen: /usr/lib/linuxcnc/modules/motmod.so: undefined symbol: kinematicsType
something seems to be wrongly compiled, you still have to compile linuxcnc again without ethercat configuration, if linuxcnc starts correctly, go to step 2
2- configure the 2 pre-configured devices EK100 / EL1809 / EL2004 and start linuxcnc and see that they work correctly.
3-create another configuration, just the generic one, and first try to get linuxcnc to start and put the device in OP, then if it starts to configure by trial and error.

Greeting
Chimeno


Hello @Chimeno

first of all thank you for your help and patience :)

#1 the motmod.so error was my faul, i missed to write the: loadrt [KINS]KINEMATICS entry in my .hal file :S :whistle:

#2 the preconfigured Beckhoff devices EK1100,EL1809 & EL2004 are good in LinuxCNC in Halshow i can toggle my Limit/Home Switches and the input is shown correctly, when i do a setp lcec.0.K010B1.dout-0 true --> the relay connected to my EL2004 switches on - that seems to work too.

#3 all of my Beckhoff Modules are in OP-State only my last Slave, the ECT60 Driver is still in Preop, i think i have misconfigured something in TwinCAT3, because i have tried to get the same Startup entries like @theshade on my drive... which was not really succesfull :unsure:

The Drive was in OP mode under LinuxCNC, before i reconfigured it in TwinCAT. At the moment i don´t know how to reset the Drive or to get it in OP State again. :ohmy:

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

More
16 Dec 2020 19:53 #192173 by chimeno
Hello @jc2ktr,

Well, the first thing is to reconfigure the driver in TWINCAT3, that it works in OP and you can move the engines, I attach the program in TWINCAT3 with the modified PDOs according to linuxcnc-ethercat, now you will have to configure the rest yourself, compare and see if you help.


I attach an image of where to change the PDOs, if you change the operating mode you will also have to change them.


I attach an image of where you have the configuration in blue, it is configured in mode 8, (position) you will have to read the manual to see the different modes to see which one interests you the most

Greeting
Chimeno
Attachments:

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

More
16 Dec 2020 21:05 #192192 by MRBaird
i have been following along and was able to get my ECT60's to move with this setup but scaling is off.

Mike
Attachments:
The following user(s) said Thank You: chimeno

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

Time to create page: 0.324 seconds
Powered by Kunena Forum