You are on page 1of 16

More

All Make: Tested Tool Maker 


Latest Membership Shop
Stories Projects Guides
Login | Signup Spotlights

Learn Portfolios Events

Get to Know Your CNC: How to Read


G-Code

a
25
d f0
y
0
h
560
#
G-code is the generic name for a plain-text language that CNC machines can
understand.

Using a modern-day desktop CNC machine and software, you’ll never have to enter G-
code manually, unless you want to. The CAD/CAM software and the machine
controller will take care of all of this for you. However, some people (especially
makers!) like to know what’s under the hood and how
More
things really work.

A G-code le is plain text; it’s not exactly human readable,


but it’s pretty easy to look through the le and gure out
what’s going
Allon. G-codes tell the
Make: controller what sort of
Tested Tool Maker 
motion isStories
desired. Here areProjects
the most common commands Guides Spotlights

and how they work.

G0/G1 (Rapid/Controlled Motion)

This tutorial is excerpted from


Make: Getting Started with
CNC, which provides a basic
overview of how to use
affordable, hobbyist-level
computer-controlled routers.
Available at Maker Shed and
ne bookstores.

The G0 command moves the machine at


More on CNC
maximum travel speed to whatever
coordinates follow G0 (Figure A). The Can a Hanging Plotter Work as
a CNC Mill?
machine will move in a coordinated
fashion, and both axes complete their How to Use Autodesk Fusion
More 360 for CNC Milling
travel at the same time. G0 is not used for
cutting. Instead, it’s used to move the 7 CNC Fixturing Tips for a
Small Shop
machine quickly to begin a job or move to
another operation within the same job. 
All Make: Tested Tool Maker
Here’s anStories
example of a rapid (G0) command:
Projects Guides Spotlights
G0 X7 Y18

A G1 command (Figure B) is similar but tells the machine to move at a speci ed rate
called the feed rate (F):
G1 X7 Y18 F500

G2 (Clockwise Motion)
More

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

Setting the mode to G2 and specifying the offset from center (Figures C and D)
creates clockwise motion between the starting point and the speci ed ending points.
G21 G90 G17
G0 X0 Y12
G2 X12 Y0 I0 J-12

The G2 starting point is where the machine is located prior to issuing the G2
command.
 It’s easiest if you move your machine to the starting point before trying to
issue the G2 command.

G3 (Counterclockwise Motion)
More

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

Just like G2, the G3 command creates an arc between two points. Whereas G2
speci es clockwise motion, G3 speci es counterclockwise motion between the points
(Figure E). A valid set of commands to produce G3 motion is shown here:
G21 G90 G17
G0 X-5 Y25
G3 X-25 Y5 I0 J-20

G17/G18/G19 (Working Planes)


These modes set the plane to be machined. Typically G17 is used and is the default
for most hobby machines, but two other planes can be used in a three-axis machine:
• G17 = x/y plane
• G18 = z/x plane
• G19 = y/z plane

G20/21 (Inches or Millimeters)


The G21 and G20 commands determine the G-code units, either inches or millimeters:
• G21 = millimeters
• G20 = inches
Here’s an example that’s set to millimeters:
G21 G17 G90

G28 (Referencing Home)


A simple G28 command sends the machine to its home position. Adding coordinates
More
will de ne an intermediate point to go to, before homing (to avoid collisions), like this:
G28 Z0
Some machines require a G28.1 command to de ne the home position coordinates:
G28.1 X0 Y0 Z0 
All Make: Tested Tool Maker
Stories Projects Guides Spotlights
G90 (Absolute Mode)
G90 causes units to be interpreted as absolute coordinates. This is the most common
mode for hobby-grade CNC machines; it’s the “default” mode.
Absolute coordinates will be interpreted as exactly that — absolute. G0 X10 will send
the machine to x = 10. It will not send the x-axis to “10 more” units from where it’s
currently located.

G91 (Incremental Mode)


The opposite mode of G90. Setting incremental mode means that every command
issued will move your machine the speci ed number of units from its current point.

