You are on page 1of 5

CNC G-Code Programming Tutorial, Course, Examples, and Programs








Free Trials


CNCCookbook's G-Code
Tutorial and Course
Take the Cloud
CAD Survey

Featured Articles
Special Purpose CNC
10 TIps for Router
Aluminum Cutting

Looking to learn CNC G-Code? Need a quick and easy G-Code Tutorial or G-Code Course? Want
some easy G-Code Training? Maybe you just want to learn more about a specific G-Code related
topic or see particular G-Code examples. If so, you're in the right place with the CNCCookbook CNC
G-Code Course. It's free, it's easy, and it's chock full of good information. This page is the syllabus.
The articles are all listed below. There's no need to register, just get started learning at your own
What is G-Code?
G-Code is the language used to control CNC machines. It's one type of CNC programming that
CNC programmers use, the other type being CAM programming. Your machine's CNC controller
probably executes g-code, although there are other possibilities--Heidenhain, Mazak, and others
have proprietary formats. Some machines with proprietary formats can also run g-code. It is the
Lingua Franca (working language) of CNC.
In order to make a part on a CNC machine, you tell it how to make the part using a G-Code

CNC Machine Hourly Rate

Why Learn G-Code?
CNC Router Cutter Types
Why use a single flute

Every CNC machinist should know g-code. If you're interested in CNC and machining, you should
We recently did a survey to assess the g-code skills of our readership. You should not be suprised
to learn that many are quite proficient with G-Code:

Step and Servo Motor

Machine Shop Estimating
2 Tools for Calculating Cut
Depth and Stepover
Conversational CNC
Feeds and Speeds
G-Code Tutorial
Coupons, Sales, and
Special Deals

We were impressed at how many readers can write g-code programs from scratch. In fact the
overwhelming majority read, write, or tweak programs on a regular basis. If you're not yet able to do
that, you need to learn. These articles are CNCCookbook's free course in g-code. No matter what
stage in g-code learning you are at, you will find the tools to advance to the next stage in these
articles. Check them out--it's easy to improve your g-code proficiency and well worth the productivity
What's the Best Way to Learn G-Code?

G-Wizard Calculator:
Fast, Easy Reliable
Feeds and Speeds

1 5

A little bit at a time, trying out the examples, and in a continuous stream. In other words, find
yourself a complete course like this one, start knocking out the lessons, work the exercises, and
keep at it. Work at your own pace, and don't move on to the next lesson until you've worked the
exercises and understand the material.
Working the exercises is a whole lot easier if you've got some software to help you play with g-code.
That's what our G-Code Editor software is all about. It simulates g-code as well as decoding it for
you. You can try out different g-codes and see visually what they do. Experimenting is one of the

PDF created with pdfFactory Pro trial version

08/12/2015 03:59

CNC G-Code Programming Tutorial, Course, Examples, and Programs

Try G-Wizard

best ways to get a good grasp of g-code. At the end of each section is a Quiz to test your skills.
Take the quiz and use the links on the questions to go back and review anything you missed so
you'll be solid before continuing to the next section.
We encourage you to sign up for the free 30 day trial--that's plenty long enough to work through all
the lessons free of charge. You'll find G-Wizard Editor not only makes it easy to work with g-code
and try the exercises in the course, but it has many features designed to make understanding the
g-code easier. For example, it offers "Hints", where it takes each line of g-code and explains in plain
English what that code does. There's nothing else like it available anywhere. For more information,
visit the GW Editor Home page. Or, go head and sign up now for the free 30 days:

Get over 200 tips, techniques

and strategies to:

G-Code is complicated
Reduce Cycle Times

G-Wizard Editor makes it easy

Save Setup Time

Try It!

Increase Tool Life

Improve Surface Finish
And More!

The second thing you should do aside from following a course and using a simulator like G-Wizard
Enter your Email below to get Editor is to start following some articles about CNC. Getting some random inputs about a variety of
topics is another way to help the juices flow. You'll see things that raise questions and get you
your FREE Tips:
thinking about the basic concepts in new ways. This helps all of the ideas to connect better. To get
a good source of such inspiration you could hardly do better than to subscribe to our own
CNCCookbook Blog. We're by far the largest CNC blog on the Internet in terms of readership. We
post articles for all levels of knowledge. Signing up is easy--you'll automatically be added to the list
if you start the 30-day trial of G-Wizard Editor. Or you can join 40,000 other CNC Enthusiasts by
visiting our signup page.

Table of Contents
Here are the articles available for maximizing your g-code proficiency and providing you with
a little CNC programmer training. Included in nearly every article are examples using our CNC
Programming Software, G-Wizard Editor.

GCode is complicated.
G-Wizard Editor
makes it easy.
Basics Every CNC Machinist and CNC Programmer Should Know

Try It!

Introduction for Beginners: More on what you can do with g-code, basic concepts, and an
interactive tool to help you learn faster.
The Coordinate System: Is it a right-handed or left-handed coordinate system?


