You are on page 1of 66

Chapter 2

CANNED CYCLES AND SUBROUTINES


CANNED CYCLES

"Canned" ?
The word "canned" has probably been borrowed from
canned goods, which one usually stores away for later use.
CANNED CYCLES

"Cycle" ?
Because the instructions represented a set of routine like
repetitive patterns.
Canned cycles & G-code address
These canned cycles are filed away under a standardized G-code
address

G84
G81
G82
G83
G76
G84
G85
G86
Types of canned cycles
1-Milling and Drilling Canned cycles
2- Turning Canned cycles
Canned Cycles
• Canned cycle or fixed cycles are the G-codes used to
combine a number of common motions that are used with
some types of operations such as drilling of holes.
• Fixed Cycles are used when programming various types of
hole operations, such as;
• shallow hole drilling,
• deep hole drilling,
• spot drilling,
• counter boring,
• regular tapping,
• rigid tapping, various types of boring, and back boring.
Standard canned cycle motions
G73 Peck drilling cycle (Feed stop with each peck for chip break)

G74 Counter tapping cycle (Left hand threading)

G75 Not for Milling

G76 Fine boring cycle

G80 Fixed cycle cancel

G81 Drilling cycle (simple drill into part and rapid out)

G82 Drilling cycle, counter boring cycle (same as G81 with added dwell)

G83 Peck drilling cycle (same as G81 with pecking amount added)

G84 Tapping cycle (Right hand threading)

