Вы находитесь на странице: 1из 32

Chapter 7

CNC Part Programming

Prepared By:
Dishank Upadhyay
Mechatronics Department
TeamLease Skills University
Vadodara
Outline
CNC Control System
Absolute & Incremental dimensions method
Introduction of programming
Procedure
CNC coordinate system
Axes and motion nomenclature
Structure and form of part programming
Word address format
Preparatory Functions (G Code)
Miscellaneous Functions (M Codes)
Tool Compensations
Macros
Canned Cycles
Thread cutting Cycle
Mirror image
Constant speed programming
Programming examples
Turning centers
Milling centers
Coding System
3 primary NC block formats used in
the industry are
1. Fixed Sequential format
2. Tab sequential format
3. Word Address format
It is the binary coded decimal or BCD
System
Newer coding system is ASCII (American
Standard Code for Information Interchange).
1. Fixed Sequential Format
Each block consist of exactly the same number of words entered in a
specific order.
Each word consist of a fixed number of digits
Example
0050 00 + 0025400 + 0012500 - 0010000 0000 00
0060 01 + 0025400 + 0012500 - 0010000 0200 08
Explaination
0060 = block number
01 = Preparatory code
+ 0025400 = X Axis Value = 25.40 mm
+ 0012500 = Y Axis Value = 12.50 mm
- 0010000 = Z Axis Value = -10.00 mm
0200 = Feed rate = 200 mm/min
08 = Miscellaneous = Coolant ON
2. Tab Sequential Format
Same as the fixed sequential format
Difference is TAB character precedes each words within the block, except
for the first word
Each word consist of a fixed number of digits
Example
0050 TAB 00 TAB + 0025400 TAB + 0012500 TAB - 0010000 TAB 0000 TAB 00 EOB
0060 TAB 01 TAB + 0025400 TAB + 0012500 TAB - 0010000 TAB 0200 TAB 08 EOB
Explaination
0060 = block number
01 = Preparatory code
+ 0025400 = X Axis Value = 25.40 mm
+ 0012500 = Y Axis Value = 12.50 mm
- 0010000 = Z Axis Value = -10.00 mm
0200 = Feed rate = 200 mm/min
08 = Miscellaneous = Coolant ON
2. Word Address Format
Used in all modern CNC machine tools.
Much easier to use
Example:
N110 G01 X131.4 Y-36.65 f0.15
Explaination
N110 = Word
X,Y = Address
131.4,-36.65 = Numeric Data
String characters are essential
Following sets of characters are generally used.
Alphabet : A to Z
Digits = 0- 9
Operator = + , - , / , * , =
Special Characters = () , (.),
2. Word Address Format
Part program is made up of NC Blocks
NC block has one or more NC Words
NC word consist of an address followed
by numeric information
Part Program = NC Block + Prog Block
+ EOB
EOB code = ; (Necessary in every
block)
Pressing ENTER generates the EOB
code
Block begins with ;block will act as a
comment and it will not work.
Types of Codes
There are total 7 types of codes used in CNC Programming

1. Sequence or Block Number (N) : Identify the block


2. Preparatory Code (G) : Prepares MCU to perform specific
operation
3. Miscellaneous Code (M) : Specify certain Miscellaneous and
auxiliary Functions available
4. Axis Word (X,Y,X etc.)
5. Feed Word (F) : Specifies the federate of the cutting tool
6. Speed Word (S) : Specifies the spindle speed
7. Tool Number (T) : Select a tool from an automatic tool
changer or a tool turret.
Preparatory Codes (G Codes)
G00 Rapid Transverse
G01 Linear Interpolation
G02 Circular Interpolation, CW
G03 Circular Interpolation, CCW
G17 XY Plane,G18 XZ Plane,G19 YZ Plane
G20/G70 Inch units
G21/G71 Metric Units
G40 Cutter compensation cancel
G41 Cutter compensation left
G42 Cutter compensation right
G43 Tool length compensation (plus)
G43 Tool length compensation (plus)
G44 Tool length compensation (minus)
G49 Tool length compensation cancel
G80 Cancel canned cycles
G81 Drilling cycle
Miscellaneous Codes (M Codes)
M00 Program stop
M01 Optional program stop
M02 Program end
M03 Spindle on clockwise
M04 Spindle on counterclockwise
M05 Spindle stop
M06 Tool change
M08 Coolant on
M09 Coolant off
M10 Clamps on
M11 Clamps off
M30 Program stop, reset to start
Modal & Non Modal Codes
All codes are either model or Non model codes.
Modal Codes
Stay effective until cancelled by another code
Code stay active in memory
For small capacity it is used
Example
G01 is a modal code that produces = linear interpolation
This code will be cancelled if G02 is programmed.
Non Modal codes
They are effective only for the blocks in which they are programmed
After that it will turn off automatically
Example
G04 = Dwell is a non modal code
To perform dwell again it must be used again in the next block
Positioning Systems
There are main 2 types of positioning system in the CNC programming
1. Absolute Programming or Positioning
2. Incremental / Relative Programming or Positioning

1. Absolute Programming
Coordinates have absolute value with respect to its origin
Sign of each movement is depending on reference/origin point

