Sei sulla pagina 1di 27

G AND M CODES

ROBOTICS &AUTOMATION
Sallar Ali (ME-1151)

Outline

Numerical controlled Ms

CNC
Process workflow

G-codes (what are they?)


Coordinate system
Common definitions
Common letters
Gs
Ms
CAM sample program

Definition of Numerical Control M/C


E.I.A : -(Electronic Ind. Association) defines NC Control as
A system in which actions are controlled by direct
insertion of numerical data or at least some portion of this
data. In simpler language NC means control by number.
The input information's for controlling the machine tool
motions is provided through punched paper tape or
Magnetic tapes in a coded language.

CNC :-Computerised Numerical Control


Computerised Numerical Control is a numerical
control system that utilizes a dedicated stored
programmed. Computer is used to perform some or all
basic function. Numerical control is a programmable
automation in which process is controlled by Numbers,
Letters, and symbols. (Computer +NC= CNC).

Detail Drawing

Production Planning

Component Size

Form in which stock


material is supplied

Type of Machining Required

Machining type (Machine Setting)

Process Operation schedule and time estimation


Work holding and
location

Speeds and feeds


CNC Machining
program
Program Proving
Component
production

Tooling type

G codes: What are they?

G&M codes is a programming language for CNC


machines
G-code programming controls how and where
a machine moves
The codes used vary based on the machine type,
make, and model

G codes explained

G stands for Geometric Codes


M stands for Miscellaneous codes
G codes are the preparatory codes, they determine
the type of motion that will occur
M codes tell the machines to perform an action

G code program structure

Preparatory codes

Safety codes

Tool change codes

Movement and positioning for operation

Program end codes

Common definitions: Word

A word is simply a letter followed by a real value


Example1: G1
G is preparatory code and 1 indicates specific
function from preparatory code
Example2: M6
M is miscellaneous code and 1 is specific function

Common definitions: Block


Sequence
#

N50

Preparatory
Function

G90 G01

Dimension
Words

X1.40Y2.25

Feed
Rate

Spindle
Function

F10

S1500

Individual Words

Tool
Function

T01

Misc.
Function

M03

Common definitions: Message & command

Message is the text displayed on the status window


during program execution
Written during program and is enclosed in a set of
parentheses
Example: (tool is moving 1.2 degrees CC)
Comment is not displayed during program execution
Just like C, C++, MATLAB comments

Common letters and their function

Comments

()

Message

Sequence Number (Block Identification Number).

Preparatory functions (G00 to G99). This prepares the M/C for next operation.

X,Y,Z Primary motion Dimension in the X,Y,Z direction respectively.

U,V,W Secondary motion Dimension in the X,Y,Z direction respectively.

P,Q,R Tertiary motion Dimension in the X,Y,Z direction respectively.

I,J,K

A,B,C Angular Dimension around in the X,Y,Z direction respectively.

Parameters.

Feedrate.

Spindle Speed/Cutting Speed.

T/D

Tool number.

Miscellaneous function (Machine Codes)

EOB End of Block.

Distance to the are center or thread leads parallel to X,Y,Z respectively.

Coordinate Location

Machine location is determined by coordinates


(Cartesian coordinates)
Letter X controls horizontal position
Letter Y controls vertical position
Letter Z controls depth in case of more than two
axis travel
Letters I & J are used to indicated incremental
center of the arc

Preparatory Codes

G90 - Absolute Coordinates


G91 - Relative Coordinates
G53 - Machine coordinates
G54-G56 - Offsets
G00 - Rapid positioning mode
G01 - Straight Line Interpolation (cutting move)
G02 - Circle Interpolation (clockwise)
G03 - Circle Interpolation (c-clockwise)
G04 - Dwell (wait) Pause between motions on all axis. Time
in seconds - G04F2 - pause for 2 sec.
G05 - Pause - waits for user intervention.

ABSOLUTE PRESET G92


USED TO SHOW CURRENT TOOL POSTION W.R.T. ZERO AT
THE TIME OF STARTING M/C.
ONCE THE CUTTER POSITION IS DEFINED USING G92 M/C
WILL DRAW ITS CO-ORDINET SYSTEM
ONCE G92 IS DEFINED THEN THERE IS NO NEED TO DEFINE
G90
IT IS MODEL
FORMAT
G92 X__ Y__ Z__
ZERO OF JOB)

(CURRENT TOOL POSITION W.R.T

REFERENCE POINT AND RETURN


G28 Return To Reference Point, set optional intermediate point
The G28 code is used to return to the machine zero position on all axes. If an
X, Y, Z, or A axis is on the same block and specifies a location, only those axes
will move and return to the machines zero reference point and the movement
to the machines zero reference point will be through that specified location.
Format: -G91 G28 X0 Y0 Z0;

Setting work co-ordinate system (G54 - G59)


G54 Work co-ordinate system 1 selection
G55 Work co-ordinate system 2 selection
G56 Work co-ordinate system 3 selection
G57 Work co-ordinate system 4 selection
G58 Work co-ordinate system 5 selection
G59 Work co-ordinate system 6 selection
G54 X_ Y_ Z_

G00 Rapid traverse


When the tool being positioned at a point preparatory to a cutting motion, to
save time it is moved along a straight line at Rapid traverse, at a fixed traverse
rate which is pre-programmed into the machine's control system. Typical rapid
traverse rates are 10 to 25 m /min., but can be as high as 80 m/min.
Format
N_ G00 X__ Y__Z__

G01 Linear interpolation (feed traverse)


The tool moves along a straight line in one or two axis simultaneously at a programmed
linear speed, the feed rate.
Format
N__ G01 X__ Y__Z__ F__

G02/03 Circular interpolation

Format
N__ G02/03 X__ Y__Z__ I__ J__K__ F__ using the arc center
OR
N__ G02/03 X__ Y__Z__ R__ F__ using the arc radius
G02 moves along a CW arc
G03 moves along a CCW arc
Arc center
The arc center is specified by addresses I, J and K. I, J and K are the X, Y and Z
co-ordinates of the arc center with reference to the arc start point.

I = X coord. of center - X coord. of start point


J = Y coord. of center - Y coord. of start point
K = Z coord. of center - Z coord. of start point
I, J and K must be written with their signs.

M Codes - Miscellaneous

M00 - Pause
M01 - Optional stop
M02 - End of Program
M03 - Spindle on
M05 - Spindle off
M06 - Tool Change
M08 / M09 - Accessory # 1 on / off
M10 / M11 - Accessory # 2 on / off

Using CAD/CAM software

Conclusion

Add your conclusions here.

Potrebbero piacerti anche