Ethercat HAL driver

More
11 Oct 2014 03:03 #51960 by javiergr
Replied by javiergr on topic Ethercat HAL driver
Me XY table and EhterCAT box

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

More
17 Oct 2014 15:04 #52154 by pavel7890
Replied by pavel7890 on topic Ethercat HAL driver
Hello,

I'd like to setup Indradrive servo drivers with LinuxCNC. I was able to follow Roshi's great guide how to do so. It works just fine, so far.

However I am not very experienced with cyclic servo positioning setup and respective HAL file. Can you Roshi please redeploy HAL and XML files? Those URLs you posted earlier are not valid anymore. Thanks.

As far as understand, LinuxCNC controls drive via positioning command every 1ms. How is maintained motor acceleration during that cycle? There is just adaptive acceleration calculated from position control with cyclic command setup on Indradrive? It would be very nice if you can also post Indraworks par file.

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

More
19 Oct 2014 21:32 - 19 Oct 2014 21:36 #52188 by roschi
Replied by roschi on topic Ethercat HAL driver
Hi,

Can you Roshi please redeploy HAL and XML files? Those URLs you posted earlier are not valid anymore. Thanks.

Sorry for that. Please find them here roschi.eu/retrofit/ Use: roschi_cnc.hal and ethercat_config_n.xml for starting.

LinuxCNC controls drive via positioning command every 1ms. How is maintained motor acceleration during that cycle? There is just adaptive acceleration calculated from position control with cyclic command setup on Indradrive?

My advise is to disable adaptive acc. in the indradrive setup. As mentioned if you use NC-driven-mode => cyclic position (and optional speed, torque) comanded values are sent over EtherCAT (or other field bus) the internal jerk and acceleration limit is ignored. There are only a maximum motor speed limit watched and maximum current. The Master --> NC, LinuxCNC has to ensure to give position values which can be reached with the maximum speed and maximum torque --> Settings in the *.ini file for each axis.

In the next days I can post the parameter files from indra drive. Especially the settings for the state-controlword are relevant for drive-based-homing. This is the method I prefer (Home switch = over travel switch and connected directly to the drive). But It is also possible or might be easier to use the standard NC based homing --> LinuxCNC controls the position during homing and the switches have to be connected to LinuxCNC.

Regards
Andreas
Last edit: 19 Oct 2014 21:36 by roschi.
The following user(s) said Thank You: pavel7890, Nico2017

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

More
19 Oct 2014 22:26 - 19 Oct 2014 22:35 #52191 by pavel7890
Replied by pavel7890 on topic Ethercat HAL driver
Hello,

thank you for files and reply.

As I have MSK servos with multiturn encoders, so my plan is to use homing as you presented with Estun drive = given absolute position from drives.

In case of Error or Warning message in Indradrives. Is there a possibility to post them to LinuxCNC and reset them?
Last edit: 19 Oct 2014 22:35 by pavel7890.

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

More
20 Oct 2014 04:13 #52199 by roschi
Replied by roschi on topic Ethercat HAL driver
Hi,

In case of Error or Warning message in Indradrives. Is there a possibility to post them to LinuxCNC and reset them?

