Ethercat HAL driver

More
5 years 10 months ago - 5 years 10 months ago #191595 by jc2ktr

theshade wrote: 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: 5 years 10 months ago by jc2ktr. Reason: attachments added

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

More
5 years 10 months ago - 5 years 10 months ago #191688 by chimeno
Hello @jc2ktr
I don't have that unit,
Is the unit in OP mode?
You can read this post in linuxcnc
Code:
PositionActualValue
, then you only have to enable the unit
compare these signals with TWINCAT3 to see which ones you have to enable
Code:
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
Code:
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"

Gretting
Chimeno
Last edit: 5 years 10 months ago by chimeno. Reason: Edit
The following user(s) said Thank You: jc2ktr

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

More
5 years 10 months ago - 5 years 10 months ago #191727 by jc2ktr

chimeno wrote: Hello @jc2ktr
I don't have that unit,
Is the unit in OP mode?
You can read this post in linuxcnc

Code:
PositionActualValue
, then you only have to enable the unit
compare these signals with TWINCAT3 to see which ones you have to enable
Code:
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
Code:
<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: 5 years 10 months ago by jc2ktr. Reason: Text added 12/13/2020

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

More
5 years 10 months ago - 5 years 10 months ago #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: 5 years 10 months ago by chimeno. Reason: Edit
The following user(s) said Thank You: jc2ktr

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

More
5 years 10 months ago #192157 by jc2ktr

chimeno wrote: 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
5 years 10 months ago #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.

Time to create page: 0.195 seconds
Powered by Kunena Forum