You are on page 1of 48

KARNATAKA GERMAN TECHNICAL

TRAINING INSTITUTE
CNC programming
Two type of programming
1.Offline programming
2.Online programming

In offline programming
Initial information:-
 Analyzing of part Drawing
 Part number, material, size means maximum length, width, height,
and diameter.
 Input condition like casting/forge/bar
 Process details like Drilling, Machining, inspection, Heat treatment.
 Allowances / Tolerance, Control dimension
Machine :-
 Milling, lathe, Grinding etc.
 Specification of machine eg:-stroke length, Spindle axis
CNC programming
 List of operation:-Step turning, Plain turning, Facing, Threading,
Drilling, etc.
 List of Tooling:-Facing tool, Parting tool, drill, Boring tool etc.
 Work holding devices:- Chuck, Fixture.
 Technological Data or Cutting parameter:-Feed, Speed, depth of cut.
 Cutting method:-Approach, Linear, Retract.
 Co-ordinate:-X,Z Position.
 Writing the program.

In online programming
 Input of program.
 Work setup.
 Loading tool.
 Taking offset
 Try out.
Drawing to Machined part steps
Part Programming
CNC programming include:-
 Alphabets[A-Z]
 Number[0-9]
 Symbols[/;()]
G-codes:-(Preparatory function)
Generating profile creating those called G-codes
M-codes:-Miscellaneous function
Vary from machine to machine depending on the
function available on it and manufacturing of the
machine decides them
Alphabets use in Lathe Part Programming
 A- Angle  N-Block Number
 B-  O-Start
 C-Chamfer always for45Deg  P-Multiple Use
 D-  Q-Multiple Use
 E-  R-Multiple Use
 F-Feed  S- speed
 G-G codes  T-Tool Number
 H-  U-Multiple Use
 I- Arc X  V-
 J-  W-Multiple Use
 K-Arc Z  X-Axis
 L-  Y-
 M-M codes  Z-Axis
Program Structure
 Start
 Tool change
 Spindle Rotation
 Axis Moment
 Metal cutting
 Program End
Terms in programming
1.Program Number:-The program number functions as addressing
symbol for accessing a program. The program number is expressed by
putting the numericals of four digits after the alphabet “O”, numericals
from 0001 to 9999 can be used.
• Example: O2244;
• The program number can be input with numericals of smaller than
four digits.
• Example: O10; = O0010;
• If the number to be input already in the memory that program can not
be input, input with the other number.
Terms in programming
2. SEQUENCE NUMBER(N)
The sequence number is used to
• search
• Callout the position is being executed.
• The position you want to edit in the program easily.

Sequence number is expressed by the numerals of 5 digits or less after


alphabet “N” numerals from 1 to 99999 can be used.

Example : O1001
Generally sequence numbers are inserted in to important
Sequence Number places of the program
Example :
N01 G00 X50 Y50
•Beginning of each tool
Sequence Number
•If the program memory is over the memory capacity :
N02 G1 Z-50 F20 Eliminate the sequence numbers to save memory capacity.
Terms in programming
3. Part Program
• Part program is used to specify the machining process for a single tool.
• That is a program for each process ( First process, Second process etc.) required.
• Number of a part program corresponding to the required number of tools is
included.
Example : O1001;
N01 G00 X50 Y50 ;
Part program
M01;

N02
G54 G00 X60 Y60 ;
Part program
M01;
M30;
Terms in programming
4. Address
The address is expressed by the alphabet.
Example :
G00 X100 Y100

Address
5. Data
Numerals (Including the sign and the decimal point). Succeeding to the address is
called data.
G00 X100 Y100

Data
Terms in programming
6. Word
• Word is minimum unit for specifying the functions.
• It consists of the numerical values (data) including the address and sign.
Example :
G00 X100 Y100

Word
7. Block
 Block Consists of words.
 Block is minimum unit necessary to operate a In machine.
 program each line corresponds to one block.

G00 X100 Y100

