KEMBAR78
Topic 13 - Machine Programming | PDF | Machining | Metalworking
0% found this document useful (0 votes)
15 views17 pages

Topic 13 - Machine Programming

This document introduces the basic concepts of programming CNC machine tools. It explains the structure of a CNC program, the movement, auxiliary, and tool functions. It also describes the axis systems, origins, and reference points used in programming. Finally, it includes examples to illustrate the concepts.
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)
15 views17 pages

Topic 13 - Machine Programming

This document introduces the basic concepts of programming CNC machine tools. It explains the structure of a CNC program, the movement, auxiliary, and tool functions. It also describes the axis systems, origins, and reference points used in programming. Finally, it includes examples to illustrate the concepts.
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/ 17

INTRODUCTION TO MACHINE PROGRAMMING

FILE MACHINE TOOL WITH NUMERIC CONTROL


THEME13
Basic bibliography:

Notes prepared by the Teaching Team

Bachelor's Degree in Industrial Technology Engineering


MANUFACTURING PROCESSES

1.- GUIDELINES FOR THE STUDY OF THE TOPIC

Topic13isanintroductorytopiconnumericalcontrolmanufacturing.
The addressed contents are:
. Communicationoforderstothemachine
. Structure of a numerical control program
. Identification of functions
. Axissystemsincomputernumericalcontrolmachinetools(CNC)
. Originsandlandmarks.

Itisrecommendedtofollowthefollowingmethodologyforthestudyofthistopic:

. Study the contents of TB3


. Study the solved examples

NATIONALUNIVERSITYOF DISTANCE EDUCATION 2


MANUFACTURING PROCESSES

2.-INTRODUCTION TO MACHINE TOOL PROGRAMMING


WITH NUMERIC CONTROL [TB3]

2.1 Introduction

Through a numerical control program, information of the type is transmitted to the machine-tool.
geometric (geometry of the piece, origins of the axis system, dimensions of the tool) and
technologicalinformation(chronologicalorderofphasesandmachiningoperationsandconditionsof
cut).
This program has a specific structure, composed of successive blocks that contain
a series of functions in a certain code. The ISO programming code used
mostly consists of preparatory functions of movements (G), control functions of
advances and speeds of the head (F, S), tool control functions - tool number - (T)
Auxiliary functions (M) such as coolant activation or spindle direction control.
Ingeneral,eachblockorlineofcodewillhaveastructureofthetype:

N G XYZ F S T M

whereNindicatestheblocknumberandeXYZthelimitsaccordingtothepreviouslydefinedcoordinateaxes.

2.2 Movement or preparatory instructions (G functions)

Thefollowingaresomebasicpreparatorymovementfunctions:

G00 Rapid positioning (fast travel)


G01 Linear interpolation: movements are made along straight paths with a speed of
controlled advance. The interpolation movements are achieved by combining the movement of
twoormoreaxesofthemachinesimultaneously
G02 Circular interpolation clockwise: the machine axes are driven to describe a
circumference
G03 Circular interpolation counterclockwise
G04 Timing between blocks*
G17 Identification of the XY plane that contains the circular interpolation
G18 Identification of the plane XZ that contains the circular interpolation
G19 Identification of the YZ plane that contains the circular interpolation
G40 Tool Radius Compensation Cancellation
G41 Tool radius compensation to the left (the CNC registers tool center)
G42 Tool radius compensation to the right
G43 Tool length compensation function (In drilling or face milling tools)
G44 Cancellation of tool longitudinal correction function

NATIONALUNIVERSITYOF DISTANCE EDUCATION 3


MANUFACTURING PROCESSES

G90 Programming in absolute coordinates


G91 Incremental Coordinate Programming
G94 F in mm/min
G95 F in mm/rev
G96 constant F

