Ethercat drive configuration woes

More
06 Dec 2022 22:11 #258760 by petervg
I took your files, only changed the PID/VID in the XML file to match the leadschine, fired up linuxcnc with these config files and my drive is working using your config files. So the config seems to be ok. I only have 1 drive, so only X is actually working. The other ones obviously produce a "joint following error".

On the other hand, the problem I have with my motor not running smoothly remains also with your files.

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

More
06 Dec 2022 22:24 #258762 by db1981
lcec.0.N.cia-statuswords should show the same as the ethercat upload command.

are there any errors in dmesg?

can you read out the interpolation period after linuxcnc start . with ethercat upload command

0x60C1 0x01 interpolation time period unit
0x60C1 0x02 interpolation time period index

has to be 1ms, like the servo_period and lcec apptimeperiod

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

More
06 Dec 2022 22:32 #258764 by db1981
Have you ever tested the native ASDA driver? "DeASDA"

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

More
07 Dec 2022 00:31 #258771 by mwc
I think it's something to do with clocks and drives not synchronising.

If I power the drives, but leave 2 and 3 disconnected (unplug CAT cable from drive 1 out), load up LinuxCNC, nothing works. Trying jog any axis results in a following error.
If I then reconnect the CAT cable, drives 2 and 3 (Y and Z) get configured, and are controllable under LinuxCNC.

This is the dmesg output -
[Dec 6 23:56] 
[ +0.000006] EtherCAT 0: Starting EtherCAT-OP thread.
[ +0.169449] EtherCAT 0: Domain 0: Working counter changed to 2/9.
[ +0.308421] EtherCAT 0: Slave states on main device: OP.
[ +0.692942] EtherCAT 0: Domain 0: Working counter changed to 3/9.
[Dec 6 23:57] EtherCAT 0: 3 slave(s) responding on main device.
[ +0.000005] EtherCAT 0: Slave states on main device: INIT, OP.
[ +0.002685] EtherCAT 0: Scanning bus.
[ +1.533575] EtherCAT 0: Bus scanning completed in 1532 ms.
[ +0.000005] EtherCAT 0: Using slave 0 as DC reference clock.
[ +0.012266] EtherCAT 0: Slave states on main device: PREOP, OP.
[ +5.086653] EtherCAT WARNING 0-1: Slave did not sync after 5000 ms.
[ +0.004006] EtherCAT 0: Domain 0: Working counter changed to 6/9.
[ +1.004464] EtherCAT 0: Domain 0: Working counter changed to 9/9.
[ +0.039295] EtherCAT 0: Slave states on main device: OP.

LinuxCNC triggers the ethercat master to start.
Master finds the first slave, and the working counter stops at 3/9.
I then plug in the extra two slaves, the master realises all 3 slaves are now online, then scans/configures them, at which point I can control those two drives/axes with LinuxCNC.

The warning about Slaves not syncing appears quite often. Is this likely to be related to the problem?


db1982,
0x60C1 comes up as an invalid dictionary object. I tried various sub-registers, but always the same response.
I've had a quick search of the manufacturer supplied XML for sync (180 hits!), and it looks like the 1C32 and 1C33 registers have various sync/time variables.

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

More
08 Dec 2022 14:55 #258892 by mwc
Just been having another go at this.
The connectivity as per the last post is repeatable (power up all drives with drives 2&3 CAT cable disconnected, load LinuxCNC, reconnect cable, and drives 2&3 will work).

Looking at some of the frames (ethercat debug 2), when the drives appear to not be working, you can see they are all returning the statusword in the raw frame data (in this case, they are reporting 0x0231 - decimal 561), yet this never shows up in the Hal Config lcec.0.N.cia-statusword. Hal config always shows the value as 0.
Yet when I get drives 2&3 operational, the statusword is reported correctly for those drives.

It's like there is something in the ethercat driver that isn't being correctly intialised.
Is there any kind of debug mode for the linuxcnc ethercat driver?

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

More
08 Dec 2022 18:26 #258907 by mwc
One other thing I've noticed, is if I try reading the controlword (6040) back from the drives via the terminal, if the drive isn't working, it returns 0.
When the drive is working correctly, it returns the value that LinuxCNC is writing.

