Ethercat 64 bit stepper drive basic example EL7041
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.
Please Log in or Create an account to join the conversation.
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.
Time to create page: 0.101 seconds