- Posts: 295
- Thank you received: 0
Ethercat HAL driver
you have to add to the "startup" tab the configuration that changes from the default, then export the .xml file description, attached a couple of images to guide you.I will receive the ECT60 drives next week and I am not in a rush, but how and where do I export the .xml from twincat3 or do I need to I need to do anything else in it like configure drives parameters or such?
I am attaching a screenshot of where the PDOs are located and I am also attaching a new general configuration file for linuxcnc-ethercat, things are missing so you can fill it yourself.The ethercat-conf.xml I use in linux CNC looks currently like this and it works in linuxCNC for the Beckhoff modules, I understand I will need to add the 4x ECT60 to it with SDOs and PDOs definitions
resguard
Chimeno
Please Log in to join the conversation.
I think I understand,
the .xml will setup the registers at startup (steps, modes, etc..) and also define the "PDO telegram"
Now I know how to start experimenting...
Thank you again,
Cheers
Please Log in to join the conversation.
@sqmathlete
and anyone else
Albert and Dan,
Ok, I have been reading and learning TC3 and can hook up my EK1100 with EL5152 terminal, then in config mode go online, and do a Scan, and under the IO tab pull up the EK1100 & EL5152.
I have been able to set up a virtual PLC and then in ladder programming build a simple motor contactor with a start push button and stop push button. Also have been learning to link a few things together in Structured Text programming, but still have a lot to learn.
The main goal is to get my EL5152 commissioned so that I can see the encoder counts and make sure all of my EL5151’s and the 5152 are good and not junk terminals. I simply believe all of them have been setup in another type of mode and that is why I cannot get any of them working in LinuxCNC.
What I thought to do in TC3 was to setup a Virtual PLC and build a simple conveyor program in ladder logic so that I could simulate the conveyor movement when turning the encoder shaft.
BUT this sounds like a lot of work as compared to simply building one NC PTP axis under the MOTION tab to link the encoder and see the counts this way. I am not sure what is the best approach so if you guy’s have a better idea, then please let me know your thoughts.
Albert, I haven’t flashed the EPROM yet as I would like to learn how to configure the EL515x terminal so that I can “SEE” the encoder working in TwinCAT. As Dan said in the past, you need TwinCAT to be able to fix or tweak any of the terminals and I would like to figure this all out for future problems even though this is really the only terminal that I am having problems with. Beckhoff seems to have done a really good job with TC3, it is much better to get working than TC2 in my opinion.
Thanks,
Robert
Please Log in to join the conversation.
I think you don't need to do all that to know if it works correctly, which would be to reset the factory settings, since linuxcnc-ethercat uses the default function, then you see if the device has the correct name, it is in OP mode and what if You connect an encoder to it, count the values, I hope you are lucky.
reguard
Chimeno
Please Log in to join the conversation.
Thanks,
Robert
Please Log in to join the conversation.
Things are not looking good for me.... I did everything as you listed to reset the terminal and I am still getting 0 for the counter value as you can see in the attached screenshot. By the way, your list was perfect as it worked exactly as you stated:
1 - "ethercat" tab of the device
2 - "advanced settings" tab
3 - "ESC ACCESS" tab
4 - "EPROM" tab
5 - "HEX EDITOR" tab
6 - "download from list" tab
7 - select the device
8 - "Ok" ... recording image.
After selecting the correct model number device and hitting OK, you could see the bar pop up at the bottom of the screen and it would fill up green as it was downloading to the terminal. It did this twice, and the second time was pretty quick. Then the box would disappear and I didn't get any errors in the "errors" box after the process. I did both the EL5151and 52 with no change to either afterwards when going online and checking them out.
Do you have any other thoughts of what to try next?
Thanks,
Robert
Please Log in to join the conversation.
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.
Attachment not found
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...
Attachment not found
it saves a very generic file with almost no info:
test.xml
Attachment not found
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...
Attachment not found
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...
Attachment not found
Attachment not found
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.
Please Log in to join the conversation.
The device seems to be working properly and is in OP mode, that's good, have you connected an encoder to the A / B / C port? Could the encoder not work? Remove the encoder and place a cable making several contacts between the pins port C (pin4) + 24v (pin6), see as in the image that I enclose the status of port C, if this works surely you have the encoder in bad condition.
reguard
Chimeno
Please Log in to join the conversation.
You are progressing a lot, I'm very happy !!
DC mode is sometimes a bit troublesome, try this configuration it helps.So I changed to:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
<dcConf assignActivate="500" sync0Cycle="2000000" sync0Shift="1000000"/>
according to the thread here:
Can it works in another SM-MODE mode ?? no cal activate DC mode
Also check that the PID and VID are correct, you can get them from the terminal
Also check the PDOs that are correct with the terminal.
You just have to export the configuration that changes from the default, it is blue.it saves a very generic file with almost no info:
test.xml
This is an error in the PDO registry, some are not well defined[ 2385.496263] EtherCAT ERROR 0-0: AL status message 0x001E: "Invalid input configuration".
reguard
Chimeno
Please Log in to join the conversation.
So I changed PID to
and ethercat pdo seem to match my xml except the 0x6040 and 0x6041 are 16bit but the haltype is u32
Attachment not found
I don't know how to change DC mode but I changed the timings according to what you suggested and finally got this:
and the servo light is solid green so I think I am OP. I think this is all good news. but it doesn't seem to be able to sync...
So can you go to OP and not have a sync???
I don't know where to go next... but I went to HAL monitor and found that lcec.0.0.actpos was moving when I rotate the axis with my hand.
Attachment not found
Probably I need to change my hal file. ( I only have 1 axis attached so far for testing)
and I see there is a lcec.0.0.poscmd a bit lower but I don't really know how to give it a new position to have the motor move.
Attachment not found
Please Log in to join the conversation.