All the previous functions except the one marked with an asterisk are modal, meaning they remain active.
until they are replaced by another instruction from the same group or incompatible with it that
Deactivate or until a reset stops the program. Functions F and S are also modal.
The functions from G79 to G89 correspond to fixed cycles for drilling, tapping, reaming, and boring.
machining of cashiers.
The longitudinal tool correction functions serve to activate and deactivate the correctors.
tools that have been previously supplied to the CNC in order to take into account the different
longitudes.

Example:

N0050G01X20.00Y10.00Z30.00F200S1000
N0060X100.00
N0070G00Z50.00
Block 50 instructs the machine to move from the current position to the absolute coordinates.
(20,10,30), at a feed rate of 200 mm/min following a straight trajectory (linear interpolation)
G01),withthespindlerotatingat(S)1000rev/min.
Block60commandsamovementinG01(modal)toX100.YandZdimensionsarenotspecified,sothe
destination coordinates are X100Y10 Z30.
Block70commandsarapidmovementG00fromthepreviouselevationtoZ50,withFasthemaximumspeedofthe
machine and S according to the last block.
It can be programmed in absolute coordinates (with respect to the origin of the program that is active) or
relative (incremental with respect to the previous point in the trajectory). By default, the CNC assume
absolute programming (G90). If working in incremental, a G91 must be programmed in the
initialline.Italsoassumes(G94)Finmm/minsothewritingofblock50hasbeensimplified.
bypassingG90G94.

2.3 Auxiliary Functions (AuxiliaryFunctions)

The auxiliary functions M produce different actions in the machine such as starting or stopping the spindle.
activationorstoppingofthecoolant,resettingvalues,endofprogram,etc.
Thefollowingisalistofsomeauxiliaryfunctions:

NATIONALDISTANCE EDUCATION UNIVERSITY 4


MANUFACTURING PROCESSES

M00 Program stop


M01 Scheduledpause(conditionalpauseoftheprogram)
M02 Endofprogram
M03 Spindle start in clockwise direction
M04 Spindle start in counterclockwise direction
M05 Screwstop
M06 Toolchange
M07 Activation of the primary refrigerant
M08 Activation of the secondary refrigerant
M09 Machining without coolant
M30 Endoftheprogramwithresetvariables

2.4 Axis and origin systems

