0% found this document useful (0 votes)
37 views

IE360 - Lecture 13 - Manual Part Programming-3

Uploaded by

gfromsomewhere
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)
37 views

IE360 - Lecture 13 - Manual Part Programming-3

Uploaded by

gfromsomewhere
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/ 43

IE360: CAD/CAM

Computer Aided Design and


Computer Aided Manufacturing

Lecture 13: Manual Part


Programming-3
Outline
➢ G-Codes programming for CNC Lathe

➢ Canned cycles for lathe

➢ CNC M-Codes

➢ Detailed description of M-Codes

➢ Examples

➢ Exercises
Objectives
➢ To understand the part programming for CNC
lathe.
➢ To be able to write part programs for cylindrical
components using necessary G-codes.

➢ To understand the use of M-Codes in part


programming with proper sequence.
➢ To be able to write part programs for CNC lathe
and milling components using necessary M-
Codes along with G-Codes.
G-Codes programming for CNC Lathe
Coordinate Axes

➢ Most of the G codes have same meaning


as used in milling operations e.g. X
Milling
➢ G00 x: parallel to the motion of the longer
Z
displacement of the table
➢ G01
➢ G02 y:parallel to the motion of the shorter
displacement of the table
➢ G03
z : axis of rotation of the tool
➢ G04 z+ move far away from the workpiece Tool
➢ G43
➢ G44
Turning hasTwo axis

Turning
➢ The major difference is that only two axis X axis is the displacement of
are present X and Z. the tool

axis are only called axis if we can control the velocity and position of axis
additional axises “ we name them W and U”

rotation of table “W “

tilting of table

you can have half- axis; rotating a table to a certain degree


G-Codes programming for CNC Lathe
Absolute and incremental positioning format
➢Another difference is that G90 and G91 are not required to be
mentioned.

➢ For absolute motions i.e. with respect to program zero CAPITAL X and Z
letters are used. Whereas for incremental movement, u and w are used
instead to describe motions along X and Z-axes.

➢ Unlike milling machine G-coding, within a same block absolute and


incremental values for X and Z-axes can be combined e.g.

N100 X60 W-30 i.e. X = 60 with axis move 30 units with respect to previous
Z location. respect to program zero while along Z

➢In addition, the user should be aware whether the machine


controller is interpreting X commands as diameters or radius.
Commonly X values are interpreted as diameters.
G-Codes programming for CNC Lathe
Feed rate specification

➢ G95 in block is commonly used in CNC lathe to specify feed rate


per revolution (mm/rev).
➢ This is different for milling where by mm/min or in/min is used
for feed rate. G94 is system default which interprets F in mm/min
Turning is requiemended to use mm/rev

Example
N1 M06 T01
N2 S500 M03
N3 G01 X0 Z0 G95 F0.3 feed rate
N4 X25 for turning we take diameter on X axis only
N5 Z-7.5
N6 X40 Z-15
N7 Z-25
N8 X60 Z-35
Canned cycles for lathe
G70: Profile finishing cycle (turning)
Format: N_ finshing
G70 P_ Q_F _
P: Start block, Q: End block, and F: Feedrate
G71: Profile roughing cycle for turning and boring
Format: N_ G71 U… R….
N_ G71 P_ Q_ U_ W_ F _ S _
roughing
➢ G71 turning cycle is used for rough (Stock)
material removal from a CNC lathe component in
turning mode. G71 turning cycle makes large
diameter cutting easy.
➢ Through G71 turning cycle parameters CNC
machinists can control
• Depth of cut.
• Retract height.
• Finishing allowance in x-axis and z-axis.
• Cycle cutting-feed, spindle speed.
➢ Often followed by the finishing cycle G70
Canned cycles for lathe
G71: Profile roughing cycle for turning and boring
Format: G71 U... R...
G71 P... Q... U... W... F... S...

Parameters description:
First block
U = Depth of cut. R = Retract height.
Second block
P = Contour start block number, Q = Contour end block number, U = Finishing
allowance in x-axis, W = Finishing allowance in z-axis, F = Feedrate during
G71 cycle, S = Spindle speed during G71 cycle

