Thursday, August 2, 2018

CNC Programming Examples - Intermediate Level

  Thanh A Tran       Thursday, August 2, 2018

Fanuc G81 Drilling Cycle 

G81 drilling cycle is used for simple drilling/spot drilling operations.

Syntax

G81 X... Y... Z... R... K... F...
Parameter Description
X Hole position in x-axis.
Y Hole position in y-axis.
Z Depth, tool will travel with feed to Z-depth starting from R plane.
R Position of the R plane.
K Number of cycle repetitions (if required) .
F Feedrate.
Once G81 drilling cycle is defined, the canned cycle is repeated at every X-Y position in sequential blocks. So G81 drilling cycle must be cancelled with G80.

Usage

N30 G81 X10 Y30 Z-17 R2 F75
        N40 Y10
        N50 X30
        N60 Y30
        N70 X90
        N80 Y10
        N90 G80
In the above example drilling will start with G81 drilling cycle at X10 Y30, so first drill will be at X10 Y30, then second at Y10, third at X30, fourth at Y30, fifth at X90 and the last one at Y10, because next block have G80 code, so drilling cycle will no more be repeated.

Working

Here is briefly described how G81 drilling cycle operates,
1- Rapid traverse to the specified x,y axis position (drilling position).
2- Rapid traverse to the R plane position.
3- Drilling with specified Feed from R-plane position to Z-depth position.
4- Rapid traverse to Initial level or R-plane depends on G98, G99 modes.

G81 drilling cycle working

G98 G99 Modes

After completing drilling depth the return is made with Rapid feed, the return height can be controlled through using G98 or G99.
G98 Drill will return to the Initial level
G99 Drill will return to R-plane.
G98, G99 can be used multiple times during G81 drilling cycle.

Example

N30 G81 X10 Y30 Z-17 R2 F75
        N40 Y10
        N50 G98 X30
        N60 G99 Y30
        N70 X90
        N80 Y10
        N90 G80

Repeat Drilling

With G81 drilling cycle drilling operation can be repeated multiple times. The drilling is repeated K times when that parameter is given with G81 drilling cycle.
Repeat drilling is normally used with G91 Incremental mode, and a good example of repeated drilling is Grid-plate drilling. the example for repeat drilling  is given below.

Working Examples


G81 Drilling Cycle Example
N10 T1 M06
        N20 G90 G54 G00 X30 Y25
        N30 S1200 M03
        N40 G43 H01 Z5 M08
        N50 G81 Z-10 R2 F75
        N60 X80 Y50
        N70 G80 G00 Z100 M09
        N80 M30

G98 G99 Example


G81 drilling cycle usage with G98 G99
N10 M06 T1
        N20 G90 G00 X12.5 Y10 Z12 S1000 M03
        N30 G99 G81 X12.5 Y10 Z-17 R2 F75
        N40 Y30
        N50 G98 X57.5
        N60 G99 Y10
        N70 G91 G80 G28 X0 Y0 Z0 M05
        N80 M30

Repeat Drilling Example


Repeat drilling with G81 Drilling Cycle
T1 M6
        G00 G90 G40 G21 G17 G94
        G54 X0 Y0 S1000 M03
        G43 H1 Z100
        Z3
        G81 G99 G91 X20 Y20 R3 Z-20 K3 F100 M08
        G80
        G00 G90 Z100
        M30
OR
T1 M6
        G00 G90 G40 G21 G17 G94
        G54 X20 Y20 S1000 M03
        G43 H1 Z100
        Z3
        G81 G99 R3 Z-20 F100 M08
        G91 X20 Y20 K2
        G80
        G00 G90 Z100
        M30

----------


Drilling Grid Plate with G81 Drilling Cycle – Sample CNC Program

CNC machine workshops deal with variety of components, of course cnc machinists program and machine them.
But a cnc machinists also should understand and practice new and economical ways to machine a component.
The following cnc programming example can be programmed in variety of ways, the method of cnc programming used in this cnc program sample uses G81 drilling cycle with G91 Incremental Programming mode, which makes programming easy.
Fanuc cnc control uses K with G81 drilling cycle to repeat drilling cycle.
Haas cnc controls use L to repeat G81 drilling cycle.
Following cnc program is written for haas cnc machine but can easily be converted for Fanuc cnc controls.
You might read other cnc programming example which shows the same technique for Fanuc cnc controls
  • G81 Drilling Cycle – Repeat Drilling in G91 Incremental Mode Example Code
  • Repeat Drilling with G81 Drilling Cycle and G91 Example Program

CNC Program of Drilling Grid Plate


