Coolant On/Off is normally done with a M7 (On) and M9 (Off). There are many other M codes for these types of functions.
G code https://en.wikipedia.org/wiki/G-code
I'm learning G Code and I was able to setup my first CNC structure and move axis, its basically not a CNC machine but I'm taking advantage of it and building a machine with robotic movements.
I have some Relays, and MOSFETs on my Arduino (or could be Arduino Mega) board is there some way that through G Code commands I can turn on/off some of them? or read switch state? or do some action in response to a trigger?
I know, I have some options like using resources for spindle, coolant etc.
But I have greater hardware needs to turn on/off and get input like switches is there some options something like custom G Code or some extra of additional commands those can be used for different scenarios like input/output.
Similar Threads:
Coolant On/Off is normally done with a M7 (On) and M9 (Off). There are many other M codes for these types of functions.
G code https://en.wikipedia.org/wiki/G-code
Jim Dawson
Sandy, Oregon, USA
Thanks, but my question is how can i run other than those existing commands, like custom commands (other than spindle, coolant)
Hi,
I don't think you can. Gcodes are defined and conform, fairly closely, to a standard. Most CNC software programs allow you to write your own macros, Mnnn,Mxxx, etc.how can i run other than those existing commands, like custom commands (other than spindle, coolant)
A macro can be called from an ordinary Gcode job by calling its name, M104, for instance.
Whether GRBL has the ability to accept custom Mcodes I don't know, but Mach4 (and Mach3 if you want to go back in time) certainly do allow custom Mcodes and provide
the software language and constructs to do it.
Craig
The G codes are usually the responsibility of the motion controller, and are generally specific to the machine, the general machine (M) functions are done with the customisable controller, specific for the purpose.
It depends alot what controller you have in mind as to how they would be implemented.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
As currently I'm choosing hardware I have no issue to select some hardware for it, I already have Arduino Mega and Uno for test
I'm using GBRL but i can also use Marlin and also thinking to check Smoothie for this.
But before buying those things i was to be sure if they will work good
Hi,
can you write your own macros in GRBL or Smoothie dialects? If the software does not accommodate custom Mcodes then
it hardly matters whether the hardware would work....if you cant craft your own Mcodes.
Craig