G-Code Dialects, Post Processors, and Setting Up GWE: The great thing about
standards is there are so many to choose from.
MDI: CNC For Manual Machinists: Pretend your CNC is just a manual machine with
DRO's and Power Feeds on every axis.
One-Shot G-Codes and Modal G-Codes: Some things in g-code are sticky and others are
CNC Editors: Tools of the Trade: CNC Programming Software.
CNC Simulators, Backplots, and Viewers: Getting a Second Opinion
Part Zero, Touch Offs, and Zeroing: Helping the machine understand where the part
begins and ends.
Basic G-Code Program Structure: Blocks, sequence numbers, words, addresses, and the
basic nuts and bolts of g-code line.

2 5

PDF created with pdfFactory Pro trial version

08/12/2015 03:59

CNC G-Code Programming Tutorial, Course, Examples, and Programs

Linear Motion: G00 and G01: Moving your CNC in straight lines.
Circular Arcs: G02 and G03: Moving your CNC along arcs.
Running the GWE G-Code Simulator: Using a G-Code Simulator to view and debug your
Tool Changes and Tool Offsets
Tool Length Offsets: Something every CNC machinist should know a lot about.
Tool Data Management: How do you keep up with all your tooling and the
compensation information? What about tool presetting?
Basic CNC Lathe Programming
Quiz on Basic GCode Programming: Test yourself with a quick quiz on this section.
Each question has links to the answers so you can review what you missed.

Relative vs Absolute Moves
Polar Coordinates
Canned Drilling Cycles
Custom Deep Hole Drilling Cycles
G96: Constant Surface Speed Programming
Precise Timing and Speed: Dwell, Exact Stop, Backlash Compensation
The G-Code Coordinate System Pipeline
G20 and G21: Unit Conversions
G54 and G92 Work Offsets: Making multiple parts easily
Helical Interpolation: Making holes bigger than any cutter you've got
Programming Tapping: Rigid Tapping, Tapping heads and Tension Compression Holders
Programming Haas Controls: Haas's unique g-codes and other differences
Thread Milling: How to thread mill, NPT and tapered threads, When to thread mill instead
of tapping

Intermediate Lathe Programming

Lathe Simple Canned Cycles: G90/G92/G94
Lathe Repetitive Roughing Cycles: The Poor Man's Turning CAM
G71: Rough Turning Cycle: Type I
Using Mill CAM to Create Profiles for Lathe Cycles
G71 Type II: Rough Turning With "Pockets"
G70: Finishing Cycle
G72: Rough Facing Cycle
G73: Pattern Repeating Cycle
Using IF and GOTO for a Poor Man's G71
G75 and Peck Parting Off for Lathes
Lathe Threading Cycles
Gang Tooling for Lathes

3 5

PDF created with pdfFactory Pro trial version

08/12/2015 03:59

CNC G-Code Programming Tutorial, Course, Examples, and Programs

G28: Return to Reference Point
Tool Compensation: The Poor Man's Milling CAM
A Mini-Tutorial on G-Code Macro Programming and Fanuc Macro B:
Parameterized Programming: Macro Variables
Subprograms and Macros: Packaging G-Code Into Building Blocks
Conditions and Looping: Making Decisions and Handling Repetition in
Accessing Modal Data: Making Subprograms Clean Up After Themselves
Modal Macro Calls
Macro Example: Digits (Work in progress)
G10: Programming Tool and Work Offsets in G-Code
Scaling the Coordinate System
Rotating the Coordinate System with G68 and G69
Mirroring the Coordinate System
G-Code Scaffolding: Making CAM Better With G-Code Help
Multiple Part Strategies
G52: Temporary programmable work offsets
Interacting With the Operator
Tweaking CAM Programs: Right Angle Heads and More
Mill 4th Axis Programming
Lathe C-Axis Machining and Live Tooling
Reference Motions
In-Process Probing

CNCCookbook Blog Posts Relating to GCode Programming: Lots more Tools, Examples,
and detailed articles.
G-Wizard Editor: CNC Programming Software for g-coders and a CNC G-Code Simulator.
We use it in this course to help teach G-Code.
G-Wizard Calculator: A CNC Machinist's Calculator
G-Code Reference for Mills
G-Code Reference for Turning
Sample G-Code Files: G-Code examples you can download and play with
CAM Toolpath Strategies: Where plunge roughing, trochoidal machining, and other
odd beasts are explained.
3D CAM Toolpaths: Learn the ins and outs of which 3D toolpaths to use in which
Rhino Tips: Some of my tips and techniques for being productive with Rhino 3D.

4 5

PDF created with pdfFactory Pro trial version

08/12/2015 03:59

CNC G-Code Programming Tutorial, Course, Examples, and Programs

Download G-Wizard G-Code Editor to Help You

Master G-Code -- Free for 30 Days

100% Privacy. I will never spam you!

Do you want to be a better CNC'er?

Get Better Tool Life, Surface Finish, and Material Removal Rates.

Start Now, It's Free!




Feeds and


Beginners Start

Feeds and


G-Code Tutorial DIY CNC

Privacy Policy

GW Calculator
GW Editor
Conversational CNC
Deals and Steals

CNC Machining
& Manufacturing

CNC Projects
Hall of Fame

Cost Estimating
CNC Dictionary

All material

5 5

PDF created with pdfFactory Pro trial version

08/12/2015 03:59