CNC%20Programming

download CNC%20Programming

of 96

Transcript of CNC%20Programming

  • 8/8/2019 CNC%20Programming

    1/96

    Symbols of good program.

    Easily understood .

    Minimum air cutting.

    Avoid repetition of tools.

    Should be simple and short.

    Considered future tooling changesfeasibility.

    Should not hamper m/c tool life.

  • 8/8/2019 CNC%20Programming

    2/96

    Contents What is mean by CNC program ?

    Coordinate measuring systems. Dimensioning system.

    CNC programming formats.

    G-CODES (Preparatory functions.)

    M-CODES (Miscellaneous Functions)

    Canned Cycles.

    Subprogram/Subroutine.

    Preparation required before doing program.

    Example of one program.

    Precautionary measures while doing and executing

    CNC Program.

  • 8/8/2019 CNC%20Programming

    3/96

    CNC program

    Set of instructions fed to the machine

    control in the form of numerical codes

    written in particular sequence.

  • 8/8/2019 CNC%20Programming

    4/96

    Example of CNC program.

    N10/ (Core drill dia 55)

    N20 T1 M6 ;

    N30 G0 G90 G54 X200. Y150. ;

    N40 G0 G43 H01 Z100. ;

    N50 G98 G81 Z-25 R5 F40 ;N60 G80 G91G28 X0. Y0. Z0. ;

  • 8/8/2019 CNC%20Programming

    5/96

    System of coordinates.

    It is used in preparation of part program forintroducing the position of machining.

    It consists of 3 axis ( X,Y&Z)

    There are two types of system of

    coordinates.

    M/C coordinate system (G53).

    Workpiece coordinate system (G54-G59).

  • 8/8/2019 CNC%20Programming

    6/96

    System of coordinates.M/C coordinate system.

    M/c actually moves in its own system of

    coordinates called M/C COORDINATE

    SYSTM.and reference point w.r.t.which it

    moves called as M/C ZERO

    Generally m/c coordinate system has

    machining zone on -ve direction from m/czero point.

  • 8/8/2019 CNC%20Programming

    7/96

    System of coordinates.M/C coordinate system.

  • 8/8/2019 CNC%20Programming

    8/96

    System of coordinates.W/P coordinate system.

    To make machining easy temporary

    reference point is taken in m/c coordinate

    system this point is called as WORKZERO.

    Distances of this temp. point in X,Y&Z

    direction from m/c zero called as ZEROOFFSET

  • 8/8/2019 CNC%20Programming

    9/96

    System of coordinates.W/P coordinate system.

    Generally this point should be such that all

    dimensions on part drawing would be from

    that point.

    For e.g. Locating pin center.

  • 8/8/2019 CNC%20Programming

    10/96

    System of coordinates.W/P coordinate system.

  • 8/8/2019 CNC%20Programming

    11/96

    System of dimensioning

    G90 (Absolute Dimensioning)

    It is the most common method of dimensioning

    our drawings used for part production on CNCmachines.

    In this system all dimensions are taken from a

    single point called as DATUM POINT orORIGIN.

    This is denoted by preparatory function G90.

  • 8/8/2019 CNC%20Programming

    12/96

    System of dimensioning

    G90 (Absolute Dimensioning)

    ADVANTAGES:

    If hole no. 2 is put inwrong location hole no.3

    would not be affected.

    Generally our drawingsare dimensioned in

    absolute method so it

    becomes very to find out

    the co-ordinates .

    50.0

    100.0

    150.0

    150.0

    50.0

    100.0

    1

    2

    3

  • 8/8/2019 CNC%20Programming

    13/96

    System of dimensioning

    G91 (Incremental Dimensioning)

    It is very rarely used.

    Generally it is used for machining ofcomplicated pockets.

    In this system measurement is from hole to hole

    This is denoted by preparatory function G90.

  • 8/8/2019 CNC%20Programming

    14/96

    System of dimensioningG91 (Incremental Dimensioning)

    If hole no. 2 is put in

    wrong location next all

    holes will be incorrectly

    positioned.

    For doing programming in

    incremental mode

    tremendous calculationsare required.

    It benefits while doing

    subprograms

    50.0

    1

    2

    3

    50.0

    50.0

    50.0 50.0 50.0

  • 8/8/2019 CNC%20Programming

    15/96

    System of dimensioningExample of G90 & G91

    G90

    N10 G71 ;

    N20 G90 ;N30 G00 X100. Y100. ;

    N40 X150. Y100. ;

    N50 X150. Y150. ;N60 X100. Y150. ;

    N70 X100. Y100. ;

    N80 M30

    100.0

    150.0

    100.0

    150.0

    X

    Y

  • 8/8/2019 CNC%20Programming

    16/96

    Program format

    Format is method of writing set of instructions.

    N10 G01 X10. Y10. F200 S200 T01 M3 ;

    SEQUENCE

    NO.

    PREPARATOTYFUNCTION

    X-COORDINATE

    Y COORDINATE

    FEED FUNCTION

    SPEED FUNCTION

    TOOL FUNCTION

    MISCLLANEOUS FUNCTION

    END OF BLOCK

  • 8/8/2019 CNC%20Programming

    17/96

    G codes

    G-Codes are also called as Preparatoryfunctions as they take active part in part

    program execution.

    They are always programmed at the start ofblock.

    They decides type of machine movement

    ,type of interpolation,type of dimension etc.

  • 8/8/2019 CNC%20Programming

    18/96

    Modal : Which remain active until another Gcode of same group is programmed.Blockwise active : Gcode which remainactive only in that particular block in which itis programmed.

    Modal Blockwise active.

    G codes

    Type of G codes

  • 8/8/2019 CNC%20Programming

    19/96

  • 8/8/2019 CNC%20Programming

    20/96

  • 8/8/2019 CNC%20Programming

    21/96

    G00 (Rapid positioning)

    Position data command programmed after

    G00 is traversed at maximum possible

    feedrate along a straight line set by machine

    tool manufacturer.

    G00 can be programmed as G or G0.

    G00 is modal and canceled with G01 or

    G02 or G03.

    On graphic screen G00 appears as a dotted

    line.

  • 8/8/2019 CNC%20Programming

    22/96

    G00 (Rapid positioning)

    Example :

    15 60

    (0,0)

    +Y

    -Y

    +X-X

    1

    2

    20

    To move from point 1 to point 2 command data is given as

    G00 X75 Y-20 ;

  • 8/8/2019 CNC%20Programming

    23/96

    G01 (Linear interpolation)

    Position data command programmed after G01is executed at programmed feedrate along a

    straight line.

    Movement being made along straight linejoining start point and end point.

    G01 is modal and canceled with G00 , G02 or

    G03. On graphic screen G01 appears as continuos

    line.

  • 8/8/2019 CNC%20Programming

    24/96

    G01(Linear interpolation).

    Example :

    15 60

    (0,0)

    +Y

    -Y

    +X-X

    1

    2

    20

    To move from point 1 to point 2 command data is given as

    G01 X75 Y-20 F20 ;

    End of block

    Programmed feed rate

    Position data

    Movement at set feedrate.

  • 8/8/2019 CNC%20Programming

    25/96

    G02/G03 (Circular interpolation)

    Position data given after G02 or G03 is

    executed along a circular path at the set feed

    rate.

    The code G02 refers to the circular

    interpolation in a clockwise direction.

    The code G03 refers to the circularinterpolation in a Anticlockwise direction.

  • 8/8/2019 CNC%20Programming

    26/96

    G02/G03 (Circular interpolation)

    When we write code G02 ,We have to feed

    information regarding

    -Start point-End point

    -Radius of arc or Circle center point.

  • 8/8/2019 CNC%20Programming

    27/96

    Example of G02/G03 with radius.

    G02

    N10 G01 X40. Y40. ;

    N20 G02 X80. Y80. R40 ;

    G03

    N10 G01 X80. Y80. ;

    N20 G03 X40. Y40. R40 ;

    (40,40)

    (80,80) (80,80)

    (40,40)

    GO2

    G03

  • 8/8/2019 CNC%20Programming

    28/96

    G02/G03 - Circular interpolation

    with circle center point

    Here instead of giving radius of circle we have

    to mention center point of circle in form of

    parameters called I,J&K.

    Where I --- Distance between starting point of

    cutter to the center of arc in X direction.

    J--- Distance between starting point of cutter to

    the center of arc in Y direction.

    K --- Distance between starting point of cutter

    to the center of arc in Z direction.

    Values of I,J&K are always incremental.

  • 8/8/2019 CNC%20Programming

    29/96

    Example of G02/G03 with

    interpolation parameters..

    G02N10 G01 X40. Y40. ;

    N20 G02 X80. Y80. I40 J0 ;(40,40)

    (80,80)

    GO2

  • 8/8/2019 CNC%20Programming

    30/96

    G04 (Dwell)

    It is used to program dwell time in sec. Dwell time value is programmed by means

    of letter X.

    For e.g. N10 G04 X2 ;Means spindle will take dwell of 2 sec. While

    executing this line.

    It is blockwise active. No other function can be programmed in a

    block in which G04 is programmed.

  • 8/8/2019 CNC%20Programming

    31/96

    Cutter radius compensation

    To accommodate difference in programmed

    diameter of cutter and actual diameter of

    cutter ,cutter compensation concept is used.

    While writing part program it is necessary

    to mention that whether cuttercompensation is required in left direction or

    right direction.

  • 8/8/2019 CNC%20Programming

    32/96

    Cutter radius compensation

    Following 3 G-codes are used for cutterradius compensation.

    G41 Compensation applied to shift the cutter

    path to left.G42 Compensation applied to shift the cutter

    path to right.

    G40 To cancel cutter Compensation.

    Direction of shift is decided by looking in

    direction of cut.

  • 8/8/2019 CNC%20Programming

    33/96

    Cutter radius compensation

    Advantages :

    1.Different dia. of cutters can be used without

    changing part program.

    2.By using cutter radius compensation job of

    programmer becomes simplified because part

    program can be developed assuming zero cutter

    radius and on actual dimensions of part

    drawing.

  • 8/8/2019 CNC%20Programming

    34/96

    Cutter radius compensation

    G41/G42

    G41G42

    Cutter

    center

    line

    Cutter

    center

    line

  • 8/8/2019 CNC%20Programming

    35/96

    Cutter radius compensation

    Example

    35.0

    35.080.0

    95.0

    X

    R15.0

  • 8/8/2019 CNC%20Programming

    36/96

    G70 (Inch unit system)

    It is used to represent inch unit system

    for e.g. N10 G70 G0 X4. ;

    It indicates that X axis will move by 4.

    For e.g N10 G70 G95 F0.02 ;

    It indicates that tool will move at the feed rate

    of 0.02 inch/rev

    This is an modal G code.

  • 8/8/2019 CNC%20Programming

    37/96

    G71 (Metric unit system)

    It is used to represent metric unit system

    for e.g. N10 G71 G0 X4. ;

    It indicates that X axis will move by 4mm.

    For e.g N10 G71 G95 F0.02 ;

    It indicates that tool will move at the feed rate

    of 0.02 mm/rev

    This is an modal G code.

  • 8/8/2019 CNC%20Programming

    38/96

    G94 (feed /min)

    When code G94 is programmed CNC

    assumes that feed rate value entered under

    address F is in mm/min or inch/min.

    for e.g. N10 G94 F100 ;

    It means that tool moves at the rate of

    100mm/min or 100 inch/min depends uponG70/G71.

    This is an modal G code.

  • 8/8/2019 CNC%20Programming

    39/96

    G95 (feed /rev)

    When code G95 is programmed CNC

    assumes that feed rate value entered under

    address F is in mm/rev or inch/rev.

    for e.g. N10 G94 F0.2 ;

    It means that tool moves at the rate of 0.2

    mm/rev or inch/rev depends upon G70/G71.

    This is an modal G code.

  • 8/8/2019 CNC%20Programming

    40/96

    MISCLLANEOUS FUNCTIONS

    (M CODES) :

    Miscellaneous function word is used to

    specify certain miscellaneous functions

    which do not relate to dimensionalmovements of the machine.

    For e.g. Spindle start , Spindle stop etc.

  • 8/8/2019 CNC%20Programming

    41/96

  • 8/8/2019 CNC%20Programming

    42/96

  • 8/8/2019 CNC%20Programming

    43/96

    Canned cycle :

    Canned cycle or fixed cycle may be defined

    as a set of instructions inbuilt or stored in

    the system memory to perform fixedsequence of operations.

    Canned cycle can be brought into actionwith single command and as such reduce

    programming time and efforts.

  • 8/8/2019 CNC%20Programming

    44/96

    Canned cycle :

    Canned cycles are used for repetitive and

    commonly used machining operations .

    Canned cycles are stored under G code address.

    G81 to G89 are reserved for canned cycles andG80 for cancellation of canned cycle.

  • 8/8/2019 CNC%20Programming

    45/96

  • 8/8/2019 CNC%20Programming

    46/96

    Drilling cycle (G81) :

    POINT R

    POINT 'Z'

    INITIAL LEVEL

    POINT 'Z'

    POINT R

    G81(G98) G81(G99)

    POINT 'R' LEVELw/p

    w/p

  • 8/8/2019 CNC%20Programming

    47/96

    Format for Drilling cycle (G81) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G81 X_ Y_ Z_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    48/96

    Operation sequence for Drilling

    cycle (G81) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool is then retracted in rapid traverse upto

    point R or upto point Z depends uponG98/G99.

  • 8/8/2019 CNC%20Programming

    49/96

    Drilling cycle (G81) :

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous

    function (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performeddrilling it can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03

    together with G81 otherwise G81 is canceled.

  • 8/8/2019 CNC%20Programming

    50/96

    Counter boring cycle (G82) :

    POINT R

    POINT 'Z'

    INITIAL LEVEL

    POINT 'Z'

    POINT R POINT 'R' LEVELw/p

    w/p

    P P

    G82(G98) G82(G99)

    F f C b i l (G82)

  • 8/8/2019 CNC%20Programming

    51/96

    Format for Counter boring cycle (G82) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    P_ Dwell time at the bottom of hole.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G82 X_ Y_ Z_ R_ P_ F_ K_

  • 8/8/2019 CNC%20Programming

    52/96

    Operation sequence for counter

    boring cycle (G82) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

    Counter boring cycle (G82) :

  • 8/8/2019 CNC%20Programming

    53/96

    Counter boring cycle (G82) :

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous function

    (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performed drilling it

    can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03 together

    with G81 otherwise G81 is canceled.

    P k d illi l (G83)

  • 8/8/2019 CNC%20Programming

    54/96

    Peck drilling cycle (G83) :

    w/p

    R

    Z=0

    q

    d

    d

    Initial level

    R

    d

    d

    q

    Z=0

    Initial level

    G83(G98) G83(G99)

    F f P k d illi l (G83)

  • 8/8/2019 CNC%20Programming

    55/96

    Format for Peck drilling cycle (G83) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    Q_ Every cut in value.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G83 X_ Y_ Z_ Q_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    56/96

    Operation sequence for peck drilling

    cycle (G83) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

    Peck drilling cycle (G83) :

  • 8/8/2019 CNC%20Programming

    57/96

    Peck drilling cycle (G83) :

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous function

    (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performed drilling it

    can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03 together

    with G81 otherwise G81 is canceled.

  • 8/8/2019 CNC%20Programming

    58/96

    Tapping cycle (G84) :

    POINT R

    POINT 'Z'

    INITIAL LEVEL

    POINT 'Z'

    POINT R

    G84(G98) G84(G99)

    POINT 'R' LEVELw/p

    w/p

    p Pspindleccw

    spindleccw

    spindlecw

    spindlecw

    F t f t i l (G84)

  • 8/8/2019 CNC%20Programming

    59/96

    Format for tapping cycle (G84) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    Q_ Every cut in value.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G84 X_ Y_ Z_ Q_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    60/96

    Operation sequence for tapping

    cycle (G84) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

  • 8/8/2019 CNC%20Programming

    61/96

    Tapping cycle (G84) :

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous function

    (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performed drilling it

    can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03 together

    with G81 otherwise G81 is canceled.

    B i l (G85)

  • 8/8/2019 CNC%20Programming

    62/96

    Boring cycle (G85) :

    POINT R

    POINT 'Z'

    INITIAL LEVEL

    POINT 'Z'

    POINT R POINT 'R' LEVELw/p

    w/p

    G85(G98) G85(G99)

    Format for boring cycle (G85) :

  • 8/8/2019 CNC%20Programming

    63/96

    Format for boring cycle (G85) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    Q_ Every cut in value.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G85 X_ Y_ Z_ Q_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    64/96

    Operation sequence for boring cycle

    (G85) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

    Boring cycle (G85) :

  • 8/8/2019 CNC%20Programming

    65/96

    Boring cycle (G85) :

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous function

    (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performed drilling it

    can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03 together

    with G81 otherwise G81 is canceled.

  • 8/8/2019 CNC%20Programming

    66/96

    Boring cycle (G86) :

    POINT R

    POINT 'Z'

    INITIAL LEVEL

    POINT 'Z'

    POINT R POINT 'R' LEVELw/p

    w/p

    spindlestop

    spindlestop

    spindlecw

    spindlecw

    G86(G98) G86(G99)

    Format for boring cycle (G86) :

  • 8/8/2019 CNC%20Programming

    67/96

    Format for boring cycle (G86) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    Q_ Every cut in value.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G86 X_ Y_ Z_ Q_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    68/96

    Operation sequence for boring cycle

    (G86) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

    Boring cycle (G86) :

  • 8/8/2019 CNC%20Programming

    69/96

    Boring cycle (G86) :

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous function

    (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performed drilling it

    can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03 together

    with G81 otherwise G81 is canceled.

    B k b i l (G87)

  • 8/8/2019 CNC%20Programming

    70/96

    Back boring cycle (G87) :

    G87(G98) G87(G99)

    NOT USEDPOINT R

    spindle cw

    spindle cw

    P

    q

    Format for back boring cycle (G87) :

  • 8/8/2019 CNC%20Programming

    71/96

    Format for back boring cycle (G87) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    Q_ Every cut in value.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G87 X_ Y_ Z_ Q_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    72/96

    Operation sequence for back boring

    cycle (G87) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

  • 8/8/2019 CNC%20Programming

    73/96

    Boring cycle (G88) :

  • 8/8/2019 CNC%20Programming

    74/96

    Boring cycle (G88) :

    POINT R

    POINT 'Z'

    INITIAL LEVEL

    POINT 'Z'

    POINT R POINT 'R' LEVELw/p

    w/p

    spindlestop

    p

    spindle

    stopp

    spindlecw

    spindlecw

    G88(G98) G88(G99)

    Format for boring cycle (G88) :

  • 8/8/2019 CNC%20Programming

    75/96

    Format for boring cycle (G88) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole.

    R_ Distance from initial level to point R level.

    Q_ Every cut in value.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G88 X_ Y_ Z_ Q_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    76/96

    Operation sequence for boring cycle

    (G88) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

    Boring cycle (G88) :

  • 8/8/2019 CNC%20Programming

    77/96

    g y ( )

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous function

    (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performed drilling it

    can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03 together

    with G81 otherwise G81 is canceled.

    Boring cycle (G89) :

  • 8/8/2019 CNC%20Programming

    78/96

    Boring cycle (G89) :

    POINT R

    POINT 'Z'

    INITIAL LEVEL

    POINT 'Z'

    POINT R

    G89(G98) G89(G99)

    POINT 'R' LEVELw/p

    w/p

    P P

    Format for boring cycle (G89) :

  • 8/8/2019 CNC%20Programming

    79/96

    Format for boring cycle (G89) :

    X_ Y_ Hole position data.

    Z_ Distance from point R to the bottom of hole. R_ Distance from initial level to point R level.

    Q_ Every cut in value.

    F_ Cutting feed rate.

    K_ No. of repeats.

    Format : G89 X_ Y_ Z_ Q_ R_ F_ K_

  • 8/8/2019 CNC%20Programming

    80/96

    Operation sequence for boring cycle

    (G89) :

    Tool is positioned to X&Y axes.

    Rapid traverse is performed upto point R. Drilling is performed from point R to point Z.

    Tool remains idle at the bottom over the period

    mentioned in P. Tool is then retracted in rapid traverse upto

    point R or upto point Z depends upon

    G98/G99.

    Boring cycle (G89) :

  • 8/8/2019 CNC%20Programming

    81/96

    g y ( )

    IMPORTANT POINTS :1.Before specifying G81 use a miscellaneous function

    (M CODE) to rotate the spindle.

    2.Specify R in block that perform drilling .If it isspecified in block that does not performed drilling it

    can be stored as MODAL data.

    3. In canned cycle mode tool offsets are ignored.4.Do not specify G codes from G00 To G03 together

    with G81 otherwise G81 is canceled.

    CANNED CYCLE SUMMARY

  • 8/8/2019 CNC%20Programming

    82/96

    CANNED CYCLE SUMMARYCANNED CYCLE SUMMARY

    CODE Drilling

    (- Zdirection)

    Operatio

    n at thebottom of

    hole

    Retractio

    n(+ Z

    direction)

    Application

    G73 Intermittentfeed

    --- Rapidtraverse

    High speedpeck drillingcycle.

    G74 feed Spindle cw feed Left handtapping cycle.

    G76 feed Orientedspindle

    stop

    Rapidtraverse

    Fine boringcycle

    G81 feed --- Rapidtraverse

    Drilling cycle

    G82 feed dwell Rapidtraverse

    Counter boringcycle

    G83 Intermittentfeed

    --- Rapidtraverse

    Peck drillingcycle.

    G84 feed Spindleccw

    feed Tapping cycle

    G85 feed --- feed Boring cycle

    G86 feed Spindlestop

    Rapidtraverse

    Boring cycle

    G87 feed Spindlestop

    Manual/Rapidtraverse

    Back boringcycle

    G88 feed Dwell-Spindlestop

    Manual/Rapidtraverse

    Boring cycle

    G89 feed Dwell-Spindle

    stop

    feed Boring cycle

    SUBROUTINES

  • 8/8/2019 CNC%20Programming

    83/96

    U U

    Also called as SUBPROGRAM.

    These are powerful time saving technique.

    Subroutines provides the capability of

    programming certain fixed sequence or

    frequently repeated patterns. Subroutines are in fact independent

    programs with all feature of usual part

    program. Subroutines are stored in memory under

    separate program no.

    SUBROUTINES

  • 8/8/2019 CNC%20Programming

    84/96

    Whenever particular feature is required

    within the program, associated subroutine iscalled for execution.

    Subroutine may called any time and any

    no.of times. After execution of subroutine the control

    returns to main program .

    To describe and use a subroutine followinginformation is required in form of code and

    symbol.

    SUBROUTINES

  • 8/8/2019 CNC%20Programming

    85/96

    For e.g.

    Start of subroutine.End of subroutine.

    A means of calling subroutine.

    For start we will use letter L followed by any

    no. for e.g. L001

    For end we will use a word as M17.

    For calling subroutine any where in main

    program by giving just subroutine no. preceded

    by letter L.

    E l f b ti

  • 8/8/2019 CNC%20Programming

    86/96

    Example of subroutine.

    N10 G91 ;

    N20 G01 Z-8. F300 ;

    N30 G01 X40. ;

    N40 G01 Y40. ;

    N50 G01 X-40. ;

    N60 G01 Y-40. ;

    N70 G00 Z8. ;N80 G90 ;

    N90 M17 ;

    X

    Y

    50.0

    50.0

    90.0

    90.0

    50.0

    (120,120)

    (200,200)

    Introducing subroutine in main

  • 8/8/2019 CNC%20Programming

    87/96

    program

    N10 G90 G71 G94 S500 M03 ;

    N20 G00 X50. Y50. ;

    N30 G00 Z5 M08 ;

    N40 L101 ;

    N50 G00 X120. Y120. ;

    N60 L101;

    N70 G00 X200. Y200. ;N80 L101 ;

    N90 G00 X0. Y0. Z20. M09

    N100 M30 ;

    X

    Y

    50.0

    50.0

    90.0

    90.0

    50.0

    (120,120)

    (200,200)

    What programmer has to do ?

  • 8/8/2019 CNC%20Programming

    88/96

    p g

    Study the drawing thoroughly.

    Identify type of material to be machined.

    Know the specification and functions of

    machine to be used.

    Decide the dimension mode (mm or inches)

    Decide the coordinate system .

    Identify the plane of cutting. Know the cutting parameters for job/tool

    combinations.

    What programmer has to do ?

  • 8/8/2019 CNC%20Programming

    89/96

    p g

    Know the federate programming.

    Check required toolings.

    Establish sequence of machining operations.

    Identify whether use of any special feature

    like subroutines is required or not.

  • 8/8/2019 CNC%20Programming

    90/96

    Part Program Example.

    OPERATIONS TOOLS

    Bore dia 60H7 Core Drill dia 55

    B. Bar dia 59.5

    B. Bar dia 60

    Drilling dia 10 HSS Drill dia 10

    Tapping M12X1.75 HSS Drill dia 10.8

    Tap M12 STD.

    Tapping M10X1.5 HSS Drill dia 8.5

    Tap M10 STD.

    Part Program Example.

  • 8/8/2019 CNC%20Programming

    91/96

    g p

    N10/ (Core drill dia 55)

    N20 T1 M6 ;

    N30 G0 G90 G54 X200. Y150. ;

    N40 G0 G43 H01 Z100. ;N50 G98 G81 Z-25 R5 F40 ;

    N60 G80 G91G28 X0. Y0. Z0. ;

    N70/ (Semifinish Boring bar dia

    59.5)N80 T2 M6 ;

    N90 G0 G90 G54 X200. Y150. ;

    N100 G0 G43 H02 Z100. ;

    N110 G98 G85 Z-25 R5 F40 ;

    N120 G80 G91G28 X0. Y0. Z0. ;

    Part Program Example.

  • 8/8/2019 CNC%20Programming

    92/96

    g p

    N130/ (Finish bore dia 60)

    N140 T3 M6 ;

    N150 G0 G90 G54 X200. Y150. ;

    N160 G0 G43 H03 Z100. ;

    N170 G98 G76 Z-25 R5 Q0.5 F40 ;

    N180 G80 G91G28 X0. Y0. Z0. ;

    N190/ (Drilling dia 10)

    N200 T4 M6 ;

    N210 G0 G90 G54 X100. Y255. ;

    N220 G0 G43 H04 Z100. ;

    N230 G99 G81 Z-25 R5 F40 ;

    N240 G98 X275. Y50. ;

    N250 G80 G91 G28 X0. Y0. Z0. ;

    Part Program Example.

  • 8/8/2019 CNC%20Programming

    93/96

    g p

    N260/ (Drill dia 10.25 for M12tapping)

    N270 T5 M6 ;

    N280 G0 G90 G54 X380. Y255. ;

    N290 G0 G43 H05 Z100. ;

    N300 G98 G81 Z-25 R5 F40 ;N310 G80 G91G28 X0. Y0. Z0. ;

    N320/ (Tap M12)

    N330 T6 M6 ;

    N340 G0 G90 G94 G54 X380. Y255. ;

    N350 G0 G43 H06 Z100. ;

    N360 M29 S100

    N370 G98 G84 Z-25 R5 F175 ;

    N380 G80 G91 G28 X0. Y0. Z0. ;

    Part Program Example

  • 8/8/2019 CNC%20Programming

    94/96

    g p

    N390/ (Drill dia 8.5 for M10

    tapping)

    N400 T7 M6 ;

    N410 G0 G90 G54 X150. Y150. ;

    N420 G0 G43 H07 Z100. ;

    N430 G99 G81 Z-25 R5 F40 ;

    N440 X250. ;

    N450 X200. Y200. ;

    N460 G98 Y100. ;N470 G80 G91G28 X0. Y0. Z0. ;

    Part Program Example

  • 8/8/2019 CNC%20Programming

    95/96

    g p

    N480/ (Tap M10)

    N490 T8 M6 ;

    N500 G0 G90 G94 G54 X150. Y150. ;

    N510 G0 G43 H08 Z100. ;

    N520 M29 S100

    N530 G99 G84 Z-25 R5 F150 ;

    N540 X250. ;

    N550 X200. Y200. ;

    N560 G98 Y100. ;N570 G80 G91 G28 X0. Y0. Z0. ;

    Precautions while doing or

  • 8/8/2019 CNC%20Programming

    96/96

    executing CNC PROGRAM.

    Always add point ( . ) at the end of each

    coordinate value of axes.

    For e.g. X200. , Y 50. While replacing any tool from m/c check

    always tool offset and feed correctly.

    Always run first program in single blockand without component.