Top 4 Reasons to Use a GCode Editor

Last modified: July 16, 2024

We recently conducted a survey among G-Wizard Editor users to determine how they were utilizing the software. Here are their responses:

GW Editor user tasks illustrated by bar graph with corresponding percentages.

The survey provides a good cross section of uses.  Customers could choose all of the choices that applied to them, and clearly a lot of folks were doing multiple things with the Editor.  Let's talk just a bit about what each one means and how it might benefit your CNC activities.

Writing G-Code From Scratch

I think this is the one that most commonly comes to mind, and if you stop here (please don't, the other uses are good stuff!), you probably don't think you could ever use a G-Code Editor.  After all, it's so much easier to let the CAM software create your g-code, isn't it?  Yet, we still see a surprising amount of hand written g-code out there.  Why do it?

For one thing, there are certain things that CAM is good at and certain other things it is terrible at.  A lot of simple parts can be programmed by hand faster than you could do a drawing in CAD to run your CAM against.  So, we could say CAM is not especially good at really simple parts.  CAM is also not very good at macro programming, and you can get a lot of benefits from macros and subprograms.  Most readers will be familiar with the notion of parametric CAD.  In fact many of you probably prefer to use a CAD program that is parametric.  But did you know that your g-code can also be parametric?  You can have variables change the behavior of the g-code.

I have a good friend who hand programmed a collection of g-code routines to make guitar parts.  You might think these would be the hardest possible things to hand program with their smooth flowing curves, and I know my friend had to work hard to put them together.  But now that he has them, he has powerful tools to make these parts (which he sells to the community of luthiers here) very custom to the needs of each guitar they'll be used on.  Even though the programs were a lot of work to write, he has completed avoided the need to do a CAD drawing and CAM session for each little variation of one of these parts.  Parameterizing the g-code in this way is often called "Family of Parts" programming, because you can use one program to manufacture entire families of similar parts just by changing the parameter variables.

You can do much the same for simpler parts.  A great area for this is fixture programming.  It's repetitive and things are often laid out on simple grids for plate fixtures.  A lot of the work may simple boil down to drilling and tapping holes in the right places.  This is easy stuff to do in a hand-coded nc program.

Learning G-Code

We get lots of students in at CNCCookbook who want to learn g-code.  Our free GCode Tutorial is one of the most popular if not the most popular NC Programming resources on the web.  When a semester starts, we get block signups from students looking to use the software in class. Pencil, paper, and books are fine, but there's nothing like a fully interactive simulator to help you get your NC Program running and to help you understand what it's doing.  In addition, G-Wizard has features that are specially designed to make diving into g-code much easier for beginners.

For example, our Hints feature tells you what each line of code will do in plain English.  Students tell me that the Hints are an absolute life saver that helps them come up to speed on the g-code radically faster.

CAD/CAM software screenshot with 3D model in progress and G-Code toolbar.

Hints are in the lower right corner, below the graphical simulation...

Any time you click on a line of g-code or a portion of the graphical plot, you'll see a hint for the line of g-code you've selected.  These hints tell you everything that's going on with that line, including a lot of things that are otherwise hard to come by.

Checking G-Code for Errors Before Running It

What's the cost of wasted time?  A program gets onto the machine only to discover something is wrong with it.  In most cases the machine and operator are now idle while they wait for a fix.  Even in a one man shop it's a nuisance to have to go back and redo the CAM at the workstation and get a fresh version for the machine.

What about the cost of scrap?  You run the program and an errant move scraps the part.  If you're particularly unlucky, your machine may now be wearing a new blemish as a reminder of the mistake.

Many don't think CAM programs ever produce errors of this kind, but anyone who has worked with CAM for very long knows that sooner or later you're going to encounter one.  With that in mind, it should come as no surprise that a great many like to simulate their programs while they're freshly posted from CAM before they head over to the machine to try to run them directly.  A good simulator catches all kinds of errors.  G-Wizard Editor is particularly meticulous in its error checking.  For many simulators, you just squint at the graphical plot to see if all looks well.  With G-Wizard, we check for a lot of errors that aren't even visible on the plot.  For example, running at feed speeds (which implies you're doing some cutting) without having turned the spindle on.  Or having an arc programmed where the two endpoints differ from the center by more than an allowed tolerance.  Running the first one will likely result in a broken endmill if you don't catch it in time.  Running the second will cause your machine controller to alarm out, perhaps not until it actually executes that code somewhere in the middle of running the program.

G-Wizard even allows you to set soft limit travel alarms.  This can be particularly useful for Z, where you may not want the endmill to descend lower than a certain value lest it start carving up tables and vices.

GWizard G-Code Editor screenshot with Alarm settings page.

Soft Limit Alarms are set on the Info Tab...

Modifying CAM Generated G-Code

This is the number one use for the G-Wizard Editor and I'll be it has some of you scratching your heads.  Why would I want to modify my CAM software's g-code?

I'm so glad you asked!

Having the ability to modify your CAM generated g-code opens a tremendous number of opportunities and flexibility:

There are many other things folks are doing to their CAM Software's g-code.  Performance tuning is a big opportunity as we've all seen that CAM doesn't always make the swiftest decisions.  Watch nearly any program run and ideas to eliminate waste quickly come to mind.

Conclusion

Wow!

Who knew there were so many great uses for g-code editing?  I'm sure many felt that hand writing g-code of any kind was a dying art when in fact it is the secret weapon of many modern and highly automated manufacturers.

G-Code certainly looks arcane and hard to learn, but in fact it's pretty straightforward.  If you've never tried to learn some, give it a shot with our Free G-Code Programming Tutorial.  Be sure to hook up with the Free 30-Day Trial of G-Wizard Editor too-it'll make the process even easier.

Be the first to know about updates at CNC Cookbook

Join our newsletter to get updates on what's next at CNC Cookbook.