G71 Turning Cycle Overview


• G71 turning cycle cuts the whole contour repeatedly which is given in P Q
blocks.
• Depth of every cut can be controlled by first-block U value.
• Second-block U and W are the finishing allowances which can be given if
you want to make a finish cut with G70 finishing cycle.
• F is cutting feed and S is spindle speed (given in second-block) which are
used during G71 turning cycle.
Canned cycles for lathe
G71: Profile roughing cycle for turning and boring
Example:
N10 G00 X106 Z 1 M03 S800 (safe location)
N20 G71 U9 R10retract
depth of cut
N30 G71 P40 Q50 U2 W0 F0.25 P: profile to machined from n40 Q:n60 check dr slides this slide has wrong info
U = Finishing
N40 G00 X60 allowance in x-axis, W = Finishing allowance in z-axis, F = Feedrate during

N50 G01 Z-75


N60 G28 X100 Z50
N70 T3 M06
N80 G70 P40 Q50
Canned cycles for lathe
G71: Profile roughing cycle for turning and boring
Sequence of operations during G71 turing cycle
First-cut
1. Tool will move in x-axis U = 9 depth of cut with programmed feed from starting-
point.
2. Tool will travel with feed in z-axis (destination point in z-axis is given in P Q
blocks )
3. Tool rapidly retracts R amount in both x-axis and z-axis (at 45 degrees).
4. Tool rapidly travel in z-axis to start-point
Later-cuts
5. Tool rapidly moves to last cut depth.
6. Tool moves with feed in x-axis again with U depth of cut (as specified in block
N20).
7. Tool with feed moves in z-axis (destination point given in P Q blocks).
8. Tool rapidly retracts in x-axis and z-axis R amount (45 degrees).
9. Tool rapidly moves to start-point only in z-axis.
10. This whole sequence of operation keep on going, until the destination point in x-
axis is met
If finishing allowance is given tool will not make the exact diameter and length given in
P Q blocks but will leave that much allowance. This finishing allowance can be later
machined by calling G70 finishing cycle.
Canned cycles for lathe
G71: Profile roughing cycle for turning and boring
(Graphical illustration)

U
U
100

82
64
60
75
Video link
• https://www.youtube.com/watch?v=0zqbN5cu1Es

• https://www.youtube.com/watch?v=PmGxFI2DwZE
Canned cycles for lathe
G71: Example-1

Example-1 (Roughing depth = 2 mm,


roughing feed = 200 mm/min and finishing
allowances along x and z directions are 0.5
and 0.2 respectively, finishing feed = 100
mm/min)
N30 G54 G21 G92 S3000
O0004 ….. Photo Album

N40 G54 G21


N50 G00 X200 Z10 M3 S800
U 2.
N60 G71 U2 R1 without decimal means micrometer

N70 G71 P80 Q120 U0.5 W0.2 F200 S1200 they come in a bundle,
First U is Depth of cut,
N80 G00 X40 Z0 U in the second line
W: incremental means a x coordinate
N90 G01 Z-30 Z: absolute allowance

N100 X60 W-30


N110 W-20
N120 X100 W-10
N130 G70 P80 Q120
N140 M30
Canned cycles for lathe
G71: Example-2
Program
N10 T1 M03 S800
N20 G00 X45 Z2 G42
N30 G71 U2 R1
N40 G71 P50 Q120 U0.25 W0.1 F0.25
N50 G00 X19.8
N60 G01 X23.8 Z-2
N70 G01 Z-25
N80 G01 X28.07
N90 G01 X34 Z-33
N100 G01 Z-48
N110 G01 X42
N120 G01 Z-58
N130 G00 X100 Z100
N140 G92 S1200
N150 T3 G96 S150 M03 M06
N160 G00 X45 Z3
N170 G70 P50 Q120
N180 G00 X100 Z100
N190 M30
Canned cycles for lathe
G72: Profile roughing cycle for facing
Format: G72 W... R...
G72 P... Q... U... W... F... S...