Block
List of G-codes
• G00Positioning rapid traverse • G71 Plain Rough Turning
• G01Linear interpolation (feed) • G72 Facing Cycle
• G02Circular interpolation CW • G73 Pattern repetition
• G03Circular interpolation CCW • G74 Face Grooving
• G04Dwell • G75 Grooving
• G20Inch unit • G76 Thread cutting
• G21Metric unit • G80 Drill cycle
• G28 Return to home • G90 Absolute system coordinate
• G40
Tool nose radius compensation system
cancel • G91 Incremental coordinate
• G41 Tool nose radius compensation system
left • G92 Co-ordinate Cutting Speed
• G42 Tool nose radius compensation Setting
right • G96 Constant Surface Speed
• G70 Finishing Cycle • G97 Revolution per minute
List of M-codes
• M00 Optional program stop request • M30 End of program, Reset to
• M02 End of program start
• M03 Spindle start (forward CW) • M32 Tail stock Quill forward.
• M04 Spindle start (reverse CCW) • M33 Tail stock Quill Retract.
• M05 Spindle stop • M50 Spindle lock
• M06 Tool change • M51 Spindle Unlock
• M07 Mist coolant ON (coolant 1 ON) • M98 Transfer to subprogram
• M08 Flood coolant ON (coolant 2 ON) • M99 End of subprogram.
• M09 Coolant off
• M10 Chuck - De clamping
• M11 Chuck - Clamping
• M16 Chuck ID Selection
• M13 Chuck OD Selection
Cutting Speed for Milling, Drilling, Turning,
Boring.
Work Tool Brazed
Coated Carbide
Inserts
material HSS Carbide Rough Medium Fine

STEEL 20 - 30 60 - 90 80 - 120 200 - 250 250 - 300 300 - 400

CAST
20 - 40 75 - 100 100 - 150 135 - 225 175 - 270 215 - 275
IRON

BRASS & 35 - 75 100 - 250 125 - 200 150 - 300 250 - 600 500 - 2500
Aluminum
FEED CHART
Cutting Machining Operation
Work Tool
material Material TURNING DRILLING BORING
HSS 0.1 – 0.2 0.1 – 0.2 0.1 – 0.2
STEEL
Carbide Tip 0.1 – 0.3 0.1 – 0.3 0.1 – 0.3

HSS 0.1 – 0.3 0.2 – 0.4 0.1 – 0.3


CAST
IRON 0.15 – 0.5 0.15 – 0.5 0.1 – 0.5
Carbide Tip

HSS 0.1 – 0.6 0.1 – 0.6 0.1 – 0.6


BRASS &
Aluminum Carbide Tip 0.2 – 0.8 0.2 – 0.8 0.15 – 0.6
Ace Designers Jobber XL Lathe
Vertical
Spindle

FANUC Series Oi Mate -TD


SWITCHING OFF MACHINE
Make sure that all of the doors to the NC unit and the electrical cabinet are
closed; floor around the machine is clean without any traces of oil or coolant
leakage; compressed air supply, if required is given
•Switch off the MAIN BREAKER on the
shops power distribution board.

•Switch off the VOLTAGE STABILIZER


(The power source lamp will be putt off.)
•Switch of the MAIN SWITCH of the
machine

•Press the HOLD Power OFF Switch for 5


seconds. (The display on screen will
disappear.)

•Press EMERGENCY STOP Button (The


status indicator machine ready Indicator
is put off)
Vertical
INTERFACING
Spindle

Popular Fanuc/Siemens CNC System


FANUC CONTROLL INTERFACING
FANUC:-Fujitsu Automatic Numerical Control-Oi Mate-TD
Power Switches ON:-Power to NC is turned on when the(POWER
ON) Switch pressed
Power Switches OFF:-Power to NC is turned off when
the(POWER FF) Switch pressed
 EMERGENCY STOP
Pressing the (EMERGENCY STOP) switch turn off the power supply
to the NC servo system and stops the machine. The EMERGENCY
STOP switch should be pressed During the following situations.
 If an Emergency state arises during operation
» OR
 To turn off the power supply at the end of an operation.
By turning the (EMERGENCY STOP) switch clockwise, the button is
released from the locked state.
FANUC CONTROLL INTERFACING
 EDIT KEY SWITCH
