Mach3 G Code Examples

Mach3 Files

  1. Reference
  2. Mach3 G Code Examples - Evillasopa
  3. See All Results For This Question

Below are some files that are FREE for taking. I am doing this to support the Mach3 community. As such, I do not warranty anything - so, be careful with what you do with this. Test, test, and then use. They work fine for me, and have been in use for some time now. You can send me feedback, which I will be happy to answer if I can.

Aug 23, 2019 Mach3 has a built in macro/scripting engine based on a product called Cypress ENABLE. The scripting engine let's you edit the standard M-codes but also enables you to create custom M-codes that can be called from your G-code. A typical example is modifying the M6 macros to. G-code is used in a lot of automated manufacturing processes. Apr 08, 2021 To get the available free G-code files on CNC Cookbook, simply go to the search tab on their official website and type “G-Code Examples & G-Code Files Free Downloads”. Then click on the link to the search result with that topic and you shall be directed to a page where you can download the specific file you want.

Smithy 1220LTD CNC Conversion Details

Click here to see pages detailing the ground-up conversion of Smithy 1220LTD 3-in-1 to machine CNC.

To see bigger version look here. For pendant assignments see here.

This is an enhanced Mach3 Mill screen. If you have already downloaded this screen, check the rev version. This is updated rev D. It is very similar to the original Mill screen, but as I do not like to switch the screens, most of the functions are now on the main screen - MDI etc. (other screens are still retained with enhancements). The screen will also allow you to switch between the jog modes, without any tabbing. Also supported is the MPG mode. When selected you can either use button to select velocity setting, or multi step modes: coarse (0.001' step), or fine (0.0001' step). This is done without any cycling, and doing this does not change the continuous jog step. You can also touch Z, or set your XY zeros directly. This screen has been customized for my pendant, but those are added hotkeys for the off-screen buttons (for pendant assignments see here). I have retained the same shortcuts for the on screen stuff, so it will work for everyone.

Changes from my rev C: If your setup has a digitizing input, you can now use AUTO Z button to reliably find your work.Note: Due to Mach3 bug, if you are going to be using 'auto touch' feature you need to upgrade to Mach3 1.083.046 or later version.

ExamplesMach3 G Code Examples


To install:
Unzip the file somewhere. Copy the 1024.set to the main Mach3 directory (it will overwrite the existing file so you may want to rename the original file). Copy the MillBitmaps to the Bitmaps folder (this will add additional pictures for the screen controls). Same with any macros I may include in future. If you wish you can rename the screen file.
Download from:
Mill_Screen-D.zip
Let me know of any bugs, or your
feedback.

To see bigger version look here. For pendant assignments see here.

MalachiDaley

This is an enhanced Mach3 Turn screen. It is very similar to the original Mill screen, but almost everything can be done from the main screen, and there are many enhancements that I find handy. The screen will allow you to switch between the jog modes, without any tabbing. Also supported is the MPG mode. When selected you can either use button to select velocity setting, or multi step modes: coarse (0.001' step), or fine (0.0001' step). This is done without any cycling, and doing this does not change the continuous jog step. You can also touch Z, or set your XY zeros directly. This screen has been customized for my pendant, but those are added hotkeys for the off-screen buttons (for pendant assignments see here). I have retained the same shortcuts for the on screen stuff, so it will work for everyone.

Another enhancement is the addition of new tool referencing. It does not use tool offsets (although they are still supported): rather you reference the tool to the lathe chuck. In essence, you set the Z for the front surface of the chuck, and the X for the front outside circumference of the chuck at the beginning. Afterwards, when you change the tool, you just 'touch' either of these features, and your reference is set. To make it easier, my QCT is electrically insulated from the rest of the machine, so when the touch occurs, there is a beep, and I can also use the digitizer to set references (otherwise you can use a piece of thin foil to detect the touch). The screen lets you do it manually, or if your probe input is activated, it will auto touch the chuck. My repeatability is better than 0.0001' when doing it manually, and 0.0005' using the auto touch. Depending on the quality of your chuck, you may want to use the same place to do the referencing. The outside concentricity of my chuck varies by about 0.0005'. So, why did I do this? Well, unless you have larger production runs, and have many tools, it is very troublesome to use the regular tool offset system. If anything was to go wrong during the machining, it is not that easy to re-reference the new tool. Say, you break your tool, and have to take it out of the holder and substitute something different. And, you also have to change the tool angle to make it possible. With this method, it does not matter - all you do is re-ref the tool to the chuck. It takes 30 seconds or less. And, yes, I did add two help buttons to tell you how to do it the first time. After that, you will not need them J.

