0% found this document useful (0 votes)
8 views5 pages

G and M Code List

The document provides a comprehensive overview of various G-code commands used in CNC machining, detailing their options, descriptions, and examples of use. It covers commands for movement, drilling cycles, tool compensation, and program control. Each command is explained with its syntax and practical application, making it a useful reference for users of the Digital Dream Standalone Motion Controller.

Uploaded by

alokpathak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

G and M Code List

The document provides a comprehensive overview of various G-code commands used in CNC machining, detailing their options, descriptions, and examples of use. It covers commands for movement, drilling cycles, tool compensation, and program control. Each command is explained with its syntax and practical application, making it a useful reference for users of the Digital Dream Standalone Motion Controller.

Uploaded by

alokpathak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Command Options Description Example of use Description of

the example

Moves the axes to the point X Y Z A, at the speed Quickly moves the axes to
G0, G00 XYZA G0 X10 Y10 Z1
specified in # 80 the point X10 Y10 Z1

Moves the axes in line to the point X Y Z A, at the


Moves the axes to the point
G1, G01 XYZA speed specified in F. If F is not specified, the speed G0 X10 Y10 Z1 F100
X10 Y10 Z1 at a speed of 100
from parameter # 76 is used.
Moving along the arc, clockwise, specified the G0 X0.00 Y-50.00
center, at the speed specified in F. I, J, K are the -----------------------
coordinates of the arc center (x, y, z), relative to the - - - - - Draws half the circle, D = 100,
G2, G02 end point (for G91.1) or in absolute coordinates
XYZIJK G2 X100.00 Y-50.00 from 0 to 180 degrees,
G90.1), K can be omitted. X, Y is the end point of the I50.00 J0 F100 clockwise, at a speed of 100
(mode1) arc. Z - for plunging into a spiral (end infeed). The
starting point of the arc is given by the preliminary
movement of the axes into it.
Moving along the arc, counterclockwise, specified
the center, at the speed specified in F. I, J, K are the
coordinates of the arc center (x, y, z), relative to the G0 X100.00 Y-50.00 Draws half the circle, D = 100,
G3, G03 end point (for G91.1) or in absolute coordinates ----------------------- 180 to 0 degrees, count count-
XYZIJK
G90.1), K can be omitted. Z - for plunging into a G3 X0.00 Y-50.00 er-clockwise, at a speed of
(mode1) spiral (end infeed). The starting point of the arc is I-50.00 J0 F100 100
given by the preliminary movement of the axes into
it.
Moving along an arc, clockwise, specified the radius,
at the speed specified in F. R is the radius of the arc. G0 X0.00 Y-50.00
Draws half the circle, D = 100,
G2, G02 X, Y is the end point of the arc. Z - for plunging into -----------------------
XYZR from 0 to 180 degrees,
a spiral (end infeed). The starting point of the arc is G2 X100.00 Y-50.00
clockwise, at a speed of 100
(mode2) given by the preliminary movement of the axes into R50 F100
it.

G0 X100.00 Y-50.00 Draws half the circle, D = 100,


G3, G03 ----------------------- 180 to 0 degrees, count-
XYZR
G3 X0.00 Y-50.00 R50 er-clockwise, at a speed of
(mode2) F100 100

Stops processing for the number of milliseconds


G4, G04 P Stops processing for 10
specified after P. In this case, the machine does not G4 P10000
seconds
stop the spindle and does not pick up the tool

G17 Selecting the working plane X-Y G17 Select the working plane X-Y

G18 Selection of working plane Z-X G18 Select of working plane Z-X

G19 Selection of working plane Y-Z G19 Select of working plane Y-Z

G20 Inch system selection G20 Inch system selection

G21 Choice of metric system G21 Metric system selection

Digital Dream Standalone Motion Controller Page-132 DDCS-Expert Users Manual


Command Options Description Example of use Description of
the example
Go back to the reference point. Works only with The X axis will first move
G91. The specified axes, first move to the specified 10mm to the right, then the
point, then to the machine 0. If 0 is specified, then XYZ axes will go to the
G28 XYZA G91 G28 X10 Y0 Z0
immediately into the machine zero. The not machine axis 0. Axis A does
specified axes do not move. not move.

Cancel tool radius compensation. The function Cancel tool radius compen-
G40 NO G40
does not work yet. sation.

Compensate the tool radius to the left of the path. Compensates the tool
G41 D D - is the tool number from the table. G40 radius 1, to the left of the
path.
Compensate tool length positively. H - the number
Compensates the length of
G42 D of the instrument according to the table. The G42 D1
tool 1 positively.
function does not work yet.
Compensate tool length positively. H - the number
G43 H Compensates the length of
of the instrument according to the table. G43 H1
tool 1 positively.

Compensate for the length of the instrument is


negative. H - the number of the instrument G44 H1 Compensates the length of
G44 H
according to the table. tool 1 negatively.