Parameters description:
First block
W = Depth of cut. R = Retract height.
Second block
P = Contour start block number,
Q = Contour end block number,
U = Finishing allowance in x-axis,
W = Finishing allowance in z-axis,
F = Feedrate during G72 cycle,
S = Spindle speed during G72 cycle

The G72 command automatically faces


off a part to a predefined depth of cut,
with preset offsets and feedrates.
Canned cycles for lathe
G72: Example-1

Program
N5 G00 X65 Z42 (safe location)
N6 G72 W2 R2
N7 G72 P8 Q9 U0 W0 F0.3
N8 G00 Z30 N8 G01 G41 X60 Z30
N9 X20
N9 G01 X20 N10 G40 G80
Canned cycles for lathe
G72: Profile roughing cycle for facing
(Graphical illustration)

W W W
60

40
Video link
• https://www.youtube.com/watch?v=o9vXeH8lCjQ

• https://www.youtube.com/watch?v=_QTEY9v9iD4
Canned cycles for lathe
G72: Example-2
Program
N010 G00 X220.0 Z60.0
N011 G00 X176.0 Z2.0
N012 G72 W7.0 R1.0
N013 G72 P014 Q021 U4.0 W2.0 F0.3 S550
N014 G00 G41 Z-70.0 S700
N015 X160.0
N016 G01 X120.0 Z-60.0 F0.15
N017 W10.0
N018 X80.0 W10.0
N019 W20.0
N020 X36.0 W22.0
N021 G40
N022 G70 P014 Q021
N023 G00 X220.0 Z60.0
N024 M30
Canned cycles for lathe
G74: Peck drilling cycle along the z axis
Format: N_ G74 R…
N_ G74 X0 Z_ K_ F_
➢ R: Retract plane, X0: X always 0
because center drilling, Z: Total depth,
K: Peck depth, and F: Feed rate
Z
➢ The G74 command executes a peck
drilling cycle with automatic retracts
and incremental depths of cut.
➢ During a peck drilling cycle, the tool Example:
feeds in to the peck distance or depth of N10 G74 R 0.25
cut, then retracts up to a pre-determined N20 G74 X0 Z-1.0 K0.125 F0.015
distance, which is the chip-breaking In this example, a hole is peck drilled
process, and then feeds to the next peck, to a total depth of 1 in, using 0.125
which takes the tool deeper. This inch for the depth of each peck. After
process is repeated until the final Z every peck tool will retract to Z= 0.25
depth is reached.
Canned cycles for lathe
G74: Example

Program
N10 T5
N20 G97 S500 M03
N30 G00 X0 Z2
N40 G74 R1
N50 G74 Z-55 k11 F0.1
N60 G00 X100 Z100
N70 M30
Exercise
Write a part program using the necessary G-codes to machine the part shown below on a
turning center. All dimensions are all in millimeters. Use the following machining parameters
and tools:
1. Tool T01 for Roughing – spindle speed of 400 rpm and feedrate of 0.4 mm/rev.

2. Tool T02 for finishing – spindle speed of 600 rpm and feedrate of 0.2 mm/rev.
The depth of cut for each roughing pass is 2 mm and the amount of stock to be left for
finishing on the X and Z axes are 0.3 and 0.5 mm, respectively. Coolant must be ON for all
cutting operations. Tool initial position is at (X=10, Z=50).

R10

X
(0,0)

Z
R10
CNC M-Codes

➢ M-codes are miscellaneous functions that


include actions necessary for machining but
not those that are actual tool movements.

➢ They are auxiliary functions, such as spindle


on and off, tool changes, coolant on and off,
program stops, and similar related functions.
Detailed description of M codes
▪ M00: Compulsory program stop
▪ M02: Program end
▪ M30: Program end, reset to start
▪ M03: Spindle rotation normal – clockwise (CW)
▪ M04: Spindle rotation reverse – counterclockwise (CCW)
▪ M05: Spindle rotation stop
▪ M06: Tool change
▪ M08: Coolant on
▪ M09: Coolant off
▪ M10:Clamps on or chuck open
▪ M11: Clamps off or chuck close
Video link
• https://www.youtube.com/watch?v=Jf09iO0Sr8Y
Detailed description of M codes
M00: Compulsory program stop
Format: N_ M00

