Ethercat HAL driver
I have no experience in Raspbian, can you try this if it helps you?
./get_source.sh
dpkg-buildpackage -uc -us
Chimeno
Please Log in or Create an account to join the conversation.
making the package works with
./get_source.sh
dpkg-buildpackage -uc -us
and it doesn't complain about the missing signature ..
but again it's when I install the package:
sudo dpkg -i etherlabmaster_1.5.2+20190904hg33b922p8ea394-1_armhf.deb
that I get the some compile errors about "free_dma" and "free_irq" : (same as last night)
DKMS make.log for etherlabmaster-1.5.2+20190904hg33b922p8ea394 for kernel 4.19.58-rt22-v7l+ (armv7l)
Thu 7 May 00:27:29 CEST 2020
make: Entering directory '/usr/src/linux-headers-4.19.58-rt22-v7l+'
CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/examples/mini/mini.o
CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/module.o
LD [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/examples/mini/ec_mini.o
CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/cdev.o
CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.o
CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/coe_emerg_ring.o
CC [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/datagram.o
/var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c: In function 'ccat_dma_free':
/var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c:264:3: error: implicit declaration of function 'free_dma'; did you mean 'free_irq'? [-Werror=$
free_dma(priv->func->info.tx_dma_chan);
^~~~~~~~
free_irq
/var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c: In function 'ccat_dma_init':
/var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.c:286:6: error: implicit declaration of function 'request_dma'; did you mean 'request_irq'? [-W$
if (request_dma(channel, KBUILD_MODNAME)) {
^~~~~~~~~~~
request_irq
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:303: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat/netdev.o] Error 1
make[2]: *** [scripts/Makefile.build:544: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices/ccat] Error 2
make[1]: *** [scripts/Makefile.build:544: /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/devices] Error 2
make[1]: *** Waiting for unfinished jobs....
....
....
LD [M] /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/master/ec_master.o
make: *** [Makefile:1517: _module_/var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.19.58-rt22-v7l+'
Thanks anyway..
Please Log in or Create an account to join the conversation.
/thk to chimeno and icshwi
tldr:
1 ) github.com/thanhtam-h/rpi4-4.19.58-rt
2 ) github.com/icshwi/etherlabmaster
# Starting from fresh 2020-02-13-raspbian-buster-full.img install
# configure language, keyboard, wifi, enable VNC
# to reproduce the full experience while listening to Billie and Finneas
#
#install subversion (svn)
sudo apt-get install subversion
# just because I forgot (it's the first thing to do)
sudo apt-get update
sudo apt-get upgrade
svn checkout github.com/thanhtam-h/rpi4-4.19.58-rt
cd prebuilt/
chmod +x deploy.sh
./deploy.sh
***************new from www.simplerobot.net/2019/11/raspberry-pi-4-support.html
********We need to fix Linux header before we can use it to build module native on rpi in future:
cd /usr/src/linux-headers-4.19.58-rt22-v7l+
sudo make -i modules_prepare
# the pi will reboot by itself... at the end of deploy.sh
uname -a
Linux raspberrypi 4.19.58-rt22-v7l+ #1 SMP PREEMPT RT Fri Nov 1 14:58:37 KST 2019 armv7l GNU/Linux
# install mercurial with mq extensions
sudo apt-get install mercurial
hg config --edit
#PRESS 1
#ADD under
#[extensions]
mq =
save file /home/pi/.hgrc
./get_source.sh
## new try from :https://github.com/icshwi/etherlabmaster DOES WORK!!!
#Installing on Raspbian
#Tests have been performed on:
#Raspberry-pi 4b running Raspbian version 4.19.97-v7l+ (ARM arch).
#generic driver
#works on 4.19.58-rt22-v7l+
#
#Prepare:
# Tools
$ sudo apt install -y build-essential libtool automake tree dkms
# Hg
$ sudo apt-get install mercurial
# Kernel headers are needed:
$ sudo apt install raspberrypi-kernel-headers
#Note: TSC is not available for ARM so the option "ENABLE_CYCLES=NO" is #needed.
# !!!!!!IMPORTANT TSC not availbe in ARM (Set ENABLE_CYCLES=NO)!!!!!!!
#$ echo "ENABLE_CYCLES = NO" > configure/CONFIG_OPTIONS.local
#Install etherlab master:
$ git clone github.com/icshwi/etherlabmaster
$ cd etherlabmaster
$ make init
# !!!!!!IMPORTANT TSC not availbe in ARM (Set ENABLE_CYCLES=NO)!!!!!!!
$ echo "ENABLE_CYCLES = NO" > configure/CONFIG_OPTIONS.local
$ make build
$ make install
$ echo "ETHERCAT_MASTER0=eth0" > ethercatmaster.local
$ make dkms_add
$ make dkms_build
$ make dkms_install
$ make setup
# Reboot or start manually
$ sudo systemctl start ethercat
Next up trying to setup linuxcnc-ethercat...
So I made an xml with the beckhoffs and started the thing... (seems I end up having the same issue as others in the same thread about 1 year ago... which is somehow comforting after 4 nights of work...)
pi@raspberrypi:~/linuxcnc-dev/configs/sim/axis $ linuxcnc
LINUXCNC - 2.9.0~pre0
Machine configuration directory is '/home/pi/linuxcnc-dev/configs/sim/axis'
Machine configuration file is 'my_xyz.ini'
check_config: (trivkins kinematics) WARNING:
Unspecified [JOINT_0]MAX_VELOCITY, default used: 1.0
Unspecified [JOINT_0]MAX_ACCELERATION, default used: 1.0
Unspecified [JOINT_1]MAX_VELOCITY, default used: 1.0
Unspecified [JOINT_1]MAX_ACCELERATION, default used: 1.0
Unspecified [JOINT_2]MAX_VELOCITY, default used: 1.0
Unspecified [JOINT_2]MAX_ACCELERATION, default used: 1.0
Starting LinuxCNC...
emc/iotask/ioControl.cc 702: can't load tool table.
Found file(LIB): /home/pi/linuxcnc-dev/lib/hallib/basic_sim.tcl
setup_kins: cmd=loadrt trivkins coordinates=XYZ
Note: Using POSIX realtime
Found file(REL): ./postgui.hal
lcec: dlopen: /home/pi/linuxcnc-dev/rtlib/lcec.so: undefined symbol: ecrt_slave_config_sdo
Please Log in or Create an account to join the conversation.
"-L /opt/etherlab/can't remember/lib"
I finally was able to have linuxcnc rt on raspberry (at least the halmeter) see the EL1008 DIN from the beckhoff..
Thank you everyone...
next task is to have the closed loop hybrid stepper driver working, but all the examples I see are for AC servos, I am sorry, I already asked in another thread but no one ever used leadshine ethercat or one of the numerous chinese stepper drivers clones? Why is that?
Please Log in or Create an account to join the conversation.
I don't quite understand what you mean, do you want to connect the step / dir signals to the EL1008?next task is to have the closed loop hybrid stepper driver working, but all the examples I see are for AC servos, I am sorry, I already asked in another thread but no one ever used leadshine ethercat or one of the numerous chinese stepper drivers clones? Why is that?
Greeting
Chimeno
Please Log in or Create an account to join the conversation.
I just ordered some ethercat closed loop drivers ECT60 from rtelligent which are as far as I understand leadshine clones.
Please Log in or Create an account to join the conversation.
ahh perfect, found the manual online, it looks good, if you have TWINCAT3 it will be a good option to experiment, then it would export the .xml configuration file and program the PDOs through the generic linuxcnc-ethercat driver.
Greeting
Chimeno
Please Log in or Create an account to join the conversation.
Is that the xml file I need?(attached) I understand reading the forums that I will have to "translate" to a linuxcnc config file somehow,
as shows the "indra drives" tutorial here:
docs.google.com/document/d/1GiB065ZIAaoM...xGQl2X9DM9-THNM/edit
Is there any c code to be writen as well? I see the delta servo ASDA-A2-E needed some here:
github.com/sittner/linuxcnc-ethercat/blo...er/src/lcec_deasda.c
and also the beckhoff here:
EL7041-1000* - 1-channel stepper motor terminal, 50 V DC, 5 A, 1 with Enc In
github.com/sittner/linuxcnc-ethercat/blo...c/lcec_el7041_1000.c
But I understand (I may be wrong in that) the beckhoff doesn't actually act as a full closed loop albeit is has encoder inputs...
Do you know of any more tools, code, documents or example from a more similar stepper that I could use as a starting point?
The drives ended up being just shy of 100$ per axis including steppers, motors, cables and shippment in case anyone asks...
still I'd honestly prefer they don't turn into paperweight.
Cheers,
Please Log in or Create an account to join the conversation.
No, that is the description file for TWINCAT3 to recognize it, you must put that fileIs that the xml file I need?(attached)
C: \ TwinCAT \ 3.1 \ Config \ Io \ EtherCAT
Here you have different examples¿Conoces más herramientas, códigos, documentos o ejemplos de un paso a paso más similar que pueda usar como punto de partida?
https://github.com/sittner/linuxcnc-ethercat/tree/master/examples
If you do not know programming, the easiest way is to use the generic mode, I will attach an example, it would be from line 18.
https://github.com/sittner/linuxcnc-ethercat/blob/master/examples/generic-complex/ethercat-conf.xml
Greeting
Chimeno
Please Log in or Create an account to join the conversation.
Thank you again for your help.
Yes I did put the .xml in TWINCAT 3 already here
C: \ TwinCAT \ 3.1 \ Config \ Io \ EtherCAT
I will receive the ECT60 drives next week and I am not in a rush, but how and where do I export the .xml from twincat3 or do I need to I need to do anything else in it like configure drives parameters or such?
All the parameters or config files I can export from a simulated axis are exporting as ".lis" ,".xti", ".csi" ..but I couldn't find where to export an .xml.
Which menu should I use or what do I need to export?
The ethercat-conf.xml I use in linux CNC looks currently like this and it works in linuxCNC for the Beckhoff modules, I understand I will need to add the 4x ECT60 to it with SDOs and PDOs definitions
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
<slave idx="0" type="EK1100" name="D1"/>
<slave idx="1" type="EL1008" name="D2"/>
<slave idx="2" type="EL1008" name="D3"/>
<slave idx="3" type="EL1008" name="D4"/>
<slave idx="4" type="EL2008" name="D6"/>
<slave idx="5" type="EL4102" name="D7"/>
<!-- <slave idx="6" type="DeASDA" name="3A1">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
</slave>
<slave idx="7" type="DeASDA" name="3A2">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
</slave>
<slave idx="8" type="DeASDA" name="4A3">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
</slave>-->
</master>
</masters>
And yes I can code in C if needed, (I find my way in most languages from assembly, C, matlab, python and even R when needed) but for a first shot I'd rather do the generic xml to get things done and understand my way around.
Greetings.
Please Log in or Create an account to join the conversation.