Can axis be made to send hex commands or is glade the answer?

More
08 Sep 2017 06:58 #98654 by sqmathlete
Hi All,

I am using the ethercat hal driver to control some AC servo amps that require LinuxCNC to issue some commands in hex. For example, to initialize the amplifier, switch to home mode, probe mode etc. The current way seems to be to break out the PDO data into bits and then connect those bits to LinuxCNC. For some things this is fine but, I would like to create a gui/panel of some sort that I would be able to press a button to say home x axis, that would trigger an event to set the mode to 0x06, then start home sequence = set control word 0x1F. When the home sequence is complete the amp resets the counter and outputs a signal saying that the routine is finished...This would have to be tied in by ladder logic.

Ideally I would be able to modify the parts of axis like the home and probe routine to suit, otherwise I am assuming Glade is the answer? If this is possible could someone perhaps give an example of a python callback that would do such a thing? At this point I'm still struggling to understand the callback definitions.

Any help is greatly appreciated.
Kind Regards,

Dan

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

More
08 Sep 2017 23:32 #98714 by andypugh
Well, of course, LinuxCNC can do this, but crikey it sounds deep.

First of all, what data channel are these commands transmitted on?
Do the commands have to be real-time?

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

More
09 Sep 2017 00:09 #98719 by sqmathlete
Hi Andy,

Crikey indeed! To be honest I'm not really sure what data channel they are on but I think that they would or could be issued via the linuxcnc command in python since I can issue them in hal no problem and I have been able to set some parameters in the intial hal and xml files. Note the xml file for ethercat is different than the xml files for gui's. I'm sure you know this...None of the commands that I want to issue need to be in real time per-say since they would be issued in either mdi or manual mode only.
For example, during homing the servo amp handles all of the motion and reports when it is done. With linuxCNC running you would issue (I haven't modified the source like schiffler yet to allow LinuxCNC to do this without complaining yet) however,
setp lcec.0.0.x-mode 0x06 = setp linuxcnc-ethercat. |master 0. | slave.0 | halPin | Parameter
to set the mode to home, then
setp.lcec.0.0.x-ctrl-word 0x1F (start home routine)
servo amp sets a bit high to acknowledge the homing routine is complete...in theory

Dan

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

Moderators: mhaberlerHansU
Time to create page: 0.244 seconds
Powered by Kunena Forum