0% found this document useful (0 votes)
5 views38 pages

Lec.5 CNC

The document is a lecture by Prof. Dr. Saber abd Rabbo on Computerized Numerical Control (CNC), detailing G-code programming for drilling cycles, tool length compensation, and circular interpolations. It includes examples of milling operations and manual part programming, illustrating the use of various G and M codes. The content serves as a guide for understanding CNC programming techniques and their applications in machining.

Uploaded by

Waleed Yossef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views38 pages

Lec.5 CNC

The document is a lecture by Prof. Dr. Saber abd Rabbo on Computerized Numerical Control (CNC), detailing G-code programming for drilling cycles, tool length compensation, and circular interpolations. It includes examples of milling operations and manual part programming, illustrating the use of various G and M codes. The content serves as a guide for understanding CNC programming techniques and their applications in machining.

Uploaded by

Waleed Yossef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Prof. Dr.

Saber abd Rabbo


Professor of Automatic
Control & Mechatronics

sinaiuniversity.net
Lec. 5
Computerized
Numerical control
CNC
Prof. Dr. Saber
2

Abdrabbo
EXAMPLE 5:
This program involves a simple drilling cycle with a defined
retract plane. Once the G-code for the drill cycle has been
executed, only the X and/or Y location of the remaining holes
need to be defined
Workpiece Size: X5, Y4, Z1
Tool: Tool #7, 3/8" HSS Drill
Tool Start Position: X0, Y0, Z1 (Relative to
workpiece)
% N55 Y1
:1005 N60 X3
N5 G90 G20 N65 X4
N10 M06 T7
N70 Y2
N15 M03 S1000
N75 Y3
N20 G00 X1 Y1
N25 Z0.25 N80 X3
N30 G81 X1 Y1 Z-0.25 R0.25 F3 N85 Y2
N35 Y2 N90 G00 Z1
N40 Y3 N95 X0 Y0
N45 X2 N100 M05
N50 Y2 N105 M30
G43 Tool Length Compensation (Plus)
Format: N_ G43 H_

The G43 command


compensates for tool
length in a positive
direction. It is important to
realize that different tools
will have varying lengths,
and when tools are
changed in a program, any
variation in tool length
will throw the origin out
of zero. To prevent this,
the difference in tool
length should be
compensated for.
G49 Tool Length Compensation Cancel
Format: N_ G49

The G49 command cancels all previous cutter length offset


commands. Because the G43 and G44 commands are modal,
they will remain active until canceled by the G49 command. It
is important to keep this in mind; forgetting that a tool has been
offset can cause the cutter to crash into the workpiece.
7
8
9
10
11
12
13
Circular interpolations(G02 )
• G02 circular interpolation clockwise around
an arc

14
Circular interpolations( G03)

•G03 circular interpolation counter clockwise around an arc

15
G2/G3 programming
Two basic methods
I. J. K. Method or Radius method
• IJK Method
The I, J, K addresses are used to specify the
distances from the start of the arc to the
arc center coordinates in XYZ directions.
I. J. K. Values can be found by using the
following equations
– I = xc-xs
– J = yc-ys
– K = zc-zs
– Format:
– G02/G03 X Y Z I J K
Where X Y Z represent the end point of the arc
16
• Radius Method
• Requires two entry
parameters in the
command the XYZ end
point of the arc and the
radius
• G02/G03 Xx Yy Zz Rr
– Positive radii are less then
180º
– Negative radii are greater
than180º

17
18
19
Exercise

20
G90 X Y G91 X Y
Absolute Increment
P0 X0 Y0 P0 X0 Y0
P0-P1 X-20 Y-20 P0-P1 X-20 Y-20
P0-P2 X12 Y-20 P1-P2 X32 Y0
P0-P3 X20 Y-12 P2-P3 X8 Y8
P0-P4 X20 Y14 P3-P4 X0 Y26
P0-P5 X12 Y20 P4-P5 X-8 Y6
P0-P6 X-20 Y20 P5-P6 X-32 Y0

21
•G04 Dwell

22
23
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

Up to now the center of the cutter has been


programmed to move around the part 24
geometry
Milling Example
Mill around profile the shown work piece, at
depth of 0.125 inch. Tool 1, is a 0.5 inch
diameter end mill.

