Ethercat HAL driver

More
30 Dec 2019 20:12 #153565 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hello manojpatil
  I can't help you much with the PANASONIC servos, I never use them, but I will try to give you some guidance.
Linux-ethercat does not integrate the driver for PANASONIC, you have two options:
- create your own controller
- use the generic driver included in linuxcnc-ethercat, attached an example
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
    <slave idx="0" type="generic" vid="00000002" pid="14566012" configPdos="true">
      <dcConf assignActivate="730" sync0Cycle="*1" sync0Shift="0" sync1Cycle="0" sync1Shift="0"/>
      <syncManager idx="2" dir="out">
        <pdo idx="0018">
          <pdoEntry idx="0086" subIdx="00" bitLen="16" halType="complex">
            <complexEntry bitLen="6"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.realtime-0" halType="bit"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.realtime-1" halType="bit"/>
            <complexEntry bitLen="2" halPin="srv0-ctrl.opmode-low" halType="u32"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.sync" halType="u32"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.opmode-high" halType="bit"/>
            <complexEntry bitLen="1"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.restart" halType="bit"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.enable" halType="bit"/>
            <complexEntry bitLen="1" halPin="srv0-ctrl.drv-on" halType="bit"/>
          </pdoEntry>
          <pdoEntry idx="0018" subIdx="00" bitLen="32" halPin="srv0-vel-cmd" halType="s32"/>
        </pdo>
      </syncManager>
    </slave>
  </master>
</masters>

the PDO can visualize them with this command
ethercat pdos -p"number device"

the VID (vendor ID) and the PID (Product code) can be found using the command
ethercat slave -p"number device" -v
I hope I have helped you, regards Chimeno

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

More
05 Jan 2020 14:58 #154099 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
Chimeno,

Thanks for adding the brake chopper... super awesome. I was looking at these for the future.

I have a request as you are verse in re-working the code. Can you add the EL7041-0000. I cannot get it to work, I have tried changing my XML with:

EL7041-1000
EL7041-0000
EL7041-
EL7041

but none of those work. I can see the terminal in C-command when doing a "# ethercat slaves" , but when you try to start LinuxCNC it gives the error screen with this in the debug:

lcec_conf: ERROR: Invalid slave type EL7041-0000
lcec_conf: ERROR: Parse error at line 6: parsing aborted

I know my HAL and INI should be fine in LNC as I have other Beckhoff setup's that work, just can't get this setup to work with the EL7041-0000. So I figured you might be able to get this terminal working also as you have fixed the code for several of the other terminals in the past.

Thanks,
Robert
The following user(s) said Thank You: chimeno

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

More
06 Jan 2020 00:11 #154118 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hello manojpatil

for your information, my system was not going into OP as there was an error on the xml config file of my ethercat.

Nicolas

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

More
06 Jan 2020 05:09 - 06 Jan 2020 05:21 #154125 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi all,
I was wondering if there was a slave number limitation on the EtherCAT configuration for linuxcnc. I am trying to run a new device, the config xml file works fine when I plug the device alone, but my system crashes when I put it after 15 other slave on my EtherCAT bus.

Is such a limitation exists, is it overall, or is it per master? My computer has two Ethernet port, so maybe I could use the other one as another master. I am just wondering how I would parametrize it in the /etc/default/ethercat file.

Thank you,

Nicolas
Last edit: 06 Jan 2020 05:21 by Nico2017.

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

More
06 Jan 2020 15:25 #154149 by phoenix_83
Replied by phoenix_83 on topic Ethercat HAL driver
Hello everyone,

my name is Heiko and i am new here. I have an old Deckel FP2 and some servo motors inclusive servo controllers from Beckhoff.
Now I would like to upgrade the Deckel with servo motors and control it via LinuxCNC.

To test and try LinuxCNC I have here an EK1100, EL1104, EL2024 and an IndraDrive Cs (HCS01.1E-W0006-A-02-B-ET-EC-PB-NN-NN-FW) with an MSK030C-0900 servo motor. With these components i want to set up an test scenario.

So I try to install the ethercat hal driver. Therefore i followed exactly the instructions from Hawkeye from page 68. Everything is going well until i came to step 5.
The steps cloning the ec-debianize and dpkg-checkbuilddeps are running well.

but when i run the command dpkg-buildpackage i geht following error message:

root@linuxcnc:/git/ec-debianize/etherlabmaster# dpkg-buildpackage
dpkg-buildpackage: Information: Quellpaket etherlabmaster
dpkg-buildpackage: Information: Quellversion 1.5.2+20190904hg33b922p8ea394-1
dpkg-buildpackage: Information: Quelldistribution lucid
dpkg-buildpackage: Information: Quelle geändert durch Sascha Ittner <This email address is being protected from spambots. You need JavaScript enabled to view it.>
dpkg-buildpackage: Information: Host-Architektur amd64
dpkg-source --before-build etherlabmaster
debian/rules clean
dh clean --with autoreconf,dkms
dh_testdir
dh_auto_clean
dh_autoreconf_clean
debian/rules override_dh_clean
make[1]: Verzeichnis „/git/ec-debianize/etherlabmaster“ wird betreten
rm -f ChangeLog
dh_clean
make[1]: Verzeichnis „/git/ec-debianize/etherlabmaster“ wird verlassen
dpkg-source -b etherlabmaster
dpkg-source: Fehler: unmöglich, mit Quellformat »3.0 (quilt)« zu bauen: unter ./etherlabmaster_1.5.2+20190904hg33b922p8ea394.orig.tar.{bz2,gz,lzma,xz} wurde kein Tarball der Originalautoren gefunden
dpkg-buildpackage: Fehler: Fehler-Exitstatus von dpkg-source -b etherlabmaster war 255