Finally, there is a button M91111. This button will call turn macro in M91111.m1s. It is currently not assigned, and the user is free to add his own code. For example, you can set the soft limits after you reference the chuck.

Note: Due to Mach3 bug, if you are going to be using 'auto touch' feature you need to upgrade to Mach3 1.083.046 or later version.

To install:
Unzip the file somewhere. Copy the 1024.set to the main Mach3 directory (it will overwrite the existing file so you may want to rename the original file). Copy the TurnBitmaps to the Bitmaps folder (this will add additional pictures for the screen controls). Same with any macros I may include in future. If you wish you can rename the screen file.
Download from:
Lathe_Screen-C.zip
Let me know of any bugs, or your
feedback.

G-CODE

Revisions:

Rev C:

q Increased resolution of DRO for feed per rev. as it didn't have enough digits to the right of the decimal.

qFixed Set XZ1 and XZ2 Button code.

qAdded M91111 button to call user defined M911111.m1s macro.

Electrically Insulated QCT

Mach3 G Code Examples

After publishing my Mach3 Lathe screen, featuring chuck tool referencing, I have received number of requests to describe construction of my toolpost modification. So here it is.

FeatureCam Mill (3axis) and Turn Postprocessors for Mach3 (and Mach2)

These two postprocessors for FeatureCam 12 (2006) are modified and adopted to Mach-3 mill and turn, in inch modes. They both employ “exact stop” modes, and will work with no problems on all systems (even the ones that have that have the backlash enabled). In The ZIP contains the posts, documentation, and two g-code examples showing you the output. I am also attaching the FeatureCam configuration file. Download from: FeatureCam-12 Mill&Turn Posts.zip

Mastercam9 Mill Postprocessor for Mach3 (and Mach2).

If you are using MC - YOU NEED THIS! After getting around various issues on MACH2.pst, I finally spent some time and modified it so it works correctly for Mach3 (and probably Mach2 also). It will support 3 and 4 axis mills, and is pretty generic, so it will work with any vertical retro (no matter how you drive the motors). I have also removed any G28 references at tool changes, and at the program end. If you need them re-enable... or use Mach3 macro to do this.

NOTE: If you get funny looking circles when you load the G-code generated with this post into Mach3 do not despair. All is well, but you have to change the 'IJ MODE' setting in Mach3. You will find it in Config/State settings.


If you re-distribute it, please do not change the file name from Mach3B (B is the revision) to avoid the confusion. If you add to it, please DO change the rev number, and add the revision notes.
MACH3B_for_MC9.zip

Mastercam9 LATHE Postprocessor for Mach3

Finally, it is here: _MACH3LA_for_MC9.zip

q Output is in the RADIUS mode, to follow MACH3 wizards convention;

q Axis polarity is set to be same as in MACH3;

q Canned threading, G76 is NOT supported. Use Longhand or Alternating methods in MasterCam Threading menu (G32 based).

Reference

q G28 references are disabled - use MACH3 Macros instead when changing tools to re-enable change line:

no_g28g50onTC : 1 to

Mach3 G Code Examples - Evillasopa

no_g28g50onTC : 0

NOTE: If you get funny looking circles when you load the G-code generated with this post into Mach3 do not despair. All is well, but you have to change the 'IJ MODE' setting in Mach3. You will find it in Config/State settings.

Guide to using Mactercam 9.x.

(MASTERCAM 9.1 TOOLPATH GENERATION for Mach3)

See All Results For This Question

I use Mach3, and although it comes with some nice wizards, they are a far cry from my needs. I finally selected MasterCAM 9.1, as it is available to me, and is (despite its DOS-like appearance) an extremely capable system (as you would expect for $20,000+, I think). For those who have access to it, this article is a short introduction to how to use MasterCAM 9.x to generate a workable G-code for the Mill. It mainly outlines the design process, and provides enough background to allow the reader to experiment and learn its operation. I placed an emphasis on smaller retrofit machines running controllers such as Mach3. You will need Adobe Acrobat to see it. Download mastercam_tutorial.pdf