Ethercat 64 bit stepper drive basic example EL7041

More
7 years 10 months ago #122760 by Grotius
For the beginner users of ethercat automation :

I have made a basic configuration for the Beckhoff EK1100 buscoupler + EL7041 stepper drive.



It has a few files :

Attachment not found


Attachment not found


Attachment not found


Attachment not found



The files are complete to replace with a sample axis gui. gscreen, gmocappy etc will also work.

The stepper driver has also 2 digital input's, they can be used for limit switches.

To configure your driver voltage, amp's, resolution etc. you can use some command line entry's, see below.

Warning: Spoiler!


This config is tested with grotius and axis gui 22 december 2018.
Stepper speed's up to 19000 mm/min. Related to parport application's it's not much faster.

If you have no chamber of commerce, i can help you with ordering new item's trough my Beckhoff account.

Please Log in to join the conversation.

More
7 years 10 months ago #122791 by Grotius
Next level is to integrate the parameter settings into the linuxcnc gui.
If you have a multi axis configuration, typing command line entry's for 3 or 4 axis can take a while.
In fact you have to set driver voltage, motor current, etc for all axis separate.

To make a quick configuration possible without terminal usage, i made a gui integration example.

The main function is :
1. Load all important stepper drive settings from stepper drive 1 to stepper drive 17
2. Customize and set all important stepper drive settings from drive 1 to 17

Attachment not found



User has to make a glade screen, just like the picture above with button's, label's and text entry's.
The attached code uses subprocess. This are terminal command's like os.system command's.
The subprocess write command's to terminal, also read value's back from terminal output.

The terminal command's are expanded with .format strings to make a kind of variable terminal command's possible.
Because Ehercat is working outside of Linuxcnc, stepper and servo driver settings can be set in a running program.
This is a big advantage ! You don't have to restart Linuxcnc.

Attachment not found

Please Log in to join the conversation.

More
1 year 9 months ago #319324 by EmcRules
Thanks for posting this it was a good place to start for me. 
Running 2.9.3 from live cd install
Installed linuxcnc-ethercat yesterday
Beckhoff EK1100 wit 3X 7041 Rev 26

I have everything up and running.  When I start Axis my 7041 module run lights turn solid showing me the slaves are in "OP"

I started with the basic XML config but then went to add the mod params to set currents and voltages.

I get the error below when starting axis  any thoughts seems odd.  looking at the driver for this is seems like it should work. i can  "sudo ethercat upload/download" data from terminal just fine.

When I use the basic XML Axis starts up fine. When I power up i get join 0 drive fault msg

Hal,INI & XML attached. 

any insight would be appreciated. 

Debug file information:
Note: Using POSIX realtime
Failed to execute SDO download: Invalid argument
LCEC: slave 0.D2: Failed to execute SDO download (0x8010:0x01, size 2, byte0=196, error -22, abort_code 00007fc6)
LCEC: fail to configure slave 0.D2 sdo maxCurrent
LCEC: modParam settings failed for slave 0.D2
LCEC: failure in proc_init for slave 0.D2
LCEC: failure, clearing config
LCEC: exiting
LCEC: returning -EINVAL
lcec: rtapi_app_main: Invalid argument (-22)
./7041.hal:6: waitpid failed /usr/bin/rtapi_app lcec
./7041.hal:6: /usr/bin/rtapi_app exited without becoming ready
./7041.hal:6: insmod for lcec failed, returned -1
6579
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime

Please Log in to join the conversation.

More
1 year 9 months ago #319325 by Grotius
Hi,

in the xml file. Idx=5 for all slaves.
Thinking should this be a incremental value? 

Please Log in to join the conversation.

More
1 year 9 months ago #319327 by EmcRules
Good catch. Thanks!! Forgot to fix on the copy and paste. Now if I can figure out the "Joint 0 amplifier fault" messages.

Please Log in to join the conversation.

More
1 year 9 months ago #319332 by Grotius
It seems idx is not incremental reading this 
linuxcnc-ethercat.github.io/linuxcnc-ethercat/el7041.html

i think i wrote this driver or driver variants myself, years ago.
Could be outdated now. This for your info.

updating the linuxcnc-ethercat is good idea.

codeberg.org/skynet/linuxcnc/src/branch/...er/cmake/libethercat

you know how cmake install works?
There is also a build script in the repositoy.
Otherwise you can use the linuxcnc install method.




 

Please Log in to join the conversation.

More
1 year 9 months ago #319333 by EmcRules
yes i have it matching the output of "ethercat slaves"
0 = coupler
1 7041
2 7041
3 7041

Please Log in to join the conversation.

Time to create page: 0.151 seconds
Powered by Kunena Forum