M10 & M11 codes (or help in creating custom codes for them)

More
27 Oct 2020 06:11 #187375 by rootboy
Hi guys,

My buddy Thurston has a Takamatsu lathe with a hydraulic chuck, and currently the chuck is released by a foot pedal, which is part of the original equipment.

He also has a tool that can be mounted into the tool changer that will grip the remaining round stock after a cut-off, and with the chuck released, allow the program to pull out a fresh length of stock and proceed to repeat the same operation on the virgin section of stock.

To do this, I'll need M codes to open and close the chuck. The normal (?) codes for this are M10 & M11, but they aren't included in LinuxCNC that I can see. So it looks like I need to create/remap these codes. But before I go down the rabbit hole of creating or remapping my own codes, has anyone else done this?

And if I have to create my own codes, is using M10 & M11 a good choice? It looks like these are getting used more and more by the plasma guys, and may eventually become part of the LinuxCNC standard.


I saw what looked to be a good start here:
forum.linuxcnc.org/20-g-code/33642-custom-m-code-python?start=0

And there are these:
linuxcnc.org/docs/html/remap/remap.html#_the_remap_statement
github.com/LinuxCNC/linuxcnc/blob/master.../src/remap/remap.txt


Thanks!

John

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

More
27 Oct 2020 06:17 #187377 by rodw
You could probably just use the digital output pins M62-M65. See
linuxcnc.org/docs/2.8/html/gcode/m-code.html#mcode:m62-m65

That would be a perfect way to trigger a relay
The following user(s) said Thank You: rootboy

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

More
27 Oct 2020 07:11 #187381 by rootboy
Ah! Now that looks like the ticket! Thanks! :)

I was wondering what those digital I/O points were for in the PNCconf wizard (and why they were limited to four each). Now I know... :)


Thanks again!

John
The following user(s) said Thank You: rodw

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

More
27 Oct 2020 07:58 #187387 by rodw
Yeh, by default there are 4 pins, but you can add more if needed.

Also have a look at M67/M68 so you know its there too...
The following user(s) said Thank You: rootboy

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

More
27 Oct 2020 15:00 #187428 by rootboy
Good to know, Thanks!

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

More
28 Oct 2020 05:07 #187509 by rootboy
It works great, thanks!
The following user(s) said Thank You: rodw

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

Time to create page: 0.125 seconds
Powered by Kunena Forum