➢The M00 command is a temporary program stop function. When it


is executed, all functions are temporarily stopped and will not restart
unless and until prompted by user input.

➢This command can be used in lengthy programs to stop the program


in order to clear chips, take measurements, or adjust clamps,
coolant hoses, and so on.
Detailed description of M codes
M02: Program end
Format: N_ M02
➢ The M02 command indicates an end of the main program
cycle operation.

➢ Upon encountering the M02 command, the MCU switches off


all machine operations (for example, spindle, coolant, all axes,
and any auxiliaries), terminating the program.

➢ This command appears on the last line of the program.

M30: Program end, reset to start


Format: N_ M30
➢ The M30 is used to end the program and reset it to the start.
Detailed description of M codes
M03: Spindle rotation normal – clockwise (CW) Format: N_ S_ M03
M04: Spindle rotation reverse – counterclockwise (CCW) Format: N_ S_ M04
➢The M03 command switches the
spindle on in a clockwise rotation.
➢ The spindle speed is designated
by the S letter address, followed by
the spindle speed in revolutions per
minute.
➢The M04 command switches the
spindle on in a counterclockwise
rotation.
➢ The spindle speed is designated
by the S letter address, followed by
the spindle speed in revolutions per
minute.
Detailed description of M codes
M05: Spindle rotation stop
Format: N_ M05

➢ The M05 command turns the spindle off.

➢ Although other M codes turn off all functions (for example,


M00 and M02), this command is dedicated to shutting the
spindle off directly.

➢ The M05 command appears at the end of a program.


Detailed description of M codes
M06: Tool change
Format: N_ T_ M06

➢ The M06 command halts all program


operations for a tool change.

➢ It is actually a two-fold command.

▪ First, it stops all machine operations


for example, the spindle is turned off
and oriented for the tool change, and
all axes motion stops - so that it is
safe to change the tool.

▪ Second, it actually changes the tool.


Detailed description of M codes
M08: Coolant on Format: N_ M08
➢The M08 command switch on the coolant flow.

M09: Coolant off Format: N_ M09

➢The M09 command shuts off the coolant flow.

➢The coolant should be shut off prior to tool changes or when tool is
rapidly moved over long distances.
Detailed description of M codes
M10:Clamps or chuck on Format: N_ M10
M11: Clamps or chuck off Format: N_ M11

➢ The M10 command turns on the


automatic clamps to secure the workpiece.
➢ The M11 command releases the
automatic clamps so that the work-piece
may be removed and the next blank
inserted.
➢ The automatic clamps may be
pneumatic, hydraulic, or
electromechanical, depending on the
application.
➢ In turning, the M10 and M11
commands are used to control the
automatic chuck.
➢ M10 clamps the chuck, and M11
unclamps it.
Examples
➢ Example 1: Write a part program to mill the edge of the plate and two
holes as shown in the following figure. The dimensions are in millimeters. A
cutter of 10 mm diameter named T01 is selected for edge cutting and a drill of
10mm named T02 for drilling of holes. A constant machining feed rate of 350
mm/min is used. A constant spindle speed rate of 500 m/min is used. The
coolant should be on. The thickness of the plate is 10 mm and depth of cut for
both milling and drilling is 10 mm. The holes are peck drilled with increment
of 2.5 mm.

X0 Y0 10 30 30 10

