- Posts: 29
- Thank you received: 5
Ethercat HAL driver
- theshade
- Offline
- Junior Member
-
Less
More
6 years 5 months ago - 6 years 5 months ago #166988
by theshade
Replied by theshade on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
Hello, just copying here in case someone is also looking for a way to have raspberry pi 4 rt as ethercat master.
/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
/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
Last edit: 6 years 5 months ago by theshade.
The following user(s) said Thank You: mcer
- theshade
- Offline
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 5
6 years 5 months ago #167710
by theshade
Replied by theshade on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
Just to report that after adding the correct library path to realtime.mk
"-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?
"-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?
- chimeno
- Offline
- Elite Member
-
Less
More
- Posts: 295
- Thank you received: 125
6 years 5 months ago #167762
by chimeno
Replied by chimeno on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
Hi @theshade,
Greeting
Chimeno
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
- theshade
- Offline
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 5
6 years 5 months ago #167771
by theshade
Replied by theshade on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
No sorry, the EL1008 would be just for end switches, end such.
I just ordered some ethercat closed loop drivers ECT60 from rtelligent which are as far as I understand leadshine clones.
I just ordered some ethercat closed loop drivers ECT60 from rtelligent which are as far as I understand leadshine clones.
- chimeno
- Offline
- Elite Member
-
Less
More
- Posts: 295
- Thank you received: 125
6 years 5 months ago #167772
by chimeno
Replied by chimeno on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
Hi @theshade,
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
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
- theshade
- Offline
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 5
6 years 5 months ago #167787
by theshade
Replied by theshade on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
Thank you Chimeno,
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,
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,
Time to create page: 0.844 seconds