This key switch is used to protect the stored program from being inadvertently
changed.
 PROGRAM EDIT ON
Program can be stored in the memory and a new program can be edited. This
key cannot be removed when the switch is set to this position.
 PROGRAM EDIT OFF
Program stored in the memory cannot be edited by the User. The key can be
removed when switch is set to this position.
 AUTOMATIC OPERATION SWITCHES
 CYCLE START
The switch is used to slot an automatic operation Auto or MDI mode. The
indicator above the switch is light during an automatic operation.
 CYCLE STOP (FEED HOLD)
This switch is used to temporarily stop the axis movement during an
automation operation. The indicator above the switch is light, while the axis
movement is stopped. Press (CYCLE START) to restart the interrupted
automatic operation.
FANUC CONTROLL INTERFACING
 COOLANT SWITCHES
 COOLANT ON
When this switch is pressed, the coolant supplied through nozzle. Also when
the coolant ON M code is read in Auto mode the coolant is automatically
supplied.
 COOLANT OFF
When the COOLANT OFF switch is pressed the coolant being supplied is
stopped.
When M09 code is executed during an automatic operation coolant is stopped.
 SPINDLE SWITCHES
 CW
The spindle rotates in the clockwise direction (Viewing a work piece
from the direction of the spindle) when this switch is pressed.
 CCW
The spindle rotates in the counter clockwise direction (Viewing the work piece
from the direction of the spindle) when this switch is pressed.
 STOP
The spindle stops when the STOP switch is pressed.
FANUC CONTROLL INTERFACING
SPINDLE LOAD METER
The spindle load meter indicates (as a percentage) the load applied
to the spindle motor.
 SPINDLE SPEED OVERRIDE %
The spindle speed is adjusted in the range of 50% to 120% of the
speed displayed in the program MDI (Manual Data Input) Screen.
Override setting is possible in increment of 10%.
 FEED OVERRIDE%
The feed(Linear Motion) is adjusted in the range of 0% to 150% of
the feed displayed in the program MDI (Manual Data Input) Screen.
Override setting is possible in increment of 10,%.
 RAPID OVERRIDE%
The Rapid feed(Air Motion) is adjusted in the range of 0% to 100% of
the feed displayed in the program MDI (Manual Data Input) Screen.
Override setting is possible in increment of 25,50,100,%.
FANUC CONTROLL INTERFACING
 MODE SELECTION
This switch selects the machine operation mode. They are classified
into three groups
1) Program Edit:-
a. Edit Mode(EDT)
2) Automatic Operation:-
a. Single Auto Mode
b. Auto Cont. Mode
c. MDI Mode(Manual Data Input)
3) Manual Operation:-
a) Handle mode (MPG) MANUAL PULSE GENAREATOR
b) Jog mode (Jump over Geometry)
c) Zero Return mode (ZRN)
FANUC CONTROLL INTERFACING
 EDIT
In EDIT mode following operations are possible:
 Inputting and storing the programs to the NC memory
 Changing and deleting the program to the NC memory
 Outputting a program stored in the NC memory using the
search functions ( Program number and search, sequence
number search)
 MDI
 A program created in the MDI mode will be cleared after it has been
executed, when the RESET key is pressed or when the power is turned
off.
 For this reason MDI mode is often used to rotate the spindle or to carry
out tool change operation.
 Setting parameter and other data.
FANUC CONTROLL INTERFACING
 HANDLE
 Select the axis to be moved through the axis selector switch
 Turn the pulse handle in the direction (+ or -), the selected axis will
move
 MANUAL PULSE GENERATOR
 The manual pulse generator is used to move an axis in the handle mode.
 The axis movement amount per pulse is selected using the MPG scale
selection switch by placing it in either “X1” or “X10” or “X100”
 JOG
 An axis is moved while the axis direction switch is held down after selecting the
Axis to be moved through the Axis selector switch. The selected axis is moved
with the feed rate set by the Feed rate override switch.
FANUC CONTROLL INTERFACING
 Single Auto
When the single block (SBK) mode is selected, the program is executed
block by block for every press of the (CYCLE START ) switch
 ZERO RETURN