Drilling Grid Plate with G81 Drilling Cycle
03400      (Drilling grid plate)
        T1 M06
        G00 G90 G54 X1.0 Y-1.0 S2500 M03
        G43 H01 Z.1 M08
        G81 Z-1.5 F15. R.1
        G91 X1.0 L9
        G90 Y-2.0   (Or stay in G91 and repeat Y-1.0)
        G91 X-1.0 L9
        G90 Y-3.0
        G91 X1.0 L9
        G90 Y-4.0
        G91 X-1.0 L9
        G90 Y-5.0
        G91 X1.0 L9
        G90 Y-6.0
        G91 X-1.0 L9
        G90 Y-7.0
        G91 X1.0 L9
        G90 Y-8.0
        G91 X-1.0 L9
        G90 Y-9.0
        G91 X1.0 L9
        G90 Y-10.0
        G91 X-1.0 L9
        G00 G90 G80 Z1.0 M09
        G28 G91 Y0 Z0
        M30
In above cnc program G90 Absolute programming mode is used while starting a new row for drilling. Although G91 Incremen0tal programming can be used but using G90 there makes this program easy to read understand and debug (if anything goes wrong).

-----------

Repeat Drilling with G81 Drilling Cycle and G91 Example Program

Here is another G81 drilling cycle programming example which illustrates the use of repeat drilling in G91 Incremental Programming Mode.
Other CNC program example is here G81 Drilling Cycle – Repeat Drilling in G91 Incremental Mode Example Code

Repeat Drilling with G81 Drilling Cycle


Repeat Drilling with G81 Drilling Cycle and G91
O1000
            T1 M6
            G00 G90 G40 G21 G17 G94
            G54 X20 Y10 S1000 M03
            G43 H1 Z100
            Z3
            G81 G99 R3 Z-20 F350 M08
            G91 X10 Y10 K4
            G80
            G00 G90 Z100
            M30

---------

G81 Drilling Cycle – Repeat Drilling in G91 Incremental Mode Example Code

This cnc program example explains the use of G81 Drilling cycle but this time the tool is not positioned in the usual way (G90 absolute programming mode) but this time G91 Incremental Programming Mode is used.
This programming example code also explains the use of G81 drilling cycle parameter K (number of repeats), which is not normally used.
Contents
  • G81 Drilling Cycle Format
  • CNC Code G81 Drilling Cycle with G91 Inremental Programming
    • Explanation

G81 Drilling Cycle Format

G81 X_ Y_ Z_ R_ F_ K_ ;
X_ Y_: Hole position data
Z_ : Z-depth (tool will travel with feed to Z-depth starting from R plane)
R_ : The distance from the initial level to point R level
F_ : Cutting feedrate
K_ : Number of repeats (if required)
G81 drilling cycle parameter K (number of repeats). On different cnc controls this parameter has different letter assign to it such as on,
  • Fanuc uses letter K for number of repeats.
  • Haas CNC uses letter L for number of repeats.
  • Fagor CNC Control uses letter N for number of repeats.
Incremental motion in canned cycle is often useful as a loop count, which can be used to repeat the operation with an incremental X or Y move between each cycle.

CNC Code G81 Drilling Cycle with G91 Inremental Programming


G81 Drilling Cycle – Repeat Drilling in G91 Incremental Mode Example Code
N10 T1 M6
                N20 G00 G90 X0 Y0 Z0
                N30 S1450 M03
                N40 G81 G99 G91 X50 Y50 Z-120 R-98 K3 F350
                N50 G98 G90 G00 X500 Y500
                N60 G80
                N70 G90 X0 Y0
                N80 M30

Explanation

N40 G81 G99 G91 X50 Y50 Z-120 R-98 K3 F350
K3 means that the G81 drilling cycle will repeat three times.
G91 Incremental mode makes the tool to move every time X50 and Y50
So first hole will be at X50 Y50
Second hole will be at X100 Y100 because
X100 = X50(previous value) + X50 (increment)
Y100 = Y50(previous value) + Y50 (increment)
Third hole will be at X150 Y150 because
X150 = X100(previous value) + X50 (increment)
Y150 = Y100(previous value) + Y50 (increment)
N50 G98 G90 G00 X500 Y500
The fourth hole position is given with G90 Absolute Programming Mode.
The above code is only possible if you use G91 Incremental Programming Mode with G81 Drilling cycle, but if you try to use G90 Absolute Programming Mode with G81 as above you will see the tool will repeat drilling at the same position

logoblog

Thanks for reading CNC Programming Examples - Intermediate Level

Previous
« Prev Post

No comments:

Post a Comment