CNC Part Programming

Embed Size (px)

Citation preview

  • 7/23/2019 CNC Part Programming

    1/17

    CNC Part Programming

    (1) Programming fundamentals

    Machining involves an important aspect of relative movement between cutting tooland workpiece. In machine tools this is accomplished by either moving the tool withrespect to workpiece or vice versa. In order to define relative motion of two objects,reference directions are required to be defined. These reference directions depend ontype of machine tool and are defined by considering an imaginary coordinate system onthe machine tool. A program defining motion of tool workpiece in this coordinatesystem is known as a part program. !athe and Milling machines are taken for casestudy but other machine tools like "#" grinding, "#" $obbing, "#" filament windingmachine, etc. can also be dealt with in the same manner.

    (1.1) Reference Points

    %art programming requires establishment of some reference points. Threereference points are either set by manufacturer or user.

    a) Machine Origin

    The machine origin is a fi&ed point set by the machine tool builder. 'sually it cannot bechanged. Any tool movement is measured from this point. The controller alwaysremembers tool distance from the machine origin.

    b) Program Origin

    It is also called home position of the tool. %rogram origin is point from where the tool

    starts for its motion while e&ecuting a program and returns back at the end of the cycle.This can be any point within the workspace of the tool which is sufficiently away fromthe part. In case of "#" lathe it is a point where tool change is carried out.

    c) Part Origin

    The part origin can be set at any point inside the machine(s electronic grid system.)stablishing the part origin is also known as *ero shift, work shift, floating *ero ordatum. 'sually part origin needs to be defined for each new setup. +ero shifting allowsthe relocation of the part. ometimes the part accuracy is affected by the location of thepart origin. -igure /.0 and /. shows the reference points on a lathe and millingmachine.

  • 7/23/2019 CNC Part Programming

    2/17

    -igure /.0. 1eference points and a&is on a lathe

    -igure /.. 1eference points and a&is on a Milling Machine

    (1.2 ) Axis Designation

    An object in space can have si& degrees of freedom with respect to an imaginary

    "artesian coordinate system. Three of them are liner movements andother three are rotary. Machining of simple part does not require all degrees of freedom.2ith the increase in degrees of freedom, comple&ity of hardware and programmingincreases.#umber of degree of freedom defines a&is of machine.

    A&es interpolation means simultaneous movement of two ormore different a&es to generate required contour.-or typical lathe machine degree of freedom is and so it called a&is machines.

  • 7/23/2019 CNC Part Programming

    3/17

    -or typical milling machine degree of freedom is , which means that two a&es canbe interpolated at a time and third remains independent. Typical direction for the latheand milling machine is as shown in figure 0 and figure 03.

    (1.3 ) Setting up of Origin

    In case of "#" machine tool rotation of the reference a&is is not possible. 4rigin canset by selecting three reference planes 5, 6 and +. %lanes can be set by touching toolon the surfaces of the workpiece and setting that surfaces as 57&, 67y and +7*.

    (1.4 ) Coding Sstems

    The programmer and the operator must use a coding system to represent information,which the controller can interpret and e&ecute. A frequently used coding system is the8inary9"oded :ecimal or 8": system. This system is also known as the )IA "ode setbecause it was developed by )lectronics Industries Association. The newer codingsystem is A"II and it has become the I4 code set because of its wide acceptance.

    (!) C"C Code Snta#

    The "#" machine uses a set of rules to enter, edit, receive and output data. Theserules are known as "#" ynta&, %rogramming format, or tape format. The formatspecifies the order and arrangement of information entered. This is an area wherecontrols differ widely. There are rules for the ma&imum and minimum numerical valuesand word lengths and can be entered, and the arrangement of the characters and wordis important. The most common "#" format is the word address format and the othertwo formats are fi&ed sequential block address format and tab sequential format, whichare obsolete. The instruction block consists of one or more words. A word consists of anaddress followed by numerals. -or the address, one of the letters from A to + is used.The address defines the meaning of the number that follows. In other words, theaddress determines what the number stands for. -or e&ample it may be an instructionto move the tool along the 5 a&is, or to select a particular tool.

    Most controllers allow suppressing the leading *eros when entering data. This is knownas leading *ero suppression. 2hen this method is used, the machine control reads the

  • 7/23/2019 CNC Part Programming

    4/17

    numbers from right to left, allowing the *eros to the left of the significant digit to beomitted. ome controls allow entering data without using the trailing *eros."onsequently it is called trailing *ero suppression. The machine control reads from leftto right, and *eros to the right of the significant digit may be omitted.

    (3) $pes of C"C codes

    (3.1) Preparator codes

    The term ;preparatory; in #" means that it ;prepares; the control system to be readyfor implementing the information that follows in the ne&t block of instructions.

    A preparator functionis designated in a program by the word address < followed bytwo digits. %reparatory functions are also called %&codesand they specify the controlmode of the operation.

    (3.!) Miscellaneous codes

    Miscellaneous functions use the address letter M followed by two digits. They perform agroup of instructions such as coolant onoff, spindle onoff, tool change, program stop,or program end. They are often referred to as machine functions or M&functions. omeof the M codes are given below.

    In principle, all codes are either modal or non9modal. Modal codestays in effect untilcancelled by another code in the same group. The control remembers modal codes.This gives the programmer an opportunity to save programming time. "on&modal

    codestays in effect only for the block in which it is programmed. Afterwards, its functionis turned off automatically. -or instance is a non9modal code to program a dwell.After one second, which is say, the programmed dwell time in one particular case, thisfunction is cancelled. To perform dwell in the ne&t blocks, this code has to bereprogrammed. The control does not memori*e the non9modal code, so it is called asone shot codes. 4ne9shot commands are non&modal. "ommands known as ;cannedcycles; ?a controller(s internal set of preprogrammed subroutines for generatingcommonly machined features such as internal pockets and drilled holes@ are non9modaland only function during the call.4n some older controllers, cutter positioning ?a&is@ commands ?e.g., pindle counterclockwiseM=B pindle stop

    M=C Tool change ?see #ote below@M3= )nd of program

  • 7/23/2019 CNC Part Programming

    5/17

    $ool motion

  • 7/23/2019 CNC Part Programming

    6/17

    PlaneSelection

  • 7/23/2019 CNC Part Programming

    7/17

    Offsetand

    compensation

    ="utter diametercompensation

    cancel

    0

    "utter diametercancellation left

    "utter diametercompensationright

    $oolmotion

  • 7/23/2019 CNC Part Programming

    8/17

  • 7/23/2019 CNC Part Programming

    9/17

    "- % &1. 1apid motion towards +790= plane

    " %1 2-. !inear interpolation

    "/ %1 !. !inear interpolation

    "0 %! 2!-. 4-. R!-. "ircular interpolation clockwise?cw@

    "5 %3 2&!-. 4-. R!-. "ircular interpolation counter clockwise?ccw@

    "1 %! 2&-. !. R!-. "ircular interpolation clockwise?cw@

    "11 %1 . !inear interpolation

    "1! %1 2. !inear interpolation

    "13 % 1. 1apid motion towards +70= plane

    "14 M- M5 pindle stop and program end

    C"C Part Programming

    In the previous section, fundamentals of programming as well basic motion commandsfor milling and turning have been discussed. This section gives an overview of < codesused for changing the programming mode, applying transformations etc.,

    3.1 Programming modes

    %rogramming mode should be specified when it needs to be changed from absolute toincremental and vice versa. There are two programming modes, absolute andincremental and is discussed below.

    3.1.1 6bsolute programming (%5)

    In absolute programming, all measurements are made from the part origin establishedby the programmer and set up by the operator. Any programmed coordinate has theabsolute value in respect to the absolute coordinate system *ero point. The machine

    control uses the part origin as the reference point in order to position the tool duringprogram e&ecution ?-igure 3=.0@.

    3.1.! Relati*e programming (%51)

    In incremental programming, the tool movement is measured from the last tool position.

  • 7/23/2019 CNC Part Programming

    10/17

    The programmed movement is based on the change in position between twosuccessive points. The coordinate value is always incremented according to thepreceding tool location. The programmer enters the relative distance between currentlocation and the ne&t point ? -igure 3=.@.

  • 7/23/2019 CNC Part Programming

    11/17

    3.! Spindle control

    The spindle speed is programmed by the letter (( followed by four digit number, such as 0===. Thereare two ways to define speed.0. 1evolutions per minute ?1%M@. "onstant surface speedThe spindle speed in revolutions per minute is also known as constant rpm or direct rpm. The changein tool position does not affect the rpm commanded. It means that the spindle 1%M will remain constantuntil another 1%M is programmed. "onstant surface speed is almost e&clusively used on lathes. The1%M changes according to diameter being cut. The smaller the diameter, the more 1%M is achievedHthe bigger the diameter, the less 1%M is commanded. This is changed automatically by the machinespeed control unit while the tool is changing positions. This is the reason that, this spindle speed modeis known as diameter speed.

    3=.3 !oops and 'nconditional jump ?

  • 7/23/2019 CNC Part Programming

    12/17

    3.4 Mirroring

    The mirroring command is used when features of components shares symmetry about one or more a&esand are also dimensionally identical. 8y using this code components can be machined using a single setof data and length of programs can be reduced.

  • 7/23/2019 CNC Part Programming

    13/17

    )&ample

  • 7/23/2019 CNC Part Programming

    14/17

    Scaling

    caling function is used to program geometrically similar components with varyingsi*es.

    ynta&

  • 7/23/2019 CNC Part Programming

    15/17

    3./ Pattern rotation

    %attern rotation is used to obtain a pattern of similar features.

  • 7/23/2019 CNC Part Programming

    16/17

    The following e&ample ?-igure 3=.F@ depicts the case of a pattern which needs to beprogrammed through

  • 7/23/2019 CNC Part Programming

    17/17

    first two digits are used to call the particular tool and last two digits are used torepresent tool offset in the program. The tool offset is used to correct the values enteredin the coordinate system preset block. This can be done quickly on the machine withoutactually changing the values in the program.

    'sing the tool offsets, it is easy to set up the tools and to make adjustments

    'eed rate control

    "utting operations may be programmed using two basic feed rate modes0. -eed rate per spindle revolution. -eed rate per time

    The feed rate per spindle revolution depends on the 1%M programmed.