-
Solution
N01 G90 G17 G54
N02 G21
N03 M06 T01
N04 M08 G42 D01
N05 G00 X0 Y0 Z2 M03 S500
N06 G01 Z-10 F350
N07 X100
N08 Y60
N09 X70
N10 G02 X30 Y60 R20 F350
N11 G01 X0
N12 Y0
N13 Z2
N14 G40
N15 M05
N16 M09
N15 G28 X0 Y0 Z10 M06 T02
N16 G43 H02 G29 X10 Y30 Z5
N17 M03 S500
N18 M08
N20 G99 G83 X10 Y30 Z-10 R 2.5 Q2.5 F350
N21 X90
N22 G80
N23 G00 X-80 Y0 Z20
N24 G49
N25 M30 or M02
Examples
➢Example 2: Write a part program to machine the part shown below. The
dimensions are all in inches. Use the following machining parameters and
tools:
1. Roughing – spindle speed of 500 rpm and feedrate of 0.012 ipr, T02
2. Finishing – spindle speed of 700 rpm and feedrate of 0.006 ipr, T03
3. Drilling – drill speed of 400 rpm and a feedrate of 0.004 ipr, T04
The depth of cut for each roughing pass is 0.0625 inch and the amount of stock
to be left for finishing on the X and Z axes are 0.05 and 0.004 inches,
respectively. The hole is peck drilled to a total depth of 1.5 inch using 0.25 inch
for the depth of each peck.
Examples
Solution
• N05 G54 G20 G95 G97
• N10 T02 M06
• N15 S500 M03
• N20 G00 X0.5 Z0.25
• N25 G01 Z0 F0.012
• N30 G71 U0.0625 R0.1
• N35 G71 P40 Q65 U0.05 W0.004 F0.012 S500
• N40 G01 X0.5 Z-0.75 M08
• N45 G02 X1 Z-1.0 R0.25
• N50 G01 Z-2.0
Examples
• N55 G02 X1.5 Z-2.25 R0.25
• N60 G01 X2.0
• N65 Z-3.0
• N70 M09
• N75 G28 X4.0 Z2.0 T03 M06
• N80 G43 H03 G29 X0.5 Z0.25
• N85 S700 M03
• N90 M08
• N95 G70 P40 Q65 F0.006
• N100 M09
• N105 G28 X4.0 Z2.0 T04 M06
• N110 G43 H04 G29 X0 Z0.25 S400 M03
Examples
• N115 M08
• N120 G74 X0.0 Z-1.5 K0.25 R0.2 F0.004
• N125 G00 X4.0 Z2.0 M09
• N130 G49
• N135 M30
Exercises
Exercise 1: Write a part program manually to mill the edge of the
plate shown below. The dimensions are in millimeters. Assume
that the raw material, a rectangular plate, has a thickness of 15
mm and that its bottom face has the z coordinate of 0. Assume
that the tool, named T03, diameter is 10 mm, the machining feed
rate is 250 mm/min, the rapid traverse feed rate is 850 mm/min,
and the spindle speed rate is 700 rpm. The coolant should be on.

(35, 40) (55, 40)


Φ 25
(80, 30)

(55,30)
y

(35, 5) (80, 5)
x
Start point (0, 0)
Exercises
Exercise 2: Write a part program manually to mill the edge of the
plate shown below. The tool, named T03, diameter is 1.0 inch and
the suggested cutting conditions are 6 ipm for the machining feed
rate and 600 rpm for the spindle speed. The dimensions are all in
inches.
Exercises
Exercise 3: Write a part program manually to machine the part shown below.
The dimensions are all in inches and the tool start position is at the point (X2,
Z3). Use the following machining parameters and tools:
1. Roughing – spindle speed of 500 rpm and feedrate of 0.012 ipr, T02
2. Finishing – spindle speed of 700 rpm and feedrate of 0.006 ipr, T03
3. Drilling – drill speed of 500 rpm and a feedrate of 0.004 ipr, T04
The depth of cut for each roughing pass is 0.0625 inch and the amount of stock
to be left for finishing on the X and Z axes are 0.05 and 0.004 inches,
respectively. The hole is peck drilled to a total depth of 1 inch using 0.125 inch
for the depth of each peck. X axis

R = 0.5

R = 0.25

Ø = 1.75 Ø = 0.5 Ø = 1.0 Z axis

1.0

1.5

2.5

You might also like