25
Part program
%(Radius method) %(I,J,k Method)
:1000
N05 G90 G20 :1000
N10 M06 T1 N05 G90 G20
N15 M03 S1200 N10 M06 T1
N20 G00 X2.0 Y0.0 Z0.125 N15 M03 S1200
N25 G01 Z-0.125 F5 N20 G00 X2.0 Y0.0 Z0.125
N30 X0.5 Y0.5 N25 G01 Z-0.125 F5
N35 Y3.0 N30 X0.5 Y0.5
N40 G02 X2.0 Y3.0 R0.75 N35 Y3.0
N45 G01 X3.5 N40 G02 X2.0 Y3.0 I0.75 J0.0
N50 Y0.5 N45 G01 X3.5
N55 G02 X3.0 Y0.0 R0.5 N50 Y0.5
N60 G01 X2.0 N55 G02 X3.0 Y0.0 I-0.5 j0.0
N60 G01 X2.0

26
Manual Part Programming Example

5”
2.5”
p4
p2 p3 p5

1”

Tool size = 0.25 inch,


5” Feed rate = 6 inch per minute,
Cutting speed = 300 rpm,
Tool start position: 2.0, 2.0
45°
Programming in inches

(4, 4)
p1 Motion of tool:
p0  p1  p2  p3  p4  p5  p1  p0
p0 (2, 2)
27
1. Set up the programming parameters

5”
2.5”
p4
p2 p3 p5

1”

Programming in inches
5”
Use absolute coordinates

Feed in ipm
45°
N010 G70 G90 G94 G97 M04
(4, 4)
p1
Spindle speed in rpm
p0 (2, 2)
Spindle CCW
28
2. Set up the machining conditions

5”
2.5”
p4
p2 p3 p5

1”
Machine moves in XY-plane

Use full-circle interpolation


5”
Feed rate

Spindle speed
45°
N020 G17 G75 F6.0 S300 T1001 M08
(4, 4)
p1
Tool no.
p0 (2, 2)
Flood coolant ON
29
3. Move tool from p0 to p1 in straight line

5”
2.5”
p4
p2 p3 p5

Linear interpolation
1”
target coordinates

5” N030 G01 X3.875 Y3.698

45°

(4, 4)
p1

p0 (2, 2)

30
4. Cut profile from p1 to p2

5”
2.5”
p4
p2 p3 p5

1”

Linear interpolation
5” target coordinates

N040 G01 X3.875 Y9.125


45°
or
(4, 4)
p1 N040 G01 Y9.125

p0 (2, 2)

X-coordinate does not change  no need to program


31 it
5. Cut profile from p2 to p3

5”
2.5”
p4 Linear interpolation
p2 p3 p5

target coordinates
1”

N050 G01 X5.634 Y9.125

5”

y = 9 + 0.125 = 9.125
(6.5 - x)2 + 0.1252 = (1 - 0.125)2
x = 5.634
45° p3
(x, y)
(4, 4)
p1 (6.5, 9)
.125

p0 (2, 2)

1” 32
6. Cut along circle from p3 to p4

5”
2.5”
p4
p2 p3 p5

1”

circular interpolation, CCW motion

5”
target coordinates

45° N060 G03 X7.366 Y9.125 I6.5 J9.0

(4, 4) coordinates of center of circle


p1

p0 (2, 2)

33
7. Cut from p4 to p5

5”
2.5”
p4
p2 p3 p5

1”

5”

Linear interpolation

45° target coordinates (Y is unchanged)

(4, 4)
N070 G01 X9.302
p1

p0 (2, 2)

34
8. Cut from p5 to p1

5”
2.5”
p4
p2 p3 p5

1”

5”
Linear interpolation

target coordinates (see step 3)


45°
N080 G01 X3.875 Y3.698
(4, 4)
p1

p0 (2, 2)

35
9. Return to home position, stop program

5”
2.5”
p4
p2 p3 p5

1”

Linear interpolation

5” target coordinates (see step 3)

N090 G01 X2.0 Y2.0 M30

45°
end of data
(4, 4)
p1
N100 M00

p0 (2, 2) program stop


36
G Codes
• G00 Rapid traverse
• G01 Linear interpolation • G40 Cutter compensation –
cancel
• G02 Circular interpolation,
CW • G41 Cutter compensation –
• G03 Circular interpolation, left
CCW • G42 Cutter compensation-
• G04 Dwell right
• G08 Acceleration • G70 Inch format
• G09 Deceleration • G71 Metric format
• G17 X-Y Plane • G74 Full-circle programming
• G18 Z-X Plane off
• G19 Y-Z Plane • G75 Full-circle programming
• G20 Inch Units (G70) on
• G21 Metric Units (G71) • G80 Fixed-cycle cancel
• G81-G89 Fixed cycles
• G90 Absolute dimensions
37
• G91 Incremental dimensions
THANK
YOU

Prof. Dr. Saber abd Rabbo

Professor of Automatic
Control & Mechatronics

You might also like