- Posts: 153
- Thank you received: 0
Beckhoff ethercat 64 with bit linuxcnc, How to install.
here is a quick step by step tutorial for the install.
- install debian OS from www.debian.org/distrib/ , choose the relevant iso adapted to your CPU architecture. I usually select the netinst for an installation through the network. But if you want to keep a ready to go iso download the CD one. During the install, select Gnome desktop as you might want to use Glade to design your machine interface.
- install the real time kernel:
then search for linux-image. Mark for installation the latest linux-image-***-rt-*** which might be described as a PREEMPT_RT kernel. The *** must match the version you want (probably the latest on the list) and the architecture of your install. Select the associated headers linux-headers-***-rt-*** matching the real time installation you just previously marked. Mark it for installation as well. Then apply to install both.Code:sudo synaptic
- reboot and make sure that you boot choosing the real time kernel newly installed (in the advanced options for Debian sub menu). This might be the one booting by default now. To check use
which should display your real time install -rt- . We are going to uninstall the non real time kernel:Code:uname -a, then search linux-image and then mark for complete removal the original install. Reboot, then the system should always boot on the remaining system which is the real time. While booting the advanced options for Debian sub menu should only display the rt option and its recovery mode.Code:sudo synaptic
-
to clone linuxcnc into the linuxcnc-dev directory. This way I never mistake it with the linuxcnc directory created by the linuxcnc installation, where all the machine configurations are stored.Code:git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev
-
, while we are cloning repository I also clone the other 2 required.Code:git clone https://github.com/sittner/ec-debianize.git
-
Code:git clone https://github.com/sittner/linuxcnc-ethercat.git
-
to install dpkg and prepare to be able to check the dependenciesCode:sudo apt-get install dpkg-dev
-
Code:cd linuxcnc-dev/debian ./configure uspace cd ..
-
lists the packages that need to be installed before proceeding. Use aCode:dpkg-checkbuilddepsto install the missing elements. Repeat until all required packages are installed.Code:sudo apt-get install packagename
- I extend the memory of the hal components before buidling linuxcnc, from @dgarret in
forum.linuxcnc.org/10-advanced-configura...-signal-pin?start=20
then I modify the values: #define HAL_SIZE (85*4096) to #define HAL_SIZE (170*4096) and #define HAL_STACKSIZE 16384 to #define HAL_STACKSIZE 32768 to double the hal memory (not sure what is doing what and not sure neither of the limit of those values regarding the installed hardware yet). I save and come back to the main linuxcnc-dev directory.Code:cd src/hal/ gedit hal_priv.h
- Now you can either build for run in place or build package. I choose the second option, build the package .deb for your install:
, this should create two .deb on the parent directory. Install those debian package usingCode:dpkg-buildpackage -b -uc, useCode:sudo dpkg -i linuxcnc-uspace_XXX_*.debif any packages are indicated as missing. InstalCode:sudo apt-get --fix-broken installand possibly missing packages too.Code:sudo dpkg -i linuxcnc-uspace-dev_XXX_*.deb
-
to check that the hal memory hal been installed with extended limitation, reading in the total shared memory the value which should match NNN*4096 with NNN the value you entered before building linuxcnc.Code:halcmd status
- you can test linuxcnc with a sim config with
, the configs file being saved by default in ~/linuxcncCode:linuxcnc
- if you need to add special components like me to extend and go above the 16 limitation see: forum.linuxcnc.org/24-hal-components/359...gument-limit?start=0
-
Code:sudo apt-get install quilt
-
Code:cd ec-debianize ./get_source.sh
-
. If it fails you can useCode:cd ec-debianize/etherlabmaster/ dpkg-buildpackageandCode:dpkg-checkbuilddepsthen retry to build the package. The final notice error "failed to sign .dsc file is not an issue. Once built, you should have the .deb files in ec-debianize.Code:sudo apt-get install nameofpackage
-
Code:cd ec-debianize sudo dpkg -i etherlabmaster_*_amd64.deb sudo dpkg -i etherlabmaster-dev_*_amd64.deb
- It might be required to be done twice for the non dev one in the case you are installing a newer version over a currently installed one.
- Identify your MAC address for the ethernet connexion linked to your Ethercat bus. To do so you can use
then you can read your MAC addresses.Code:sudo apt-get install net-tools sudo ifconfig
- Identify your MAC address for the ethernet connexion linked to your Ethercat bus. To do so you can use
then modify the MASTER0_DEVICE="" to MASTER0_DEVICE="MACADRESS" with MACADRESS the value obtain with ifconfig. Also change DEVICE_MODULES="" to DEVICE_MODULES="generic" then save.Code:sudo gedit /etc/default/ethercat
-
then reboot to make those modifications effective. To check that the ethercat is working, just connect and power your ethercat bus then tryCode:sudo update-ethercat-configYou should see all the ethercat module connected to your bus.Code:ethercat slaves
- This first step is required to make the ethercat+linuxcnc work, as indicated by @Hawkeye in
forum.linuxcnc.org/24-hal-components/223...ver?start=670#123888
. On my case this is required to avoid the error while launching linuxcnc with ethercat:
Go to the directory where you have been cloning the git linuxcnc-ethercat. Mine is in ~/linuxcnc-ethercat.Code:<stdin>:3: waitpid failed /usr/bin/rtapi_app lcec <stdin>:3: /usr/bin/rtapi_app exited without becoming ready <stdin>:3: insmod for lcec failed, returned -1edit this file adding #include "rtapi_mutex.h" below #include "rtapi_app.h" then save and close gedit.Code:cd ~/linuxcnc-ethercat gedit ~/linuxcnc-ethercat/src/lcec_main.c
- Then come back to the linuxcnc-ethercat directory, and
N being the number of processor to speed up the process.Code:make -jNCode:sudo make install
- Copy some files across to the relevant location:
to your linuxcnc sim folder (copy it where your ini files is)Code:cp ~/linuxcnc-ethercat/src/lcec_conf ~/linuxcnc/configs/FolderWhereInIFileForConfigapparently only required for for linuxcnc_dev usersCode:cp ~/linuxcnc-ethercat/src/lcec.so ~/linuxcnc-dev/rtlib/
- Make the Ethercat0 permission permanent for your user for linuxcnc
. Reboot to make it effective permanently.Code:sudo adduser $USER ethercat sudo adduser root ethercat
To shorten boot time at connexion:Grotius wrote: copy lcec_conf ==> ../linuxcnc-ethercat/src/lcec_conf ==> to your linuxcnc sim map (copy it where your ini files is)
copy lcec_so ==> ../linuxcnc-ethercat/src/lcec.so ==> to your home/.../linuxcnc/rtlib/ (this is only for linuxcnc_dev users)
copy and edit the ethercat_config.xml from the linuxcnc-ethercat example directory and copy it where your ini file is.
In your ini file add "HALFILE = postgui.hal"
make a postgui.hal file include :
loadusr -W lcec_conf ethercat-conf.xml
#loadrt lcec
#addf lcec.read-all servo-thread
#addf lcec.write-all servo-thread
First check if lcec_conf will load, open your halmeter.
When you see the Lcec section, uncheck the # sign's in the postgui.hal file.
-
on
It might fail to find libxml-2.0, in this casenewbynobi wrote:
now install it by typing:Code:wget ftp://ftp.gnome.org/pub/GNOME/sources/glade3/3.8/glade3-3.8.6.tar.xz tar -xpf glade3-3.8.6.tar.xzto test the glade install, enter in the terminal:Code:cd glade3-3.8.6 ./configure make sudo make installCode:glade-3
newbynobi wrote:
Code:sudo mkdir -p /usr/local/share/glade3/backup/catalogs sudo mkdir -p /usr/local/share/glade3/backup/pixmaps sudo cp /usr/local/share/glade3/catalogs/* /usr/local/share/glade3/backup/catalogs sudo cp -r /usr/local/share/glade3/pixmaps/* /usr/local/share/glade3/backup/pixmaps
now copy/add the missing files to that dir with the following terminal commandsCode:sudo cp ~/linuxcnc-dev/lib/python/gladevcp/*.xml /usr/local/share/glade3/catalogs sudo cp ~/linuxcnc-dev/lib/python/gladevcp/*.png /usr/local/share/glade3/pixmaps
PS: somehow if glade-3 works but the hal components are not showing up, you can try to uninstall glade-3 using
Then retry to install glade-3, withpaste this before "http:// : " ( to many links in post )
linuxcnc.org/dists/wheezy/base/binary-amd64/libgladeui-1-11_3.8.0-0ubuntu6_amd64.deb
linuxcnc.org/dists/wheezy/base/binary-amd64/glade-gtk2_3.8.0-0ubuntu6_amd64.deb
linuxcnc.org/dists/wheezy/base/binary-amd64/glade-gnome_3.8.0-0ubuntu6_amd64.deb
Unpack in terminal :
$ sudo dpkg -i libgladeui-1-11_3.8.0-0ubuntu6_amd64.deb
$ sudo dpkg -i glade-gtk2_3.8.0-0ubuntu6_amd64.deb
$ sudo dpkg -i glade-gnome_3.8.0-0ubuntu6_amd64.deb
I hope that this post will be usefull and contains all steps to create a new install with a latest RT OS for Debian and linuxcnc on a 64bits architecture, with a running Ethercat capability and Glade for building user interface. This is more a summary of different answers from different post and I though it would be useful to assemble them in one post.
Thank you to those who helped me when I was stuck in one step: @grotius, @Hawkeye, @dgarrett, @newbynobi
Nicolas
Please Log in to join the conversation.
I would like to know this line "add #include" rtapi_mutex.h "below #include" rtapi_app.h "then save and close gedit.
make -jN "in what affects the linuxcnc-ethercat ?, I just tried and I said that the file does not exist, where does it come from?
regards
Chimeno
Please Log in to join the conversation.
Please Log in to join the conversation.
i am trying to install ethercat but after $ dpkg-buildpackage i got this error:
thank you for your help!
Please Log in to join the conversation.
Aiai, a German installation 64 bit ethercat, nice !!
dpkg-checkbuilddeps shows nothing
That is good news for today !
In what step are you at the installation?
It looks you did a terminal : ./configure
die Regel für Ziel „override_dh_auto_configure“ scheiterte
What has been your override command?
Read this carefully :
Part of the message is hidden for the guests. Please log in or register to see it.
Please Log in to join the conversation.
Your question is here : forum.linuxcnc.org/38-general-linuxcnc-q...cnc-to-control-slave
It's nice to see Ethercat is next to Hong Kong !!
Please Log in to join the conversation.
this was quick

GOOD NEWS! I managed to find the problem. At the installation of the preemt kernel i got the wrong header files choosen. Now with the correct headers and deinstalled unused kernel+header files this works so far! awsome...
Thank you for your quick response and generally for your nice feedback with those components. only because of that i am now switched to beckhoff for this upcoming project
Best regards
Conny
Please Log in to join the conversation.
my inputs on the EL1004 modules are working fine now
But one thing i have to ask:
Does it mean you are using one EL2124 for 4 independent stepper drivers? if so, please tell me how can this be done if you need a 5v STP DIR and ENA signal for one driver.Grotius wrote: I now use a EL2124 to guide 4 stepgen signals ( 4 motor pulse train's )
Thank you!
Please Log in to join the conversation.
Thank you very much for your tutorial. Sorry i was a bit late to thank you.
Respect for you
Please Log in to join the conversation.
Does it mean you are using one EL2124 for 4 independent stepper drivers? if so, please tell me how can this be done if you need a 5v STP DIR and ENA signal for one driver.
2 pieces of this high speed (<1ms) output stuff is enough.
Switching times typ. TON: < 1 µs, typ. TOFF: < 1 µs
If a McLaren has this valve time, they will go faster....
Now i know that you cant load the lcec component in the already existing postgui_call_list.hal!
Is this for the Nico tutorial? Please provide more information about your item... This for other user's.
Please Log in to join the conversation.
