top of page

Help, my CNC machine doesn't understand GCode



I have seen countless variations on this cry for help. Usually it comes down to two possibilities: file extension or post processor. Both are usually quite easy to solve in software.




File Extensions


As long as there have been computer files there has been a way to declare their type. A file extension is a way to define the file type. It is basically the last part of a file name, separated from the name itself via a dot (.). What it means in Windows and other operating systems is really what kind of applications can open/modify/write these files. You can even define the application associated with that file extension. When you "activate" or "run" the file, the operating system will cause the associated application to execute and open the file. In the early days of computers, file extensions were limited to, at most, 3 characters so you get things like .pdf, .exe, .jpg and so on in a rather dizzying blizzard of alphabet soup. Modern operating systems have relaxed the 3 character limit but the tendency to just use 3 remains.


Not only is 3 characters pretty limiting but there is no central authority defining extension names. Nowhere is this more evident than in the CNC world - there are lots of GCode file extension names. It seems like every CAD/CAM application has a different extension. Some even allow you pick your own extensions. I know of at least 7 extensions that are used for GCode files: .txt, .cnc, .nc, .ncc, .ngc, .gcode and .tap. The underlying reality is that a GCode file is just text - you can open the file with any text editor, modify it and write it out. You can also change the file extension from one of the above extensions to another and the file will work the same.


What causes a lot of confusion is the fact that not every CNC controller (application, gcode sender, ...) looks for all the file extensions. So, if a CAD/CAM application uses, for example, .nc but the controller doesn't look for .nc files, it will appear to the neophyte that their machine does not support that CAD/CAM application. One fix is simple - rename the file to use an extension type that the controller looks for. So, if you have a file, say foo.nc, and the controller does not see it, rename it to foo.cnc and try again. Or, foo.ngc, or foo.gcode or ...


You might be able get your CAD/CAM application to output files with a different file extension. Or you can get your controller application to look for the extension. Either one of these is preferable to renaming the file every time you create a new job.


Note: In Windows, the default File Manager (er, Windows Explorer) settings hide the file extension from the user. This only serves to further confuse the situation. In the File Manger, to see extensions, check the File name extensions box in the Show/Hide section of the View tab.


For example, VCarve uses .gcode for their file extension. If your controller application does not show foo.gcode, you might need to rename it to have an extension that it knows. Though, you might simply try typing in "foo.gcode".


Post Processor


Every CNC machine is slightly different and the CAD/CAM applications need a way to tailor the GCode they output to that machine. This is done with something called a post processor, often times simply called "Post". Most CAD/CAM applications supply post processors for the popular machines and allow you to select which one you want it to use when writing out the GCode file for your job. Selecting the wrong Post can lead to a range of problems from subtle errors to outright crashes. A common error is selecting an imperial (inch) Post for a metric (mm) machine and getting a job that is 1/25 too small (or big)!


Configuring your CAD/CAM application for the right post processor is typically done in the machine configuration section. For example, in VCarve and Aspire, the Machine menu has 3 different items for Post-Processing including a way to download additional ones. The list of available post processors is quite extensive.





If your CAD/CAM application does not supply a post processor for your machine, you should ask the publisher if they have one available. Even if they do not, just asking will bring your machine to their attention. You could also ask in any user groups, especially one dedicated to your specific machine. Many of these groups are often quite helpful. I recommend finding one for more than just getting a compatible post processor. And, if all else fails, you could try writing one yourself. It is a text file with a list of instructions to the application for how to print GCode. I would start from a post processor for a similar machine. A number of CAD/CAM software companies have instructions for writing post processors.


About Me.

I'm Phil Barrett, a long time CNC enthusiast. I run a small company, Brookwood Design, that makes several breakout boards for grblHAL and love to help people get the most out of their CNC machines.



Featured Posts
Recent Posts
Search By Tags
No tags yet.
Follow Us
  • Facebook Classic
  • Twitter Classic
  • Google Classic
  • Wix Facebook page
  • Twitter Classic
  • Google Classic
bottom of page