Yes reseting is possible. Use the so called signal control word (German: Signalsteuerwort) in the Indradrive sertup which is/can be cyclic exchanged between Master/Slave. (see also 'signalcontrol" in the EtherCAT XML file)
This control word has 16 bits. Each bit can be configured individual via the IndraDrive configuration (drop down menu for each bit in IndraWorks Software).
If there is a drive error e.g. because a over travel switch is reached this or all other error can be reseted via the drive command 'C4600 reset'. This command can be linked to a bit in the signal control word. A rise from 0 to 1 will trigger the linked command.
So just connect the corresbonding bit in the HAL file (e.g. lcec.0.1.signalcontrol-05) to a push button in the pyvcp named e.g. Clear/Reset drive. (You can trigger all drives parralel; One button for all drives)

About posting the message to EtherCAT Master I have no knowledge. Perhaps the error number can be written. See/Search IndraDrive help for configurable Parameters/Values for cyclic exchange. (signal status word only exchanges bits like signal control word)
That there is a error on the drive is indicated via: --> lcec.0.0.drivestatus-13 => axis.0.amp-fault-in for example

I hope that gives some help.

Pavel maybe you can desrcibe your System Succes story later?

Regards Andreas
The following user(s) said Thank You: Nico2017

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

More
23 Oct 2014 15:12 - 23 Oct 2014 15:13 #52323 by nylon7
Replied by nylon7 on topic Ethercat HAL driver
1st Download ethercat master from IgH
2nd Untar the file: tar xvfj ethercat-1.5.2.tar.bz2
3rd download debian folder from sittner
4th copy debian folder (3rd step) to /ethercat-1.5.2/ (2nd step)
5th sittner instructions:
#cd ethercat-1.5.2
# cd debian
# ./configure -a
# cd ..
# dpkg-checkbuilddeps (and install missing deps)
# dpkg-buildpackage
6th # sudo dpkg -i ethercat_1.5.2-1_i386.deb
7th edit /etc/default/ethercat with your configuration (in the file there are useful comments)
8th # sudo update-ethercat-config
9th # sudo dpkg -i ethercat-dev_1.5.2-1_i386.deb
10th restart the machine to get the driver loaded at start. After that you can execute # ethercat master in terminal

I follow these steps above, and the there is no error..

and then ...

Install linuxcnc with lcec

I download this source

so.....

this Makefile is OK(hal/drivers/ethercat/lcec_el5151.o \) and homing.c is OK
cd src
In the source directory, build LinuxCNC:
./autogen.sh (this builds the configure script)
./configure
make clean
make
sudo make setuid

ethercat master

Master0
Phase: Idle
Active: no
Slaves: 2
Ethernet devices:
Main: 00:22:15:5f:ab:92 (attached)
Link: UP
Tx frames: 866671
Tx bytes: 52019500
Rx frames: 866670
Rx bytes: 52019440
Tx errors: 0
Tx frame rate [1/s]: 250 250 250
Tx rate [KByte/s]: 14.6 14.6 14.6
Rx frame rate [1/s]: 250 250 250
Rx rate [KByte/s]: 14.6 14.6 14.6
Common:
Tx frames: 866671
Tx bytes: 52019500
Rx frames: 866670
Rx bytes: 52019440
Lost frames: 0
Tx frame rate [1/s]: 250 250 250
Tx rate [KByte/s]: 14.6 14.6 14.6
Rx frame rate [1/s]: 250 250 250
Rx rate [KByte/s]: 14.6 14.6 14.6
Loss rate [1/s]: 0 0 0
Frame loss [%]: 0.0 0.0 0.0
Distributed clocks:
Reference clock: Slave 0
Application time: 0
2000-01-01 00:00:00.000000000

ethercat slaves

0 1001:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 1001:1 PREOP + EL2521 1K. Pulse Train Ausgang


message is correct

But

dmesg message error

[ 3034.246141] lcec: Unknown symbol lcec_el5101_init
[ 4598.452856] LCEC: lcec_conf is not loaded


So, how should I do to solve the problems..

thanks
Last edit: 23 Oct 2014 15:13 by nylon7.

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

More
23 Oct 2014 18:46 - 23 Oct 2014 22:48 #52330 by cgc
Replied by cgc on topic Ethercat HAL driver
Hello,
you forgot this:

"3rd modify /src/makefile due to there is a mistake inside:
cec.cec.
they have forgotten: hal/drivers/ethercat/lcec_el5101.o \
between hal/drivers/ethercat/lcec_el41x2.o \ and hal/drivers/ethercat/lcec_el5151.o \
"

Frank
Last edit: 23 Oct 2014 22:48 by cgc.
The following user(s) said Thank You: nylon7

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

More
24 Oct 2014 14:44 #52348 by nylon7
Replied by nylon7 on topic Ethercat HAL driver
I follow this Tutorial file& user cgc

Now

ethercat slaves

0 1001:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 1001:1 PREOP + EL2521 1K. Pulse Train Ausgang


halcmd: loadusr -W lcec_conf ./el2521.xml

<stdin>:1: execv(lcec_conf): No such file or directory
<stdin>:1: lcec_conf exited without becoming ready


So, how should I do to solve the problems..

thanks

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

More
11 Nov 2014 20:15 #53011 by narogon
Replied by narogon on topic Ethercat HAL driver

I follow this Tutorial file& user cgc

Now

ethercat slaves

0 1001:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 1001:1 PREOP + EL2521 1K. Pulse Train Ausgang


halcmd: loadusr -W lcec_conf ./el2521.xml

<stdin>:1: execv(lcec_conf): No such file or directory
<stdin>:1: lcec_conf exited without becoming ready


So, how should I do to solve the problems..

thanks


You must create a file that describes your network. There is an example in the tutorial. I'm writting using phone, I'll try to clear it up later.

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

More
27 Dec 2014 17:40 #54314 by ccdodo
Hi, I am trying to use linuxcnc with ethercat these days but meet some difficulties:

The first one is failed to 'home'...

Here are the steps I follow to setup linuxcnc:
1. Download ethercat-1.5.2 from Igh
2. untar the tarball of ethercat
# tar xvfj ethercat-1.5.2.tar.bz2
3. About linuxcnc-add-hal-ethercat, there are two source in git, one is from s*** and the other is a***, I download linuxcnc-add-hal-ethercat from axxxx in git as the debian folder is not under /ethercat/master in s*** version.
4. use debian folder in linuxcnc-add-hal-ethercat and ethercat to generate ethercat_1.5.2-1_i386.deb and ethercat-dev_1.5.2-1_i386.deb via dpkg:
4.1 copy the debian directory to your build directory.
# cp -av <path-of-LinuxCNC-add-hal-ethercat>/src/hal/drivers/ethercat /master/debian ethercat-1.5.2 <- Here the debian folder is not really got from a*** source but using the "ec-debianize-master"
4.2 build the packages
# cd ethercat-1.5.2
# cd debian
# ./configure -a
# cd ..
# dpkg-checkbuilddeps (and install missing deps:libtools,dpatch)
# dpkg-buildpackage
5. Install the first deb, modify the MAC and DEVICE in /etc/default /ethercat , and update the config
6. Install the second deb and reboot
7. compile linuxcnc-a-h-e follow:
7.0 add 5101 line to source code
7.1 cd ./linuxcnc-a-h-e/src
7.2 ./configure
7.3 sudo make
7.4 sudo make install
7.5 sudo make setuid
7.6 source script/rip-environment

According to the instruction, "Then do a reboot or load the ec*-modules manually (see /etc/modules), the master should now be functional." after step 5 BUT the modules are not loaded after reboot sometimes or are loaded but no /opt/etherlab/bin/ethercat exist in different trys. Since ethercat works not well so the debs are removed and source code of ethercat has been re-compiled follow:
1 ./autogen.sh
2 ./configure (no "--enable-run-in-place")
3 make clean
make
sudo make setuid
4 back to the upper path and 'source scripts/rip-environment'
5 The version of linuxcnc is 2.6.0~pre

Then the ethercat is able to start and slave status can be checked.

Everything seems to be OK until I press the home button...Nothing happens
HAL config is used to find the problem: Once the home button is pressed, the corresponding axis.N.homing will be true but the vel-cmd will not change and the real axis does not move.
After tried many ways, the problem seems to stay at "HOME_SEARCH_VEL" and "HOME_LATCH_VEL" in INI file:
If both are set to zero, home button is useful but the current position will be set as HOME.
If one is set to zero but the other not, error will be sent to say that the value should be non-zero.
If both are set to non-zero, nothing happens except the status of axis.N.homing changes from false to true and axis.N.home-state changes from 0 to 7.

And if I set both to zero, manualy move those axis to a certain position, and set the current position to be HOME, the machine runs perfect in MDI, JOG or NC mode.

I guess maybe some part of the code is wrong as it was still developing in git but I've no idea what to do...

So, what should I do to solve the problem ?
And where can I get the complete version but not developing version of linuxcnc-add-hal-ethercat?

As to the problem above, I tried another version of linux-add-hal-ethercat in which the emc was still named as "emcec" on another PC.
The steps are the same as those above except the debian folder used in 4.1 is obtained from the folder under corresponding linuxcnc.
Ethercat works well by checking the master and slaves by command lines.
Emcec can be started by 'halrun' and ethercatConf.xml can be loaded by emcec_conf.
BUT, a fatal error jumped out when I type 'loadrt emcec' as below:
'
halcmd: loadrt emcec
insmod: error inserting '/home/nim/new/linuxcnc-add-hal-ethercat/rtlib/emcec.ko': -1 Unknown symbol in module
<stdin>:3: exit value: 1
<stdin>:3: insmod failed, returned -1
See the output of 'dmesg' for more information.
'

Then I make clean and make again but only many few *.ko can be generated so errors like helper_modules can not be found in /bin will jump out in during make.
Then I install the debs again to compile the linuxcnc again but the error shows up all the same even though no error shows during make.

More info is obtained via 'dmesg' of which maybe useful are attatched and some key sentences are listed below:

[18617.447960] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[18617.447962] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[18617.447982] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[18617.447984] PIPELINE layers:
[18617.447986] f8d64e20 9ac15d93 RTAI 200
[18617.447987] c085cb20 0 Linux 100
[18617.461417] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[18617.461543] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[18617.461546] RTAI[sched]: hard timer type/freq = APIC/20883354(Hz); default timing: periodic; linear timed lists.
[18617.461549] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2999805000 hz.
[18617.461550] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[21739.424304] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[21739.424362] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[21739.424366] RTAI[sched]: hard timer type/freq = APIC/20883354(Hz); default timing: periodic; linear timed lists.
[21739.424368] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2999805000 hz.
[21739.424370] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[21739.424416] RTAI[usi]: enabled.
[21739.447954] RTAI[math]: loaded.
[21762.205786] emcec: Unknown symbol ecrt_sdo_request_timeout
[21762.205847] emcec: Unknown symbol ecrt_request_master
[21762.205953] emcec: Unknown symbol ecrt_release_master
[21762.206013] emcec: Unknown symbol ecrt_master_activate
[21762.206126] emcec: Unknown symbol ecrt_sdo_request_read
[21762.206330] emcec: Unknown symbol ecrt_domain_size
[21762.206390] emcec: Unknown symbol ecrt_master_deactivate
[21762.206451] emcec: Unknown symbol ecrt_slave_config_create_sdo_request
[21762.206656] emcec: Unknown symbol ecrt_master_sync_reference_clock
[21762.206716] emcec: Unknown symbol ecrt_slave_config_pdos
[21762.206776] emcec: Unknown symbol ecrt_domain_data
[21762.206836] emcec: Unknown symbol ecrt_sdo_request_data
more sentences like above fills the whole screen...

As to the weird problems, what should I do to solve them ?
Thanks for your attention and happy new year.
Attachments:

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

Time to create page: 0.178 seconds
Powered by Kunena Forum