Sie sind auf Seite 1von 6

CNC CODE FORMAT IN ISO / EIA / WORD-ADDRESS FORMAT

A profile cutting application will typically require 4 basic


motion codes viz. rapid motion along a line in idle mode - G00,
cutting motion along a line - G01, cutting motion along a
clockwise arc - G02 and cutting motion along an anticlockwise
arc - G03.

These 4 codes are fairly universal, though some controllers


represent them as G0, G1, G2 and G3 respectively, without using
the middle "0". Also, some controllers refer to the letter "R"
at the end of "G01" code to denote rapid motion, instead of
supporting a separate "G00" code. Some controllers follow
another different style, using codes like G11/G12/G13 (relative
mode, described below) or G21/G22/G23 (absolute mode, described
below) or G31/G32/G33 (absolute mode with decimal shift,
described below) for line/arc motions, with letter "R" denoting
rapid motion. Still, by and large, most controllers use G00-G03
codes for line/arc movements.

For all the above mentioned codes, the user must specify the X
and Y coordinates of the endpoint, where the cutter is supposed
to go at the end of this motion. In case of G00/G01, X & Y refer
to the endpoint of the line. In case of G02/G03, X & Y refer to
the endpoint of the arc. In case of an arc, one must also
specify I & J values, to denote the coordinates of the centre of
the arc.
Note, there is no need to specify the start point of the line /
arc in the motion codes. The end point of the previous line /
arc becomes the start point of the next line / arc and hence,
the controller already knows the start point of the line / arc.
For the very first cutter movement, the neutral position (also
called home position) of the cutter becomes the start point. In
general, the cutting machine operator brings the cutter at a
specific location (usually, one of the four corners of a
rectangular stock) before starting any cutting operation and
this point is called the neutral position.

The coordinates are written either in mm or inch and this is


indicated at the start of the program. Generally, G71 (or, G21

Page 1 of 6
in some cases) indicates coordinates in mm and G70 (or, G20 in
some cases) indicates coordinates in inch. Some controllers may
not offer this flexibility and may always require the codes in
specific units only. Normally, the default unit is mm.

Some controllers follow strict specifications regarding the


number of digits to be specified after the decimal point while
writing X/Y/I/J values. Normally, 1-2 digits after the decimal
point are found acceptable to most controllers.

The above-mentioned coordinates can be specified in one of the


two modes viz. relative (incremental) or absolute. In relative
mode, all the coordinates are written with respect the start
point of the current entity. In absolute mode, all the
coordinates are written with respect to fixed origin i.e. (0,0).
This classification is found universally in all controllers
while specifying X & Y values. It is also true for I & J values
in relative mode. However, in absolute mode, some controllers
interpret I/J as absolute values whereas some other controllers
interpret I/J as relative values. The codes for relative and
absolute mode are G91 and G90 respectively, for most
controllers. These codes are written at the top of the program
and usually, the programming mode is not altered later on. The
default mode is usually relative.

It is not always necessary to write all X/Y/I/J values for each


line/arc motion. In relative mode, one may skip that value which
is equal to zero. In absolute mode, one may skip that value
which does not change. For instance, while writing a horizontal
line, one need not specify the Y value in relative as well as
absolute mode. While specifying a full circle in relative mode,
only I & J values are required. (In fact, one may also omit I/J
value, if the X/Y coordinate of the centre of the circle is same
as that of the start point.) While the rules for skipping
X/Y/I/J values are same for almost all controllers, rules for
skipping may differ in absolute mode, for certain controllers.
(In absolute mode, some controllers allow skipping if the value
remains same, whereas some others allow skipping if the value is
zero.)

Page 2 of 6
The codes may be specified in certain controllers insist on
inserting the "+" sign in front of all the positive values of
X/Y/I/J fields. However, in general, one may omit the "+" sign
while writing non-negative X/Y/I/J values for most controllers.

Many controllers allow the use of decimal shift or fixed format


facility. Here, all the X/Y/I/J values are multiplied by 10 and
there is no decimal point (".") to be found in the entire code.
The code for indicating decimal shift differs across controllers.

In general, G00-G03 codes are modal i.e. you have to specify


them only when the type of motion changes. For example, for
specifying a rectangle using four straight lines, it is
sufficient to specify G01 code in the first statement only. For
the next 3 statements, one may specify the X/Y values only,
without writing the G01 code.

Each cutting machine has a transverse axis and a rail axis. The
rail axis is usually bigger, offering longer cutting length as
compared to the transverse axis. It is necessary to know how +X
and +Y axes are located along the transverse and rail axes,
before loading a cnc code file on the cutting machine, because
the X-Y axes assumed by the cnc code file may not match with the
machine X-Y axes. If there is a mismatch, the codes in the cnc
file may have to be rotated by either 90, 180 or 270 degrees at
the time of cnc code generation itself. Most cad/cam post
processors allow the axes rotation facility at the time of cnc
code generation.

