Ethercat HAL driver
I did not look at the EL1819.c file, just the compilation, now that I am looking at it, everything is wrong with the PDO entries, where did you get it? I attached the folder with the solution much better, since it is a simple device .
regards
Chimeno
Please Log in or Create an account to join the conversation.
I modified EL1904 to EL1819. I added channels.
Thank you very much for the edited files.
Compilation Ok. Start LinuxCNC Ok.
When I connect 24V (or 0V) to input # 1 I don't see a change in HAL Configuration.
It's good?
Thank you very much for your advice.
Jirka
Please Log in or Create an account to join the conversation.
currently, I am trying to get my CNC running with LinuxCNC and EtherCAT. I think I came quite far but now, I am stuck facing a problem where I need your help. My Beckhoff parts, EK1100&EL, work perfectly but I have a problem with my Rexroth servo drive.
Right now, I am concentrating on getting 1 Bosch Rexroth HCS01 up and running. All neccessary drivers and software should be installed properly. In the attachment, you can find my minimalistic .ini, .hal, and .xml-files. When I start the ini-file everything seems to work as expected. The position of my motor is shown correctly. When turning the shaft of my disabled motor, the position feedback changes as expected. (Currently, scaling is set s.t. 1°=1mm).
Enabling seems to work, too, since the current state switches from Ab -> AF. However, when I want jog the motor, nothing happens. The motor simply does not turn. Using the Hal-Meter, I can see that the value of lcec.0.0.poscommand changes correctly but my motor does not want to turn. Btw, in TwinCAT the motor is turning and working.
Actually, I think I must have made mistake in the xml-file or in the drive parameterization but I have no idea what might go wrong. The 'dmsg'-command shows the following errors.
[Sat Feb 8 10:14:27 2020] EtherCAT 0: Scanning bus.
[Sat Feb 8 10:14:27 2020] EtherCAT 0: Bus scanning completed in 32 ms.
[Sat Feb 8 10:14:27 2020] EtherCAT 0: Using slave main-0 as DC reference clock.
[Sat Feb 8 10:14:27 2020] EtherCAT 0: Slave states on main device: PREOP.
[Sat Feb 8 10:14:35 2020] EtherCAT: Requesting master 0...
[Sat Feb 8 10:14:35 2020] EtherCAT: Successfully requested master 0.
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Domain0: Logical address 0x00000000, 12 byte, expected working counter 3.
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 12 byte, type LRW at ffff9d7c4a8d7c18.
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Master thread exited.
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Starting EtherCAT-OP thread.
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0: 1 datagram UNMATCHED!
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Slave states on main device: INIT.
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Slave states on main device: PREOP.
[Sat Feb 8 10:14:35 2020] EtherCAT ERROR 0-main-0: Slave does not support CoE!
[Sat Feb 8 10:14:35 2020] EtherCAT ERROR 0-main-0: Failed to read number of mapped PDO entries.
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Failed to read PDO entries for PDO 0x0018.
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Slave does not support changing the PDO mapping!
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Currently mapped PDO entries: (none). Entries to map: 0x0086:00/16 0x002F:00/32
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Slave does not support assigning PDOs!
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Currently assigned PDOs: (none). PDOs to assign: 0x0018
[Sat Feb 8 10:14:35 2020] EtherCAT ERROR 0-main-0: Slave does not support CoE!
[Sat Feb 8 10:14:35 2020] EtherCAT ERROR 0-main-0: Failed to read number of mapped PDO entries.
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Failed to read PDO entries for PDO 0x0010.
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Slave does not support changing the PDO mapping!
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Currently mapped PDO entries: (none). Entries to map: 0x0087:00/16 0x0033:00/32
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Slave does not support assigning PDOs!
[Sat Feb 8 10:14:35 2020] EtherCAT WARNING 0-main-0: Currently assigned PDOs: (none). PDOs to assign: 0x0010
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Domain 0: Working counter changed to 2/3.
[Sat Feb 8 10:14:35 2020] EtherCAT 0: Slave states on main device: SAFEOP.
[Sat Feb 8 10:14:36 2020] EtherCAT 0: Domain 0: Working counter changed to 3/3.
[Sat Feb 8 10:14:37 2020] EtherCAT 0: Slave states on main device: OP.
If you need more information, please let me know. Do you have an idea what I am doing wrong? I appreciate every hint.
Best wishes
-K
Please Log in or Create an account to join the conversation.
EL1904 is an input terminal device that is associated with the safety set EL6900, EL1904, EL2904, works differently and is not a good starting point for standard terminals, I advise you to use other examples lcec_el40x1.C and lcec_el40x1.hI modified EL1904 to EL1819. I added channels.
It is not good, I would have to change, can you verify that the device is OP mode? One way to do this is by starting linuxcnc and while you are running, in a terminal you visualize it with the commandWhen I connect 24V (or 0V) to input # 1 I don't see a change in HAL Configuration.
It's good?
ethercat slave
regards
Chimeno
Please Log in or Create an account to join the conversation.
you may be missing more PDO to configure, I attached a configuration file for you to compare and if it helps you.
regards
Chimeno
Please Log in or Create an account to join the conversation.
thanks a lot for your reply. I have tested your file now, but unfortunately, I still get the same error (the only difference is that the list of pdo entries to be mapped in the error message is getting longer).
I have seen that Roger (forum.linuxcnc.org/24-hal-components/223...iver?start=290#74541) has had the same problem. But I don't understand what he means in his post explaining his solution (forum.linuxcnc.org/24-hal-components/223...iver?start=330#77475).
So, if I use TwinCAT I don't have a problem to get the servo drive up and running and the motor turns as expected. The only difference I see at the moment is that the NC-Cycle is always set to 2000us when switching from PreOP->SafeOP, no matter how I parameterize the value for the NC-Cycle in Indraworks. If I set the NC-Cycle time to 2000us in the xml-file in LinuxCNC, I get an error saying 'LCEC: invalid appTimePeriod of 2000000 for master 0 (should be 1000000)'.
I'm a not really into EtherCAT, but as far as I understood from roschi's tutorial, the list of pdo entries in the xml-file used to configure the drive via TwinCAT needs be equal to the list of entries in the LinuxCNC xml-file. As I am currently using the unmodified xml-File provided by Bosch Rexroth to configure my drive, I thought that I just need to consider the two pdo entries for pdo 0x0018
<RxPdo Mandatory="1" Sm="2">
<Index>#x0018</Index>
<Name>MDT</Name>
<Entry Fixed="true">
<Index>134</Index>
<SubIndex>0</SubIndex>
<BitLen>16</BitLen>
<Name>Master control word</Name>
<DataType>UINT</DataType>
</Entry>
<Entry>
<Index>47</Index>
<SubIndex>0</SubIndex>
<BitLen>32</BitLen>
<Name>Position command value</Name>
<DataType>DINT</DataType>
</Entry>
</RxPdo>
and for pdo 0x0010
<TxPdo Mandatory="1" Sm="3">
<Index>#x0010</Index>
<Name>AT</Name>
<Entry Fixed="true">
<Index>135</Index>
<SubIndex>0</SubIndex>
<BitLen>16</BitLen>
<Name>Drive status word</Name>
<DataType>UINT</DataType>
</Entry>
<Entry>
<Index>51</Index>
<SubIndex>0</SubIndex>
<BitLen>32</BitLen>
<Name>Position feedback value 1</Name>
<DataType>DINT</DataType>
</Entry>
</TxPdo>
As the dmesg-error says, the problem seems to be reading the pdo entries from pdo 0x0018 and 0x0010 on the the servo drive but I have no idea why.
Do you have a HCS01 servo drive at hand? Then, you could export a list of your parameters for me and I might see what's misconfigured.
Thanks in advance for every help.
Best wishes,
-K
Please Log in or Create an account to join the conversation.
I never had a device of this type, I can not help you much with the issue of device configuration, surely I will have the device configured incorrectly, there are different ways to configure, you will have to ask another forum partner to use the HCS01 drive and I can help you I'm sorry I can't contribute much more.Do you have a HCS01 servo drive at hand? Then, you could export a list of your parameters for me and I might see what's misconfigured.
regards
Chimeno
Please Log in or Create an account to join the conversation.
my name is Max and I plan on retrofitting a mill to use Linuxcnc with the Ethercat driver.
I got two questions regarding the EL2521 and EL2522 modules, that I would like to clarify before I go and order parts next week.
The EL2521 has four different variants:
EL2521-0000, EL2521-0024, EL2521-0124, EL2521-0025
download.beckhoff.com/download/document/...rminals/el252xen.pdf <= English version
download.beckhoff.com/download/document/...rminals/el252xde.pdf <= German version
Are these four versions identical regarding their software driver ? Or should I pick a certain one ?
And has anybody tried the two channel EL2522 perhaps ? Or are they not supported yet ?
Also if anybody could give me links to resources to get the ethercat drive setup ? I have been reading the last 25 pages or so of this thread and the first 10 or so - and I ll read more. However the ealiest configurations were done with 10.04 a few years back. My experience so far is with Linuxcnc with Mesa cards, but this mill that I want to retrofit is bigger and thus I really want to use a field bus with this machine, hence the interest in using Ethercat.
Thanks
Max.
Please Log in or Create an account to join the conversation.
Hello @mh , according to the manual they seem the same except that the outputs are different and you will have to choose the one that suits you, I do not think you have a problem with any versionThe EL2521 has four different variants:
EL2521-0000, EL2521-0024, EL2521-0124, EL2521-0025
download.beckhoff.com/download/document/...rminals/el252xen.pdf <= English version
download.beckhoff.com/download/document/...rminals/el252xde.pdf <= German version
Are these four versions identical regarding their software driver ? Or should I pick a certain one ?
EL2522 there is no driver in linuxcnc-ethercar, you will have to use the generic one, I don't have it but I don't think I have problems with both channels.And has anybody tried the two channel EL2522 perhaps ? Or are they not supported yet ?
regards
Chimeno
Please Log in or Create an account to join the conversation.
Other modules I have "OP"
I have read the instructions in my language and it is beyond my possibilities.
Thank you very much.
Please Log in or Create an account to join the conversation.