CNC Programming Part 2
CNC Programming Part 2
WORK OFFSET,TOOL LENGTH OFFSET AND DIAMETER OFFSET MOST COMMONLY USED G & MCODES G91 (INCREMENTAL) G90 (ABSOLUTE) PROGRAMMING G00 AND G01 PLANE SELECTION REFERANCE POINT (2ND 3RD & 4TH )
G & M CODES
G FUNCTIONS: 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:
Type meaning One 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 another G-code of the same group is specified.
Example; G04 and G10
G04 X____; G10X____Y____Z____;
Example;
G01 and G02 are modal G-codes
G01 X____; y____; X____;
G00 X____;
G CODE
GROUP
FUNCTION
G00
G01
G02 G03 01
G04
G10 G11 G17 G18 G19 02 00
DWELL
DATA SETTING DATA SETTING MODE CANCEL Xp Yp PLANE SELECTION Zp Xp PLANE SELECTION Yp Zp PLANE SELECTION
G CODE
GROUP
FUNCTION
G20
INPUT IN INCH
G21
06
INPU IN MM
G27
G28
G29 G30 G31 00
G33
01
Thread cutting
G CODE
GROUP
FUNCTION
G40
G41
G42 G43
07
08
G44
G49
G52 G53
00
G CODE
G54 G54.1 G55 G56 G57 G58 G60 G61 G62 G63
GROUP
14
FUNCTION
work piece coordinate selection 1 Additional work piece coordinate selection 1 work piece coordinate selection 2 work piece coordinate selection 3 work piece coordinate selection 4 work piece coordinate selection 5
00/01 15
Single direction positioning Exact stop mode Automatic corner overide Tapping mode
G64
G65 G66 G67 00 12
Cutting mode
Macro call Macro modal call Macro modal call cancel
G CODE
G73 G74 G76
GROUP
09`
FUNCTION
Peck drilling cycle Counter tapping cycle
09 G80 G81 G82 G83 G84 G85 G86 G87 G88 G89
Fine boring cycle Canned cycle cance Drilling cycle/spot boring cycle Counter boring cycle 09 peck drilling cycle Tapping cycle boring cycle boring cycle Back boring cycle Boring cycle Boring cycle
G CODE
G90 G91 G94
GROUP
03 05 13 10
FUNCTION
Absolute command Increment command Feed per minute
G95
G96 G97 G98
G99
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 ONOFF & 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;
M-CODES
M00 PROGRAM STOP M01 OPTIONAL STOP M02 PROGRAM END M03 CW SPINDLE ROTATION M04 CCW SPINDLE ROTATION M05 SPINDLE STOP M06 TOOL CHANGE CYCLE M08 COOLANT PUMP ON M09 COOLANT PUMP OFF M10 ROTARY TABLE UNCLAMP (4TH AXIS) #-OPTIONAL FUNCTIONS.FOR DETAILS REFER THE
MACHINE MANUFACTURES MANUAL
M11 M19 M28 M29 M30 M36 M37 M43 M44 M48 M48 M55 M65 M66 M67 M68
ROTARY TABLE CLAMP (4TH AXIS) SPINDLE ORINTATION STOP RIGID TAP MODE CANCEL RIGID TAP MODE CANCEL PROGRAM END AND REWIND COMPONENT LOAD CYCLE COMPONENT UNLOAD CYCLE DOOR CLLOSE DOOR OPEN SPINDLE OVERIDE ENABLE SPINDLE OVERIDE DISABLE JIG FLUSHING COOLANT IMAGE X AXIS IMAGE Y AXIS IMAGE 4TH AXIS IMAGE CANCEL
TOOL POCKET DOWN DOUBLE ARM GRIPS TOOLS DOUBLE ARM ROTATES 1800 AND LOADS TOOLS SPINDLE TOOL CLAMP M-CODES ARM RETURN TO PARKING POINT TOOL POCKET UP CLEAR TOOL DATA SET TOOL DATA
G00 (POSITIONING)
G00 COMMAND MOVES A TOOL TO POSITION IN THE WORK PIECE SYSTEM SPECIFIED WITH ABSOLUTE OR INCREMENTAL COMMAND AT A RAPID TRAVERSE RATE.
Absolute Dimensions
0,0
10 20 30 40
2. Incremental dimensioning system (G91): The system in which all measurements for the next position are calculated in the forms of increments of distance from the point at which the slide is resting presently. Hence needs no predetermined datum point.
Incremental Dimensions
10
10
10
10
Work offset
a) Positioning
Machine referance
Positioning should be always programmed in Work absolute mode for to avoid any changes offset in part programme during set up change. Moove Tool from m/c ref to work offest on Rapid. G00 G90 XO.O YO.O ZO.1 ;
a)Incremental programming
Machine referance
(10.00) (10.00) (10.00)
Work offset Move Tool from work zero To Pos no-1 and 2 in feed .
G00 G90 X 0 Y 0 Z 0 ;
(20.00)
(20.00)
(20.00)
a)Absolute programming
Machine referance
(10.00) (10.00) (10.00)
Work Moove Tool from work zero To Pos no-1 and 2offset in feed . G00 G90 X0 Y0 Z0;
G1X-20.00 Y10.00 F100.0 ;
(20.00)
(20.00)
(20.00)
G1 X-40.0 Y20.0 ;
WORK OFFSET
WORK OFFSET IS THE DISTANCE BETWEEN MACHINE REF POINT TO WORK ZERO (Ref point) POSITION.
Command :
STATION 3
STATION 2
STATION 1
G56
G55
G54
TOOL LENGTH
O0001; 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;
G28 AND G30 (Ref point return, 2nd 3rd and 4th point return)
FOR REF PT RETURN GENERALLY NO Return to reference point INTERMEDIATE VALUE IS Command: EXECUTED G00 G91 G28 X0.0 Y0.0 Z 0.0;
G 28
G30 2nd 3rd & 4th REFERANCE POINT RETURN FOR REF PT RETURN NO GENERALLY INTERMEDIATE VALUE IS EXECUTED Command:
APPLICATIONS OF G30
MOVE TO TOOL CHANGE POSSITION MOVE TO PALLET CHANGE POSITION WHEREVER MORE THAN ONE PALLET.
PLANE SELECTION
G17 Xp Yp plane
G18 Zp Xp plane
G19 Yp Zp plane
G19;
G03 Y83.7 Z16.6 J12.9 K0.0;
G0 Z16.6;
G17;