Ethercat HAL driver

More
19 Feb 2021 16:40 - 20 Feb 2021 17:30 #199455 by jc2ktr
Replied by jc2ktr on topic Ethercat HAL driver

okay....
lcec.read_all (reading from hardware) has to be the first addf line in the hal.
lcec.write_all (write to hardware) must be the last addf line in the hal.


when you put it like that it makes a lot of sense :)

I snucked my hal configuration from multiple sources together, without fully understanding how it works.

I will adapt my hal config and let you know how it behaves then, could only get better from now on, have so many learned in the last days/weeks.

@db1981 after your mentioned Changes of the HAL-Config the Axis runs super smooth and noise free. Only one problem is still there. When i do a cyclic position loop like G1 F2000 X0 to G1 F2000 X100 with 20 repeats. after a short time The drive gets in Error state with F2037 Excessive position command difference, In TwinCAT is this no Problem since now.
Last edit: 20 Feb 2021 17:30 by jc2ktr. Reason: Edit

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

More
22 Feb 2021 16:57 #199723 by bkt
Replied by bkt on topic Ethercat HAL driver
@db1981 It is el5151 00x0 twincat configurator see it as el5151 0000 0025 and I see there are 2 configuration "1600/1601 - 1A00/1A01" these seems ok ... but not see any value changing inside online tab on twincat configurator (I use twincat configurator because more easy than twincat3). On twincat configurator I can send el5151 in OP mode ... but in linuxcnc is anytime on PREOP when all other slaves is in OP mode.

There are any reasons? Is only because is not set the right xml or there are other reasons?

regards

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

More
22 Feb 2021 17:45 - 22 Feb 2021 17:46 #199735 by db1981
Replied by db1981 on topic Ethercat HAL driver
under the tab "process Data" , is an button "predefined PDO Assignment" there choose "standart 32 Bit" and run the configuration. this will change the pdo content of 1A00.
After this it should work with linuxcnc.

at the moment this is obiviously configured as "standart 16 Bit"...
Last edit: 22 Feb 2021 17:46 by db1981.

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

More
22 Feb 2021 18:24 #199746 by db1981
Replied by db1981 on topic Ethercat HAL driver
@bkt

sorry forget it.
I've got the same proplem by testing now.
Beckhoff changed the Pdo configuration between firmware 0024 and 0025. This will not work at the moment.
I will discuss this with sascha tomorrow.
The following user(s) said Thank You: bkt

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

More
22 Feb 2021 18:36 #199748 by bkt
Replied by bkt on topic Ethercat HAL driver
Seems I'm a very lucky man. :( ....... Thanks for the advice and I hope in your or Chimeno help tomorrow.

Good Night

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

More
22 Feb 2021 18:48 #199751 by db1981
Replied by db1981 on topic Ethercat HAL driver
the changes for this are only to edit 4 lines of codes, but then it is hardcoded for this revision of the card.

because of that this will not stay an single case in the future, we should implement an solution in lcec_conf for handling/detect this firmware rev. stuff.
The following user(s) said Thank You: bkt

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

More
23 Feb 2021 07:38 - 23 Feb 2021 08:03 #199801 by bkt
Replied by bkt on topic Ethercat HAL driver

but then it is hardcoded for this revision of the card.


does this mean that you will need to create an xml file specifically for the el5151 element? Or more clean solution is write a new custom driver called el5151_25 and use it on my xml instead the old one?

P.S.: I launch these command: ethercat xml -p6 (my el5151) and obtain these xml

Warning: Spoiler!


The problem is ethercat-xml see SubIdx=20 and SubIdx=17 as UINT32 but on ethrcat-pdos command these SubIdx seems nr.11 and 14? is these the problem? Different number of SubIdx detected or stored?

If I read lcec_el5151.c I see these part:

Warning: Spoiler!


That is the same thart i see on ethercet configurator .... same idx, same pin, same data type .... so seems lcec_el5151.c was ok .... but these part is no understand from my side, so not understand if work or not for me:

Warning: Spoiler!


I appreciate some little expalanation so maybe I have some ideas about.

regards

bkt
Last edit: 23 Feb 2021 08:03 by bkt.

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

More
23 Feb 2021 09:13 #199804 by db1981
Replied by db1981 on topic Ethercat HAL driver
the custom driver for the el5151 needs to be modified. It has to check for the revision of the card and then use the corespondending pdo mapping.

If you look at this:
static ec_pdo_entry_info_t lcec_el5151_in[] = {
   {0x6000, 0x01,  1}, // Latch C valid
   {0x6000, 0x02,  1}, // Latch extern valid
   {0x6000, 0x03,  1}, // Set counter done
   {0x0000, 0x00,  4}, // Gap
   {0x6000, 0x08,  1}, // Extrapolation stall
   {0x6000, 0x09,  1}, // Status of input A
   {0x6000, 0x0a,  1}, // Status of input B
   {0x6000, 0x0b,  1}, // Status of input C
   {0x0000, 0x00,  1}, // Gap
   {0x6000, 0x0d,  1}, // Status of extern latch
   !!!{0x1c32, 0x20,  1}, // Sync error
   {0x0000, 0x00,  1}, // Gap
   !!!{0x1800, 0x09,  1}, // TxPDO Toggle
   {0x6000, 0x11, 32}, // Counter value
   {0x6000, 0x12, 32}  // Latch value
};

and here:
LCEC_PDO_INIT(pdo_entry_regs, slave->index, slave->vid, slave->pid,!!! 0x1c32, 0x20!!!, &hal_data->sync_err_pdo_os, &hal_data->sync_err_pdo_bp);
  LCEC_PDO_INIT(pdo_entry_regs, slave->index, slave->vid, slave->pid,!!! 0x1800, 0x09!!!, &hal_data->tx_toggle_pdo_os, &hal_data->tx_toggle_pdo_bp);

beckhoff changed :

0x1c32, 0x20 to 0x6000 , 0x0E and
0x1800, 0x09 to 0x6000 , 0x10

sizes are the same...

so if you are firm with this, you can change these 4 lines, compile and test it.
The following user(s) said Thank You: bkt

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

More
23 Feb 2021 12:08 #199815 by bkt
Replied by bkt on topic Ethercat HAL driver

so if you are firm with this, you can change these 4 lines, compile and test it.


I'm not very ... but I don't see any other chances for my incremental encoder .... is there any?

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

More
23 Feb 2021 12:34 #199820 by db1981
Replied by db1981 on topic Ethercat HAL driver
ok, then i will prepare this ...

-which linuxcnc version ?
-debian?
-RIP version oder installed linuxcnc?

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

Time to create page: 0.227 seconds
Powered by Kunena Forum