For example, in incremental mode, G1 X1 will advance the machine 1 unit in the x
direction, regardless of its current location.

G-Code Rules
Just like a math equation, G-code has its own rules about the order of operations.
Here are the most common, in order of precedence (that is, comments will be
interpreted rst and the change tool will be interpreted last):

Comments
Feed rate
Spindle speed
Select tool
Change tool

When you issue a G command, you are putting the machine into that mode. If you
issue a G1 command, such as G1 X5 Y13, then the machine moves to X5 Y13.

If you issue another set of coordinates, you do not need to issue another G1
command. Why? Because the machine is in G1 mode until you change it to something
else like G0 or G2 or G3.

Feeds, Speeds, and Tools


Simple G-code commands are used for setting the speed, feed, and tool parameters.

“F” Is for “Feed”


The F command sets the feed rate; the machine operates at the set feed rate when G1
More
is used, and subsequent G1 commands will execute at the set F value.

If the feed rate (F) is not set once before the rst G1 call, either an error will occur or
the machine will operate at its “default” feed rate. An example of a valid F command:
G1 F1500 X100
All Y100 Make: Tested Tool Maker 
Stories Projects Guides Spotlights
“S” Is for “Spindle Speed”
The S command sets the spindle speed, typically in revolutions per minute (RPM). An
example of a valid S command:
S10000

“T” Is for “Tool”


The T command is used in conjunction with M6 (M-codes are machine action codes)
to specify the tool number to be used for cutting the current le:
M6 T1
On industrial machines, an M6 T command usually produces a tool change with an
automatic tool changer. On hobby machines with no tool changer available, issuing a
new M6 T command will generally cause the machine to issue itself a feed-hold
command, wait for the operator to change the tool, and then continue the job after the
“resume” button is pressed.

SPONSORED CONTENT

How to pay off your house