Out of curiosity, I added 6040 to the read/in values in the xml, and it always returned the same value as LinuxCNC was writing (only ever 4 or 6), yet if I queried the drive via the terminal, it returned 0.
Looking at the frame data, the drive was also returning 0, so I'm assuming there is some form of state machine the ethercatmaster is maintaining, that the ethercat driver is querying.
Also, I can't get any drives to operate if I'm reading the controlword back as part of the pdos. Remove it from the pdos, and I can get drives 2 & 3 to enable.

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

More
08 Dec 2022 23:48 #258936 by db1981
sorry I can't understand your last post completly (may be my bad englisch)

It is not clear to me:

-When the drive is working correctly, (Ethercat state , linuxcnc state ??)

-read/in values in the xml ( configured as pdo ??)

-Also, I can't get any drives to operate if I'm reading the controlword back as part of the pdos. Remove it from the pdos, and I can get drives 2 & 3 to enable. (fully not clear to me.. / how can you enable the drives without the controlword? )

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

More
08 Dec 2022 23:56 #258939 by db1981
By the way, I read your drives manual page 23. If the document is correct The DS402 statemachine is not implemented as usual, they want to set mode of operation in front of the whole "enable statemachine" . The normal case is between state 2 and 3 in front of the last bit "enable voltage".

To check if this is the problem:

-disconnect the modes_of_op pdo (0x6060) from the CIA402 opmode pin in the hal

-start linuxcnc, don't enable the drives / control

-set the lcec.0.X.modes_of_op (0x6060) pin manual to 8 , per halcmd or halshow

-read out the "opmode-display" pin -> should be 8 too

-try to enable the drive
The following user(s) said Thank You: wazza77

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

More
09 Dec 2022 00:22 #258943 by mwc
Start from the beginning (in reply to your first post)

If I power the drives up with the CAT/Network cable disconnected between drive 1 and 2 (aka drive 2 and 3 not linked to the master), load LinuxCNC, then connect the CAT cable (so drives 2 and 3 are now connected/linked to the master), drives 2 and 3 get configured and can be enabled and controlled by LinuxCNC (I can jog the Y and Z axis), but drive 1 still does nothing.

At this point, if I look at Hal config, drive 2 and 3 are correctly reporting their statusword, whereas drive 1 reports 0.
If I read the statusword via a terminal (ethercat upload -p0 -t int16 0x6041 00), the driver returns 561 (IIRC - working from memory here, all info is on a different computer).

If I look at the frame data, I can see the statusword being received correctly by the master.

There appears to be some issue with the statusword not being updated between the ethercat master, and the linuxcnc ethercat driver.




Regarding the controlword, I noticed that when the drives fail to enable, if you read the controlword from a terminal (ethercat upload -p0 -t int16 0x6040 00), they always report 0. Even if you set it to a different value, it will always return 0.
Yet when the drives do enable, if you then read the controlword via a terminal, it reports correctly (0x0F/15 with LinuxCNC controlling the drives)
To try and understand what was happening, I added 6040/controlword to the xml/pdo (SM3) list to be read from the drives (with it connected to a hal pin "controlword-read"), and it always reports in Hal Config the value being written (4 or 6 when LinuxCNC is running), yet if you try reading the value from a terminal, it reports 0.

Now if you look at the frame data, the drive is also returning 0, yet Hal Config shows the value being written.
I'm not sure if this is significant, or just the way the linuxcnc ethercat driver interacts with the ethercatmaster state machine for pdos.

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

More
09 Dec 2022 00:26 #258944 by mwc

By the way, I read your drives manual page 23. If the document is correct The DS402 statemachine is not implemented as usual, they want to set mode of operation in front of the whole "enable statemachine" . The normal case is between state 2 and 3 in front of the last bit "enable voltage".

To check if this is the problem:

-disconnect the modes_of_op pdo (0x6060) from the CIA402 opmode pin in the hal

-start linuxcnc, don't enable the drives / control

-set the lcec.0.X.modes_of_op (0x6060) pin manual to 8 , per halcmd or halshow

-read out the "opmode-display" pin -> should be 8 too

-try to enable the drive
 


That could be the problem. I'll try that tomorrow.
It is like something isn't getting set correctly, but if the drive configuration is done immediately before being enabled (by the CAT cable being plugged in), they do get enabled.

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

Time to create page: 0.106 seconds
Powered by Kunena Forum