Before starting a cutting operation, the operator has to set the


neutral position of the cutter manually to one of the 4 corners
of the stock. Closer the neutral position to him, the better. It
is necessary that the cnc program generated by the cad/cam
software uses this neutral point as the origin i.e. (0,0). Most
cad/cam software support options for setting the default neutral
position as well as editing the coordinates of the neutral
position anytime before generating cnc codes. However, the
location of the neutral position changes if the codes are roated
by 90/180/270 degrees for X-Y axis alignment, as discussed
above. In other words, the default angle of X-Y axes as well as

Page 3 of 6
default neutral position are related and must be defined
carefully.

This is usually a one-time activity for each cutting machine.


(However, while cutting offcuts, it may be necessary to define
neutral position manually at a non-standard location and the
operator may have to be informed about its location, before
cutting an offcut stock.)

The above description is related to the movement of the cutter


along a 2-D profile. However, in a cnc code file, one may also
come across additional codes, as explained below.

Most controllers support built-in facility for offsetting a 2-D


profile. These controllers can receive the actual profile
dimensions from the cnc code file, offset the same by cutter
radius and automatically generate the path to be traced by the
centre of the cutter. In such cases, the cnc code file must
specify the cutter compensation direction i.e. whether the
cutter is located on the left side of the profile or on the
right side. Generally, the direction of tool compensation is
specified at the beginning of a cutting cycle and is not altered
until the end of that cutting cycle is reached. In general, the
left/right compensation direction may be different for different
cutting cycles. (Note, the kerf value i.e. the cutter diameter
is usually entered by the operator on the cnc control panel at
the start of the cutting process and hence, need not be
specified for each profile.) Normally, the cutter compensation
is kept off during the non-cutting phase and the code for that
is G40. The code for left compensation is G41 and that for right
compensation is G42. These codes are fairly universal, except
for some controllers where M69/M67/M68 are used for indicating
zero, left and right kerf compensations. (Note, certain
controllers do not have the built-in offset facility and in such
cases, the cad/cam software must calculate and write the path
traced by the centre of the cutting tool in the cnc code file.
Though it is not recommended, it becomes a necessity for certain
controllers.)

Page 4 of 6
In most 2-D cutting applications, one must specify torch on /
off commands in the cnc file at the beginning / end of a cutting
cycle, using the relevant M-codes. These codes differ vastly
across different controllers and they can be found only from the
relevant controller manuals.

Some controllers require dwell to be specified at the beginning


of a cutting cycle. Usually, the dwell is specified using G04
code. The dwell time may either be programmed by the operator on
the control panel or within the cnc code file, as required.

Some controllers require feed (cutting speed) to be specified in


the cnc code file. This is usually done at the start of the
program. Howver, some controllers may also require feed value
for every line/arc to be cut. Normally, feed is specified using
F-code and is written in mm per minute.

Some controllers require toolsize (kerf value i.e. flame


diameter) at the beginning or the end of the cnc code file. The
toolsize is usually specified using T-code, in mm.

Most controllers support comment lines within cnc code file,


which are ignored by the controller. Some controllers allow
comments to be written within round brackets "()", whereas
others treat the entire statement following characters ";" or
"#" as a comment line.

Many controllers support line numbers which appear at the start


of a new statement in a cnc code file. The line numbers usually
start with character N. Some controllers follow strict
specification regarding the length of the line number, though 4
digits after N are usually acceptable to most controllers.

Most controllers can handle and ignore white spaces (space & tab
characters) within a cnc code file. Some controllers follow
strict specification regarding the white spaces, which can be
found from the relevant controller manual.

In general, each controller requires a specific set of


statements at the beginning and at the end of a cnc code file.

Page 5 of 6
Normally, a cnc code file begins with % sign. The code M02 or
M30 is used to denote the end of the program, usually followed
by a % sign in the last line. However, that is not mandatory for
all controllers.

Some controllers require program name to be written at the top


of the cnc code file. Some controllers follow strict
specification regarding the format/composition of program name.
Wherever required, program name is written immediately after the
% symbol at the top of the cnc file and is usually restricted to
maximum 8 characters.

Some controllers require the name of the cnc code file in a


specific format, with specified extension, like CNC or NC. This
can be found from the relevant controller manual.

Finally, the sequence in which the above codes appear in a cnc


code file differs across controllers as well as across users.
This is usually true at the start/end of a cutting cycle as well
as start/end of the entire program. Study of the sample cnc code
files sent by the user usually reveal the programming style that
would be found acceptable at the customer's end.

Page 6 of 6

Das könnte Ihnen auch gefallen