With the selector switch in the Zero return position. The axes can be
returned to home position and the indicator for the Axes zero return
light will ON.
 OPTIONAL STOP
When the Optional stop (OSP) switch is in the ON position, Optional
stop function is called. The indicator above the switch will light when M01
command is executed and the machine operation is stopped. To continue
with the operation press the (CYCLE START) switch. Placing the switch
the OFF position cancels the optional stop function and the indicator goes
OFF.
FANUC CONTROLL INTERFACING
 BLOCK DELETE
When the Block Delete ( BDT) switch is in the ON position, the indicator
above the switch is light will on and the block delete function is called and
the commands in the program is ignored with the slash code (/) . placing the
switch in the OFF position cancels the block delete function and the
indicator goes OFF
 DRY RUN
With DRY RUN function enabled, the cutting feed rate specified in the
program is ignored and all the axis feed commands are executed. At a feed
rate set by the override switch.
 MACHINE LOCK
When this function is ON, the axes movement commands are all locked
while the operation data displayed on the screen is updated according to
the execution on the program.
O0001;Progamme Number
T0000; Pervious Tool/offset cancel FACING
G0 X0 Z0;Homing
T0101;Tool call with offset No.
G92 S1000 M04;
Spindle Rotation CCW
Maximum Spindle Speed
Maximum RPM setting
G96 S120;
Cutting Speed
Constant cutting/Surface Speed
G0 Z2.0; Safety height in Z axis
G0X32.0; Safety height in X axis
M07;Coolant ON
G72 W0.2 R0.3; Facing cycle
G72 P10 Q20 F0.2;
N10 G01 Z-10.0;
N20 G01X-1.0; Final tool path
G0 Z2.0; Safety height in Z axis
G0X32.0; Safety height in X axis
G97 T0000 M09;
Coolant OFF
Pervious Tool/offset cancel
Revolution Per Minute/RPM Constant
G0 X0 Z0;Homing
M30;End of Program.
FACING PARAMETERS FOR ROUGHING CYCLE
G72 Facing Roughing Cycle.
W Incremental depth of cut in Z axis
R Retraction
P Starting block number
Q Ending block number
F Feed Rate(MM/Rev)
O1234; Progamme Number PLAIN TURNING
T0000; Pervious Tool/offset cancel
G0 X0 Z0; Homing
T0101; Tool call with offset No.
G92 S1000 M04;
Spindle Rotation CCW
Maximum Spindle Speed
Maximum RPM setting
G96 S120;
Cutting Speed
Constant Surface Speed
G0 Z2.0; Safety height in Z axis
G0X52.0; Safety height in X axis
M07; Coolant ON
G71 U0.2 R0.3; Plain Turning cycle
G71 P10 Q20 F0.2;
N10 G01 X30.0;
G01Z-40.0; Tool Movement/Tool Path
N20 G01X50.0;
G0 Z2.0; Safety height in Z axis
G0X52.0; Safety height in X axis
G97 T0000 M09;
Coolant OFF
Pervious Tool/offset cancel
Revolution Per Minute/RPM Constant
G0 X0 Z0; Homing
M30; End of Program.
PLAIN TURNING PARAMETERS FOR ROUGHING CYCLE
G71 Plain Roughing Cycle.
U Incremental depth of cut in X axis
R Retraction
P Starting block number
Q Ending block number
F Feed Rate(MM/Rev)
STEP TURNING
O1111;
T0000;
G0 X0 Z0;
T0505;
G92 S1000 M04;
G96 S120;
G0 Z2.0;
G0X40.0;
M07;
G71 U0.2 R0.3; Plain Turning cycle
G71 P10 Q20 U0.05 W0.05 F0.2;
N10 G01 X20.0;
G01Z-10.0;
G01X30.0;
G01Z-20.0 Tool Movement/Tool Path
N20 G01X40.0;
G0 Z2.0; STEP TURNING
G0X40.0;
STEP TURNING PARAMETERS
G97 T0000 M09;
G70 Finishing Cycle
G0 X0 Z0;
U Incremental depth of
M01;Optional STOP
cut in X axis
N1T0202;(FINISHING CYCLE)
G92S1200 M04;
U Stock of material in X
G96S100 axis for finishing pass.
G00 Z2.0 W Stock of material in Z
M07; axis for finishing pass.
G70P10Q20 F0.1; R Retraction
G0Z2.0; P Starting block number
G97 T0000 M09; Q Ending block number
G0 X0 Z0;
F Feed Rate(MM/Rev)
M30;
Radius Turning
1234;
T0000;
G0 X0 Z0;
T0505;
G92 S1000 M04;
G96 S120;
G0 X42.0;
G0Z2.0;
M07;
G71 U0.4 R0.3;
G71 P10 Q20 U0.05 W0.05 F0.2; Plain Turning Rough Cutting Parameter
N10 G01 X0.0;
G01Z0.0;
G03X10.0Z-5.0R5.0;
G01Z-17.5; Tool Movement/Tool Path
G02X15.0Z-20.0R2.5;
G01X30.0
G03X35.0Z-22.5R2.5;
G01Z-30.0
N20 G01X40.0;
G0 Z2.0;
G97 T0000 M09;
Radius Turning
G0 X0 Z0; Radius Turning PARAMETERS
M01; G70 Finishing Cycle
N1T0202; U Incremental depth of cut in X axis
G92S1200 M04; U Stock of material in X axis for
G96S100
finishing pass.
G00 X42.0
G00Z2.0
W Stock of material in Z axis for
M07; finishing pass.
G70P10Q20 F0.1; R Retraction
G0X42.0; P Starting block number
G0Z2.0
Q Ending block number
G97 T0000 M09;
G0 X0 Z0;
F Feed Rate(MM/Rev)
M30; G02 Circular interpolation in CW
G03 Circular interpolation in CWW
Drilling
O1234;
T0000;
G0 X0 Z0;
T0505;
G97 S800 M03;
G0 Z2.0;
G0X0.0;
G83 - Face Drill Cycle
M07; Q - Incremental depth of cut along Z
G83 Z-50.0 Q300 R0.4 F0.02 axis in Micron
G01 Z2.0; Z - Total drill length from origin
G97 T0000 M09; R - Retraction
P - Starting block number
G0 X0 Z0;
Q - Ending block number
M30; F - Feed Rate(MM/Rev)
O1234;
T0000;
Step Boring With Finishing
G0 X0 Z0;
T0505;
G92S1000M04;
G96 S120 ;
G0 Z2.0;
G0X23.0;
M07;
G71 U0.2 R0.3;
G71 P10 Q20 U0.05 W0.05 F0.2;
N10 G01 X40.0;
G01Z-15.0;
G01X30.0;
G01Z-25.0;
N20G01X23.0;
G00Z2.0;
Step Boring With Finishing
G97 T0000 M09;
G0 X0 Z0;
M01;
N1T0202;
G92S1200 M03;
G96S100
G00 X23.0
G00Z2.0
M07;
G70P10Q20 F0.1;
G0X23.0;
G0Z2.0
G97 T0000 M09;
G0 X0 Z0;
M30;
O4455;
T0000;
Profile Boring
G0 X0 Z0;
T0505;
G92S1000M04;
G96 S120 ;
G0 Z2.0;
G0X14.5;
M07;
G71 U0.2 R0.3;
G71 P10 Q20 U-0.1 W0.05 F0.2;
N10 G01 X38.0;
G01Z0.0;
G01X30.0 Z-4.0;
G01Z-14.0;
G03X28.0 Z-15.0 R1.0;
G01X24.0
Profile Boring
G0Z-23.0 G70P10Q20 F0.1;
G03X20.0Z-25.0R2.0; G0Z2.0;
N20 G01X14.5; G0X23.0
G0Z2.0; G97 T0000 M09;
G97 T0000 M09; G0 X0 Z0;
G0 X0 Z0; M30;
M01;
N1 T0202;
G92S1200 M03;
G96S100;
G00 Z2.0;
G00Z14.5;
M07;
O5555;
T0000;
Grooving
G0 X0 Z0;
T0505;
G92S800M04;
G96 S120 ;
G0 Z2.0;
G0X26;
G01Z-18.0 F0.5
M07;
G75 X20.0 Z-18.0 P200 R0.2 F
G01 X26.0;
G01Z-31.0 F0.5;
G75 R0.3;
G75 X21.0 Z-34.0 P200 Q2500 F0.02;
G4 X1.0
G75 - Grooving Cycle Grooving Parameter
P - Incremental depth of cut along X
axis in Micron
Q - Incremental depth of cut along Z G4> Dwell time
axis in Micron
X - Groove Diameter Dwell=60xnumber of Revolution
R - Retraction rpm
F - Feed Rate(MM/Rev)
N=100x1000 60x2
3.14x24 800
100000 0.075x2=0.15 seconds=150 milliseconds
75.36
1326.9RPM 1-2 revolution for Brittle Material like
Rpm=1326x2 Cast iron, Brass.
3 1-4 revolution for tensile Material like
Steel , Aluminum.
880RPM
O3344;
T0000;
Internal Grooving
G0 X0 Z0;
T0303;
G97S800M04;
G0 Z2.0;
G0X18.0;
G01Z-25.0 F0.5;/G00Z-25.0;
M07;
G75 R0.3;
G75 X30.0 Z-28.0 P400 Q3500 F0.05; G75 - Grooving Cycle
G4X1.0 P - Incremental depth of cut along X
G00X18.0; axis in Micron
G00 Z2.0 Q - Incremental depth of cut along Z
G97 T0000 M09; axis in Micron
G0 X0 Z0; X - Groove Diameter
M30; Z - Total Groove Length from origin
F - Feed Rate(MM/Rev)
O112;
T0000;
Threading
G0 X0 Z0;
T0404;
G97S1000M04;
G0 Z2.0;
G0X18.0;
M07;
G76P040060 Q20 R0.05;
G76 X14.05 Z-20.0 P975 Q20 F1.5;
G00 Z2.0
G97 T0000 M09; Height=pitch x constant(0.01-0.65)
G0 X0 Z0;
h=1.5x0.65=0.975
M30;
Minor Dia = Major Dia-2h
=16-2x0.975
=14.05
Threading Parameter
P04 00 60
Thread Angle
End pull out Angle
Number of finishing Passes
G76 - Threading Cycle
R - Stock of material for finishing Passes
P - Thread height in Micron
F - Pitch
X - Minor Diameter
Z - Thread Length
(1st ) Q - Incremental depth of cut along X axis in Micron
(2nd ) Q - First depth of cut in micron
O113;
T0000;
Internal Threading
G0 X0 Z0;
T0707;
G97S500M04;
G0 Z2.0;
G0X15.0;
M07;
G76P04 00 60 Q20 R0.02;
G76 X20.0 Z-30.0 P1675Q20 F2.5;
G00 Z2.0
G97 T0000 M09; Height=pitch x constant(0.01-0.65)
G0 X0 Z0;
h=2.5x0.65=1.625
M30;
Minor Dia = Major Dia-2h
=20-2x1.625
=16.75
Internal Threading Parameter
P04 00 60
Thread Angle
End pull out Angle
Number of finishing Passes
G76 - Threading Cycle
R - Stock of material for finishing Passes
P - Thread height in Micron
F - Pitch
X - Major Diameter
Z - Total Thread depth from origin
(1st ) Q - Incremental depth of cut along X axis in Micron
(2nd ) Q - First depth of cut in micron
O1144;
T0000;
Taper Threading
G0 X0 Z0;
T0202;
G97S1000M04;
G0 Z0.0;
G0X40.0;
M07;
G76P04 00 60 Q20 R0.02;
G76 X38.05 Z-40.0 P975 Q20 R-5.0 F1.5;
G00 Z2.0
G97 T0000 M09; Height=pitch x constant(0.01-0.65)
G0 X0 Z0;
h=1.5x0.65=0.975
M30;
R=R1-R2 Minor Dia = Major Dia-2h
2 =40-2x0.975
40-30
=38.05
2 =5

You might also like