Ethercat 64 bit stepper drive basic example EL7041
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2274
- Thank you received: 2031
22 Dec 2018 22:21 - 22 Dec 2018 22:31 #122760
by Grotius
Ethercat 64 bit stepper drive basic example EL7041 was created 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 :
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.
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.
I have made a basic configuration for the Beckhoff EK1100 buscoupler + EL7041 stepper drive.
It has a few files :
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!
www.beckhoff.com/english.asp?ethercat/el7041.htm
page 220
Read encoder internal or external (1=slave position):
ethercat -p 1 upload --type uint8 0x8012 0x08
Set :
sudo ethercat -p 1 download --type uint8 0x8012 0x08 1
Read motor supply voltage [mV] :
ethercat -p 1 upload --type uint16 0x8010 0x03
Set motor supply voltage [mV] :
sudo ethercat -p 1 download --type uint16 0x8010 0x03 24000 (24 V)
Read stepper motor current 0-5000[mA] :
ethercat -p 1 upload --type uint16 0x8010 0x01
Set stepper motor current [mA] :
sudo ethercat -p 1 download --type uint16 0x8010 0x01 1000
Reset Terminal to its Factory Settings
sudo ethercat -p 1 download --type uint32 0x1011 0x01 0x64616F6C
Read microstepping setting from driver
sudo ethercat upload -p 1 -t uint8 0x8012 0x45
0 = Fullstep
1 = Halfstep
2 = 1/4 Microstepping
3 = 1/8 Microstepping
4 = 1/16 Microstepping
5 = 1/32 Microstepping
6 = 1/64 Microstepping
set microstepping :
sudo ethercat -p 1 download --type uint8 0x8012 0x45 6
Read function for input 1 :
sudo ethercat upload -p 1 -t uint8 0x8012 0x32
Read invert digital input 1 :
sudo ethercat upload -p 1 -t uint8 0x8012 0x30
Set invert digital input 1 :
sudo ethercat -p 1 download --type uint8 0x8012 0x30 1
page 220
Read encoder internal or external (1=slave position):
ethercat -p 1 upload --type uint8 0x8012 0x08
Set :
sudo ethercat -p 1 download --type uint8 0x8012 0x08 1
Read motor supply voltage [mV] :
ethercat -p 1 upload --type uint16 0x8010 0x03
Set motor supply voltage [mV] :
sudo ethercat -p 1 download --type uint16 0x8010 0x03 24000 (24 V)
Read stepper motor current 0-5000[mA] :
ethercat -p 1 upload --type uint16 0x8010 0x01
Set stepper motor current [mA] :
sudo ethercat -p 1 download --type uint16 0x8010 0x01 1000
Reset Terminal to its Factory Settings
sudo ethercat -p 1 download --type uint32 0x1011 0x01 0x64616F6C
Read microstepping setting from driver
sudo ethercat upload -p 1 -t uint8 0x8012 0x45
0 = Fullstep
1 = Halfstep
2 = 1/4 Microstepping
3 = 1/8 Microstepping
4 = 1/16 Microstepping
5 = 1/32 Microstepping
6 = 1/64 Microstepping
set microstepping :
sudo ethercat -p 1 download --type uint8 0x8012 0x45 6
Read function for input 1 :
sudo ethercat upload -p 1 -t uint8 0x8012 0x32
Read invert digital input 1 :
sudo ethercat upload -p 1 -t uint8 0x8012 0x30
Set invert digital input 1 :
sudo ethercat -p 1 download --type uint8 0x8012 0x30 1
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.
Last edit: 22 Dec 2018 22:31 by Grotius.
The following user(s) said Thank You: tommylight, thefabricator03, blue0cean
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2274
- Thank you received: 2031
23 Dec 2018 19:36 - 23 Dec 2018 19:43 #122791
by Grotius
Replied by Grotius on topic Ethercat 64 bit stepper drive basic example EL7041
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
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.
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
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.
Last edit: 23 Dec 2018 19:43 by Grotius.
The following user(s) said Thank You: tommylight, thefabricator03
Please Log in or Create an account to join the conversation.
- EmcRules
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 1
18 Jan 2025 23:58 #319324
by EmcRules
Replied by EmcRules on topic Ethercat 64 bit stepper drive basic example EL7041
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
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 or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2274
- Thank you received: 2031
19 Jan 2025 00:44 #319325
by Grotius
Replied by Grotius on topic Ethercat 64 bit stepper drive basic example EL7041
Hi,
in the xml file. Idx=5 for all slaves.
Thinking should this be a incremental value?
in the xml file. Idx=5 for all slaves.
Thinking should this be a incremental value?
Please Log in or Create an account to join the conversation.
- EmcRules
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 1
19 Jan 2025 00:49 #319327
by EmcRules
Replied by EmcRules on topic Ethercat 64 bit stepper drive basic example EL7041
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 or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2274
- Thank you received: 2031
19 Jan 2025 01:09 - 19 Jan 2025 01:21 #319332
by Grotius
Replied by Grotius on topic Ethercat 64 bit stepper drive basic example EL7041
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.
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.
Last edit: 19 Jan 2025 01:21 by Grotius.
Please Log in or Create an account to join the conversation.
- EmcRules
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 1
19 Jan 2025 01:12 #319333
by EmcRules
Replied by EmcRules on topic Ethercat 64 bit stepper drive basic example EL7041
yes i have it matching the output of "ethercat slaves"
0 = coupler
1 7041
2 7041
3 7041
0 = coupler
1 7041
2 7041
3 7041
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.113 seconds