Ethercat HAL driver

More
19 Feb 2021 13:25 - 19 Feb 2021 13:53 #199417 by db1981
Replied by db1981 on topic Ethercat HAL driver
hello,

0x1006 is the com cycle time = 500µs this is equal to your ethercat app cycle time
0x60C2 is the interpolation time, it's also 50ms * 10^ -5 = 500µs.

is your servo_period in the ini (thread which executes lcec_read/write) also set to 500000ns (2khz) ?
Last edit: 19 Feb 2021 13:53 by db1981. Reason: changed ns to µs, typo

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

More
19 Feb 2021 13:32 #199422 by arvidb
Replied by arvidb on topic Ethercat HAL driver
A typo there I guess? 500 ns = 0.5 µs = 2 MHz.

So the cycle time is probably in units of 1 µs?
The following user(s) said Thank You: db1981

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

More
19 Feb 2021 13:38 - 19 Feb 2021 13:39 #199425 by bkt
Replied by bkt on topic Ethercat HAL driver
@db1981

Warning: Spoiler!
Last edit: 19 Feb 2021 13:39 by bkt.

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

More
19 Feb 2021 13:40 #199426 by jc2ktr
Replied by jc2ktr on topic Ethercat HAL driver

hello,

0x1006 is the com cycle time = 500ns this is equal to your ethercat app cycle time
0x60C2 is the interpolation time, it's also 50ms * 10^ -5 = 500ns.

is your servo_period in the ini (thread which executes lcec_read/write) also set to 500ns (2khz) ?


This is my hal line with the periods:

loadrt [KINS]KINEMATICS
loadrt motmod base_period_nsec=500000 servo_period_nsec=1000000 traj_period_nsec=100000

when i try to change the servo period linuxcnc did not start anymore.

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

More
19 Feb 2021 13:59 #199431 by db1981
Replied by db1981 on topic Ethercat HAL driver
thats an servo_period of 1ms,
In which of this threads the lcecs are called (addf)

can you attach the hal file, seems there is something strange with the bus cycle time and the dcconf.

In the Indramat manual is written, that for an position control cycle at 0,25ms (fix for this drive) the communcation period should be min. 1ms.

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

More
19 Feb 2021 14:07 #199432 by jc2ktr
Replied by jc2ktr on topic Ethercat HAL driver

thats an servo_period of 1ms,
In which of this threads the lcecs are called (addf)

can you attach the hal file, seems there is something strange with the bus cycle time and the dcconf.

In the Indramat manual is written, that for an position control cycle at 0,25ms (fix for this drive) the communcation period should be min. 1ms.



This is my halfile where lcec is loaded


File Attachment:

File Name: ec_rexroth.hal
File Size:1 KB
Attachments:

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

More
19 Feb 2021 14:18 #199436 by db1981
Replied by db1981 on topic Ethercat HAL driver
@bkt

this does not match the drivers pdo. If this is an used device (ebay etc.. ) the card may be is configured for 16 Bit Mode. Factory standart would be 32 Bit mode (MDP511), for this the driver is configured.

Is this exactly an EL5151 or an special type EL5151-00XX ?.

Do you have acces to twincat? this would be much faster then configure the Card with sdo commands.

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

More
19 Feb 2021 14:58 #199443 by db1981
Replied by db1981 on topic Ethercat HAL driver
okay....

usually there is no need for a second thread if you don't need an Step Generator. Putting the Ethercat read and write in an faster thread then the calculations is the same as to putting water in an river. :) and waste ressources.
delete "base_period_nsec=500000" and put the lcec functions in the servo thread, change the apptimecycle_period in the ec_conf to 1000000. that's it for timing.....

but theres annother big Problem :

execution order !!!

the running order of your functions is wrong. You are reading Inputs and writing directly the outputs without any action or calculations, without pids this will not be very terrible, but every command is 1 cycle delayed (f-error will be high).

So think about the execution order like we are using an normal PLC or programming an realtime function. the functions are executed like you have arranged them in hal file. So if an function needs the outputs from annother function it has to be called after this.

reading inputs
.
.
functions (IO Control, Motion, PLC)
.
.
calculations (pids always after motion, kinematics before motion)
writing Outputs

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.
The following user(s) said Thank You: Nico2017, jc2ktr, Stormholt, Dimitri

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

More
19 Feb 2021 16:18 - 19 Feb 2021 16:27 #199450 by bkt
Replied by bkt on topic Ethercat HAL driver
@db1981 Yea I have acces ....but not know the right procedure for factory reset .... I try later

+ I must add pudh-pull resistor .... now led of el5151 blink .... so for sure is work. It need more than 15V signal on A-B signal so my NPN encored not reach that signal level .... but adding 2Kohm led blink ...now I must reset the unit.
Last edit: 19 Feb 2021 16:27 by bkt.

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

More
19 Feb 2021 16:37 #199454 by db1981
Replied by db1981 on topic Ethercat HAL driver
in Twincat, TAB Process Data, predefiened PDO Assignment, "Standart 32 Bit",
activate Configuration
The following user(s) said Thank You: bkt

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

Time to create page: 0.252 seconds
Powered by Kunena Forum