Ethercat HAL driver

More
06 May 2020 20:19 #166888 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hi @theshade
I have no experience in Raspbian, can you try this if it helps you?
./get_source.sh
dpkg-buildpackage -uc -us
Greeting
Chimeno

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

More
06 May 2020 22:42 #166894 by theshade
Replied by theshade on topic Ethercat HAL driver
Hi @chimeno, Thank you so much for your help.

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)
Warning: Spoiler!


Thanks anyway..

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

More
07 May 2020 22:38 - 08 May 2020 23:26 #166988 by theshade
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
Last edit: 08 May 2020 23:26 by theshade.
The following user(s) said Thank You: mcer

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

More
14 May 2020 08:10 #167710 by theshade
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?

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

More
14 May 2020 17:05 #167762 by chimeno
Hi @theshade,

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?

I don't quite understand what you mean, do you want to connect the step / dir signals to the EL1008?

Greeting
Chimeno

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

More
14 May 2020 18:45 #167771 by theshade
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.

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

More
14 May 2020 18:58 #167772 by chimeno
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
Attachments:

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

More
14 May 2020 20:52 #167787 by theshade
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,
Attachments:

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

More
17 May 2020 10:24 - 17 May 2020 10:24 #168037 by chimeno
Hi @theshade,

Is that the xml file I need?(attached)

No, that is the description file for TWINCAT3 to recognize it, you must put that file
C: \ TwinCAT \ 3.1 \ Config \ Io \ EtherCAT
, the .xml file that you need you have to generate with TWINCAT3, this is the easiest way if you don't have much knowledge.

¿Conoces más herramientas, códigos, documentos o ejemplos de un paso a paso más similar que pueda usar como punto de partida?

Here you have different examples
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
Last edit: 17 May 2020 10:24 by chimeno. Reason: Edit
The following user(s) said Thank You: theshade

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

More
17 May 2020 20:53 - 17 May 2020 20:54 #168088 by theshade
Hi @chimeno,

Thank you again for your help.

Yes I did put the .xml in TWINCAT 3 already here
C: \ TwinCAT \ 3.1 \ Config \ Io \ EtherCAT
and it works, I was able to make an axis in the twincat and I have an "offline" drive. (see screenshot)

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.
Attachments:
Last edit: 17 May 2020 20:54 by theshade.

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

Time to create page: 0.165 seconds
Powered by Kunena Forum