Ethercat drive configuration woes

More
09 Dec 2022 00:55 #258949 by wazza77
db1981,
When I was trying to look through the code and what was wanted in that manual something was not lining up in my head, but I worked 137 hrs in the last two weeks so not much lines up. thanks for taking a look.

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

More
09 Dec 2022 11:11 #258989 by db1981
this is now very strange.
Linuxcnc should not start if drives 2 and 3 are not connected . Because lcec_conf is not able to mount the slaves / pdos and will broke up with error.

Are your drives 1,2,3 always the same piece of hardware? Or is this behaviour only related to the connection order?

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

More
09 Dec 2022 11:25 #258991 by mwc
The drives are all identical.

I did try swapping the order of the drives incase it was a faulty drive, but it never made any difference. It's only ever the 2nd and 3rd drives in the chain that can be enabled.


I tried the suggestion in your previous post this morning before leaving for work, about unlinking the opmode pins, and issuing 8 via halcmd, but it didn't make any difference.
The lcec.0.N.opmode showed as 8 in Hal config, but the drives were still returning a opmode/statusword of 0.
I'll try again when I get home, just to make sure I did change the correct things.

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

More
09 Dec 2022 11:26 #258992 by mwc
Forgot to mention that LinuxCNC loads up with no errors reported, even if no slaves are connected.

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

More
09 Dec 2022 17:39 #259019 by mwc
Just ran through a few things.

First attempt-
Load up LinuxCNC, but leave drives disconnected.
LinuxCNC loads without any errors, but EtherCAT reporting various messages via dmesg (as I'd expect, as the requested slaves can't be found)
Connect drives. Drives configure as 123.
Try jogging. Motors don't move, but hear drives disabling (clicking) when following error is triggered.
Remember opmode is still disconnected in Hal.
Open Hal config, and find statusword and controlword are reporting correctly.
Issue opmode 8 to each drive via Hal Command, and all axis are under LinuxCNC control.

Now I tested various things.
The opmode doesn't actually make any difference. If I add the opmode nets back into my hal, it makes no difference.
Provided I load up LinuxCNC with the drives disconnected (network cable unplugged from the master, or the drives not powered on), then connect/power on the drives, they configure, and can be enabled/controlled via LinuxCNC.
If you load LinuxCNC with the drives connected, they configure, but won't enable. No amount of disconnecting/power cycling the drives will get them to enable.

The key thing during all this, is LinuxCNC not reporting the correct statusword.
When LinuxCNC loads with the drives connected, the statusword is always reported as 0.
Check the statusword via a terminal, the statusword is shown correctly (0x250 or 0x231), and the status word is even shown correctly in the frame data (ethercat debug  level 2). But it shows as 0 at lcec.0.N.statusword.

If you connect the drives after loading LinuxCNC (it doesn't matter if the drives are freshly powered on, or still showing as configured/slaves from a previous load), then LinuxCNC reports the statusword correctly, and the drives work as expected.


So the problem appears to be LinuxCNC not retrieving the correct value if it loads with the drives connected.

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

More
09 Dec 2022 18:04 #259023 by db1981
there is something strange with your installation or they changed important things in the etherlab master.

-Can you please try if you can start linuxcnc, after an fresh reboot without drives connected.

-please post the ethercat pdos -v output from an slave, after reboot, without starting linuxcnc.

-please post actual ethercat.xml and halfile

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

More
09 Dec 2022 18:28 #259026 by mwc
LinuxCNC starts without any reported errors after a fresh reboot, with no drives connected.

pdos -
lcnc@debian:~$ ethercat pdos -p0 -v
SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x26, Enable 1
RxPDO 0x1a01 "TxPDO 2"
PDO entry 0x603f:00, 16 bit, "ErrorCode"
PDO entry 0x6041:00, 16 bit, "StatusWord"
PDO entry 0x6064:00, 32 bit, "Position actual value"
PDO entry 0x60fd:00, 32 bit, "Digital inputs"
PDO entry 0x6061:00, 8 bit, "Modes of operation display"
RxPDO 0x1601 "RxPDO 2"
PDO entry 0x6040:00, 16 bit, "ControlWord"
PDO entry 0x6060:00, 8 bit, "Modes of operation"
PDO entry 0x607a:00, 32 bit, "Target position"
PDO entry 0x6081:00, 32 bit, "Profile velocity"
PDO entry 0x6099:01, 32 bit, "Search Switch"
PDO entry 0x6099:02, 32 bit, "Search Zero"
SM1: PhysAddr 0x1100, DefaultSize 128, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1200, DefaultSize 12, ControlRegister 0x64, Enable 1
RxPDO 0x1600 ""
PDO entry 0x6040:00, 16 bit, ""
PDO entry 0x607a:00, 32 bit, ""
PDO entry 0x60ff:00, 32 bit, ""
PDO entry 0x6060:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
SM3: PhysAddr 0x1300, DefaultSize 19, ControlRegister 0x20, Enable 1
TxPDO 0x1a00 ""
PDO entry 0x6041:00, 16 bit, ""
PDO entry 0x6064:00, 32 bit, ""
PDO entry 0x606c:00, 32 bit, ""
PDO entry 0x6061:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
Attachments:

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

More
09 Dec 2022 18:29 #259027 by mwc
Hal and xml, since the editor didn't post them on the last post :/

 

File Attachment:

File Name: conf_2022-12-09-2.xml
File Size:8 KB

 

File Attachment:

File Name: my-mill_20...09-2.hal
File Size:4 KB
Attachments:

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

More
09 Dec 2022 18:49 #259032 by mwc
I also dug out a screen capture device.

This is when LinuxCNC is loaded with the drives connected/powered on -
 
As you can see, LinuxCNC reports statusword as 0, yet a direct read via the terminal shows it as 0X0231, and the values are shown in the frame data.


And I took a screen recording of what happens if you load LinuxCNC before connecting/powering on the drives -

All values get read correctly, and the drives/motors can be enabled/moved. If you disable the drives (machine off), you can turn the motors by hand, the position is updated in LinuxCNC DROs.
Attachments:

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

More
09 Dec 2022 22:03 #259047 by db1981
Hmm, this is a complete new (and good) behaviour of the ethercat master.
But we don't know yet, what they also did change in the api and methods.
In normal Case lcec_conf should stop with errors...

We will have no Lcnc Projekt in the next months at work, to get time for checking this.

I would recommend, to use the "old" TAG 1.5.2 from the ethlerlab master. This is the branch linuxcnc-ethercat is coded on.


About your drive, i've never got an slave with pdos at SM0/1, this is unknown to me.
Do you get pdos at SM0/1 on all 3 drives or only at the first one.

I have noticed the EK1101 in your xml file, what happens to the drives if you place the ek as first slave in the row?
The following user(s) said Thank You: wazza77, mwc

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

Time to create page: 0.189 seconds
Powered by Kunena Forum