G49 Cancel tool length compensation. Cancel tool length compen-


H G49
sation

Compensates the length of


G53 H malfunctioning, working analog G153 G44 H1
tool 1 negatively.

Selecting a coordinate
G54 - G59 XYZA Selecting the coordinate system G54
system

The cycle of step drilling with the full output of the


Drills the hole at point X10
drill, with the speed F. X, Y - the coordinates of the
Y5, from 0 to 7mm, at a
center; Z - is the distance from R to the bottom of
speed of 300 mm / min. The
G73 XYZRQIK the hole; R - drilling depth (usually, 0); Q - is the G83 X10 Y5 Z-7 R0
step size is 1.4mm, thus 5
step size; I - distance of failure to return to G0; K - Q1,4 I0 K1 F300
steps are done. After each
is the number of repetitions. The drill is retracted
step, the drill is retracted by
and fed at a speed of G0, which can be limited by
1mm.
parameters # 78 and # 79.

Drilling in 1 pass, with speed F. X, Y - coordinates


Drills the hole at point X10
G81 XYZRK of the center; Z is the distance from R to the G81 X10 Y5 Z-7 R0 K1
Y5, from 0 to 7mm, at a
bottom of the hole; R - drilling depth; K is the F300
speed of 300 mm / min.
number of repetitions.

Drilling in 1 pass with a delay at the end (for better Drills the hole at point X10
processing of the bottom), with speed F. X, Y - Y5, from 0 to 7mm, at a
G82 XYZRKP coordinates of the center; Z - is the distance from G82 X10 Y5 Z-7 R0 K1 speed of 300 mm / min. At
R to the bottom of the hole; R - drilling depth; K - P2000 F300 the bottom of the drilling,
is the number of repetitions, P - is the delay in the pause is 2 seconds.
milliseconds.
Drills the hole at point X10
The cycle of step drilling with the full output of the Y5, from 0 to 7mm, at a
drill, with the speed F. X, Y - the coordinates of the speed of 300 mm / min. The
center; Z - is the distance from R to the bottom of step size is 1.4mm, thus 5
G83 XYZRQIK the hole; R - drilling depth (usually, 0); Q - is the G83 X10 Y5 Z-7 R0
steps are done. Failure = 0,
step size; I - distance of failure to return to G0; K - Q1,4 I0 K1 F300 in this way the drill is
is the number of repetitions. The drill is retracted returned on fast feed to the
and fed at a speed of G0, which can be limited by end point of the previous
parameters # 78 and # 79. step.G80

Digital Dream Standalone Motion Controller Page-133 DDCS-Expert Users Manual


Example Description of
Command Options Description of use the example
M03
M8
Tapping of right hand threads to be done with M3
G74 XYZRM (Speed & Feedrate)
spindle rotation.
S400 we want to tap a 1/4-20
F20
( Tapping ) Here’s the code to do that
Z1.0 with G84 G Code.
Tapping of right hand threads to be done with M3
G84 XYZRM G00 X0.0 Y0.0
spindle rotation.
G01 M29
G84 Z-0.5 R0.2

For G0/G1:Specifying absolute coordinates; For G90 G1 X10 Y0


G90 No G2/G3:The main coordinates are absolute and the
G90 G2 X20 I5
centers of the arcs are relative.

For G0/G1:Specifying relative coordinates; For G90 G1 X10 Y0


G91 No G2/G3:The main coordinates are relative and the
G91 G2 X10 I5
centers of the arcs are relative.
G2 X-10 I-5

For G0/G1:Specifying absolute coordinates; For G90 G1 X10 Y0


G90.1 No G2/G3:The main coordinates are absolute and the
G90.1 G2 X20 I15
centers of the arcs are absolute.
G2 X10 I15

For G0/G1:Specifying relative coordinates; For G90 G1 X10 Y0


G91.1 No G2/G3:The main coordinates are relative and the
G90.1 G2 X20 I15
centers of the arcs are absolute.
G2 X10 I15

G92 XYZA Setting new current coordinates G90G92X0Y0Z0A0 Zero all axes

G98
-------
After drilling cycles, the tool returns to the Z G1 Z1 F1000 After drilling, the tool will
G98 position, before the start of the cycle. Raises the Z be in position 1 to Z
No -------
axis to a safe height.. G81 X0 Y0 Z-7 R0
K1 F300
G99
After the drilling cycles, the tool returns to the -------
G99 No G1 Z1 F1000 After drilling, the tool will
point R (along the Z axis). Raises the Z axis to a
------- be in position 0 to Z
safe height.
G81 X0 Y0 Z-7 R0
K1 F300

Digital Dream Standalone Motion Controller Page-134 DDCS-Expert Users Manual


