Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

THAI NGUYEN UNIVERSITY OF TECHNOLOGY

FACULTY OF INTERNATIONAL TRAINING

REPORT
USE INVENTOR TO OUTPUT G CODE FOR CNC
MILLLING

LECTURER : LE VAN NHAT


STUDENTS : HOANG MAI TRUNG

THAI NGUYEN,2020
I. INTRODUCE ABOUT G CODE?

1. Define
G-code (also RS-274), which has many variants, is the common name for the
most widely used computer numerical control (CNC) programming language. It is
used mainly in computer-aided manufacturing to control automated machine tools.
G-code is a language in which people tell computerized machine tools how to
make something. The "how" is defined by G-code instructions provided to a
machine controller (industrial computer) that tells the motors where to move, how
fast to move, and what path to follow. The two most common situations are that,
within a machine tool such as a lathe or mill, a cutting tool is moved according to
these instructions through a toolpath cutting away material to leave only the
finished workpiece and/or, an unfinished workpiece is precisely positioned in any
of up to nine axes[1] around the three dimensions relative to a toolpath and, either or
both can move relative to each other. The same concept also extends to noncutting
tools such as forming or burnishing tools, photoplotting, additive methods such
as 3D printing, and measuring instruments.
2. FUNCTION
G-codes, also called preparatory codes, are any word in a CNC program that
begins with the letter G. Generally it is a code telling the machine tool what type of
action to perform, such as:

 Rapid movement (transport the tool as quickly as possible in between cuts)


 Controlled feed in a straight line or arc
 Series of controlled feed movements that would result in a hole being bored,
a workpiece cut (routed) to a specific dimension, or a profile (contour) shape
added to the edge of a workpiece
 Set tool information such as offset
 Switch coordinate systems
There are other codes; the type codes can be thought of like registers in a
computer.
It has been pointed out over the years that the term "G-code" is imprecise
because "G" is only one of many letter addresses in the complete language. It
comes from the literal sense of the term, referring to one letter address and to the
specific codes that can be formed with it (for example, G00, G01, G28), but every
letter of the English alphabet is used somewhere in the language. Nevertheless, "G-
code" is metonymically established as the common name of the language.
II. SPECIFIC CODE
1.Letter addresses

Address Description

O program number

/ optional block

N block number

G preparatory function

X, Y, Z, U, V ,W length coordinates

A, B, C, H angular coordinates, auxiliary functions

R circle radius, auxiliary data

I, J, K circle center coordinates, auxiliary


coordinate

E auxiliary coordinate

F feed rate

S spindle speed

M miscellaneous function

T tool number

L repetition number

P auxiliary data, dwell time

Q auxiliary data

,C distance of chamfer

,R radius of fillet
,A angle of straight line

2. List of G-Code
Code Description code descrition
G00 Rapid positioning G50 Scaling function cancel
G01 Linear interpolation
G02 Circular interpolation, clockwise G52 Local coordinate system (LCS)

G03 Circular interpolation, G53 Machine coordinate system


counterclockwise

G04 Dwell G54 to G59 Work coordinate systems


(WCSs)

G05 P10000 High-precision contour control G54.1 P1 to P48 Extended work coordinate


(HPCC) systems

G05.1 Q1.
AI Advanced Preview Control G61 Exact stop check, modal

G06.1 Non-uniform rational B- G62 Automatic corner override


spline (NURBS) Machining

G07 Imaginary axis designation G64 Default cutting mode (cancel


exact stop check mode)

G09 Exact stop check, non-modal G68 Rotate coordinate system

G10 Programmable data input G69 Turn off coordinate system


rotation

G11 Data write cancel G92 Position register (programming


of vector from part zero to tool
tip)

G17 XY plane selection G94 Feedrate per minute

G18 ZX plane selection G95


Feedrate per revolution

G19 YZ plane selection G97 Constant spindle speed

G20 Programming in inches G73 Peck drilling cycle for milling –


high-speed (NO full retraction
from pecks)

G21 Programming G98 Return to initial Z level in canned


in millimeters (mm) cycle

G28 Return to home position G74 Tapping cycle for


(machine zero, aka machine milling, lefthand thread, M04
reference point) spindle direction

G30 Return to secondary home G99 Return to R level in canned cycle
position (machine zero, aka
machine reference point)

G31 Feed until skip function G76 Fine boring cycle for milling

G33 Constant-pitch threading G80 Cancel canned cycle

G34 Variable-pitch threading G81 Simple drilling cycle

G40 Tool radius compensation off G82 Drilling cycle with dwell

G41 Tool radius compensation left G83 Peck drilling cycle (full
retraction from pecks)

G42 Tool radius compensation right Tapping cycle, righthand


thread, M03 spindle
Tapping cycle, righthand
direction
thread, M03 spindle direction

G43 Tool height offset compensation G84.2 Tapping cycle, righthand


negative thread, M03 spindle direction,
rigid toolholder

G44 Tool height offset compensation G84.3 Tapping cycle, lefthand


positive thread, M04 spindle direction,
rigid toolholder

G45 Axis offset single increase G85 boring cycle, feed in/feed out

G46 Axis offset single decrease G86 boring cycle, feed in/spindle
stop/rapid out

G47 Axis offset double increase G87


boring cycle, backboring

G48 Axis offset double decrease G88 boring cycle, feed in/spindle
stop/manual operation

G49 Tool length offset compensation G89 boring cycle, feed in/dwell/feed
cancel out

G91 Incremental programming G90 Absolute programming


G100 Tool length measurement

III. SOME EXAMPLE USING COMMAND G-CODE

1. The command to move in a straight line G0 & G1.


Note how to write, syntax ...
Gx is required, where x is between 0 (or 00) and 99.
[x] the [] symbol denotes an optional parameter that may or may not be.
G0 - fast move command.
Is the command to move straight & fast in the coordinates X, Y, Z or both A,
B, C. Move at the maximum speed that the machine can respond. Often used to
quickly move between the machining areas.

Syntax: G0 [X] [Y] [Z] [A] [B] [C]


Example: G0 X0.5 Y1.3 Z10
Meaning: Move quickly to X 0.5, Y 1.3, Z 10 coordinates.
Note: Be carefully tool breakage groove.
G1 - move command with speed parameter.
A command to move straight at a controlled speed according to the attached
parameter, or the speed parameter specified before. Often used in the machining
process.

Syntax: G0 [X] [Y] [Z] [A] [B] [C] [F] where F is the speed parameter.
Example: G0 X0.5 Y1.3 Z10 F1000
Meaning: Move to the coordinates X 0.5, Y 1.3, Z 10 at a speed of 1000 units /
minute.
2.Command to move in the arc G2 & G3.
* Note how to write, syntax ...
Gx is required, where x is between 0 (or 00) and 99.
[x] the [] symbol denotes an optional parameter that may or may not be.
G2 - command to move forward (CW)

For example, according to the image above:

F1000

G17

G1 X1 Y2

G2 X2 Y1 I1 J1
These two commands have the same syntax and usage but quite complicated
because it is necessary to define the correct machining plane as XY, XZ or YZ. For
each machining plane the corresponding parameter is also different.

3.G17, G18, G19 command specifies the machining plane.

Instructions G17, G18, G19 specify the machining planes xOy, xOz and yOz,
respectively.
IV. INVERTOR CAM WITH G-CODE

The first is setup workpiece, choose

+ milling

+ side offset

+ top offset, bottom offset

And save it
Choose cutting tool that you require

Note: Choose number you want to cut in retract height offset, feed height offset
and maximum stepdown.
This is simulation process.
Output program

After output program, inventor provide a program.

You might also like