Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
02 Mar 2020 20:28 #159023 by Moronicsmurf
Well in theory you can just use a Digital output 5V and drive steppers that way.. question is where the stepgen ends up being. There is also ethercat stepper drivers that connects straight to the fieldbus.. so its why i asked in the first place. :)

But yeah in the case of servo drives, that is probably completely correct.

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

More
02 Mar 2020 21:06 #159031 by Nico2017
Hi,

yeah that would be as Todd said you would send a pos or vel command to the drive which does the rest of it.

Nicolas
The following user(s) said Thank You: Moronicsmurf, thefabricator03

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

More
02 Mar 2020 21:13 #159033 by Sockheaven
Ok Progress!
The issue was an endian-ness one, I translated on 8 and 16 bit lines and things started to take shape (see config files attached)
I can now:
  • Startup without errors (both LinuxCNC and logs, log below)
  • Initial Position Feedback read from the drive

What I cannot do:
  • Enable/Disable axis
  • Receive cyclic Pos Feedback (checking by watching HalMeter)

Log Data - as far as I know its good, but here it is in case someone else sees a problem with it:
Note: log is from closing LinuxCNC to re-starting LinuxCNC
EtherCAT 0: Master thread exited.
EtherCAT 0: Starting EtherCAT-IDLE thread.
EtherCAT 0: Releasing master...
EtherCAT 0: Released.
EtherCAT 0: 0 slave(s) responding on main device.
EtherCAT 0: 1 slave(s) responding on main device.
EtherCAT 0: Slave states on main device: OP.
EtherCAT 0: Scanning bus.
EtherCAT WARNING: Datagram ffff8ff18f8a0370 (master-fsm) was SKIPPED 1 time.
EtherCAT 0: Bus scanning completed in 260 ms.
EtherCAT 0: Using slave main-0 as DC reference clock.
EtherCAT 0: Slave states on main device: SAFEOP + ERROR.
EtherCAT ERROR 0-main-0: AL status message 0x001B: "Sync manager watchdog".
EtherCAT 0: Slave states on main device: SAFEOP.
EtherCAT 0-main-0: Acknowledged state SAFEOP.
EtherCAT 0: Slave states on main device: INIT.
EtherCAT 0: Slave states on main device: PREOP.
EtherCAT: Requesting master 0...
EtherCAT: Successfully requested master 0.
EtherCAT 0: Domain0: Logical address 0x00000000, 12 byte, expected working counter 3.
EtherCAT 0: Datagram domain0-0-main: Logical offset 0x00000000, 12 byte, type LRW at ffff8ff17a1003d8.
EtherCAT 0: Master thread exited.
EtherCAT 0: Starting EtherCAT-OP thread.
EtherCAT WARNING 0: 1 datagram UNMATCHED!
EtherCAT 0: Slave states on main device: INIT.
EtherCAT 0: Slave states on main device: PREOP.
EtherCAT 0: Domain 0: Working counter changed to 2/3.
EtherCAT 0: Slave states on main device: SAFEOP.
EtherCAT 0: Slave states on main device: OP.
EtherCAT 0: Domain 0: Working counter changed to 3/3.

Questions that come to mind:
  1. I do notice something about Sync Manager watchdog - would this indicate that the controller has aborted updating cyclic values(PDOs)?
  2. The PDO for position command/feedback is a U32 for the Kollmorgen AKD, but LinuxCNC wants to force me use a FLOAT variable in my XML file - do i need to do some kind of data casting? or is there why the other servo drives seem to have modules built (h/c files)
  3. how do i connect the control word to the LCEC module? for example changing amp enable over the DS402 spec requires state changes in a sequence, but aside from that i dont have any state machine from LCEC connected to the control word and i feel like thats missing

Let me know what you guys think. Thanks!
Best Regards,
Paul

File Attachment:

File Name: ecat_test_...3-02.hal
File Size:4 KB

File Attachment:

File Name: ecat_test_...3-02.ini
File Size:2 KB

File Attachment:

File Name: ethercat-c...3-02.xml
File Size:5 KB
Attachments:

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

