67% found this document useful (3 votes)
3K views

CNC Turning Examples

This document provides an introduction to CNC turning using a FANUC system. It discusses the fundamental principles of CNC turning including the parts of a CNC machine, programming units, machine control units, machine tools, and coordinate systems. It also covers various G-codes and M-codes used in CNC turning programs to control machine movements and functions. Example programs are provided to illustrate linear, circular, and cycle programming.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
67% found this document useful (3 votes)
3K views

CNC Turning Examples

This document provides an introduction to CNC turning using a FANUC system. It discusses the fundamental principles of CNC turning including the parts of a CNC machine, programming units, machine control units, machine tools, and coordinate systems. It also covers various G-codes and M-codes used in CNC turning programs to control machine movements and functions. Example programs are provided to illustrate linear, circular, and cycle programming.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

CNC TURNING

(FANUC SYSTEM)
 INTRODUCTION
 FUNDAMENTAL PRINCIPLES
 INSTRUCTION
1. INTRODUCTION

 Ways of Turning
 Parts of CNC Machine
 Working Methods of CNC
Ways of Turning

 Conventional or Traditional
 Numerical Control (NC)
 Computer Numerical Control (CNC)
Difficulties with Conventional System
 Complex shapes are difficult to machine
 Depends on the human skill
 Frequent & repeated measurements are required
 Difficult to achieve consistency in product quality
 High Changeover Time
 Less productive hours
 More scrap is generated
Current Market Demand
 High quality products
 at  Lowest cost
 in  Minimum time
 with  wide range of variety

Answer to the above is NC System


Parts of NC/CNC Machine

 Programming Unit

CNC  Machine Control Unit


NC

 Machine Tool Unit


Programming Unit

 Programmer
 Computer system
 User Interface device
 Data Storage and Transfer facility
Machine Control Unit
 Tape Reader
 Data Buffer
 Signal Output Channels to Machine Tool
 Feedback channels from the Machine Tool
Machine Tool
 Structure
 Extra Rigid
 Easy chip disposal System, eg: Use of Slant Bed

 Thermal Resistant

 Drives
 AC Induction motors
 DC motors
Machine Tool
 Actuation System
 Stepper motor/servomotor
 Ball Screw & nut with support bearing

 Feed back devices on closed loop system

 Linear Bearing

 Tool & Work handling Devices


 Automatic Tool Changers (ATCs)
 Turret Head

 Automatic Pallet Changers

 Hydraulic/Pneumatic Tool/Work Clamping System


2. Fundamental Principles
 Coordinate System
 Longitudinal Motion
 Transverse Motion

 Dimensioning System
 Absolute
 Incremental

 Mixed

 Reference System
 Machine Reference
 Work Reference
Instruction or program
 Introduction
N 10 G 00 X 50.0 Z 25.0 ; Block

Block No. Words End of Block

G 00 Data