Description of
Command Options Description Example of use the example
Stops the program, before
Stopping the program, before pressing the pressing the "START"
M0, M00 No "START" button, is completely the same as M0 button. Raises the Z axis
pressing the "PAUSE" button. and sets the spindle, if it is
set in the settings.
Stops the machine unless
M01 No Optional Stop: Operator Selected to Enable M01 there is further interaction
from the User.
Starts the spindle at a speed
M3, M03 S Start spindle rotation with speed S M3 S2000
of 2000 rpm

Starts the spindle at a speed


M4, M04 S Start spindle rotation with speed S in CCW direction M4 S2000
of 2000 rpm in CCW

M5, M05 Stop the spindle M5 Stops the spindle

Plays the contents of the T.nc. file Specifies the


M6, M06 T tool number for offsets. T specifies the number of M6 T5 Replaces the tool with T5
the tool (it can be omitted).

M8, M08 No Switch on spindle cooling M8 Switch on spindle cooling

M9, M09 No Switch off spindle cooling M9 Switch off spindle cooling

M10 No Turn on the coolant pump Turn on the coolant pump

M11 No Turn off the coolant pump M11 Turn off the coolant pump

It stops the program, before


M30 No End of the program, cancels all commands and pressing the "START"
M110
loops. Do not use immediately after M6. button. Peep 3 times with
built-in peepal
M47 No Repeat program from first line. M47 Restart Program Execution
M50 / M51 Output 01 Open / Close Control the Output 01
M52 / M53 Output 02 Open / Close Control the Output 02
M54 / M55 Output 03 Open / Close Control the Output 03
M56 / M57 Output 04 Open / Close Control the Output 04
M58 / M59 Output 05 Open / Close Control the Output 05
M60 / M61 Output 06 Open / Close Control the Output 06
M62 / M63 Output 07 Open / Close Control the Output 07
M64 / M65 Output 08 Open / Close Control the Output 08
M66 / M67 Output 09 Open / Close Control the Output 09
M68 / M69 Output 10 Open / Close Control the Output 10
M70 / M71 Output 11 Open / Close Control the Output 11
M72 / M73 Output 12 Open / Close Control the Output 12
M744 / M75 Output 13 Open / Close Control the Output 13
M76 / M77 Output 14 Open / Close Control the Output 14
M78 / M79 Output 15 Open / Close Control the Output 15
M80 / M81 Output 16 Open / Close Control the Output 16
M82 / M83 Output 17 Open / Close Control the Output 17
M84 / M85 Output 18 Open / Close Control the Output 18
M86 / M87 Output 19 Open / Close Control the Output 19
M88 / M89 Output 20 Open / Close Control the Output 20
M90 / M91 Output 21 Open / Close Control the Output 21

Digital Dream Standalone Motion Controller Page-135 DDCS-Expert Users Manual


Example Description of
Command Options Description of use the example
Call a Subprogram with the reference to the
separate program created and loaded on the M98 Pxxxx Ln xxxx is the line number, nn is
M98
controller. the number of repetitions

O01234

...

(Part program)
...

M98 P111 (Jumps to This M-code is used to end


program O00111 to run) the sub-program. If M99 is
used in the main program,
… it will cause the program to
M99 End Sub-Program or Return or Loop
(The M99 at the end of loop back to the beginning
the sub-program will and repeat over and over
jump back here) again without stopping.

...

(Finish part)

M30 (End of main


program)

Sets the speed of the working feed, for many


commands. You can write, as at the end of the line F100
F No Application with the command, and a separate line. If F is not ---------------- Moves the X axis to, at point
10.5, at a speed of 100.
specified anywhere, the speed from parameter # G1X10.5
76 is used.
Specifies the pause time, in milliseconds, for the G4 P2000
P No Application and G82 commands. You can write, as at the end of ---------------- Pauses the program for 2
seconds
the line with the command, and a separate line. G4
Specifies the spindle speed for the M3 command. S21000
S No Application You can write, as at the end of the line with the Starts the spindle at a speed
----------------
of 21000 rpm
command, and a separate line. M3
Moves the X axis on fast
No Application The symbol for dividing the whole and fractional G0 X10.5
feed, to the point 10.5.
parts of numbers. Comma - does not work. Option G0 X10.5 - will not
work.
SIN [n] The sine of the parameter n, in degrees. #1=SIN[30.0]

COS [n] The cosine of the parameter n, in degrees. #1=COS[60.0]

TAN [n] The tangent of the parameter n, in degrees. #1=TAN[45.0]

SQRT [n] The square root of the parameter n. #1=SQRT[2.0]


returns the angle between the ray to the point
ATAN [n1,n2] (n1,n2) and the positive x-axis, confined to (-180, #1=ATAN[30,10]
180].

ABS [n] returns the absolute value of that parameter n. #1=ABS[-30.1]

Digital Dream Standalone Motion Controller Page-136 DDCS-Expert Users Manual

You might also like