Beckhoff ethercat 64 with bit linuxcnc, How to install.

More
6 years 7 months ago #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

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

More
6 years 7 months ago #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

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

More
6 years 7 months ago #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
6 years 7 months ago - 6 years 7 months ago #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: 6 years 7 months ago by Nico2017.

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

More
6 years 7 months ago #159236 by Sockheaven
I haven't used the python scripting/userspace components before. Is that the same thing as the ladder logic, or is there another ladder logic component I could investigate?

The mux might actually work depending how that component works, i could use the ESTOP and ENABLE signals to mux.

I'll investigate that. Thanks for the ideas! (and the verification that this kind of logic may not be suited for the HAL layer)

Best Regards,
Paul

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

More
6 years 7 months ago #159243 by Sockheaven
Ok i looked into the MUX2 hal object, and I like it, since I seem to only care about the state machine values of 6/15, this would work well to connect to the enable pin.

I am having a problem connecting it though. For some reason, while the documentation states that the MUX2.out is a float - LinuxCNC is giving me an error at startup that its a bit - what am I doing incorrectly?
Code:
# Connect Enable Pins / Signals net xenable => mux2.0.sel setp mux2.0.in0 6.0 setp mux2.0.in1 15.0 net mux2.0.out => iocontrol.0.emc-enable-in => lcec.0.0.TxControlWord

Error:
Signal 'mux2.0.out' of type 'bit' cannot add pin 'lcec.0.0.TxControlWord' of type 'u32'

I know i haven't converted the float to u32, but the HAL layer actually seems to convert floats/u32 automatically. but that's not even the error its throwing, its complaining it's not a bit...

File Attachment:

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

File Attachment:

File Name: ethercat-c...3-05.xml
File Size:6 KB

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

Time to create page: 0.476 seconds
Powered by Kunena Forum