Address
Layout of a CNC Program
[BILLET X 25.0 Z 60.0; [Size of raw Material
G99 G21 S500 M13; [ Setting Cutting Condition
G28 U0 W0; [ Ref. Point Return Header
M06 T0101; [ Tool Call
G00 X 25.0 Z 2.0; [Positioning
…… [ Path Definition
…… or Cycle Utility Body
or Subroutine Utility
G28 U 0 W0; [ Return to Ref. Point
End
M30; [ End of Program
Linear Path Function
 G00  Rapid Linear Movement
 G01  Linear Movement with
Programmed Feed Rate
Writing Format
G00 X 50.0 Z2.0;
G01 X 50.0 Z2.0 F0.1;
Example Program
[BILLET X55.0 Z40.0;
G99 G21 G40;
S1000 M13;
M06 T0101;
G00 X55.0 Z2.0;
G01 X55.0 Z0.0 F0.2;
G01 X -1.0 Z0.0 F0.1;
G00 X 55.0 Z2.0; 0,0
G00 X20.0;
G01 X20.0 Z-10.0 F0.1;
G01 X40.0 Z-10.0;
G01 X40.0 Z-25.0;
G01 X50.0 Z-25.0;
G01 X50.0 Z-35.0;
G01 X55.0 Z-35.0;
G00 X55.0 Z2.0;
G28 U0 W0;
M30;
Circular Path Function
 G02  Circular Movement Clockwise (CW)
 G03  Circular Movement Counter Clock
Wise (CCW)
Writing Format

G02 X 25.0 Z-10.0 R5.0 F0.1; G03 X 25.0 Z-10.0 R5.0 F0.1;
Example Program
[BILLET X55.0 Z40.0;
G99 G21 G40 S1000 M13;
M06 T0101;
G00 X38.0 Z2.0;
G01 X38.0 Z0.0 F0.2;
G01 X -1.0 Z0.0 F0.1;
G00 X 38.0 Z2.0;
G00 X10.0;
G01 X10.0 Z-10.0 F0.1;
G02 X18.0 Z-14.0 R4.0;
G01 X18.0 Z-19.0;
G03 X24.0 Z-22.0 R3.0;
G01 X24.0 Z-30.0;
G01 X38.0 Z-30.0;
G00 X38.0 Z2.0;
G28 U0 W0;
M30;
Example Program

(50.0, -25.0) (56.0, 0.0)


G00 X55.0 Z2.0; (56.0, -35.0) (56.0, 2.0)
(40.0, -10)
G01 X55.0 Z0.0 F0.2; (50.0, -35.0)
G01 X -1.0 Z0.0 F0.1;
(40.0, -25.0)
G00 X 55.0 Z2.0; (20.0, 2.0)
G00 X20.0; (20.0, -10)

G01 X20.0 Z-10.0 F0.1;


(0, 0)
G01 X40.0 Z-10.0;
G01 X40.0 Z-25.0;
G01 X50.0 Z-25.0;
G01 X50.0 Z-35.0;
G01 X55.0;
G00 X55.0 Z2.0;
Various Important Addresses
 O: Used to represent program number
 N: Used to represent Block Number
 G: Are known as preparatory codes, used to prepare the machine
for a particular function.
 X, Y, Z : Represents Absolute coordinates
 U, V, W: Represents Incremental coordinates
 I, J, K: Specifies coordinate of centre of arc
 R: Represents radius of arc
 S: Represents Spindle Speed
 T: Specifies Tool Number
 M: Miscellaneous Functions
 P, Q: Used to represent start & end block number in a subroutine
cycle.
 F: Represents Feed
G71 (Turning Cycle)

1st Line of G71:


Writing Format U – Specifies the depth of cut in each pass
G71 U1.0 R1.0; R – Retract amount after every pass
G71 P10 Q20 U0.5 W 0.5 F0.25;
N10 G00 X…..; 2nd Line of G71:
P – Specifies the start block number
…….
Q – Specifies the end block number
……. U – Specifies the finishing allowance in X
……. W – Specifies the finishing allowance in Z
N20 ……..; G70 – Finishing Pass
G70 P10 Q20 F0.15;
Example Program
……
N10 G00 X38.0 Z2.0;
N20 G71 U1.5 R0.5;
N30 G71 P40 Q130 U0.5 W0.2 F0.35;
N40 G01 X16.0;
N50 G01 Z0.5;
N60 G01 X20.0 Z 1.5;
N70 G01 Z-30.0;
N80 G01 X 23.0;
N90 G03 X25.0 Z-24.0 R1.0;
N100 G01 X30.0 Z-65.0;
N110 G01 Z-75.0;
N120 G02 X36.0 Z-77.0 R3.0;
N130 G01 X38.5;
N140 G70 P40 Q 130;
….
Example Program
[BILLET X38.0 Z40.0;
G99 G21 G40 S1000 M13;
M06 T0101;
G00 X39.0 Z2.0;
G01 X38.0 Z0.0 F0.2;
G01 X -1.0 Z0.0 F0.1;
G00 X 38.0 Z2.0;
G71 U1.0 R0.5;
G71 P10 Q20 U0.5 W0.1 F0.35;
N10 G00 X10.0;
G01 X10.0 Z-10.0 F0.1;
G02 X18.0 Z-14.0 R4.0;
G01 X18.0 Z-19.0;
G03 X24.0 Z-22.0 R3.0;
G01 X24.0 Z-30.0;
N20 G01 X39.0 Z-30.0;
G70 P10 Q20;
G00 X39.0 Z2.0;
G28 U0 W0;
M30;
Types of Instructions
1. Movement Instruction
• G00, G01, G02, G03
2. Machine Instruction
• M00, M02, M03, M04, M05, M06, M08, M09, M30
3. Tool Instruction
• T0101
4. Technological Instruction
• Cutting Speed
• Spindle Speed
• Feed
5. Dimensional Instruction
• Metric
• Inch
G- Codes
 G28: Return to Machine Reference Point
Writing Format: G28 U0 W0;
 G20: Programming in Inches
 G21: Programming in Metric (mm)
M-Codes
 M00: Program Stop, starts again when cycle start is pressed
 M01: Optional Stop
 M02: Program Reset
 M30: Program Reset & Rewind
 M03: Spindle Start in Clockwise Direction
 M04: Spindle Start in Anti Clockwise Direction
 M05: Spindle Stop
 M06: Command Tool Change
 M07/M08: Coolant ON
 M09: Coolant OFF
 M10: Chuck Open
 M11: Chuck Close
 M13: Spindle ON (CW) & Coolant on
 M14: Spindle ON (CCW) & Coolant on
 M25: Tailstock Quill Extend
 M26: Tailstock Quill Retract
 M98: Subprogram Call
 M99: Return to Main Program
G72 (Facing Cycle)

1st Line of G72:


Writing Format W – Specifies the depth of cut in each pass
G72 W1.0 R1.0; (in Z Direction)
G72 P10 Q20 U0.5 W 0.5 F0.25; R – Retract amount after every pass
N10 G00 X…..; 2nd Line of G71:
……. P – Specifies the start block number
……. Q – Specifies the end block number
N20 ……..; U – Specifies the finishing allowance in X
G70 P10 Q20 F0.15; W – Specifies the finishing allowance in Z
G70 – Finishing Pass
Example Program
[BILLET X28.0 Z40.0;
G99 G21 G40 S1000 M13;
M06 T0101;
G00 X29.0 Z2.0;
G72 W0.5 R0.5;
G72 P40 Q50 U0.5 W0.1 F0.35;
N40 G00 Z-33.0;
G01 X25.0 Z-33.0;
G01 X25.0 Z-23.0;
G01 X22.0 Z-23.0;
G01 X16.0 Z-8.0;
G01 X14.0 Z-8.0;
G03 X8.0 Z-5.0 R3.0;
G01 X8.0 Z-2.0;
G01 X4.0 Z0.0;
N50 G01 X0.0 Z0.0;
G70 P40 Q50 F0.15;
G00 X29.0 Z2.0;
G28 U0 W0;
M30;
Tool Offset
The Distance traveled by the tool cutting edge from the machine
reference point to the work reference point in a particular axis is
termed as “Tool Offset”. For turning tool offset is measured in
both the directions i.e. ‘X’ & ‘Z’.
Modal & Non Modal G-Codes
 The G-Codes whose effect continue in the
program once specified until it is cancelled or
overridden by another code are known as
“MODAL”. Eg: G00, G01, G02, G03 etc.

 The G-Codes whose effect only in the block where


it is defined are known as Non-Modal Codes. Eg:
G04
Groups of G-Codes
 The G-Codes are grouped under various groups.
Each group contains similar kind of codes and their
effect can only be overcome/nullified by the use of
another code of same group.

Group ‘0’ : G04, G10, G27, G28, G29, G30, G31


G50, G65, G72, G73, G74, G75, G76
Group ‘1’ : G00, G01, G02, G03, G90, G92, G94
Group ‘2’ : G66, G67, G96, G97
Group ‘4’ : G70, G71
Group ‘6’ : G20, G21
Group ‘7’ : G40, G41, G42
Group ’11’ : G98, G99
Centre Drilling Cycle (G81)
[BILLET X28.0 Z40.0;
G99 G21 G40 S1000 M13;
G28 U0 W0;
M06 T0202;
G00 X0.0 Z2.0;
G81 Z-5 F0.1;
G28 U0 W0;
M30;
Peck Drilling Cycle (G74)
[BILLET X28.0 Z40.0;
G99 G21 G40 S1000 M13;
G28 U0 W0;
M06 T0303;
G00 X0.0 Z2.0;
G74 R10.0;
G74 Z-68.0 Q20000 F0.05;
G28 U0 W0;
M30;
R = Retraction amount after every depth
Z = Depth of Cut
Q = Peck Increment (in micron)
F = Feed Rate
Different Modes of Machining
 Reference Mode or Home Mode
Tasks: Returns the turret to the machine reference/home point
 Manual or Jog Mode
Continuous Jog

Incremental Jog

Hand wheel Jog

Tasks: Move the Axes, Start & stop spindle rotation at a


predefined speed, Coolant On & Off, Turret indexing in
machine defined default direction one station on push of
button.
Different Modes of Machining
 Manual Data Input (MDI) Mode
Tasks: Single or few line simple program can be
written temporarily and executed only once. After
executing the written lines of program are deleted from
the machine memory.
 Auto Mode
Continuous Auto

Runs the complete program from beginning to the end


once the cycle start button is pressed.
Single Auto

Runs the program block by block i.e. only one block of


the program is executed by pressing the cycle start
button once.
Feed (Method Selection)
During Lathe working the feed of the tool can be defined by two
different Methods.

1. mm/minute
2. mm/revolution
While programming on CNC Machine the feed methods can be
selected by:

1. mm/minute : G98
2. mm/revolution : G99
Step Boring Cycle (G90)
[BILLET X28.0 Z40.0;
G99 G21 G40 S1000 M13;
G28 U0 W0;
M06 T0404;
G00 X12.0 Z2.0;
G90 X14.0 Z-30.0 F0.1;
X16.0;
X18.0;
X19.0;
X21.0 Z-20;
X23;
X24.0;
G28 U0 W0;
M30;
Grooving Cycle (G81)
[BILLET X28.0 Z40.0;
G99 G21 G40 S1000 M13;
G28 U0 W0;
M06 T0505;
G00 X52.0 Z2.0;
G01 Z-15.0 F0.3;
G81 X30.0 F0.02;
G01 Z-30.0;
G81 X20.0;
G28 U0 W0;
M30;
Profile Boring Cycle (G71)
[BILLET X40.0 Z40.0;
G99 G21 G40 S1000 M13;
G28 U0 W0;
M06 T0404;
G00 X15.0 Z2.0;
G71 U0.5 R0.5;
G71 P25 Q45 U-0.5 W0.1 F0.2
N25 G01 X35.0;
G01 X35.0 Z-10.0;
G01 X30.0 Z-10.0;
G02 X18.0 Z-16.0 R6.0;
G01 Z-30.0;
N45 G01 X15.0;
G28 U0 W0;
M30;
Pattern Repeating Cycle (G73)
[BILLET X55.0 Z50.0;
G99 G21 G40 S1000 M13;
G28 U0 W0;
M06 T0101;
G00 X56.0 Z4.0;
G73 U4 W3 R10;
G73 P10 Q20 U0.5 W0.5 F0.1
N10 G00 X15.0;
G01 X15.0 Z0.0;
G01 X15.0 Z-20.0;
G01 X25.0 Z-20.0;
G73 1ST Line:
G03 X35.0 Z-25.0 R5;
U : Specifies Roughing Material on X-Axis (in Radius)
G01 X40.0 Z-25.0; W: Specifies Roughing Material in Z-Axis
G01 X40.0 Z-40.0; R: Number of Passes.
N20 X50.0 Z-40.0; G73 2nd Line:
G70 P10 Q20; U : Specifies Finishing Allowance on X-Axis
W: Specifies Finishing Allowance on Z-Axis
G28 U0 W0; P & Q: Start & End Block Number Respectively
M30;
Use of G96, G97 & G50
While Programming for CNC Turning
(Fanuc)
 Meaning of G96, G97 & G50

 Significance

 Writing Format

 When to use
Meaning
 G96: Specifies constant cutting speed (m/min)

 G97: Specifies constant spindle RPM

 G50: Limits the maximum Spindle Speed


Cutting Speed & RPM
 Cutting Speed: It is defined as the speed with which the
periphery of workpiece passes over the cutting edge of
the tool. Its unit is m/min. It depends on following
quantities:
 Material of Workpiece
 Material of cutting tool

 RPM: It is the speed with which the spindle is rotating.


Its unit is revolutions per minute.
 The Cutting Speed & RPM are related by the following
formula:
V = πDN/1000,
where V is Cutting Speed, D is Diameter of Job, N
is RPM.
Significance
 G96 enables the machine to vary the spindle RPM with
varying diameter which results in:
 Good Surface Finish
 Reduced cycle time
 Improved tool life

 G50: Must be used with G96 to limit the maximum


spindle speed to prevent the extreme cases.

 G97 enables the machine to work with constant RPM:


 In some cases it is desired to have constant RPM
Writing Format
 Constant Cutting Speed
 G50 S4000; (here S represent Limit for maximum spindle
speed)
 G96 S100 M03; (here S represents the Cutting Speed defined
in m/min)

 Constant Spindle Speed


 G97 S2500 M03; (here S represents constant Spindle Speed)
When to use
 G96
 Turning & Facing
 Boring

 Grooving

 Parting

 G97
 Threading
 Drilling
Facing Cycle (G94)
[BILLET X40.0 Z15.0;
G99 G21 G40;
G28 U0 W0;
G50 S2500;
G96 S200 M03;
M06 T0101;
G00 X41.0 Z1.0;
G94 X-1.0 Z0.0 F0.1;
X15.0 Z-1.0;
Z-2.0;
Z-3.0;
X25.0 Z-4.0;
Z-5.0;
Z-6;
G28 U0 W0;
G97;
M30;
Grooving Cycle (G75)
[BILLET X25.0 Z60.0;
G99 G21 G40 S500 M13;
G28 U0 W0;
G50 S2500;
M06 T0505;
G00 X27.0 Z1.0;
G01 Z-10.0 F0.2;
G75 R1.0;
G75 X20.0 Z-40.0 P2000 Q15000 F0.02;
G28 U0 W0;
M30;
P: Depth of Cut in X-Axis
Q: Distance Between two consecutive groove in Z-axis
R: Retraction after each depth of cut
Z: Total distance in Z-axis for grooving
Threading

Crest

Root
Threading

Calculation for Thread Height:


h = 0.61343 x pitch
Core Diameter, d = D – 2x h
Requirements for Threading
 Select Proper Cutting Tool: Angle & Shape of
cutting tool should be same as that of the cross-
section of thread.
 Make Chamfer prior to threading: At the start of
thread.
 Make Groove prior to threading: At the end of
thread.
Threading Cycle (G92)
[BILLET X25.0 Z45.0;
G99 G21 G40;
S500 M13;
G28 U0 W0;
M06 T0606;
G00 X16.0 Z2.0;
G92 X15.4 Z-32.0 F2.0;
X15.1;
X14.8;
X14.5;
X14.2;
X13.9;
X13.6;
X13.546;
G28 U0 W0;
M30;
Threading Cycle (G76)
[BILLET X50.0 Z60.0;
G99 G21 G40;
S500 M13;
G28 U0 W0;
M06 T0101;
G00 X51.0 Z2.0;
G71 U1.5 R0.5;
G71 P10 Q20 U0.5 W0.5 F0.15;
N10 G01 X20.0 ;
G01 X24.0 Z-2.0; 1ST Line of G76:
N20 X24.0 Z-42.0; Pxxyyzz:
G70 P10 Q20; xx: No. finishing Passes
G28 U0 W0; yy: Chamfering amount at the end of thread
M06 T0606; zz: Angle of tool tip (in deg)
G00 X24.5 Z2.0; Q….: Minimum depth of cut in each pass (in micron)
G76 P031560 Q50 R0.15; R….: Finishing allowance (in mm)
G76 X20.319 Z-38.0 P1840 Q150 F3.0; 2nd Line of G76:
G28 U0 W0; X…..: Core diameter of thread (mm)
M30; Z….: Length of thread (mm)
P….: Height of thread (in micron)
Q…..: Depth of cut in first pass (in micron)
F….. : Pitch of thread (in mm)
Sub Program (M98 & M99)
 It is a program that is written once and can be
called as many times as it is desired in any other
main/sub program.
 Auxiliary functions used:
 M98: Jump to sub program
 M99: Return to main program/End of subprogram

 P2400 – Name of Sub program


Sub Program (M98 & M99)

 Operating Limits or rules:


 The name of a sub program can be maximum of 4
digit number (only numeric names can be sensed)
 Sub program should not be written within the main
program
 Sub program should not carry headers like [BILLET

 The name & number of subprogram need to same.

 The subprogram should not contain “M30” at the


end.
 One subprogram can be called in other subprogram.
Sub Program Example
[BILLET X40.0 Z100.0;
G99 G21 G40;
M03 S2000;
G28 U0 W0;
M06 T0101; TURNING TOOL]
G00 X42.0 Z0.0;
G01 X-1.0 F0.1;
G00 X40.0 Z2.0;
G01 Z-70.0 F0.1;
G28 U0 W0;
M06 T0404; [GROOVING TOOL]
G00 X42.0 Z-10.0;
M98 P100;
G00 Z-25.0; O100;
M98 P100; G81 U-8.0 F0.1;
G00 Z-40.0; G01 W-4;
M98 P100; G81 U-8.0;
G00 Z-55.0; M99;
M98 P100;
G28 U0 W0;
M30;
Sub Program
Tool Nose Radius
Compensation (TNRC)

G41/G42/G40
Importance

Actual Path Generated


(Material Left on Tool Path)
Programmed Path
Specifying TNRC
 Decide the Direction of TNRC
 G41 (Left)/G42 (Right) : Program

 Decide the Amount of TNRC


 Value of Tool Nose Radius : Tool Offset Page

 Decide the Imaginary Tool Nose Position (Tool Type)


: Tool Offset Page

 Cancel the TNRC (G40) : Program


Direction of TNRC

G42 (RIGHT)

G41 (LEFT)
Amount of TNRC
Radius of Tool Nose
Imaginary Tool Nose Position

2 6 1

7
5

3 8 4
Tool Types based on Imaginary TNR Position
Tool Types based on Imaginary TNR Position
How to specify in a program
WITHOUT TNRC WITH TNRC
[BILLET X38.0 Z40.0; [BILLET X38.0 Z40.0;
G99 G21 G40 S1000 M13; G99 G21 G40 S1000 M13;
G00 X 38.0 Z2.0; G00 X 38.0 Z2.0;
G71 U1.0 R0.5; G71 U1.0 R0.5;
G71 P10 Q20 U0.5 W0.1 F0.35; G71 P10 Q20 U0.5 W0.1 F0.35;
N10 G00 X10.0; N10 G00 G42 X10.0;
G01 X10.0 Z-10.0 F0.1; G01 X10.0 Z-10.0 F0.1;
G02 X18.0 Z-14.0 R4.0; G02 X18.0 Z-14.0 R4.0;
G01 X18.0 Z-19.0; G01 X18.0 Z-19.0;
G03 X24.0 Z-22.0 R3.0; G03 X24.0 Z-22.0 R3.0;
G01 X24.0 Z-30.0; G01 X24.0 Z-30.0;
N20 G01 X39.0 Z-30.0; N20 G01 G40 X39.0 Z-30.0;
G70 P10 Q20; G70 P10 Q20;
G00 X39.0 Z2.0; G00 X39.0 Z2.0;
G28 U0 W0; G28 U0 W0;
M30; M30;
How to specify in machine
 Go to Tool Offset Page
 Choose the Offset Number for the given tool

Sl X-offset Z-offset R T
1 ……….. ……….. 0.8 3

 In R-Column specify the tool nose radius


 In T-Column specify the Tool Type which ever is applicable from 1to
8 No.
G90 (Turning Cycle)

[BILLET X45.0 Z40.0;


G99 G21 G40 S1000 M13;
G00 X 46.0 Z2.0;
G01 X35.0 Z0.0 F0.1;
G90 X45.0 Z-30.0 R-1.0 F0.1;
G90 R-2.0;
G90 R-3.0;
G90 R-4.0;
G90 R-5.0;
G28 U0 W0;
M30;
Important G- Codes
G00 Rapid Linear Movement G00 X…. Z…. Used for air
movements only
G01 Linear Interpolation with G01 X …. Z …. F…. Used for metal
Program defined feed cutting

G02 Circular Interpolation G02 X… Z... R… F… Used for metal


Clock Wise (CW) Direction cutting

G03 Circular Interpolation G03 X… Z... R… F… Used for metal


Counter Clock Wise cutting
(CCW) Direction

You might also like