7/29/2019 CNC-PROGRAMMING-PART-2
1/64
7/29/2019 CNC-PROGRAMMING-PART-2
2/64
TOPICS COVERED
WORK OFFSET,TOOL LENGTH OFFSETAND DIAMETER OFFSET
MOST COMMONLY USED
G & MCODES
G91 (INCREMENTAL) G90 (ABSOLUTE)PROGRAMMING
G00 AND G01
PLANE SELECTION REFERANCE POINT (2ND 3RD & 4TH )
7/29/2019 CNC-PROGRAMMING-PART-2
3/64
G & M CODES
7/29/2019 CNC-PROGRAMMING-PART-2
4/64
These are commands which prepare the
machine for different modes of movement like
positioning contouring, thread cutting etc.
The preparatory functions always precede the
dimension word.
G FUNCTIONS:
7/29/2019 CNC-PROGRAMMING-PART-2
5/64
G FUNCTIONS:
Type meaningOne shot G-code The G-code is effective only in the block
in which it is specified
Modal G-code The G-code is effective until anotherG-code of the same group is specified.
Example;
G01andG02are modal G-codesG01X____;
y____;
X____;
G00X____;
G01 is effective in
this range
Example;
G04 and G10
G04X____;
G10X____Y____Z____;
G10 is effective
only in this range
7/29/2019 CNC-PROGRAMMING-PART-2
6/64
CLICK TO SEE G CODES:
7/29/2019 CNC-PROGRAMMING-PART-2
7/64
G CODE GROUP FUNCTION
G00 POSITION (RAPID TRAVERSE)
G01 INEAR INTERPOLATION (FEED)
G02 01 CIRCULAR INTERPOLATION CW
G03 CIRCULAR INTERPOLATION CCW
G04 DWELL
G10 00 DATA SETTING
G11 DATA SETTING MODE CANCEL
G17 Xp Yp PLANE SELECTION
G18 02 Zp Xp PLANE SELECTION
G19 Yp Zp PLANE SELECTION
7/29/2019 CNC-PROGRAMMING-PART-2
8/64
G CODE GROUP FUNCTION
G20 INPUT IN INCH
G21 06 INPU IN MM
G27 Return to reference posiiton check
G28 Return to reference posiiton
G29 Return from reference posiiton
G30 2nd 3rd &4th Return to reference posiiton
G31 00 Skip function
G33 01 Thread cutting
7/29/2019 CNC-PROGRAMMING-PART-2
9/64
G CODE GROUP FUNCTION
G40 Cutter compensation cancel
G41 07 Cutter compensation left
G42 Cutter compensation right
G43 08 Tool length compensation +direction
G44 Tool length compensation direction
G49 Tool length compensation cancel
G52 00 Local coordinate systemselection
Machine coordinate system
selection
G53
7/29/2019 CNC-PROGRAMMING-PART-2
10/64
G CODE GROUP FUNCTION
G54 14 work piece coordinate selection 1
G54.1 Additional work piece coordinateselection 1
G55 work piece coordinate selection 2
G56 work piece coordinate selection 3
G57 work piece coordinate selection 4
G58 work piece coordinate selection 5
G60 00/01 Single direction positioning
G61 15 Exact stop mode
G62 Automatic corner overide
G63 Tapping modeG64 Cutting mode
G65 00 Macro call
G66 12 Macro modal call
G67 Macro modal call cancel
7/29/2019 CNC-PROGRAMMING-PART-2
11/64
G CODE GROUP FUNCTION
G73 09` Peck drilling cycle
G74 Counter tapping cycle
G76
09 Fine boring cycle
G80 Canned cycle cance
G81 Drilling cycle/spot boring cycle
G82 Counter boring cycle
G83 09 peck drilling cycle
G84 Tapping cycle
G85 boring cycleG86 boring cycle
G87 Back boring cycle
G88 Boring cycle
G89 Boring cycle
7/29/2019 CNC-PROGRAMMING-PART-2
12/64
G CODE GROUP FUNCTION
G90 03 Absolute command
G91 Increment command
G94 05 Feed per minute
G95 Feed per rotation
G96 13 Constant surface speed control
G97 Constant surface speed control cancel
G98 10 Return to initial point in canned cycle
G99 Return to R point in canned cycle
7/29/2019 CNC-PROGRAMMING-PART-2
13/64
BASIC M CODES
M functions :
This function pertains to auxiliary or
switching information, which does not relate
to dimensional movement of the machine,such as spindle command or coolant ON-
OFF & other functions.
Some of the miscellaneous functions are
defined by CNC system manufacturers and
some are defined by machine tool
manufacturers.
A list of M-functions are given below;
7/29/2019 CNC-PROGRAMMING-PART-2
14/64
CLICK TO SEE M CODES:
7/29/2019 CNC-PROGRAMMING-PART-2
15/64
M-CODES
M00 PROGRAM STOP
M01 OPTIONAL STOP
M02 PROGRAM END
M03 CW SPINDLE ROTATION
M04 CCW SPINDLE ROTATIONM05 SPINDLE STOP
M06 TOOL CHANGE CYCLE
M08 COOLANT PUMP ON
M09 COOLANT PUMP OFFM10 ROTARY TABLE UNCLAMP (4TH AXIS)
#-OPTIONAL FUNCTIONS.FOR DETAILS REFER THEMACHINE MANUFACTURES MANUAL
7/29/2019 CNC-PROGRAMMING-PART-2
16/64
M11 ROTARY TABLE CLAMP (4TH AXIS)
M19 SPINDLE ORINTATION STOP
M28 RIGID TAP MODE CANCEL
M29 RIGID TAP MODE CANCELM30 PROGRAM END AND REWIND
M36 COMPONENT LOAD CYCLE
M37 COMPONENT UNLOAD CYCLE
M43 DOOR CLLOSE
M44 DOOR OPENM48 SPINDLE OVERIDE ENABLE
M48 SPINDLE OVERIDE DISABLE
M55 JIG FLUSHING COOLANT
M65 IMAGE X AXIS
M66 IMAGE Y AXIS
M67 IMAGE 4TH AXIS
M68 IMAGE CANCEL
7/29/2019 CNC-PROGRAMMING-PART-2
17/64
M-CODES
M70 TOOL POCKET DOWNM71 DOUBLE ARM GRIPS TOOLS
M74 DOUBLE ARM ROTATES 1800
AND LOADS TOOLS
M76 SPINDLE TOOL CLAMPM77 ARM RETURN TO PARKING
POINT
M78 TOOL POCKET UP
M90 CLEAR TOOL DATA
M91 SET TOOL DATA
7/29/2019 CNC-PROGRAMMING-PART-2
18/64
G00 (POSITIONING) &G01 (LINEAR
INTERPOLATION)
7/29/2019 CNC-PROGRAMMING-PART-2
19/64
G00 (POSITIONING)
G00 COMMAND MOVES A TOOL TO
POSITION IN THE WORK PIECE
SYSTEM SPECIFIED WITH ABSOLUTEOR INCREMENTAL COMMAND AT A
RAPID TRAVERSE RATE.
7/29/2019 CNC-PROGRAMMING-PART-2
20/64
G01
(LINEAR INTERPOLATION) A TOOL MOOVES ALONG A LINE TO
SPECIFIED POSITION AT A FEED RATE
SPECIFIED IN FIN PART PROGRMME.
THE FEED RATE SPECIFIED IN F IS
EFFECIVE UNTIL NEW VALUE IS
SPECIFIED.IT NEED NOT BE SPECIFIED FOR
EACH BLOCK.
7/29/2019 CNC-PROGRAMMING-PART-2
21/64
G90 (ABSOLUTE) &
G91 (INCREAMENTAL)
7/29/2019 CNC-PROGRAMMING-PART-2
22/64
1. Abso lu te d imens ion ing sys tem (G90):
The system in which all the measurements are
taken from a fixed origin with coordinatesX=0, Y=0 and Z=0 is known as absolute
coordinate system.
This origin serves as a datum position from
which all the distances are measured parallel
to each axis of the system.
TYPES OF DIMENSIONING
SYSTEMS
7/29/2019 CNC-PROGRAMMING-PART-2
23/64
Absolute Dimensions
10
20
30
40
0,0
7/29/2019 CNC-PROGRAMMING-PART-2
24/64
2. Incremental d imens ion ing system (G91):The system in which all measurements
for the next position are calculated in
the forms of increments of distancefrom the point at which the slide is
resting presently.
Hence needs no predetermined datumpoint.
TYPES OF DIMENSIONING SYSTEMS
7/29/2019 CNC-PROGRAMMING-PART-2
25/64
Incremental Dimensions
1010 10 10
M hi
7/29/2019 CNC-PROGRAMMING-PART-2
26/64
(20.00) (20.00) (20.00)
(10.00)(10.00)
(10.00)
Machine
referance
Work
offset
Pos 1Pos 2
M hi
7/29/2019 CNC-PROGRAMMING-PART-2
27/64
(20.00) (20.00) (20.00)
(10.00)(10.00)
(10.00)
Machine
referance
Workoffset
Moove Tool from m/c ref to work offest on Rapid.
G00 G90 XO.O YO.O ZO.1 ;
a) Positioning
Positioning should be always programmed inabsolute mode for to avoid any changes in part
programme during set up change.
M hi
7/29/2019 CNC-PROGRAMMING-PART-2
28/64
(20.00) (20.00) (20.00)
(10.00)
(10.00)
(10.00)
Machine
referance
Work
offsetMove Tool from work zero To Pos no-1 and 2 in feed .
G00 G90 X 0 Y 0 Z 0 ;
G01 G91 X-20.0 Y10.0 F100.0 ;
G01 G91 X-20.0 Y10.0;
a)Incremental
programming
M hi
7/29/2019 CNC-PROGRAMMING-PART-2
29/64
(20.00) (20.00) (20.00)
(10.00)
(10.00)
(10.00)
Machine
referance
Work
offsetMoove Tool from work zero To Pos no-1 and 2 in feed
.
G00 G90 X0 Y0 Z0;
G1X-20.00 Y10.00 F100.0 ;
G1 X-40.0 Y20.0
a)Absolute
programming
7/29/2019 CNC-PROGRAMMING-PART-2
30/64
WORK OFFSET
WORK OFFSET
7/29/2019 CNC-PROGRAMMING-PART-2
31/64
WORK OFFSET(WORK COODRDINATE SYSTEM)
WORK OFFSET IS THE DISTANCE
BETWEEN MACHINE REF POINT
TO WORK ZERO (Ref point)
POSITION.
MACHINE REF
7/29/2019 CNC-PROGRAMMING-PART-2
32/64
(X0.0 Y0.0 Z0.0)
MACHINE REF
POINT
Z -230.25
Y 120.5
X100.0
Command :
G00 G90 G10 L2P2 X100 Y120.5 Z-230.25;
WORK REF
POINT
7/29/2019 CNC-PROGRAMMING-PART-2
33/64
WHY WORKPIECE
COORDINAYE SYSTEM
IT IS DIFFICULT TO WRITE PART
PROGRAMME WITH REFERANCE TO
MACHINE REF POINT ANY EDITING OR SMALL CORRECTION
NEEDS MORE CALCULATION
DIFFICULT TO READ AND UNDERSTANDPROGRAMME w.r.t. DRAWING.
7/29/2019 CNC-PROGRAMMING-PART-2
34/64
SELECTING WORKPIECE
COORDINATE SYSTEM
G54 WORK PIECE COORDINATE SYSTEM 1
G55 WORK PIECE COORDINATE SYSTEM 2
G56 WORK PIECE COORDINATE SYSTEM 3
G57 WORK PIECE COORDINATE SYSTEM 4
G58 WORK PIECE COORDINATE SYSTEM 5
G59 WORK PIECE COORDINATE SYSTEM 6
7/29/2019 CNC-PROGRAMMING-PART-2
35/64
G 54 WORK
7/29/2019 CNC-PROGRAMMING-PART-2
36/64
G 54 WORK
PIECE CO
ORDINATE
SYSTEM 1
G 55 WORK
7/29/2019 CNC-PROGRAMMING-PART-2
37/64
G 55 WORK
PIECE CO
ORDINATE
SYSTEM 2
7/29/2019 CNC-PROGRAMMING-PART-2
38/64
ADVANTAGES OF MANY
WORK CORDINATE SYSTEMS WHENEVER MORE THAN ONE PART
IS BEING MACHINED ON SAME
FIXTURE, PROGRAMMING CAN BEWRITTEN MORE CONVINIENTLY FOR
EACH PART BY MENTIONING
DIFFERENT COORDIANTE SYSTEM.
7/29/2019 CNC-PROGRAMMING-PART-2
39/64
STATION3
G56
STATION1
G54
STATION2
G55
7/29/2019 CNC-PROGRAMMING-PART-2
40/64
SETTING WORKPIECE
COORDINATE SYSTEM
G00 G90 G10 L2P1 X__ Y__ Z__;
G00 G90 G10 L2P2 X__ Y__ Z__;
G00 G90 G10 L2P3 X__ Y__ `Z__;
PROGRAMMABLEDATA INPUT
WORK
COORDINATE
SYSTEM`3PAGE NUMBER
7/29/2019 CNC-PROGRAMMING-PART-2
41/64
TOOL LENGTH
OFFSET
7/29/2019 CNC-PROGRAMMING-PART-2
42/64
WHAT IS TOOL LENGTH
TOOL LENGTH
TOOL DIAMETER
7/29/2019 CNC-PROGRAMMING-PART-2
43/64
TOOL LENGTH OFFSET
ALWAYS PART PROGRAMMING IS DONECONSIDERING TOOL LENGTH ASZERO.WHEN IN ACTUL TOOL WILL BE
HAVING SOME LENGTH.
FOR SMALL VARIATION IN ONE TOOLLENGTH PART PROGRAMME HAS TO BECHANGED TO GET DESIRED QUALITY
TO COMPENASTE TOOL LENGTH w.r.t.WORK COORDINATE SYSTEMAUTOMATICALLY, TOOL LENGTH OFFSETWILL BE GIVEN
7/29/2019 CNC-PROGRAMMING-PART-2
44/64
(X0.0 Y0.0 Z0.0)WORK REF
POINT
7/29/2019 CNC-PROGRAMMING-PART-2
45/64
(X0.0 Y0.0 Z0.0)WORK REF
POINT
IF TOOL LENGTH OFFSET NOT GIVEN
7/29/2019 CNC-PROGRAMMING-PART-2
46/64
(X0.0 Y0.0 Z0.0)WORK REF
POINT
IF TOOL LENGTH OFFSET GIVEN
7/29/2019 CNC-PROGRAMMING-PART-2
47/64
TOOL DIAMETER OFFSET
ALLWAYS PART PROGRAMMING IS DONECONSIDERING SPINDLE CENTERAXIS.WHEN IN ACTUL TOOL WILL BE
HAVING SOME DIAMETER. FOR SMALL VARIATION IN ONE TOOL
DIAMETER PART PROGRAMME HAS TO BEEDITED TO GET DESIRED QUALITY
TO COMPENASTE TOOL DIAMETER w.r.t.WORK COORDINATE SYSTEMAUTOMATICALLY, TOOL DIAMETEROFFSET WILL BE GIVEN
7/29/2019 CNC-PROGRAMMING-PART-2
48/64
(X0.0 Y0.0 Z0.0)WORK REF
POINT
IF TOOL DIAMETER OFFSET NOT
GIVEN
IF TOOL LENGTH OFFSET GIVEN
7/29/2019 CNC-PROGRAMMING-PART-2
49/64
(X0.0 Y0.0 Z0.0)WORK REF
POINT
IF TOOL LENGTH OFFSET GIVEN
7/29/2019 CNC-PROGRAMMING-PART-2
50/64
7/29/2019 CNC-PROGRAMMING-PART-2
51/64
G- COMMANDS FOR TOOL
LENGTH COMPENSATION
G43 - TOOL LENGTH COMPENSATION + ve
G44 - TOOL LENGTH COMPENSATION - ve
G49 - TOOL LENGTH COMPENSATION
CANCEL.
7/29/2019 CNC-PROGRAMMING-PART-2
52/64
N1 M36;
N15 G10 G90 L2P2 X-020.025 Y-134.30 Z-359.45;
N20 G10 G90 L2P3 X-204.970 Y-134.30 Z-388.24;N25 G10 G90 L2P4 X-020.025 Y-240.93 Z-420.93;
N30 T51:
N35 G0 G90 G55 X0.0 Y17.0 M03 S2000;
N40 GO G43 H1 M8;
N45 G1 G41 X-6.1 Y5.05 D1;
-----------
-----------
N75G0 G90 G56 X51.5 Y15S2500;
---------
Go G49 Z100
7/29/2019 CNC-PROGRAMMING-PART-2
53/64
G28 AND G30(Ref point return, 2nd 3rd
and 4th point return)
G28 REFERANCE POINT RETURN
7/29/2019 CNC-PROGRAMMING-PART-2
54/64
G 28
Return to reference point
Command:
G00 G91 G28 X0.0 Y0.0 Z 0.0;
G28 REFERANCE POINT RETURN
FOR REF PT RETURN IS
GENERALLY EXECUTED
ONLY IN G91 MODE
FOR REF PT RETURNGENERALLY NO
INTERMEDIATE VALUE IS
EXECUTED
7/29/2019 CNC-PROGRAMMING-PART-2
55/64
M/c REF POINT
G30 2nd 3rd & 4th REFERANCE POINT RETURN
7/29/2019 CNC-PROGRAMMING-PART-2
56/64
Command:
G00 G91 G30 P2 X0.0 Y0.0 Z 0.0;
G30 2nd 3rd & 4th REFERANCE POINT RETURN
FOR REF PT RETURN IS
GENERALLY EXECUTED
ONLY IN G91 MODE
FOR REF PT RETURN NO
GENERALLY
INTERMEDIATE VALUE IS
EXECUTED
P2 is optional for 2nd reference point, where as
P3,P4 are mandatory for respective ref point
return
7/29/2019 CNC-PROGRAMMING-PART-2
57/64
APPLICATIONS OF G30
MOVE TO TOOL CHANGE POSSITION
MOVE TO PALLET CHANGE POSITION
WHEREVER MORE THAN ONE PALLET.
7/29/2019 CNC-PROGRAMMING-PART-2
58/64
PLANE SELECTION
G17 G18 &G19
SELECTION OF PLANE IS DONE
7/29/2019 CNC-PROGRAMMING-PART-2
59/64
SELECTION OF PLANE IS DONE
FORCIRCULAR INTERPOLATION,CUTTER
COMPENSATION.G code Selected plane
G17 Xp Yp plane
G18 Zp Xp plane
G19 Yp Zp plane
7/29/2019 CNC-PROGRAMMING-PART-2
60/64
G17 Xp Yp plane
When machined is switched on G17 will be
by default
7/29/2019 CNC-PROGRAMMING-PART-2
61/64
G18 Zp Xp plane
G18 will be active till another G code of
same group is executed
7/29/2019 CNC-PROGRAMMING-PART-2
62/64
G19 Yp Zp plane
G19 will be active till another G code of
same group is executed
7/29/2019 CNC-PROGRAMMING-PART-2
63/64
Example of plane selection
T6;
G0 G90 G55 X28.75 Y-109.5 S3180 M3;
G43 H6 Z16.6 M8;
G19;
G03 Y83.7 Z16.6 J12.9 K0.0;
G0 Z16.6;
G17;
7/29/2019 CNC-PROGRAMMING-PART-2
64/64
Top Related