More
03 Mar 2020 16:52 #159087 by Sockheaven
Woohoo! Ok, so first misake I made was using that runup script as is - after reviewing the commands, that example from the website was configuring it as 2ms. I updated the script to be 1ms and it appears i'm cyclic!

On top of that, the feedback from the drive is succesfully updating in the GUI, and appears to be working despite my suspicion around the float->U32 casting. Although the values being read are pure integers, so i have a scaling issue on my hand.

Regardless, this is a good step forward.

The remaining big question is how to map the control word - i am still unable to enable/disable from LinuxCNC.

Any ideas?

Thanks guys!
-Paul

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

More
03 Mar 2020 17:43 - 03 Mar 2020 17:44 #159090 by Sockheaven
Just spitballing here...
While stuck on the control word I was looking at resolving the scaling issue, and I think at the core I have an issue where the AKD - while it has user defined scaling, i don't think there's anything I can do about the integer->float problem.

Natively the drive is reporting counts back (counts/rev or counts/pole-pitch for linear). These are always integer, and while I can define the counts/rev, i can't make the drive return a float for this (or receive a float for that matter).

So it made me think; does anyone know how to do one of the following:
1. Create a HAL script (or similar) that translates integer-> float (with a scaling term)
2. Set the units in LinuxCNC to be um or nm (instead of mm) which would get me closer.

The other thing i noticed - where do i set the position error tolerance? It wants to say I have a following error with very small tolerances.

-Paul
Last edit: 03 Mar 2020 17:44 by Sockheaven. Reason: clarity

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

More
03 Mar 2020 18:52 #159096 by Todd Zuercher
The following user(s) said Thank You: Sockheaven

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

More
03 Mar 2020 20:23 #159103 by Sockheaven
Thanks Todd!
The knob2float set me on the right path - it got me patched up one direction, but didn't allow me to translate the command(float)->int with scaling.

I did a little searching through those HAL components (man, searching that is rough...) and ran across the scale component and that got me setup (attached files in case anyone else has wanted an example of the SCALE component (as i didn't find any examples).

My last remaining hurdle is figuring out how to map the control word - anyone else with a working EtherCAT installation, how did you map the control word?

Best Regards,
Paul

File Attachment:

File Name: ecat_test_...3-03.hal
File Size:5 KB

File Attachment:

File Name: ecat_test_...3-03.ini
File Size:2 KB

File Attachment:

File Name: ethercat-c...3-03.xml
File Size:5 KB
Attachments:

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

More
04 Mar 2020 19:33 #159210 by Nico2017
Hi Paul,
for the control word, I usually match a machine state of linuxcnc to an equivalent of the drive control bit.
So basically you should have machine Estop, machine not Estop and off and machine ON. Then you have more specific things relative to individual joints. For instance you could use the joint . amp-enable which are available to possibly be associated with another control bit of your drive.

It really depends of the documentation of your drive and what each control bit does.

For the scaling, I think there is a scaling command into the xml ethercat config file regarding complex pdos entries. Otherwise you can use the hal scale component.

Nicolas
The following user(s) said Thank You: thefabricator03

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

More
04 Mar 2020 19:49 #159213 by Sockheaven
Hey Nico,
Yea i've been learning a lot about this the past few days. I just posted a bit more info on this on another thread:
forum.linuxcnc.org/24-hal-components/223...ver?start=850#159212

Turns out, the AKD drive uses a state machine and not discrete values to enable/disable.

In this case, I need to set that word to 6, and THEN set to 15 to get the amp to enable and follow setpoints from the bus, then back to 6 when i want to disable the axis again.

As mentioned in the other thread, not sure how to implement this kind of logic at the HAL layer.

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

More
04 Mar 2020 23:34 - 04 Mar 2020 23:37 #159230 by Nico2017
Anything which has time sequence or sequencing requirement could be done over ladder or using the python programming and python userspace components.

Not sure how your drive works, but sometime instead of a full control word you just need to adjust a control bit one by one while the lcnc software change from state to state.

Otherwise a mux with defined input float value being directed according to the machine state which change the sel bit to direct the right value.

Nicolas
Last edit: 04 Mar 2020 23:37 by Nico2017.

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

Time to create page: 0.171 seconds
Powered by Kunena Forum