To schedule the movements of the MHCN it is necessary to define a system of axes and an origin of
Coordinates. In the following figure, the axis systems that are taken when it is the
tool that moves (X,Y,Z), or when it is the piece that moves, remaining fixed the
tool (X',Y',Z'). The Z axis is located in the direction of the machine's main spindle. If there is no a
mainspindle(spindlethatprovidesmovementtothetool)wil taketheZaxisaccordingtothenormal
projecting to the plane of attachment of the part.

+Y

+X'
+Z´

+Z +X
+Y'

Thereferencepointthatdefinesthezeroofthemovementinthenumericalcontrolprogramcanbedefined
asapointofthemachineitselforasapieceorigin.Ingeneral,themachinezero(pointM)
itisadefinedorigininnumericalcontrolbutisnotusuallyusedasthezeroofthepartprogram.In
In the case of the lathe, a workpiece origin (point W) is used, which is defined as shown in the following.
figure

NATIONALDISTANCE EDUCATION UNIVERSITY 5


MANUFACTURING PROCESSES

+X

M W
+Z

Numericalcontrolallowsdefiningtheworkpieceoriginbyintroducingtherelativecoordinatesofthatpoint.
This is how to avoid working with the zero machine that is usually an inaccessible point of the machine.
Ingeneral,thezeropointofthepieceisdeterminedatapointonthepiecethatinterestsus,asindicatedinthe
next figure:

Z
Y
X

W
Z
Y
X

Bibliography:

Sebastián, M.A.; Luis, C.J.: Programming of machine tools with numerical control. Collection
Studies of UNED, UNED, Madrid, 2004

NATIONALUNIVERSITYOF DISTANCE EDUCATION 6


MANUFACTURING PROCESSES

2.5 Examples

Example 13.1

Itisdesiredtocarryoutherefacingofacylindricalpiecemeasuring80mminlengthand30mmindiameter,inorderto
eliminate some irregular edges of up to 2 mm that it presents on its front face. The bar is mounted on
cantileverintheheadstockofanumericalcontrollatheandthearrangementofthelatheusedrequiresthatthe
theprocessconsiderediscarriedoutwithaleftheadturning.Throughouttheprocess,awillbeused.
constant cutting speed of 200 m/min and a feed of 0.15 mm/rev. The program is to be carried out
numericalcontrolfortheindicatedmachining.

Solution

Thesketchofthepieceisthatofthefollowingfigure,inwhichthecrestsonthefrontfacearevisible.

TheprogrammingoftheprogramblocksofCNisexplainedbelow:

Block1.-Activationofmodalfunctions,theadvancefunction,thecuttingspeedfunction,thetoolfunction,
the auxiliary functions and positioning at the starting point of the program (sufficiently distant from the
machining positions); in this case, point Xr = 35 mm and Z = 20 mm, separated 20
mm-ineachdirection-frompointXr=15mmandZ≈2mmwherethetool-workpiececontactwillbegin.

N10 G00 G90 G95 G96 X70 Z20 F0.15 S200 T1.2 M04 M08

G00 Rapid positioning (modal function)


G90 Programming with
absolute dimensions (modal function)
G95 The value of
the function F is expressed in mm/rev (feed) (modal function)
The value of the function S is expressed in m/min (cutting speed) (modal function)
X70; Z20 Rapid positioning (associated with G00) of the tool tip to the point (35 mm;
20mm)withrespecttotheoriginofthepiece(X-Zaxesofthesketch).Notethatitisprogrammedin
diameters(whichismoreconvenientthaninradii,Xr,sincethediameteristheindicateddimensionin
the plane); that is, to position itself on the 70 mm diameter, the tool must be
attheradialpositioncorrespondingto70/2=35mm

NATIONALDISTANCE EDUCATION UNIVERSITY 7


MANUFACTURING PROCESSES

F0.15 (associated with G95) Feed of 0.15 mm/rev


S200 (associated with G96) Constant cutting speed of 200 m/min
T1.2 Tool 1 with the corrections from file 2
M04 Activation of the head rotation counterclockwise (to the left)
M08 Activation of the secondary cooling device

Block 2.- Quick approach to the point where the advancement of the referencing will be activated.

N20 X34 Z0

X34; Z0 Tool tip positioning at point (17 mm; 0 mm) located at


thereframingplan.

Block3.-Refacedwithanadvanceof0.15mm/rev.

N30 G01 X-1

It would be enough to reach X0, but it is usually programmed to "go over" a certain length to ensure the
complete face referencing. Note that since the function is not programmed in the block
Zpositioningwil notchangeitsvalueduringtheexecutionofsaidblock;thatis,
the tool moves parallel to the X axis.

Block4.-Rapidmovementtotheprogramstartposition.

N40 G00 X70 Z20

Block5.-Endoftheprogram.

N50 M30

Thisresultsinthefollowingnumericalcontrolprogram:

N10 G00 G90 G95 G96 X70 Z20 F0.15 S200 T1.2 M04 M08

N20 X34 Z0

N30 G01 X-1

N40 G00 X70 Z20

N50 M30

NATIONALDISTANCE EDUCATION UNIVERSITY 8


MANUFACTURING PROCESSES

Example 13.2

Aroughcylindricalturningistobeperformedonacylindricalbarof80mminlengthand30mmindiameter.
diameter up to a final diameter of 18 mm.The bar is mounted overhanging on the headstock of a lathe.
numericalcontrolandthelengthoftheareatobecycledis30mm.A..
cutting speed of 200 m/min and a feed of 0.2 mm/rev. The arrangement of the lathe used requires that the
theconsideredprocessiscarriedoutwiththerotationoftheleftheadandthedepthofthepassesof
Theroughingis2mm.Itisdesiredtocreatethenumericalcontrolprogramfortheindicatedmachining.

Solution

Thesketchofthefinalpieceisasfollows

For the implementation of the indicated machining, a numerical control program such as the
next

Block1.-Activationofthemodalfunctions,theadvancefunction,thecuttingspeedfunction,thetoolfunction,
the auxiliary functions and positioning at the start point of the program (sufficiently far from the
machining positions); in this case, point Xr = 35 mm and Z = 20 mm, separated by 20
mm-ineachdirection-ofthepointXr=15mmandZ=0mmwherethetool-piececontactwillbegin.

N10 G00 G90 G95 G96 X70 Z20 F0.2 S200 T1.3 M04 M07

G00 Rapid positioning (modal function)


G90 Programming with absolute dimensions (modal function)
G95 The value of the function F is expressed in mm/rev (feed) (modal function)
G96 The value of function S is expressed in m/min (cutting speed) (modal function)
X70; Z20 Rapid positioning (associated with G00) of the tool tip to the point (35 mm;
20mm)relativetotheoriginofthepart(X-Zaxesofthesketch).Notethatitisprogrammedin
diameters(whichismoreconvenientthaninradii,Xr,sincethediameteristhespecifiedmeasurementin

NATIONALUNIVERSITYOF DISTANCE EDUCATION 9


MANUFACTURING PROCESSES

the plane); that is, to position itself on the diameter of 70 mm, the tool must be
attheradialpositioncorrespondingto70/2=35mm
F0.2 (associated with G95) Feed of 0.2 mm/rev
S200 (associated with G96) Cutting speed of 200 m/min
T1.3 Tool 1 with the corrections from file 3
M04 Activation of the head rotation in the counterclockwise direction (to the left)
M07 Activation of the primary cooling device

Block2.-Quickapproachtothepointwheretheworkadvancewillbeactivated(0.2mm/rev)

N20 X34 Z2

X34; Z2 Positioning of the tool tip at the point (17 mm; 2 mm) that is located
separated2mm-accordingtoeachofthetwocoordinateaxes-withrespecttothepointofcontactwiththe
piece.

Block 3.-Approach to work advancement (0.2 mm/rev) up to the radial position of the first pass of
roughing(depthofcutof2mm)

N30 G01 X26

Note that since the Z positioning function is not programmed in the block, it will not vary.
value of it during the execution of said block; that is, the tool moves
paralleltotheXaxis.

Block4.-Firstroughingpass

N40 Z-30

Please note that since the positioningX function is not scheduled in the block, it will not change the
value of it during the execution of said block; that is, the tool moves
paralleltotheZ-axis.

Block5-Outputofthetoolreferencing

N50 X34

Block6.-Quickreturntothepointwheretheworkadvanceforthesecondpasswillbeactivated

N60 G00 Z2

Block 7.-Approach to work advance (0.2 mm/rev) up to the radial position of the second pass of
roughing

NATIONALDISTANCE EDUCATION UNIVERSITY 10


MANUFACTURING PROCESSES

N70 G01 X22

Block 8.- Second roughing pass

N80 Z-30

Block9.-Exitofthetoolreferencing

N90 X34

Block 10.- Quick return to the point where the work progress for the third and final one will be activated,
last

N100 G00 Z2

Block 11.-Approach to work progress (0.2 mm/rev) until the radial position of the third pass
roughing

N110 G01 X18

Block 12.-Third roughing pass

N120 Z-30

Block13.-Exitofthetoolreferencing

N130 X34

Block14.-Quickreturntotheprogram'sstartingpoint

N140 G00 X70 Z20

Block15-Endoftheprogram

N150 M30

Therefore,anumericalcontrolprogramforroughturningtobecarriedoutisasfollows:

NATIONALDISTANCE EDUCATION UNIVERSITY 11


MANUFACTURING PROCESSES

N10 G00 G90 G95 G96 X70 Z20 F0.2 S200 T1.3 M04 M07
N20 X34 Z2

N30 G01 X26

N40 Z-30

N50 X34

N60 G00 Z2

N70 G01 X22


N80 Z-30

N90 X34

N100 G00 Z2

N110 G01 X18

N120 Z-30

N130 X34

N140 G00 X70 Z20

N150 M30

Example 13.3

A blind hole is to be drilled at the central point of a steel plate of dimensions


100x60x30mm,asindicatedintheattachedsketch.Forthis,aspindlemillingmachineisavailable.
vertical equipped with numerical control of the type Fagor 8050MU.
Thecompletemachiningprocessconsistsofapreliminarymarkingandtheactualdrilling.
Thedottingisdonewitha4mmdiametercenteringdrill,withafeedrateof0.1mm/rev,ataregime
ataspeedof200rpmandatooltipdepthof8mm.Drilingiscarriedoutwith
10mmdiameterhelicaldrilbit,withafeedof0.2mm/revandarotationfrequencyof300rpm.
Thenumericalcontrolprogramfortheindicatedmachiningisdesired.

NATIONALDISTANCE EDUCATION UNIVERSITY 12


MANUFACTURING PROCESSES

Solution

Therequestednumericalcontrolprogramconsistsofthefollowingblocks:

Block 1.- Once the punching tool is mounted at the tool change point (point lo
sufficiently far from the work area; e.g.: point X = 200; Y = 200; Z = 300), block 1 produces
the activation of preparatory functions (G90: Absolute coordinates; G95: Feed in mm/rev; G43:
Longitudinalcompensationofthetoolsinceitisaboutdrills;G17:Mainplane(XY),thatofthe
tool(T),thetools' rotationspeed(S),inrpmbydefault,andtheauxiliaryfunction(M03:
Right-handedspindlerotation:

N10 G90 G95 G43 G17 T1.1 S200 M03

Block 2.- Quick move to the point where the drilling advance will be activated and activation of
primary cooling device (M07):

N20 G00 X0 Y0 Z10 M07

Block 3.- Displacement with the progress of work to a depth of the drill bit of 8
mm:

NATIONALDISTANCE EDUCATION UNIVERSITY 13


MANUFACTURING PROCESSES

N30 G01 Z-8 F0.1

Please note that since the X and Y positioning functions are not programmed in the block, no
the value of the coordinates in X and Y will vary during the execution of that block; that is,
thetoolmovesonlyalongtheZaxis,keepingitspositioninXandY.

Block4.-Fastexitdisplacementofthetoolfromthehole:

N40 G00 Z10

Block5.-Rapidmovementtothetoolchangepoint(200;200;300):

N50 X200 Y200 Z300

Not having modified the modal function G00, the movement is made at rapid speed of
positioning.

Block6.-Sincethetoolisgoingtobechanged,thelongitudinalcompensationofthefirstoneiscanceled.
tool(G44);thespindlerotationstops(M05)andthecoolingdeviceisdeactivated(M09):

N60 G44 M05 M09

Block7.-OncethemarkingtoolhasbeenchangedfortheØ10mmdrilingbit,block7
producetheactivationofpreparatoryfunctions(G90:Absolutecoordinates;G95:Feedinmm/rev;
G43: Longitudinal tool compensation; G17: Selection of the XY main plane.
tool(T),thetoolrotationregime(S)andtheauxiliaryfunction(M03:Spindlerotationto
rights

N70 G90 G95 G43 G17 T2.2 S300 M03

Block8.-Rapidmovement(G00)tothepointwherethedrillingfeedwillbeactivatedandactivation
oftheprimarycoolingdevice(M07):

N80 G00 X0 Y0 Z10 M07

Block9.-Displacementwiththeworkprogress(G01)toadepthofthedrilltipof
13mm:

N90 G01 Z-13 F0.2

Block10.-Rapidmovement(G00)fortoolexitfromthehole:

NATIONALUNIVERSITYOF DISTANCE EDUCATION 14


MANUFACTURING PROCESSES

N100 G00 Z10

Block11.-Rapidmovementtothetoolchangepoint(200;200;300):

N110 X200 Y200 Z300

Block12.-Cancellationofthelongitudinalcompensationofthetool(G44);thespindlerotationstops
(M05) and the cooling device (M09) is deactivated:

N120 G44 M05 M09

Block13.-Endofprogram(M30):

N130 M30

Therefore,anumericalcontrolprogramforthedrillingtobeperformedisasfollows:

N10 G90 G95 G43 G17 T1.1 S200 M03

N20 G00 X0 Y0 Z10 M07

N30 G01 Z-8 F0.1

N40 G00 Z10

N50 X200 Y200 Z300

N60 G44 M05 M09

N70 G90 G95 G43 G17 T2.2 S300 M03

N80 G00 X0 Y0 Z10 M07

N90 G01 Z-13 F0.2

N100 G00 Z10

N110 X200 Y200 Z300

N120 G44 M05 M09

N130 M30

NATIONALUNIVERSITYOF DISTANCE EDUCATION 15


MANUFACTURING PROCESSES

Exercise 13.4

Ablockofstainlesssteelmeasuring100mminlengthand35mminwidthundergoesafacemilling.
withafeedspeedof6mm/sandacuttingdepthof3mm.Thecharacteristicsoftheendmil
tobeusedare:diameterd=50mmandz=20teeth;andthemillingisdonewitharotationfrequency
from the 60 rpm milling cutter. It is desired to obtain the numerical control program if such a face milling process
ItiscarriedoutonaverticalspindlemillingmachineequippedwithaFagor8050MUtypecontrolandconsidering
theoriginofthepieceshownintheattachedsketch.

Solution

Therequestednumericalcontrolprogramconsistsofthefollowingblocks:

Block1.-Oncethemil ismountedatthetoolchangepoint(apointfarenoughaway
from the work area; e.g.: point X = 200; Y = 200; Z = 300), block 1 activates the
preparatory functions (G90: Absolute coordinates; G94: Feed in mm/min; G43: Compensation
longitudinalofthetoolsinceitisafrontmillingcutterwithahandle;
G17:Mainplane(XY),thatofthetool(T),thatofthetools' rotationregime(S)andthefunction
auxiliary(M03:Right-handspindlerotation)

N10 G90 G94 G43 G17 T1.1 S60 M03

Block 2.- Quick movement to the point where work advance will be activated and activation of
primary cooling device (M07):

N20 G00 X27 Y17.5 Z-3 M07

IthasbeenconsideredthattheXYplane(andthereforetheoriginoftheZaxis)isontheinitialsurfaceof
the piece; therefore, to achieve a depth of 3 mm, one must go to Z = -3mm. Note that for
establishing the 'input' and 'output' lengths of the end mill, the considerations are valid.
made in section c) of Exercise 10.3; although here the addition has been evaluated at 2 mm.

NATIONALDISTANCE EDUCATION UNIVERSITY 16


MANUFACTURING PROCESSES

makes these lengths with respect to the value ded/2. With the value Y = 17.5 mm it is guaranteed that the milling cutter
be centered with respect to the piece.

Block3-Displacementattheworkfeedspeed(6mm/s=0.1mm/min)untiltheaxisof
the strawberry surpasses the position of the 'output length' (l=d/2 + 2): s

N30 G01 X-127 F0.1

Block4.-Rapidmovementtothetoolchangepoint(200;200;300):

N40 G00 X200 Y200 Z300

Block 5.-Cancellation of longitudinal compensation, spindle rotation, and deactivation of the device
cooling

N50 G44 M05 M09

Block6.-Endofprogram:

N60 M30

Therefore,anumericalcontrolprogramforthefacemillingofplaningtobecarriedoutisasfollows:

N10 G90 G94 G43 G17 T1.1 S60 M03

N20 G00 X27 Y17.5 Z-3 M07

N30 G01 X-127 F0.1

N40 G00 X200 Y200 Z300

N50 G44 M05 M09

N60 M30

NATIONALDISTANCE EDUCATION UNIVERSITY 17

You might also like