- Posts: 5
- Thank you received: 1
Ethercat HAL driver
- lincnc
- Offline
- New Member
-
Less
More
12 years 3 months ago - 12 years 3 months ago #48834
by lincnc
Replied by lincnc on topic Ethercat HAL driver
Roschi,
I really don't understand how are you achieving to rotate the motor with the drive(the slave) being in PREOP state, I think that Lenze drivers won't allow any movement until the drive is in OP state.
Now I notice that after issuing the procedure in my last post the drive goes to OP state but dmesg shows a lot of unmatched and skipped datagrams, I guess that's connected with the DC sync. Do you have any ideas what could be wrong with the DcConf in the xml configuration file?
I noticed that in PREOP state I can change some objects like 0x55AF but I can't change the Mode of Operation (0x6060) object, the Control Word (0x6040), Target Position object etc. The strange think is that dmesg doesn't show any error while issuing the "ethercat download" command.
UPDATE 1:
I changed the hard coded (lcec.c line:201) alias address from 0 to 1001(according to Lenze's manual) and recompiled everything. Now, the executing of "halcmd loadrt lcec" fails and dmesg says:
The key error " EtherCAT ERROR 0 0:0: PDO entry 0x6040:00 is not mapped. " is issued by the "ecrt_master_slave_config(..)" function.
Do you have any ideas?
UPDATE 2:
I googled similar problem : link .
It says that if "Enable notLRW: yes" two separate domains should be used. Issuing "ethercat slaves -v" confirms that in my case this is true (Enable notLRW:yes), so I guess I should write my own driver or does anyone have idea how to modify Sascha's one to use two separate domains, one for input and another one for output?
Thank you very much.
I really don't understand how are you achieving to rotate the motor with the drive(the slave) being in PREOP state, I think that Lenze drivers won't allow any movement until the drive is in OP state.
Now I notice that after issuing the procedure in my last post the drive goes to OP state but dmesg shows a lot of unmatched and skipped datagrams, I guess that's connected with the DC sync. Do you have any ideas what could be wrong with the DcConf in the xml configuration file?
I noticed that in PREOP state I can change some objects like 0x55AF but I can't change the Mode of Operation (0x6060) object, the Control Word (0x6040), Target Position object etc. The strange think is that dmesg doesn't show any error while issuing the "ethercat download" command.
UPDATE 1:
I changed the hard coded (lcec.c line:201) alias address from 0 to 1001(according to Lenze's manual) and recompiled everything. Now, the executing of "halcmd loadrt lcec" fails and dmesg says:
Code:
EtherCAT: Requesting master 0...
[24062.569235] EtherCAT: Successfully requested master 0.
[24062.569396] EtherCAT ERROR 0 0:0: PDO entry 0x6040:00 is not mapped.
[24062.569400] LCEC: master 0 PDO entry registration failed
[24062.569402] EtherCAT 0: Releasing master...
[24062.569406] EtherCAT 0: Released.
The key error " EtherCAT ERROR 0 0:0: PDO entry 0x6040:00 is not mapped. " is issued by the "ecrt_master_slave_config(..)" function.
Do you have any ideas?
UPDATE 2:
I googled similar problem : link .
It says that if "Enable notLRW: yes" two separate domains should be used. Issuing "ethercat slaves -v" confirms that in my case this is true (Enable notLRW:yes), so I guess I should write my own driver or does anyone have idea how to modify Sascha's one to use two separate domains, one for input and another one for output?
Thank you very much.
Last edit: 12 years 3 months ago by lincnc.
The following user(s) said Thank You: Nico2017
Please Log in or Create an account to join the conversation.
- roschi
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 29
12 years 3 months ago #48846
by roschi
OP state means cylic data transfer for the field bus. For basic test the first steps can be done via commandline tool ethercat --> No cylic transfer. In case of ESTUN Drive and Indra Drive you can get the drive running because the state machine of the drive (power on, enable amps,...) is controled over drive-controlword. The state of the bus is a different state machine. In case of LENZE I don't have any experinces so it seems this won't work for them.
So you need a running and configured bus transfer.
The topic about the alias: If you connect the drive to the master which alias address is shown by ethercat slaves? 1001, 0 or another number?
LRW topic: Ok I aggree if the drive has notLRW:yes the solution is using different domains (knowledge from google, I have no experinces)
That means programm a driver for Lenze :blink: . --> combine code lcec.c (request master, domain creation, pdo reg) and lcec_stmds5k.c (as an example, pdo entries, read/write functions, init/export hal pins,....)
XML config file: DC sync0shift is limited to special values the values depend on the drive/slave. As far as I see in the Lenze XML the only value is "0" or disable DC.
Replied by roschi on topic Ethercat HAL driver
lincnc wrote: I really don't understand how are you achieving to rotate the motor with the drive(the slave) being in PREOP state, I think that Lenze drivers won't allow any movement until the drive is in OP state.
OP state means cylic data transfer for the field bus. For basic test the first steps can be done via commandline tool ethercat --> No cylic transfer. In case of ESTUN Drive and Indra Drive you can get the drive running because the state machine of the drive (power on, enable amps,...) is controled over drive-controlword. The state of the bus is a different state machine. In case of LENZE I don't have any experinces so it seems this won't work for them.
So you need a running and configured bus transfer.
The topic about the alias: If you connect the drive to the master which alias address is shown by ethercat slaves? 1001, 0 or another number?
LRW topic: Ok I aggree if the drive has notLRW:yes the solution is using different domains (knowledge from google, I have no experinces)
That means programm a driver for Lenze :blink: . --> combine code lcec.c (request master, domain creation, pdo reg) and lcec_stmds5k.c (as an example, pdo entries, read/write functions, init/export hal pins,....)
XML config file: DC sync0shift is limited to special values the values depend on the drive/slave. As far as I see in the Lenze XML the only value is "0" or disable DC.
The following user(s) said Thank You: Nico2017
Please Log in or Create an account to join the conversation.
- lincnc
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 1
12 years 3 months ago #48867
by lincnc
Replied by lincnc on topic Ethercat HAL driver
Okay,
here is another important update for the Lenze drive case.
I tried using this xml file:
And this is the old xml file:
As one can see, I just removed the "out" sync manager PDO's from the old xml file, and it worked properly.
The problem is, I "lost" the information about Status Word, Mode Of Operation Display and Actual Position. All of these PDO's can be properly read with the "ethercat upload" command.
I wondered if I can start another HAL EtherCAT Driver instance using xml file only with sync manager for "in" PDO's . I'll try that soon and I'll post my results here.
here is another important update for the Lenze drive case.
I tried using this xml file:
And this is the old xml file:
As one can see, I just removed the "out" sync manager PDO's from the old xml file, and it worked properly.
The problem is, I "lost" the information about Status Word, Mode Of Operation Display and Actual Position. All of these PDO's can be properly read with the "ethercat upload" command.
I wondered if I can start another HAL EtherCAT Driver instance using xml file only with sync manager for "in" PDO's . I'll try that soon and I'll post my results here.
Please Log in or Create an account to join the conversation.
- cgc
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 10
12 years 2 months ago #49740
by cgc
Replied by cgc on topic Ethercat HAL driver
Hello,
I have running a system with EtherCat and CANopen servos.
I have used the EK1100 + EL6751 for CANopen and Berger-Lahr CPD17 servos. (Schneider Lexium 05)
To create the CANopen initial commands I have used the Beckhoff TwinCat 3 software.
I have configured my hardware in TwinCat3 and copied the CoE commands for the ethercat_conf.xml.
The servos has fix PDOs with a size of 48 bits, first 16 bits is the command register last 32 bits the (target)position.
But lcec has only 32 single bits or s32 or u32.
I have changed lcec_conf.c (line 990) and lcec_generic.h (line 24) to 48 single bits. This is my interface to hal.
Then, I have written a small comp to convert the 48 single bits to command register and (target)position.
Also, the servos needs a rising edge for each new position command.
In the comp, I have use a togglebit for each cycle, this is my rising edge for the new position command.
In the appendix, the files for a (laser)system with 2 axis, or a lathe.
I have running a system with EtherCat and CANopen servos.
I have used the EK1100 + EL6751 for CANopen and Berger-Lahr CPD17 servos. (Schneider Lexium 05)
To create the CANopen initial commands I have used the Beckhoff TwinCat 3 software.
I have configured my hardware in TwinCat3 and copied the CoE commands for the ethercat_conf.xml.
The servos has fix PDOs with a size of 48 bits, first 16 bits is the command register last 32 bits the (target)position.
But lcec has only 32 single bits or s32 or u32.
I have changed lcec_conf.c (line 990) and lcec_generic.h (line 24) to 48 single bits. This is my interface to hal.
Then, I have written a small comp to convert the 48 single bits to command register and (target)position.
Also, the servos needs a rising edge for each new position command.
In the comp, I have use a togglebit for each cycle, this is my rising edge for the new position command.
In the appendix, the files for a (laser)system with 2 axis, or a lathe.
The following user(s) said Thank You: serdigi
Please Log in or Create an account to join the conversation.
- cgc
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 10
12 years 2 months ago - 12 years 2 months ago #49794
by cgc
Replied by cgc on topic Ethercat HAL driver
Last edit: 12 years 2 months ago by cgc.
The following user(s) said Thank You: serdigi, zmrdko
Please Log in or Create an account to join the conversation.
- bigalex
- Offline
- Premium Member
-
Less
More
- Posts: 89
- Thank you received: 2
12 years 2 months ago - 12 years 2 months ago #50341
by bigalex
Replied by bigalex on topic Ethercat HAL driver
Hi Frank.
In this case are you using the EtherCAT EK1100 as a gateway for the servoamps ?
This is interesting because there is not a CanOpen driver for LCNC (or I don't know if it exist onestly) but in your applcation you are "routing" the motion commands via the EtherCAT driver to the CanOpen servoamps.
Please let me know if I'm wrong.
Regards
Alex
In this case are you using the EtherCAT EK1100 as a gateway for the servoamps ?
This is interesting because there is not a CanOpen driver for LCNC (or I don't know if it exist onestly) but in your applcation you are "routing" the motion commands via the EtherCAT driver to the CanOpen servoamps.
Please let me know if I'm wrong.
Regards
Alex
Last edit: 12 years 2 months ago by bigalex.
Please Log in or Create an account to join the conversation.
Time to create page: 0.204 seconds