Now i am not able to do the next steps. when i try to execute sudo dpkg -i /git/ec-debianize/etherlabmaster_1.5.2+20180317hg9e65f7-2_amd64.deb the error is:

dpkg: Fehler: Auf das Archiv »/git/ec-debianize/etherlabmaster_1.5.2+20180317hg9e65f7-2_amd64.deb« kann nicht zugegriffen werden: Datei oder Verzeichnis nicht gefunden

Can anyone help me with the error messages? I have tried everything but nothing worked. Please give me a hint of what i am doing wrong.


05. Setup "ec-debianize"
cd /git
git clone https://github.com/sittner/ec-debianize ec-debianize
./get_source.sh
cd etherlabmaster
dpkg-checkbuilddeps
dpkg-buildpackage (the output error "failed to sign .dsc file" is no issue)
sudo dpkg -i /git/ec-debianize/etherlabmaster_1.5.2+20180317hg9e65f7-2_amd64.deb
sudo dpkg -i /git/ec-debianize/etherlabmaster-dev_1.5.2+20180317hg9e65f7-2_amd64.deb
nano /etc/default/ethercat (change mac-address [MASTER0_DEVICE=""] e.g. [MASTER0_DEVICE="11:22:33:44:55:66"])
nano /etc/default/ethercat (change [DEVICE_MODULES=""] to [DEVICE_MODULES="generic"])
sudo update-ethercat-config
usermod -a -G ethercat linuxcnc
reboot

06. Setup "LinuxCNC-Ethercat"
cd /git
git clone http://github.com/sittner/linuxcnc-ethercat.git linuxcnc-ethercat"
nano /git/linuxcnc-ethercat/src/lcec_main.c (add here [#include "rtapi_mutex.h"] below [#include "rtapi_app.h"])
cd /git/linuxcnc-ethercat
make -j4
make install
sudo make install

07. Further things to consider
- if you experience issues when starting linuxcnc (cpu high load), then try to change "BASE_PERIOD=0" within your ini-file (config of your machine)

08. .. this is know the part where I guess I can end this guide now.
.. further steps (setting up ethercat.xml, machine config, ... can be seen within the forum).
.. hope this helped you - thanks for reading.
.. please leave a comment whether you managed it to get your system running.




Best Regards,
Ben[/quote]

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

More
06 Jan 2020 19:02 #154165 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi phoenix_83,
I remember facing similar issue at some point but cannot remember if it was exactly the same. What OS and distribution are you using (lucid on ubuntu apparently), but more importantly I think the RTAI and RTPREEPMT real time kernel version (do uname -a to check it quickly) could make the difference as RTAI is no longer supported for ec-debianize. You apparently also do everything as root so should not have any permission issues but might worth to have a look at it too.

I also remember that using previous version of the ec-debianize could help for some OS so reversing back to an older commit was somehow working.

Nicolas

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

More
07 Jan 2020 04:52 #154196 by manojpatil
Replied by manojpatil on topic Ethercat HAL driver
Hello Nico2017

Can you guide me regarding the xml file .. as in where are the xml files stored and where should I make changes for my specific driver.

Thanks.

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

More
07 Jan 2020 04:56 #154197 by manojpatil
Replied by manojpatil on topic Ethercat HAL driver

File Attachment:

File Name: SINEE_EA1x...CAT1.xml
File Size:285 KB
Attachments:

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

More
07 Jan 2020 17:46 #154227 by phoenix_83
Replied by phoenix_83 on topic Ethercat HAL driver
Hi Nicolas,

thank you for your fast answer.

I am using Debian GNU/Linux 9 \n \l (cat /etc/issue) and I also checked the version by using uname -a and the following answer appears:
Linux linuxcnc 4.9.0-8-rt-amd64 #1 SMP PREEMPT RT Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux

Does the amd64 mean that the kernel is only for amd prozessors? I use an Dell Optiplex 9020 with an Intel i5.

Sorry but this are all informations i can find.

is it possible, that you give me another hint?

thanks

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

More
07 Jan 2020 19:19 - 07 Jan 2020 20:05 #154237 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hi Corbett,
Thank you very much for everything, just try to have a good time fun and share it with you, many times it is difficult to program things without having much knowledge, for the chopper module if you use it you will have to load the configuration file for the work stress levels.

For the question you have about this error lcec_conf: ERROR: Analysis error on line 6: aborted analysis, it is simply that you should have a misspelling in the configuration .xml file, can you check if it is like this?
<slave idx = "1" type = "EL7041-1000" name = "EL7041" />

if you want you can publish your .xml file and we take a look

Ideally, configure EL7041 using TWINCAT3

if you can add the EL7041-0000, no problem

The EL7041-0001 and EL7041-1000 have the same generic PDO pre-defined, it should work without problems.

Greeting
Chimeno
Attachments:
Last edit: 07 Jan 2020 20:05 by chimeno. Reason: more information

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

Time to create page: 0.600 seconds
Powered by Kunena Forum