2. Incrmental Programming
Measurement is not from part origin
It is from the previous point.
Diameter & radius Programming
Data input units
All cnc machines permits programming in either Inch or in mm.
It may be noted that when switching from one data mode to another,
units of following items may be changed
1. Feedrate
2. Coordinate position
3. Offset values
4. Unit of scale for manual pulse generator
5. Spindle speed
It is not advised to switch data mode, so we have to use data input
units.
1. G20 = inch Programming
2. G21 = Metric or mm Programming
G20,G21 are modal codes.
Spindle Speed Control
Spindle speed control consist of controlling 2 things
1. Direction
2. Spindle speed
1. Direction
.M words are used to specify direction of rotation of spindle
M 03 = Clockwise direction
M 04 = Counter Clockwise direction
M 05 = Stops the spindle rotation
2. Spindle speed
. It is programmed using a S code following by 4 digit word
. For 550 rpm = S550 is used.
. Spindle speed modes are
G97 = constant RPM mode (RPM)
G98 = Constant surface speed (feet per minute)
Feedrate control
Cutting operation may be programmed using
2 basic feedrate mode.
1. Turning Centre = G98(Per minute) , G99 (per
revolutions)
2. Machining centre = G94 (per minute) , G95 (Per
revolution)
Example
. G98 F50 = Feedrate of 50 mm per revolution
. G99 F0.2 = Feedrate of 0.2 mm per revolution
Tool and tool offset
Word T is used followed by 2 or 4 digits
indicating the number of tool to load from the
ATC.
Example:
T 00 = includes tool offset number and tool number
T 0000 = last 2 tool offset number, first 2 tool number
T00H00 = last 2 tool offset number, first 2 tool number
Program Control
Codes used are
M00, M01, M02, M30
M00 = Program stop
Temporary stops, when we press start button program will
resume from where it was stopped
M01 = Optional stop
Gives the option to stop the program
M02 = End Program
Stop the spindle and stop the coolant
M30 = Program stop and rewind
Reset all registered values to the initial mode.
G00 Rapid Traverse
Rapid traverse to save time move one position
to another quickly
Typical rapid traverse rates are 10m/min to 25
m/min
Speed Accelerated at start of the block and
decelerated at end of block
Dogleg effect
in incremental U = X , W = Z.
Feed rate cannot be programmed with G00.
G00 Rapid Traverse
Syntax:
Absolute Programming
G00 X_________ Z___________
Incremental Programming
G00 U_________ W__________
G01 Linear Interpolation
Linear cutting or straight cutting
command
Syntax:
G00 X______ Z_______ F_______
Where F = Feedrate
Used to cut segment of straight line
between 2 straight points
Programming of 2 axis at a time,
tool will move simultaneously in
both the axis as shown in figure.
For taper cutting also both the axis
are programmed together.
Example - 1

Write a manual part program for the part shown in figure, assume
that the part is already rough turned and the tool is required to be
programmed for finish turning.
For facing use : T03 with Feedrate : 0.1 mm/rev
For Finish Turning : T03 with feedrate : 0.15 mm/rev
Example 2 Rough Turning

Write a manual part program for the part shown in figure, assume
that the part is already rough turned and the tool is required to be
programmed for finish turning.
For facing use : T03 with Feedrate : 0.1 mm/rev
For Rough Turning : T03 with Feedrate 0.2 mm/rev & D.O.C 4 (max)
For Finish Turning : T03 with feedrate : 0.15 mm/rev & D.O.C 1.5(max)
G02/G03 Circular Interpolation
G02 : Clockwise Direction
G03 : Anti-Clockwise Direction
Tool cuts an arc or even a full
circle.
Tool moves to the two axis
simultaneously.
Following information is required
1. Cutting Direction (G02/G03)
2. Arc End point Coordinates
3. Radius of arc or centre of arc
G02/G03 Circular Interpolation
Method 1 : Radius of arc
programming
Syntax:
G02/G03 X__ Z__ R__ F__
G02/G03 U__ W__ R__ F__
Where
X,Z :
U,W :
R: Radius of Arc
F : Feedrate
G02/G03 Circular Interpolation
Method 2 : Centre of arc
programming
Syntax:
G02/G03 X__ Z__ I___ K___ F___
G02/G03 U__ W__ I____ K___ F____
Where
X,Z :
U,W :
I,K are incremental distance from the arc start point
to the arc centre in X,Z axis respectively.
F : Feedrate
I,K codes should not be mixed with R Code.
If this codes are mixed, the R code will take
precedence over the other codes.
Example

Write a manual part program for the part shown in figure, assume
that the part is already rough turned and the tool is required to be
programmed for finish turning.
For facing use : T03 with Feedrate : 0.1 mm/rev
Tool Compensations
3 kinds of tool compensations used on turning
centres.
1. Geometrical Offset
2. Wear Offset
3. Tool Nose Radius Compensations
Geometrical Offset
Wear Offset
T 0507 : Tool 5 offset by 7
T 0000 : Tool 5 offset
cancel
Tool nose radius compensation
G40, G41, G42
G41 : Offset to left
G42 : Offset to right
G40 : cancel any tool nose
radius compensations
Thank You

Вам также может понравиться