ASAP (It's so simple)
BY LENDING TREE

ADVERTISEMENT

1 Regulatory Compliance - Download the Free White Paper


Comply with weighing regulations in pharmaceutical manufacturing. mt.com/Regulatory/Compliance

2 Download Manual - Free


Download Free Manuals With AtoZManuals free.atozmanuals.com

By Edward Ford
October 24, 2016, 5:30 am PDT
More

ADVERTISEMENT

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

RELATED TOPICS

CNC CODE DIGITAL FABRICATION MAKE54 SKILL BUILDERS

ADVERTISEMENT

Let's Stay in Touch!

Enter your Email Sign Up

Discover Newsletters 

ADVERTISEMENT
More

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

This Massive Utility Knife Is A


Masterpiece Of Woodworking
More

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

a d f 0
y0
h0
#

Paul Jackman got his hands on a comically oversized utility knife blade made by
Jimmy Diresta. Many of us would probably joke about building an equally oversized
utility knife to match, but few would actually follow through, and fewer still would
match the craftsmanship that Paul displayed on this project.

Watch closely and you’ll see that this isn’t just a visual gag. Paul has made it fully
functional with a retracting mechanism identical to the normal sized ones you’d nd
in any shop.
More

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

Not only that, but every piece on this is made of wood, including the big bolt that
holds it together.

You can read more about Paul’s process on his blog.

By Caleb Kraft
 @calebkraft

1 hour ago

RELATED TOPICS

WOODWORKING

ADVERTISEMENT

ADVERTISEMENT

Furniture, Art, and Beer: Makers in


Grand Rapids, Michigan
More

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

a d f 0
y0
h0
#
As the excitement grows for the 5th annual Grand Rapids Mini Maker Faire this
weekend, we re ect on how this city began, how it has grown, and how historical and
contemporary Makers alike inspire the city, its residents and people across the world.

Makers of all kinds populate the growing metropolis of Grand Rapids, Michigan. From
the historical furniture industry and to the recent craft-brewing movement to the
most-attended public art event in the world, this city has always been a place for
Makers to thrive.

Known as Furniture City, Grand Rapids ranks among the top in leaders of the furniture
industry. Home to Steelcase, Herman Miller and other world-wide furniture brands,
Grand Rapids houses endless furniture maker connoisseurs.
More

All Make: Tested Tool Maker 


Stories Projects Guides Spotlights

These are individuals who are passionate about creating top-quality products, and
they’ve spread their wisdom and desire to make throughout the community. They’ve
raised their children and inspired their neighbors with the principles of creativity and
innovation.

The talents of the Grand Rapids’ youth will appear at the Maker Faire in mid-August
with the fantastic abundance of resolute and tenacious Robotics teams that
exempli es how the upcoming generation has been inspired by the Maker-roots of
their city.

Besides furniture, Grand Rapids is also known world-wide as the home to ArtPrize, an
international art competition held annually since 2009. For over two weeks each fall,
public and private spaces alike are transformed as over 400,000 people parade the
streets, appreciating the works of over 1,000 artists.
More
Grand Rapidians highly value art as a medium through which one can express their
creativity and make a statement. Living in a community with such values is
encouraging to local Makers, as they have observed and taken part in this annual
event, learning
All from andMake:
teaching other artists who make extravagant
Tested Tool worksMaker
of art. 
Stories Projects Guides Spotlights
Many submissions to ArtPrize are pioneering and avant-garde, such as the 2010
winner “Steam Pig”, which the artist described as “provocative.” With large public
support and appreciation of such pieces, GR Makers are encouraged and inspired to
make similarly large statements.

One profound and impressive work that’s expected at this year’s GR Maker Faire is the
“Challenger Deep”, created by Maker Gary Sluis. The “Challenger Deep” is a home
built, one person submarine. Weighing 3,800 lbs, this submarine can dive to depths of
100 feet. Inspired by the undersea explorer Jacques Cousteau, Sluis was fearless in
his creation of the unfathomable.

The valiant, daring spirit that Sluis exhibits can be seen throughout the Makers at our
5th annual Faire. From chefs pushing the boundaries of the traditional, to brewers
pursuing their passion, this year’s Maker Faire is expected to parallel the dedication
and craftsmanship of Grand Rapids’ traditional furniture industry as well as the
entrepreneurship and creative spark of the worldly ArtPrize event.
Another form of Maker has taken Grand Rapids by storm. Dubbed Beer City, USA,
More
Grand Rapids has become more than well-known for its beer, with over 60 different
craft breweries in the city. Serving as another inspiration for local Makers, the
precision, attention to detail, and subtleties of this industry transfers over to this
year’s Maker Faire. 
All Make: Tested Tool Maker
Stories Projects Guides Spotlights

Breweries small and large thrive in Grand Rapids. Ranked 3rd best brewery in the
world, Founders Brewing Co has been around for just over two decades. Still relatively
new to Grand Rapids, the brewing industry continues to grow. New breweries keep
popping up around town, such as TwoGuys Brewing, which opened this past March
and will showcase their products at the GR Mini Maker Faire. The fact that new
breweries continue to appear demonstrates how the encouraging atmosphere of this
city, inspiring Makers to become o cial.
The attendees of this year’s Faire can also expect a demonstration of the beer
More
brewing process put on by Rivertown Homebrewers, another local brewing company.
The eagerness of craft-brewers to inspire and teach others is infectious.

Grand Rapids is unique; rooted in both the traditional and the contemporary, with
creative and
Allexperimental branches,
Make: Tested the city is growing upward. Rich with diverse
Tool Maker 
interests Stories
and passions, theProjects Guides
5th annual Mini Maker Faire is representative Spotlights
of the many
types of Makers that call Grand Rapids home.

Full with food and beer, inspired by Makers of all kinds, you’ll hopefully leave this
year’s Grand Rapids Mini Maker Faire with some more knowledge, a new passion, and
a similar drive for success as the city’s founders and residents who have helped
create the wonderful city we know today.

By Christie Bender

4 hours ago

RELATED TOPICS

MAKER FAIRE

ADVERTISEMENT

ADVERTISEMENT

You might also like