G85 thru Boring cycle (There are various types, feed in rapid out, feed in and out, feed in stop
G89 spindle then rapid out, back bore cycle, and others.
G98 Return to initial point/level in Fixed cycle

G99 Return to the R point/level in Fixed cycle


Standard canned cycle motions
Canned Feed from At programmed depth Used for
cycle surface (end of feed point)
number Dwell Spindle Spindle
speed return
motion
G80 Off -- Stop -- Cancel canned cycle
G81 Constant -- -- Rapid Drilling, centre drilling
G82 Constant Yes -- Rapid Counter sinking, Counter
G83 Intermitten -- -- Rapid boring
G84 t -- Reverse Feed Deep hole drilling
G85 Constant -- -- Feed Tapping
G86 Constant -- Stop Rapid Reaming
G87 Constant -- Stop Manual Boring
G88 Constant Yes Stop Manual Multiple Boring
G89 Constant Yes -- Feed Boring
Constant Boring
Standard canned cycle motions
The distance from the origin in the Z axis, where Z axis motion changes
R from rapid to feed, it is also used as the distance to retract before moving to
the next hole if using G99.
Q The depth of each Peck until the Z depth is reached
Dwell amount when the Z axis has reached its depth, specified as a time
P value with no decimal. Example: P1000= 1 second, P500=1/2 second,
P250=1/4 second
F Cutting feed rate
K Number of repeats (can be used on the end of any fixed cycle)
Standard canned cycle motions
Fixed Cycle Tool Motion and Application Chart
Z axis motion Operation when Z axis Z axis motion
G-Code into the work depth is reached out of the work Application

G73 Intermittent feed N/A Rapid traverse High speed peck drilling cycle
G74 Feed Dwell & reverse spindle Feed Left hand tapping cycle
G76 Feed Spindle stop & orient Rapid traverse Fine boring cycle
G80 N/A N/A N/A Cancel
G81 Feed N/A Rapid traverse Drilling cycle
G82 Feed Dwell Rapid traverse Drill, spot drilling, counter boring

G83 Intermittent feed N/A Rapid traverse Peck drilling cycle

G83 Intermittent feed Dwell Rapid traverse Small hole peck drilling cycle
G84 Feed Dwell & reverse spindle Feed Right hand tapping cycle
G85 Feed N/A Feed Boring cycle
G86 Feed Spindle stop & orient Rapid traverse Boring cycle
G87 Feed Spindle start Rapid traverse Back boring cycle
G88 Feed Dwell & spindle stop Manual Boring cycle
G89 Feed Dwell Feed Boring cycle
Standard canned cycle motions
G73 Peck drilling cycle (Feed stop with
Fixed/Canned Cycle Code Format Chart each peck for chip break)
Code format, this is all possible codes allowed on G74 Counter tapping cycle (Left hand
G-Code the fixed cycle start block, some maybe omitted threading)
G75 Not for Milling
G73 G98/99 G73 X__ Y__ Z__ R__ Q__ F__ K__
G76 Fine boring cycle
G74 G98/99 G74 X__ Y__ Z__ R__ P__ F__ K__
G80 Fixed cycle cancel
G76 G98/99 G76 X__ Y__ Z__ R__ Q__ P__ F__ K__
G81 Drilling cycle (simple drill into part and
G80 G80
rapid out)
G81 G98/99 G81 X__ Y__ Z__ R__ F__ K__ G82 Drilling cycle, counter boring cycle
G82 G98/99 G82 X__ Y__ Z__ R__ P__ F__ K__ (same as G81 with added dwell)
G83 G98/99 G83 X__ Y__ Z__ R__ Q__ F__ K__ G83 Peck drilling cycle (same as G81 with
G83 G98/99 G83 X__ Y__ Z__ R__ P__ Q__ F__ I__ K__
pecking amount added)
G84 Tapping cycle (Right hand threading)
G84 G98/99 G84 X__ Y__ Z__ R__ P__ F__ K__
G85 Boring cycle (There are various types,
G85 G98/99 G85 X__ Y__ Z__ R__ F__ K__
thru feed in rapid out, feed in and out, feed
G86 G98/99 G86 X__ Y__ Z__ R__ F__ K__ G89 in stop spindle then rapid out, back
G87 G98/99 G87 X__ Y__ Z__ R__ Q__ P__ F__ K__ bore cycle, and others.
G88 G98/99 G88 X__ Y__ Z__ R__ P__ F__ K__
G89 G98/99 G89 X__ Y__ Z__ R__ P__ F__ K__
• Cutter Compensation ..................No.

Since X-Y motions are strictly for positioning and the


programmed machining patterns take place in the Z-axis, no
canned cycles are to be used in cutter diameter compensation
mode.

•Canned Cycles for all systems are standard................No.


Most systems provide numerous canned cycles as standard
equipment, but not all systems use the same codes to
designate the same cycles. Always use the codes provided by
your system manual.
Drilling Canned Cycle G81:
G81 Is a canned cycle for drilling holes in a single drill stroke.
Its motion is rapid motion to R plane, feed down (into the
hole) and rapid up (out of the hole) to the R level or to the
initial Z level (Zinitial)
G81 Xn Yn Zn Rn Fn
Canned cycle Example
N010 G81 X25.0 Y35.0 Z-18.0 R2.0 F125 *
N015 X55.0 Y50.0 *
N020 X75.0 Y70.0 * N025 G80 X0 Y0 Z50
*
Counter boring or countersinking holes cycle G82:
G82 Xn Yn Zn Rn Fn Pn

Its action is similar to G81, except that it has a timed dwell at the
bottom of the Z-stroke.
Will spot face, bore, or counter bore. The canned cycle will
perform as follows:
Rapid to "R" ,
Feed to "Z,"
Dwell at "Z" for a duration given by "P"
Rapid return to "R" or Initial depending on whether G99 or G98
was called in the program.
One second is P100 and 3 seconds are P300,
Counter boring or countersinking holes cycle G82:
G82 Xn Yn Zn Rn Fn Pn

Rapid to "R" ,
Feed to "Z,"
Dwell at "Z" for a duration given by "P"
Rapid return to "R" or Initial depending on whether G99
or G98 was called in the program.
One second is P100 and 3 seconds are P300,
Deep drilling canned cycle G83 :
•Hole depth > 3 times the drill's diameter.
•Prevent chips from packing in the drill's flutes, resulting in drill
breakage.
G83 Xn Yn Zn Qn Rn Fn
Deep drilling canned cycle G83 :
•Drill in at feed rate a small distance (called the peck increment)
and then retract at rapid travel.
•Then the drill advances at rapid travel back down to its previous
depth, feeds in another peck increment, and rapids back out again.
•Then it rapids back in, feeds in another peck increment, etc., until
the final Z-depth is achieved.
G83 Xn Yn Zn Qn Rn Fn
Deep drilling canned cycle G83 :
G83 will:G83 Xn Yn Zn Qn Rn Fn
1. Rapid to X-Y location and to "R"
level,
2. Feed by the amount "Q"
3. Rapid return to "R"
4. Rapid in by "Q-d,"
5. Feed "Q" from there,
6. Rapid return to "R" thus removing
the swarf from the part,
7. Rapid in by "2Q-2d"
8. Feed "Q" from there,
9. Rapid return to "R" etc.
The G84
The programmed feed must be fully synchronized with the
spindle speed Before starting the tapping portion of the
program, we have to set tapping speeds and calculate tapping
feeds.
G84 Is a canned cycle for tapping.
It coordinates the spindle's rotary motion to the Z-axis
motion for feeding the tap into and out of the hole without
breaking off the tap.
G84 Xn Yn Zn Rn Fn
G81 Xn Yn Zn Rn Fn
G84 Xn Yn Zn Rn Fn

The G84 canned cycle will perform the


tapping of one or more holes as follows:
Rapid to "R" level,
Feed to "Z-" level,
Reverse direction of rotation at "Z-"
level,
Feed up to "R" level,
Reverse direction of rotation to original
direction.
Usually, in one tape block, the canned cycle will control all or
most of the following motions:

• Positioning the tool in the X-Y plane


• Rapid motion to the "R" level, Rapid Down To
• Controlled feed motion to the "Z" level,
• Commanded motions at "Z" level, such as dwell, spindle
stop, spindle reverse, spindle orientation, spindle lateral shift,
etc.,
• Rapid or feed return to "R" level, as applicable, and
• Rapid return to INITIAL level.
Tapping canned cycles
Consist of the following steps:
•Clockwise rotating of the tap at the correct rpm
• Rapid advancing of the tap to (R-level)- Rapid Down To
• Feeding the rotating tap to a set depth at a rate of one
thread pitch per revolution (or mm/rev, or in in. /rev.)
• Reversing both feed and spindle rotation
•Feeding the rotating tap until the tap reaches the R-Level
• Returning spindle rotation to its original clockwise direction

The spindle is now ready to rapidly return "home" for a tool


change, relocate to another position or carry out any other
instruction of the program.

Similar motion patterns are available for drilling, boring,


turning, threading, etc.
General format of the fixed Milling canned cycle is the following:

N G G X Y Z R Q P F L

N is the sequence number of the block

G is the respective canned cycle (e.g.,


G81, G84, G73, G76, etc.)

The second G may be G98 or G99.

G98 will return the tool point to the


initial level. ( Save Rapid Level)

G99 will return the tool point to R level;

X and Y are the coordinates of the


location to be machined
Z is the level attained by the tool in feed mode
R is the level reached by the tool at the end of its rapid motion
Q is the depth of cut in feed in peck drilling
P is the dwell in spot facing or boring operations
F is the feed
L is the number of repeats, if applicable
The following observations apply to canned cycles for machining
centers in general:
• The tool motion starts in canned cycle from an Initial Level.
• The tool will move in Rapid mode to the programmed X-Y
location
• The quill will move in Rapid mode to the R (for Rapid) Level.
•The tool will feed to the Z-Level,

Z-Level is measured from Initial in absolute mode (G90)


Z-Level is measured from R in incremental mode (G91).
Three levels of tool position in any canned cycle:
• The Initial level, which is the specific position of the tool at the
moment the canned cycle becomes effective,
• The "R" for Rapid level, which is the end of the rapid quill
motion, usually 0.020 to 0.100 inches (0.5 to 2.5 mm) from the
part surface, and
• The "Z" level which is the end of the feed (metal cutting)
motion.
•If the tool is already on location, there is no need to program

X andY.

• A canned cycle is in effect until canceled (or replaced by

another canned cycle). Accordingly, subsequent locations can

be machined by simply programming X and Y in subsequent

blocks.

•If you do not intend to perform the canned cycle at the next

location, you must cancel it first (G80).


Z-Level is measured from Initial- Level in absolute mode (G90)
Z-Level is measured from R- Level in incremental mode (G91).

Absolute
Incremental
Suppose the tapping speed has been selected to be 100 rpm
(S100), What is the tapping feed (ipm) for 3/8 "-16 ?

1. Calculate the pitch in inch: Sixteen tpi represent a pitch of


1/16 or 0.0625 inch.

2-Find the feed per rev:


Feed / rev = Pitch in inches =0.0625 inch/ rev.

3- Calculate the feed per minute


Feed per minute = feed per rev * Speed (rpm)
100 x 0.0625 = 6.25 ipm, ( F6.25 )
Short Formula:
Divide the selected speed by the number of tpi.
Therefore, 100/16 = 6.25 and we program F6.25.
Using an "inch" tap in a metric program
Multiplying 6.25 ipm by the factor 25.4 = F158.75 mm/min.
Metric threads in a metric program
M 6 x l , Using 125 rpm F..... mm/min.?
We just multiply the pitch by the selected rpm
Feed will be 1 X 125 = 125
F125.
Metric threads in an inch program
F125 mm/min = .......inc/min.
We simply divide the feed obtained by 25.4.
Hence, 125 (mm/min) / 25.4 will be programmed as F4.9213 ipm
Fine boring canned cycle G76
G 76 Xn Yn Zn Rn Q n Fn

1- Rapid to "R" (point A).


2- Feed to "Z" (point B),
3- Spindle stop

4- Orient, shift the tool point by the programmed amount Q


away from the hole wall,
5- Rapid return to "R" or Initial as programmed
6-Restart of spindle.
Example:
Write the program to bore the hole in the following part in absolute
Example:
Write the program to bore the hole in the following part in absolute
N0010 G20 G40 G80 G90 G00-
G20: (Inch programming, shown above as G20, is programmed on many controls
as G70. Check your programming manual.)
G40: Cancel Radius Compensation
G80: Cancel previous canned cycle
N0020 T01 M06
N0030 G92 X0 Y0 Z0
This command will zero the registers with no motion taking place
N0040 S600 M03 - Spindle On
N0050 M08 - Coolant On
N0060 G98 G76 X9.0 Y7.5 Z-5.9 R-4.75 Q 0.1 F 0.75
.
:‫ﺳﺆال‬
How many ridges will be remains on the hole after executing the
above CNC program (600 rpm, F 0.75 inch/min) ?
:‫اﻻﺟﺎﺑﺔ‬
At 600 rpm, F 0.75 inch/min will ensure 800 tool marks or ridges
in 1 inch of bored surface. How?
Feed per rev = 0.75 ÷ 600 = 0.00125 inch per rev = Ridge Thickness
Number of Ridges in 1 inch = 1 ÷ 0.00125 = 800
:‫ﺳﺆال‬
How to produce finer surface ( Increase Number of Ridges)

:‫اﻻﺟﺎﺑﺔ‬

Feed per rev = Feed per min ÷ Speed= ........ inch per rev = Ridge Thickness
Number of Ridges in 1 inch = 1 ÷Ridge Thickness = ......

Should a finer surface be required, we can increase S, reduce F,


or both. In a production situation, a carbide-tipped boring tool
could run at speeds to 3,000 rpm and feeds to 3.5 ipm.
Canned cycle cancellation G80
G80 deactivates (cancels) any of the G80-series canned Z-axis
cycles.

Each of these canned cycles is modal. Once put in effect, a hole


will be drilled, bored, or tapped, each time the spindle is moved
to a new location.

This code is normally used in three situations:


1-When different programs are run consecutively on the same
machine, it issued before the first motion statement, in
conjunction with other codes as a safety feature, to cancel
potential leftover canned cycles from a previous program. On
some controls, a previously used canned cycle may remain
active even if the control is reset or the power is turned off.
N0010 G20 G40 G80 G49 G91 G00
2-When a canned cycle is canceled, as it should be, as soon as
it is no longer needed in the program.
N0040 G80

3-When it is required to reposition the spindle without any


machining taking place at that location (such as an
intermediary position in a change of direction).
N0090 G80 X3.0 Y4.5
Zn , Rn
‫و ‪ 160‬و ‪161‬‬ ‫ﺗﺼﺤﯿﺢ اﻷﻣﺜﻠﺔ ﺻﻔﺤﺔ ‪159‬‬
Turning Canned cycles

Longitudinal turning cycle G84

A G0 command is used to bring the tip of the tool to starting


position S.
The G84 command will make the tool move in a series of
rectangular paths cutting material axially until the tool tip
reaches target point K where the cycle ends.

Cutting movements will be at the cutting feed rate. All other


movements will be at rapid traverse rate.
N Block Number
G84 Longitudinal Turning Cycle
X,Z Absolute, Incremental Coordinates of the contour joint point K
Po Taper dimension in X Direction
P2 Taper dimension in Z Direction
Do Allowance in X
D2 Allowance in Z
D3 Cut division
F Feed
N Block Number
G85 Threading Cycle
X,Z Absolute, Incremental Coordinates of the thread end point K or N
P2 Thread run out
D3 Depth or Number ( From Table)
D4 Number of no load cuts to clean
D5 Angle of thread
D6 Total thread depth
D7 Identification number (from table)
F Feed
D3
D7 K or N
( Decrement or Constant ) Depth or Number
0 Decrement Depth
K
1 Constant Depth
2 Decrement Depth
N
3 Constant Depth
4 Decrement Number
K
5 Constant Number
6 Decrement Number
N
7 Constant Number
Plunge – cut cycle G86
A G0 command brings the right-hand corner of the tool to starting position
P. The G86 command will make the tool move forward, back and left
repeatedly to cut the groove. The movements continue until the left-hand
corner of the tool tip reaches target point K where the cycle ends.
N Block Number
G86 Plung Cut Cycle
X,Z Absolute, Incremental Coordinates of the contour joint point K
D3 Feed per Cut ( feed /rev)
D4 Dwell time
D5 Tool width
F Feed
G25 Subroutine Call
Canned cycles could be made even more efficient by the use of the
Subroutine feature, when sevral operations (center drill, drill, booring, tap,
etc. ) are performed at the same location. The location pattern is placed in a
Subprogram known as Subroutine and called as needed by the main
program

O10 Main program Name


N010 ………………
Main Program N020 ………………
N030 G25 L 81 04 Call Subroutine 81 Four times
N040 ………………
N050 M30
O81 Name of the Subroutine
Subroutine N500 …………………
N510…………………..
N520 ……………………
N530 M17 Return to Line N040 in the main
Program after four execution
Write a program for milling the shown 4 rectangular pockets in the shown
part, use G25 subroutine call to facilitate your programming.

25

50
25
X

20 45 45 45
N10 G90 S800 M03 O200
N20 G00 X20 Y12.5 N500 G92 X0 Y0
N30 G01 Z0.1 F55 N510 G42 G90
M08 N520 G01 Z-5 F2.5
N40 G25 L200 01 N530 G01 Y25 F5
N50 G00 X65 N540 X25
N40 G25 L200 01 N550 Y0
N50 G00 X110 N560 X0
N40 G25 L200 01 N570 G00 Z0.1
N50 G00 X155 N580 M17
N40 G25 L200 01
N50…………………
N60…………………
N70…………………
N80…………………
N90…………………
N100 M30
R5
M 24x1.5
15
34

95 5 15 10 15
%

021102

N000 G71

N010 G00 X35 Z141 T0101 S700 M04

N020 G84 X24 Z95 P0=0.0 P2=0.0 D3=500 F100

N030 G01 X24 Z140 F50

N040 G84 X15 Z115 D3=500 F100

N050 G00 X15 Z141

N060 G84 X0.0 Z140 P2= -15 D3=500 F100

N070 G00 X40 Z150


N080 G00 X25 Z100 T0202

N090 G86 X15 Z95 D3=100 D4=1 D5=4000 F50

N100 G00 X40 Z150

N110 G00 X25 Z98 T0404 S300

N120 G85 X24 Z115 P2=2 D3=6 D4=2 D5=80 D6=1200


D7=7 F1500
N130 G00 X40 Z150

N140 G00 X24 Z95 T0101

N150 G02 X34 Z90 I5 K0 F50 S500

N160 G00 X40 Z156

N170 M30

You might also like