Professional Documents
Culture Documents
03 - Ch1 To Ch4 - Final
03 - Ch1 To Ch4 - Final
for manufacturing.
Examples of CAD Software
SolidWorks SolidEdge
CAMWorks EdgeCAM
PowerMILL FeatureCAM
AlphaCAM Mastercam
• …….etc
Customers
& Process
Markets Planning (5)
(1)
CAM
What is Manufacturing?
From Liquid
B. Same Material
ex:( Casting)
D. Additive Manufacturing
C. Subtractive Process
Machining
In Machining, A Manufactured Part Is Created To Its
Desired Geometric Dimensions By The Removal Of Excess
Material From A Work Piece, Via A Force Exerted Through
A Certain Material Removal Tool.
Turning Milling
Drilling Shaping
Types of
Milling Machines
Horizontal Vertical
milling machine milling machine
MILLING MACHINE
End Mill
Cutting Tool
Holders
Universal Vise
Milling Operations
Pocket milling
Profile milling
Milling
Parameters
S: Spindle Speed (RPM)
• Drilling
Drilling Operations
Drilling Operations:
1- Drilling:
A drill bit enters the workpiece axially and cuts a
blind hole or a through hole with a diameter
equal to the tool diameter.
Twist Drill
It is the angle between the cutting edges. It is generally 118 degree. Its
value depends upon the hardness of the work piece to be drilled. For
harder material, larger angles are used.
VI- Drilling Operations:
2- Reaming:
A reamer is a multi-point tool that has
many flutes, which may be straight or
in a helix.
•A reamer enters the workpiece
axially and enlarges an existing hole to
the diameter of the tool.
•Reaming removes a minimal amount of
material and is often performed after
drilling to obtain
- Accurate diameter.
- A smooth internal finish.
• Quality control
• The adverse effect of operator skill, fatigue and
human reliability have been reduced to minimum
• More complex parts can be produced at high level
of accuracy as well as quality
• Service responsibility
Advantages of NC
1. Program of instructions
2. Machine Control Unit (MCU)
3. Machine tool (turn, mill, machine
center)
1. Program of instructions
Magnetic tape
• The main advantages :
1. Easier for handling.
2. Rapidly produced and read.
3. Programs can be erased and tape reused.
4. More durable than paper (in perforated
tape)
5. More storage space than perforated tape
• The main disadvantages :
1. Not visible
2. Need VDU to check by eye
1.3. Floppy disk
5.25 In
3.5 In
• Advantage
Faster transfer rate than other medias
• Disadvantage
Same with magnetic Tape (not visible)
• Solution
Using PC to visualize contents
1.4. Direct to computer
Linear Axes
➢ The Z axis is along the spindle. +Z is from the part looking
1. Reading drawing
2. Programming
3. Input Program
4. Manufacturing
68
NC Words
General Format of a Block
Tool
Dimension Feed
Sequence Preparatory Number
Words Rate Spindle Misc.
# Function
Speed Function
N G X Y Z I J K F S T M
Example
N010
N020
N025
N030
G-Code : Preparatory Word
Is used to prepare the controller for instructions
G20 – Inch input (in) – G70
G21 –Metric input (mm) – G71
Coordinate Systems
Absolute Incremental
1 (10,2) 1 (10,2)
Absolute & incremental coordinates
Absolute (G90) : All Points refers to Zero point
Incremental (G91) :
All Points refers to
Previous point
pt Abs Inc
Practice
X-Y-Z Word : Coordinates word
G Codes – Arcs
Method : Arc with R
(R is arc radius)
Absolute coordinates
X1Y2
N0 G90 ; Absolute coord
N5 G00 X1 Y2 ; start
R1
N10 G02 X2 Y1 R1
X2Y1
X1Y2
R1
Relative coordinates
N0 G91; Relative coord
X1Y-1
N05 G00 X1 Y2 ; start
N10 G02 X1 Y-1 R1
F-Word : Feed Rate :
The feed rate code to move the cutting tool or work piece to
80 Tool Magazine
CNC turret
Miscellaneous function
M-Code List: that used for decision command like
spindle on/off or coolant on/off
M02 End of Program
M03 Spindle on CW
M04 Spindle on CCW
M05 Spindle off
M06 Tool change
M07 Coolant 2 on
M08 Coolant 1 on
M09 Coolant off
M30 End of tape
Preparatory function
G-Code List: that used to guide the machine tool to
carry out machining processes
G00 Rapid Linear Interpolation PTP
G01 Linear Interpolation
G02 Clockwise Circular Interpolation
G03 Counter Clockwise Circular Interpolation
G17 X-Y Plane Selection
G18 Z-X Plane Selection
G19 Y-Z Plane Selection
G20 Inch Mode
G21 Metric Mode
G90 Absolute Value Command
G91 Incremental Value Command
Programming
Point N G X Y Z I J S F T M
P1
…
…
Pn
Profile milling
Profiling is to cut the WP using one side of the
cutting tool
Practice
Write a part programme to machine the following part and
list the tool used
30
50
20
80 10
Dim in mm
Solution Tool change Point
P0
Y
30
P2
50 P3
P4 P5
20
P1
80 P6 X 10 Z
Solution
N010 G21 G90
N050 Y50
N060 X30
N070 Y20
N080 X80
N090 Y0
N100 X0
N110 Z5
N130 M30
Tool Description
90
Example2 (Profiling)
example
Absolute cord. N10 G90
Feed Rate (mm/min) N20 G98
Metric units N30 G21
Go to above start point(1) N50 G0 X25 Y5 Z10
Tool changing N60 T1 M6
Spindle 1000rmp&feed N80 S1000 M03
Down to depth 5 at (1) N90 G01 Z-5 F100
Linear to (2) N100 X95
Linear to (3) N110 Y12
CW to (4) N120 G2 X110 Y27 R5
Linear to (5) N130 G1 X115
Linear to (6) N140 Y70
CCW to (7) N150 G3 X100 Y85 R15
Linear to (8) N160 G1 X15
example
Linear to (9) N170 X5 Y63
Linear to (10) N180 Y27
Linear to (11) N190 X10
CW to (11) N200 G2 X25 Y12 R15
Linear to (12) N210 G1Y5
Out of w.p. to Z=10 N220 Z10
Spindle stop N230 M5
End program N240 M2
Slot milling
Slotting is to cut the WP using both sides of cutting
tool
Example3 (Slotting)
Example (Slotting)
Example (Slotting)
Example (Slotting)
Example (Slotting)
Example (Slotting)
Absolute cord. N10 G90
XY plane N20 G17
Metric units N30 G21
Go to above start point(1) N50 G0 X40 Y100 Z10
Tool changing N60 T2 M6
Spindle 1000rmp&feed N80 S1000 F10 M3
Down to depth 5 at (1) N90 G01 Z-20
Linear to (2) N100 Y60
CCW to ( 3) N110 G3 X70 Y30 R30
Linear to(4) N120 G1 X130
CCW to (5) N150 G3 X160 Y60 R30
Linear to (6) N160 G1 Y100
Out of w.p. to Z=10 N220 Z10
Spindle stop N230 M5
End program N240 M2
Example No. 4
16
1 10
24
1 GRID
SPACES
D( , ) I( , ) J( , )
B( , ) K( , )
L( , )
E( , )
A( , )
F( , )
C( , )
H( , ) G( , )
Origin
(0,0)
1GRID
SPACES
L(21,12)
E(21,4)
A(3,2)
F(19,2)
C(10,2 )
H(14,4) G(16,2)
Origin
(0,0)
Solution Tool
Y change
Point
N010 G90 G21
N020 G00 X25 Y17 Z1.5 T01 M06
N030 G00 X3 Y2 Z1 S1000 M03 M08
X
N040 G01 Z-1 F5
N050 Y14
N060 X10 Y2
N070 Y14
N080 G00 Z1
Tool
Y change
N090 X21 Y4 Point
N100 G01 Z-1
N110 X19 Y2
N120 X16
N130 X14 Y4 X
N140 Y12
N150 X16 Y14
N160 X19
N170 X21 Y12
N180 G00 Z1.5
N190 X25 Y17 M05 M09
N200 M30
109
Fixed Zero and Floating Zero
Machine
Zero
Program Zero
Part Zero
Part Zero: The part origin can be set at any point inside the
machine's electronic grid system. Establishing the part origin is also
known as zero shift, work shift, floating zero or datum. Usually part
origin needs to be defined for each new setup. Zero shifting allows
the relocation of the part.
Fixed Zero and Floating Zero
Floating Zero:
20
20
G92 X…Y…Z…
Produced
pocket
Produced
profile
D: Cutter Diameter rc
rc: cutter radius D
The programming regarding tool radius
compensation are as follows:
At Left compensation
G41
Compensation direction
Types of Compensation
1. Ramp compensation
2. Parallel compensation
G42
G41 (or G42) and G01 in the same block ramp takes place at
block N0010.
N0010 G01 G42 X0.500 Y1.700
N0020 G01 X1.500
Tool compensation G-Codes
1. Automated tool compensation
2. Parallel compensation
G41
G42
G41 (or G42) is already started before G01 in previous
block, the compensation is effective from the start.
N0010 G41………………………
N0020 G01 X0.500 Y1.700
N0030 G01 X1.500
Recommended
Tool compensation G-Codes
1. Automated tool compensation
136
Tool length offset
• If more than one tool is being used, the first tool is set to zero on all
axis (XYZ). As the X and Y axis are set at the center of the cutter
they will be the same for all subsequent cutters.
• The Z axis zero point will however be different for each tool, being
dependent on the tool length.
This means that tool No. 1 has been set to a tool length
of 0
H= -30 mm
T05 M06
T05 new tool
length G43 H05
Radius G41 H35
T05 M06
length T05 new tool
G43 H05
G41 D05
Radius
Example II
Solve the following with auto. tool compensation using
tool of 20 mm diameter at depth 10 mm, S2000, and
F10
Point X Y
1 0 0 3 4
2 0 100
3 50 170 5
4 140 170 2
5 190 120
6 190 40 6
7 150 0
1 7
Example II
Solve the following with auto. tool compensation using
tool of 20 mm diameter at depth 10 mm, S2000, and
F10
Absolute cord. N10 G90 G98
XY plane N20 G17
comp. off N30 G40
Metric units N40 G21 3 4
w.p. floating(0) N50 G54
Go to above 1 N60 G0 X-20 Y-20 Z20
Tool changing N70 T1 M6 G43 H1
1000rmp&feed N80 S1000 F10 M3 5
Dwn to depth 10 at (0) N90 G01 Z-10
2
Ramp Linear to (1) G41 D01 X0 Y0
152
calculated
Original
profile
Offset
profile
(2,4)
(6.5,2)
(0,0) (6,0)
feature.
solution.
Example No.1
Write a CNC program to mill the outline of the following
part using 0.5” end mill. The machine doesn't
5 1
Dim in inch
Y
ΔY 2 ΔY
ΔX P2 P3 ΔX
4
ΔY ΔY
P4ΔX P5 ΔX
P1 1
P6
ΔY 5 X ΔY 1 Z
ΔX ΔX
XC = YC =
point X Y ΔX ΔY
X+ΔX Y+ΔY
1 0 0 -0.25 -0.25 -0.25 -0.25
2 0 4 -0.25 0.25 -0.25 4.25
3 2 4 0.25 0.25 2.25 4.25
4 2 1 0.25 0.25 2.25 1.25
5 5 1 0.25 0.25 5.25 1.25
6 5 0 0.25 -0.25 5.25 -0.25
ΔX : the cutter location shift in X direction
ΔY : the cutter location shift in Y direction
G Code Program
N010 G20 G90
N050 Y4.25
N060 X2.25
N070 Y1.25
N080 X5.25
N090 Y-0.25
N100 X-0.25
N110 Z0.5
N130 M30
The tool path is regenerated according to
tool’s diameter
ΔX and ΔY are determined depending on the case
of the intersections of two surfaces.
ΔX = ΔY = rc ΔY
ΔX
ΔY = rc ΔX
α
2/ α
ΔX = rc / tan(α/2) rc ΔY
α
Case No.3 : one vertical and other inclined
ΔX = rc
ΔY = rc / tan(α/2)
ΔX = rc
ΔY = rc / tan(α/2)
Example No.2
Write a CNC program to mill the outline of the following
part using 0.5” end mill. The machine doesn't
support the tool compensation option.
Dim in inch
Thick. = 1”
XC = YC =
point X Y ΔX ΔY
X+ΔX Y+ΔY
1 0 0 -0.25 -0.25 -0.25 -0.25
2 0 5 -0.25 0.25 -0.25 5.25
3 2 5 .09 0.25 2.09 5.25
4 5 2.48 0.25 0.116 5.25 2.6
5 5 0 0.25 -0.25 5.25 -0.25
G code Program
N010 G20 G90
N060 X2.09
N080 Y-0.25
N090 X-0.25
N100 Z1
N130 M30
Case No.5 : Line with arc
Example No.3
Define the coordinates for the outline of the following
profile. The machine doesn't support the tool
compensation option.
All Dim.
are in inch
point X Y ΔX ΔY XC YC I J
Solution
At Point 3
ΔX3=(1.75+0.25) sin (θ)
ΔY3=(1.75+0.25) cos (θ)
Where:
Θ=α+β
Tan(α)=1/2.75 α = 20 deg.
Sin(β) = 0.25 / 𝟐. 𝟕𝟓𝟐 + 𝟏𝟐 β = 5 deg. Θ = 25 deg.
ΔX3 = 0.842 inch
ΔY3 = 1.814 inch
Xc3 = 1.75+0.842=2.592 inch
Yc3 = 2.5 + 1.814 = 4.314 inch
At Point 4
Z initial
R -level
Z -level
Initial level : is the specific position of the tool at the moment the canned
cycle become effective
Z - level: is the end of the feed (metal cutting) motion or the final depth
R - level : the end or rapid motion (0.5: 2.5mm) from the part surface.
Conventional programming
G81 : Drilling
Sequence of moves:
Op 3) Feed to Z depth.
Z
Example
Z initial
G00 Z30
30
R -level
G98 G81 X10 Y10 Z-15 R2 F0.4
20 15
Note Z -level
Y
If the Zero point in the bottom of the WP
G00 Z50
10 X
G98 G81 X10 Y10 Z5 R22 F0.4 10
Note (cont.)
For through holes
Z = wp thick + d /(2tan 59) + clearance (5mm)
Z = 20 + (10 / (2tand(59))) + 5 = 31mm Z
Example
G00 Z30 30
G00 Z50 d
118
G98 G81 X10 Y10 Z-11 R22 F0.4
G82 : Counter Boring
Sequence of moves:
Op 3) Feed to Z depth.
Format
G82 X Y Z R F P
Z
Example
Z initial
G00 Z30
30
R -level
G98 G82 X10 Y10 Z-5 R2 F0.4 P2500 5
20
Note Z -level
Y
If the Zero point in the bottom of the WP
G00 Z50
10 X
G98 G82 X10 Y10 Z15 R22 F0.4 P2500 10
G83 : Deep Hole Peck Drilling ---- (L/d)≥3
Sequence of moves:
Op 1) Rapid position to X, Y and Z (the initial level).
Op 2) Rapid traverse to R point level.
Op 3) Feed in to the value of Q.
O p4) Rapid traverse out to R point. Operation from 2 to 4 are repeated until
Z depth is reached.
Op 5) Rapid traverse to Initial level (G98) or R level (G99)
Format
G83 X Y Z R F Q
Z
Example L=15 ,d=5mm
Z initial
G00 Z35
35
R -level
G98 G83 X10 Y10 Z-15 R2 F0.4 Q 2
5
30 15
Note Z -level
Y
If the Zero point in the bottom of the WP
G00 Z65
10 X
G98 G83 X10 Y10 Z15 R32 F0.4 Q 2 10
Note (cont.)
For through holes
Z = wp thick + d /(2tan 59) + clearance (5mm)
Z = 20 + (10 / (2tand(59))) + 5 = 28mm Z
G00 Z65 d
118
G98 G81 X10 Y10 Z-11 R32 F0.4
G84 : Tapping
Sequence of moves:
Op 3) Feed to Z depth.
Note
Example
------
Note :
F = 100*(1/20)=5”/min
G76 : Fine Boring
Sequence of moves:
Op 3) Feed to Z depth.
Format
G76 X Y Z R F Q
Q: side shift Z
Example
Z initial
G00 Z35
35
R -level
G98 G76 X10 Y10 Z-35 R2 F0.4 Q 0.5
5
30
Note Z -level
Y
If the Zero point in the bottom of the WP
G00 Z65
10 X
G98 G76 X10 Y10 Z-5 R32 F0.4 Q 0.5 10
1. Complete the following table to perform the (Drilling, Counter
boring, and Tapping operations) For the part shown in the Fig,
using suitable canned cycles. Note: R-level =2mm for all
operations.
position Drilling Operation
G X Y Z R S F P Q Note
1 81 25 25 -5 52 1000 4 Z=
2 81 100 50 -5 52 1000 4
3 81 100 150 -5 52 1000 4
4 81 175 175 -5 52 1000 4
Counter boring
2 82 100 50 15 27 1000 100
3 82 100 150 15 27 1000 100
Tapping
1 84 25 25 -5 52 100 200
4 84 175 175 -5 52 100 200
Multiple Machining
195
Y
Loop Command Cycles
N10 G90 G20 X
G91 X1 L9
G90 Y-2
G91 X-1 L9
Y
G90 Y-3
X
G91 X1 L9
G90 Y-4
G91 X-1 L9
……………
G90 Y-10
G91 X-1 L9
M30
Bolt Hole Patterns
G70 I J L
L: Number of Holes
Y
Example X
N10 G90 G20 G00 X6 Y5 Z1 T01 M06
hole circle)
Note : L0 will cause machine
N50 G99 G81 Z-0.5 R0.1 F0.4 L0
to not do this command until
N60 G70 I1.25 J10 L8 the control reads the next
G71 I J K L
L: Number of Holes
Example Y
N10 G90 G20 G00 X6 Y5 Z1 T01 M06 X
N80 M30
G72 I J L
L: Number of Holes
Y
Example X
N40 G00 X0.65 Y-1.5 (Start position of bolt holes along an angle)
N80 M30
Example No.1 Y
N10 G90 G20
N40 G00 X1 Y1
N170 M30
Subprogram
Subprogram call M97
instead of repeating them many times, they can be “called up” when
needed.
holes which may need to be center drilled, peck drilled, tapped, and/or
chamfered.
holes, the main program can define the canned cycles, and the hole
operations.
Thus, the X-Y positions can be entered only once and used several
with the subroutine call it is repeated that number of times before the
M99 which sends it back to the next line after the subroutine call in
O100 (Subprogram)
X2.5
X4.5
X3.5 Y1.5
…………Listing all the hole locations
M99 (ends a sub-program and returns back to
the next line in the main program)
Write a G code program for milling the shown 4 rectangular pocket,
use subroutine
Y call.
20
25
20
30
X
N1 G90 G21 G00 X200 Y80 Z50 T01 M06
Main Program
N2 G00 X20 Y20 Z5 S1000 M03 M08
N4 M97 O100 L1
N6 G00 X70 O100 (Subprogram)
N7 M97 P100 L1 G92 X0 Y0 (set current
N8 G00 X120 position to X=0,Y=0)
N9 M97 O100 L1 G01 Z-10 F4
N10 G00 X200 Y 50 Z20 M05 M09 Y25
N11 M30 (End of main program) X30
Y0
X0
Z2
M99