CNC Setting and Operation Workbook
CNC Setting and Operation Workbook
Operation Workbook
City and Guilds Co-publishing Series
City and Guilds of London Institute has a long his tory of providing
assessments and certification to those who have undertaken education and
training in a wide variety of technical subjects or occupational areas. Its
business is essentially to provide an assurance that pre-determined
standards have been met. That activity has grown in importance over the
past few years as government and national bodies strive to create the right
conditions for the steady growth of a skilled and flexible workforce.
Both teachers and learners need materials to support them as they work
towards the attainment of qualifications, and City and Guilds is pleased to
be working with several distinguished publishers towards meeting that
need. It has been closely involved in the planning, author selection and text
appraisal, although the opinions expressed in the publications are those of
the individual authors and are not necessarily those of the Institute.
City and Guilds is fully committed to the projects listed below and is
pleased to commend them to teaching staff, students and their advisers.
Tom Renshaw
Department of Engineering Technology
Blackpool and The Fylde College
M
MACMILLAN
~
C+3
Cityand Guilds
© Tom Renshawand City and Guild~ nf I.ondon Institute 199.+
Acknowledgements
Thanks are duc to the following for perm iss ion to use photographs:
Cincinnati Milaeron (page 3), Norelen (page 16).
Contents
Introduction 1
Safety note 3
Glossary 47
Index 49
Introduction
2
Safety note
The tasks in this workbook are mainly designed for metal-cutting turning
centres (Figure A) and machining centres (Figure B). The general
principles and the skills you will acquire should, in general, be transferable
to all types of CNC machines.
All the tasks in this workbook are structured in such a way that you will
never be required to run a machine vvithout the use of machine and tool
guards, together with all the other recognised safety precautions. You must
never operate a machine without supervision by qualified personnel. If you
notice any defect during operation, you must report it immediately to your
supervisor.
Before operating any machine tool, you should make sure that all
services and functions are in working order. It is the duty of everyone
concerned with the production process, particularly the setter/operator, to
check the machine regularly, and to folio\\' the routine maintenance
schedule as a minimum requirement. The following should always be
checked:
• the pneumatic system for recommended pressure, adequate lubrication
and clean filters
• the hydraulic system for recommended pressure, reservoir levels and
adequate lubrication
• that the machine is clean and free from swarf build-up, and that the
correct type and quantity of coolant is being used.
Before you operate any machine, you must be fully aware of emergency
conditions. You IIll/sl also be able to shut down the machine if an
emergency does happen.
-Y
~
y~ Y~
z
X. Y plane x 2 plane Y Z plane
)_.+X
+X
+2
4
x- ~ culting tool
__+----,lL,-------+_ Z +
x, Z zero pOint
\ wor k'
piece
X-----~~---.~X~+~----------"
y-
x, Y, Z zero point
Z-
.... Figure 1.4 Cartesian co-ordinate system:
milling (three axes)
10 2 ________________________________________
o ___________________________________ 5 _____
o 10 20 30 40 50 60 70 80 90 100
.... Figure 1.5
5
From To Absolute Incremental
position position co-ordinate co-ordinate
datum 1
1 2
2 3
3 4
~ Figure 1.6
4 5
position 1 30120
position 2 -401-20
position 3 -20/10
position 4 10/-10
position 5 401-30
N ow, with the datum transferred to the centre of the grid (Figure 1. 7),
complete the table in Figure 1.8. (Notice the significance of the positive
and negative signs in the chart.)
datum 1
1 2
2 3
3 4
4 5
~ Figure 1.8
Before operating a CNC machine, you first need to set it to its own datum
position. This allows the part program to be written with a datum point
relevant to the component. The position of this work datum relative to
the machine datum can then be entered into the machine control. You
will need to know the limits of travel in all three machine axes, so as to be
able to select and position the work within the capacity of the machine.
Always keep in mind the following safety rules:
• machines must not be operated without qualified supervision
• guards must be in position and all interlock switches operative
• machine parameters must only be set by qualified personnel
• when cutting metal you may not be fully protected by guards; you mUSl
wear goggles.
6
Task 1.2 Checking table limits of travel
With the machine positioned at its datum, in manual mode and with
the positional axes of the machine control unit (MCU) set to zero,
move the machine in all axes through their maximum limits of travel.
Note the distances moved by referring to the MCU readouts.
Additional information
CNC machines mayaiso have a number of rotary axes (Figure 1.9),
together with controlled movements of the machine table and tools about
these axes. These machines can not only produce more complex
component shapes, but also produce components using fewer set-ups.
These developments, together with the introduction of multiple spindies
and driven tooling on turning centres, have greatly enhanced the
capabilities of CNC machines.
~B~
+X,+Yor+Z
+X
c~
+Z
+Y
+8
r - - - - c r l - - ' - - - +X
+A
+Z
7
Learning Assignment 2
Methods of guarding
The guard devices on CNC machines have three purposes:
• to protect the operator
• to protect the machine
• to protect the workpiece.
All operators must be thoroughly familiar with the safe running of all the
machines in their area. As the setter/operator, it is also your responsibility
to maintain safety within the working area by keeping the area clean and
easily accessible.
8
Additional information
With any guarding method, there is a conflict between total protection and
reasonable accessibility. Everyone in the machine industry, from designers
to operators, must always be aware of the dangers to people and machines
from rotating tools, workpieces and materials used, especially because a
small adjustment lo an element setting or operation may radically alter
some other part of the process.
Interlocks
Slideways
Spindies
Machine isolators
Emergency stops
Air pressure
Oilleveis
Limit switches
Proximity switches
9
Task 2.4 Checking interlock guards
Load and run a machine with a demonstration program. During
operation of the program, open the interlock-protected guards to test
each switch in turn. (You do not need to use cutting tools or a
workpiece for this task.)
You must be familiar with the procedures for machine re-start after
emergency shutdown before you begin this task. Make sure that all offsets
are correctly cancelled or re-set, and that the tools used are in the right
location and sequence for operation.
10
Learning Assignment 3
Machine datums
Part programs used to machine components on CNC machines are written
using co-ordinate dimensions taken from the component datum. When the
component is placed on a maehine, thc position of this datum needs to be
loeated and entered into the MCU. This is aehieved by eomparing the
eomponent datum with the machine datum so that the MCU ean eompute
the co-ordinate values between the two positions. This must be done
before maehining ean begin. The fixed maehine datum position is set
using mieroswitehes and positional eneoders loeated on eaeh of the
maehine's movable axes. Setting is usually earried out by an automatie A POINT TO NOTE
setting routine whieh moves the table, spindie or turret away from its A machine datum on the Z axis is
loeation and then aeeurately re-positions it. This routine must be earried usually located within the spindIe.
out every time the maehine is switehed on.
~
c. ~
/
"V
machine
spindie
spIndie
datum
'-- cutter
spindie datum on a vertlcal table datum on a vertlcal
milling machine milling machine (plan view)
chuck
machine
spindie
J spindie
datum
Eaeh faee of a turret must have its own datum position, but these all
eoineide when indexed into the working position.
When tools or workpieces are plaeed into their respeetive holding
positions, maehine datums are often ineonvenient for programming. These
datums ean be transferred to more easily usable positions sueh as the tip of
the tool or the end of the bar. This may be done either by inc1uding these
transfer values in the set-up ea1culations, or by the use of toollength
offsets within the part program.
11
turre!
spIndie
lurret datum
tool-holder
cutllng
1001
/
datum effecllvely
lranslerred to tool tip
datum effectively transfer red 10
cutter lip by 1001 length ollset lacility
within program
turning lools milling cutters
~ Figure 3.2 Datum transfer
Movement - (table/tool)
Machine tool Axis
Signed direction Amount
~ Figure 3.3
Additional information
The position of a component datum point relative to a machine datum
may be set within the work co-ordinate system of component location.
This enables the component to be accurately located by using the
appropriate preparatory function code. Look, for example, at the part
program in Program 3A, and then at Program 3B, which is the same
~ ProgrlUIl 3A
04545
N5 GOO G90 G71 G94 G80 G49
NIO G92 X-345.0 Y234.0 Z123.0
N15 T06 M06
N20 G44 H06
N25 S2340 M03
N30 GOO XO.O YO.O Zl.O
12
04545
N5 GOO G90 G71 G94 G80 G49
N10 T06 M06
N15 G44 H06
N20 S2340 M03
N25 G55
N30 GOO XO.O YO.O Zl.O .... Program3B
~ datum
~ With a rectangular block c1amped on to a CNC milling machine table
and with the machine set to manual mode (Figure 3.4), locate the
four corners of the block and complete the table in Figure 3.5. Follow
this work sequence:
1 Note the diameter of the cutter to be used (say 10 mm dia slotdrill).
2 Set the machine datum position to zero in all three major axes.
3 Move the tool to touch the top surface of the workpiece (Z = 0).
4 Note the distance moved in Z.
5 Move the tool to touch the edge of the test block on the X datum
face.
6 Note the distance moved in X.
7 Move the tool to touch the edge of the test block on the Y datum • Figure 3.4 Task 3.3
face.
8 Note the distance moved in Y.
To ca1culate the correct X and Y values, remember to add (or
subtract) the cutter radius to (or from) the noted values, as required.
Take care not to damage the tool. Use special setting tools if these are
available. The Z value will be the same for all four corners.
4
.... Figure 3.5
13
Learning Assignment 4
Work-holding
In Learning Assignment 1 we said that there are three planes far possible
movement: the X, Y horizontal plane, and the X, Z and the Y, Z vertical
planes. Ir is also possible far rotation to take place about each of the three
axes, X, Y and Z. Movement can take place in any of these six ways and
this is often described as having six degrees offreedom (Figure 4.1).
When you damp a component, you need to think about constraint in a11
six (Figure 4.2).
Components may be restrained by a combination of two methods:
• damping friction, induding magnetic chucks and suction plates
... Figure 4.1 Six degrees of freedom • locational stops, induding angle plates, location pegs and fixtures.
Locational stops should be used to resist the main cutting forces. Do not
rely on the frictional farces between the damps and the workpiece.
The damping of components must not interfere with the cutter paths.
This is best ensured by listing a11 c1amps available to the setter/operator in
a work-holding database for the programmer. If a workpiece unavoidably
has to be damped across cutter paths, extra c1amps must be used with a
sequence of c1amp adjustments and programmed stops induded in the
part prograrn. Details of this, together with a11 necessary documentation,
must be made available to the setter/operator.
Automatie damping set-ups can be used. These a110w the damps to be
swung away from the damping position, and then back, as the cutter
passes. This is done by using the required 'misce11aneous' (M) codes
within the part program.
The aims of damping arrangements must be to avoid interference whilst
safely securing the component with a minimum number of set-ups which
delay the cutting process.
Selecting clamps
The selection process depends on the method used:
• in manual c1amping, you select the damps from a list, noting any
preferences mentioned by the programmer
• in automatie loading and c1amping (used with fu11y automated
manufacture), a11 damps are selected during the design and/or
programming stages.
clamping
force
location
-plate
location
peg
14
050
15
Fixtures should be designed together with thc component; often a minor
modification at this stage can greatly improve thc damping arrangements
later. You must be aware of the fixtures available and their methods of
assembly. Good fixture design ensures that the component can only be
loaded in thc right way. Often, in production of small quantities of
components, you will have responsibility for choosing the damping.
The versatility of CNC machining allows the design engineer to
consider shapes that cost too much to produce by conventional machining
methods. Intricately shaped components can be awkward to damp,
however. To manufacture fixtures suitable for each component may be
expensive, so purchasing modular damping could be cost-effective. These
modular fixtures are assembled from accurately manu1'actured
components, often on grid plates. With good planning you can assemble
the fixture in advance, further reducing set-up time.
The ultimate in modern damping methods is the use of hydraulicallyl
pneumatically operated modular damping, with the operating sequence
managed from within the part program. This method 01' manufacture
increases your responsibility, as setter/operator.
ADDITIONAL TASK
16
Learning Assignment 5
Ne tooling
The principles of metal cutting are the same for both CNC and
conventional machining. Tool geometry and tool wear characteristics are
also the same. The tool-changing facilities and tool monitoring are the
principal benefits of CNC tooling.
When tools wear the cutting forces increase, and with the more
technically advanced CNC controllers these fore es can be monitored and
acted upon. This action will be in the form of visually displayed data for
the operator or the activation of an automatie tool-changing sequence.
These facilities greatly improve both product quality and production
efficiency.
The selection of tool type and tool material depends on the work
material and the cutting conditions. Once you have selected the tools, you
can calculate the correct cutting speeds and feeds.
Indexable (throwaway) inserts are recommended for all tooling on CNC
machines. The characteristics of such tips are standardised; the codes used
are shown in Figure 5.1. The seven compulsory symbols are always stated,
whilst the remaining three may or may not be shown.
2 Tool care
17
u/cut 3.0 wide*3.0 deep
u/cut 5.0 wide*2.0 deep
o 0
o ci
(') "<t
lSl lSl
medium-carbon steel 1
2
3
~ Figure 5.4
4
Turned components may require fur- Identify the tools shown in Figure 5.5. List their applications and
ther machining - for example, holes on explain their shape. Their names are listed in random order at the foot
a pitch circle diameter (PCD) or lateral of the dia g ram. Select the correct name for each too1.
grooves. Generally, this would require
an additional set-up on a machining
F
centre with extra handling and set-up
~50 ~h~50 ~
time.
If powered tooling is available on the
turret, however, these milling operations
may be carried out during the turning
cycle. This greatly reduces the lead -..jf2 ....j~
time.
Mo 9;:~2Ö~ ~ 11 P
rough turning finish boring finish turning internal grooving
~ Figure 5.5 CNC tuming tooIs external grooving screw-cutting rough boring parting-off
18
Milling Turning
l
correct
correct
Cl
c:
.2
o
.E
deflection
incorrect incorrect
.... Figure 5.6 l\lilling and turning tool
deflection
Additional information
In tool setting, it is always necessary to minimise tool deftection, which
produces dimensional inaccuracy and poor surface finish. To reduce the
effects of any unavoidable tool deftection you may need to take aspring
cut, that is, profile or bore the component with previously programmed
cutter paths.
The aims of monitoring the toollwork interface are to optimise tool life
and to ac hieve the most economical cutting conditions. In conventional
machining the operator can monitor the cutting, but with CNC machining
in-process sensing has to be used. This in-process sensing, or adaptive
control, monitors the tool, workpiece and driving elements, and
automatically compensates tool feeds, speeds and cutting depth to
maintain chosen cutting conditions.
Data files of tool li fe can be incorporated into timed tool changes within
the part program. Unacceptable amounts of tool wear can thus be avoided.
19
Learning Assignment 6
Tool changing
The benefits of CNC machines, such as their ability to machine contours,
accuracy of location and repeatability, must be backed up whenever
possible by efficient materials handling and tool changing. The aim is to
reduce downtime and to optimise the manufacturing process, at whatever
scale of production. It is inefficient to stop a CNC machine to adjust tool
damps or holders. So any setting to centre height or tool datums must,
where possible, be made away from the machine.
Methods oftool changing and associated tool storage must always be cost-
effective. They vary considerably, but most fall within three categories.
20
wear and so forth. The setter/operator must be able to re-set the part
program with the correct tool offsets should a machining operation have to
stop for a broken tool.
70
~_ _--<~ 2 mm lead
o
N
<Sl
tO 0
L!) co
012
L!)
N
96
Top view
R100
oC')
120
Front view
L
21
Additional information
Modern turning centres, as weil as having modular tooling and twin
turrets, may be fitted with driven tooling. These are tools such as slot-type
milling cutters or drills that are driven through the turret to enable them to
be programmed to cut aseries of slots or drill holes at a single setting - for
example, holes spaced radially on a pitch circle diameter (PCD). You need
to be able to pre-set this type of tool and enter the relevant tool settings
into the MCU. Whenever tools are changed, you must ensure that the data
for new tools corresponds exactly with the data in use, especially da ta such
as tool nose radius compensation (see page 30).
V) ADDITIONAL TASK
~
V)
Using first a turning centre and then a milling machinc, work through
~ the sequence of actions to be taken in the event of a broken tool, as
folIows:
1 Stop the programmed cutting sequence.
2 Note the sequence number of the program.
3 Return the tool to the tool change position.
4 Replace the too1.
5 Set the correct tool offsets.
6 Re-set the program to tool change prior to the noted sequence
number.
7 Start the machining sequence.
22
Learning Assignment 7
Tooloffset facilities: turning
The shapes and sizes of cutting tools used by CNC machines vary
considerably. When a cutting tool is mounted in a CNC machine turret or
carousel for the first time, it is necessary to determine its exact position
relative to the machine datums.
If a cutter wears through use, or if it is replaced in a tool-holder, its
shape and/or position relative to the machine datums will alter slightly. If
no action is taken, corresponding inaccuracies in the machine workpiece
will appear. POl TS TO NOTE
Tool offset facilities are provided by CNC control to enable the operator Too! offset facilities enable ace
to enter the initial tool data, and subsequent variations, into a permanent machine operator to achieve very
memory within the system. Programmed tool selections and movements precise limit of size on a finished
will then refer to this stored data, automatically adjusting positional co- workpiece. They also provide a rapid
ordinates and thus eliminating inaccuracies in the workpiece. and effective means of correcting
minor errors arising from roo! wear
or tip replacement.
Programming information
Tool offsets are located in a CNC control system memory by a number,
typically 01 to 16 or 01 to 64. USEFUL OBSERVATION
An offset number is normally selected and set according to the location
of the associated tool in the machine turret or carousel; for instance, a tool Search the memory locations for each
located in position 7 in a turretlcarousel would be allocated offset number tool offset in your CNC control system
and note the typical values that should
7. This would result in a programmed tool change being executed by the be anticipated.
part program command T0707. The first 07 represents the tool location,
and the second 07 the offset. This convention helps to avoid confusion, Remember that the relatively small val-
but you can use any of the offset numbers available with tools in any ues normally found represent variations
turretlcarousel location, providing that they are pre-set accordingly. from fairly accurate nominal sizes and
positions. Any !arge values that appear
lt is also convention that the offset value will be seen to increase to
(0.5 mm and above) should be treated
compensate for a test cut which is less than the programmed diameter, and with caution.
to decrease if the test cut is oversize.
~ To complete this task, you will need to have access to a CNC turning
machine with an outer profile right-hand knife turning tool in the
toolpostlturret. Mount a suitable piece of round bar in the machine
spindie. Enter a proven test program, appropriate to the the tool and
workpiece available, into the CNC control system. Set the tool and
program at the start position.
1 Check carefully that it is safe to proceed. Then execute the
program, which should complete a simple test cut producing a
programmed diameter on the workpiece. Return the tool to the
start position (Figure 7.1 ).
chuck
cutllng
tool
cutter path
23
2 Measure the diameter of the test cut, using aprecision micrometer
or any other suitably accurate method (Figure 7.2). Record the
value.
3 Compare the measured diameter value with that specified in the
test program and determine any difference. (If this test cut
produces a diameter which is less than the programmed value, you
may need to use a new workpiece, or amend the program to
produce a smaller test diameter.)
4 Select the offset mode on the CNC control system and the offset
number designated for the tool specified in the test program.
5 Select the offset for the X axis. The current value should appear on
the system digital display.
6 Add the difference between the programmed diameter and the
measured diameter to the current offset reading. Enter this new
value, using the data input method appropriate to your system.
A POINT TO NOTE 7 Check that the tool and program are re-set to the start position.
Most commercial CNC systems rec- Then re-execute the test program.
ognise X readings as diameter val- 8 Again measure and re cord the diameter of the test cut. If this
ues, in both program and offset data. differs from the programmed value, repeat the procedure for
adjusting the X offset value.
_ workplece
test diameter
24
Learning Assignment 8
Toollength offsets: milling
When several milling cutters are to be used in sequence to machine a
workpiece, the distance from the machine spindie datum to the job datum
has to be fixed. It would be poor engineering practice to attempt to set all
the tools to the same length in their holders. Instead, the tools are set to
their best operational length, taking into account the workpiece, c1amps
and so on. The tool length offset (TLO) facility allows the variations in
toollength to be entered into the MCU offset register. When a particular
tool is selected in apart program a Geode is used, together with the
corresponding offset register number to assign the value stored. This
stored value compensates for the length differenee between the chosen and
the datum tool (Figure 8.1). For example, in the block G44 H04, G44
seleets the tool offset funetion and H04 selects the value stored in tool
offset register number 4.
The datum tool is often chosen to be the longest, so that all offset values
and corresponding movements are in the same direction.
tooll tool2
(datum)
tool engtn
- offseI
component
r-------~~------------------~--~ 2=0
l-
~
--- .... Figure 8.1 Toollength offsets
25
The setting fixture is designed so that aB tool-holders are held at a set
position equivalent to the spindie datum on the machine.
Automatie setting of the TLOs on a machine is carried out as foBows:
1 Place the rool to be measured into the machine spindie.
2 Activate the table-mounted tool-setting probe (Figure 8.3 ) .
3 Move the 1001 down to touch the probe.
4 Enter the value into the appropriate 1001 offset register.
A POINT TO l OTE A smaB part program may be used 10 carry out steps 3 and 4, that is, to
When new rools have been used the move the 1001 to touch the table-mounted probe and to enter the resulting
workpiece will need ro be inspected. offset value automatically into the offset register.
This may be done either away from
the machinc, or du ring manufacturc
You should only carry out the automatic setting procedure if you have
using in pecrion probing. Wh ich- been properly trained in the use of probes. Probing routines often use
ever method is used, any error customised subroutines and coding which require special knowledge. If
caused by the too1 length can easily you use them incorrectly, you may damage relatively fragile instruments.
b rectified by making the nece sary
alteration to the TLO value for that
tool. Task 8.1 Setting TLO values manually on a machine
Measure the tool length offset for three tools using steps 1 10 4 in the
first method described above. Calculate the corresponding offsets and
enter the values into their positions in the MCU tool offset register.
ADDITIONAL TASK
26
Learning Assignment 9
Tool setting
In a CNC turning centre, the distance from the spindie datum to the turret
datum is a known fixed value, but this value is not easily used within apart
program. The distance from the tool tip to the work datum is a much
more usable value. To determine this distance you have to take into
account the Z axis setting value and the X axis setting value. These values
position the tool tip in relation to the turret datum in the X and Z axes
(Figure 9. 1) . (Milling tools are catered for in the part program by the tool
length offset and the cutter diameter compensation facilities.)
There are three principal methods of determining the X and Z setting
values. Once determined, these values are either entered into the MCU as
setting values to be automatically accounted for, or incorporated into G50
preparatory code X and Z values. Note that the setting value of aboring
bar tool will be negative (Figure 9.2).
Tools may be either pre-set or set on the machine. Alternatively,
qualified tools may be used.
turre datum
----;r---+_ - - -
Q)
:::l
ro tool-holder
>
Cl
§
Q)
(f)
turret datum
turret ......-'
27
~ Figure 9.3 '1'001 setting on the machine
(turning)
Pre-setting
To set tools by this method a setting fixture is used. This places the tool-
holder relative to a datum position equivalent to the datum position in the
machine turret. The distance from the tool tip to the datum location is
measured either using a vernier height gauge or optically, using a
microscope. The vertical distance corresponds to the Z setting value and
the horizontal distance to the X setting value. Specially manufactured tool-
measuring fixtures often incorporate a microscope as an integral part of
the fixture.
Qualified tooling
All qualified tools are manufactured so that the cutting point of the tool is
a fixed (qualified) distance from the end, front and back of the tool shank
(Figure 9.4).
28
Letter
Quallflcatlon of tool SKetch
symbol
~j ~
1I\ y--'
--'"
/1 ± 0,08
.1
The tools must be mounted into the tool-holder with the shank located
from the qualified faces. This method of tooling allows tools to be changed
without re-setting. Now that CNC machine controllers have tool-setting
facilities, the advantages of qualified tooling are reduced. But the tool
setting must be re-set in the MCU when tools are changed.
....Figure 9.5
Tools to be set X setting value Z setting value
Rough turning
Grooving tool
Drill
Boring tool
External threading
Rough turning
Grooving tool
Drill
Boring tool
External threading
29
Tool no se radius compensation(TNRC)
The tips of turning tools vary considerably in their radii, depending on the
tool type. When the radius is small (0.4 mm or less) its value can be
neglected except when extreme accuracy is required. Tools with a large tip
radius require compensation to allow for cutting away from the tip in both
the Z and the X planes (Figure 9.7). With most modern turning centres,
the too! tip radius va!ue may be entered as too! data into the MCU. Use of
the appropriate G codes in the part program then allows the machine
controller to compensate automatically for the tip radius.
Both the tip radius va!ue and the appropriate too! quadrant must be
entered into the MCU (Figure 9.8). The quadrant that the tool is using
determines the direction in which the compensation is applied.
E~
iJ=== distances to
turret datum
in Z axis
-- -i=O~PO"CI
points of
cutting
contact
half-profile
30
Learning Assignment 10
Ne program listing and analysis
The aim of apart program is to produce a component of the required
quality using optimum cutting conditions. If you are to playa full part in
this process, you must understand the programming format. The format
used in this book is called the word address format. The programming
data is conveyed by blocks of words, in which each word has an
idcntifying letter address. This preceding letter defines the function of the
word. A block of information that defines an operation may contain several
words or just a single word. If a function is to be repeated in the next
block the word need not be entered again; it remains active. It is said to be
modal (that is, remembered).
A typical section of apart program with blocks containing modal
information would bc.
Sampie block N50 GOO X20.0 Y40.0 Z1.0
Next block N55 G01 X20.0 Y40.0 Z-6.0 F250
Next block N60 GOO X20.0 Y40.0 Z1.0
Also with somc MCUs it is not necessary to complete a full word format.
Instead, some of the zeros be fore and after the numerical information can
be omitted. Thus the block
X0223.350 Y-0015.000 Z100.000
could be written as
X223.35 Y-15. Z100.
31
techniques, such as the use of subroutines, loops and macros. This is
important for the safe proving and operation of such programs. (For
further information, refer to Chapter 5 in the core book of this series.)
Additional information
Many MCUs can display the cutting time for each operation, with this
information being used in assessing production times. The more advanced
CNC machines can also sense the cutting forces and then adjust the
cutting conditions to suit. But in general it is the setter/operator who has
the ultimate control of the machining conditions.
32
92
78
70
60
4
- -- - - - - Y+,tI4''/~r +-----{J
22
: Tl
106
• 30
70 .1
50
datum 30
-I
T" +
i
i
0
(\J
co
0
C")
0
'<t
i
0
<D
AT A
R15
106
120 2 dowe! holes
05
I I
!WM!
I I
! f01;j3
I
section on A-A
All undimensioned radii 5 mm. All dimensions are in mm.
..... Figure 10.2 Task 10.2
33
Learning Assignment 11
Input, edit and store data
Part programs may be input directly into the MCU using the manual data
input (MDI) facility. This process is time-consuming and costly, in both
operation time and machine downtime. The MDI facility is therefore
normally used to edit the program as required, after it has been transferred
to the machine. Its main function is its use for viewing, editing and setting
the MCU parameters.
The MCU is also capable of storing programs, but this is a limited
facility used to store programs in current use, custom macros or
commonly used subroutines such as probing programs.
Part programs mayaiso be stored in binary coded form on paper tape or
computer discs. If the part program is stored on paper tape it may be read
directly into the machine using a local tape reader. Alternatively the paper
tape may be read using a tape reader away from the machine and the data
transferred to the MCU using standard communication networks. It is
useful to have some means of switching between the tape reader and the
machine, to divert the program to any available machine. This enables
several machines to be downloaded with programs read at one source.
Similarly part programs stored on disc may be transferred to machines
using a network.
Whichever way the data is transferred to the machine, the start and end
of every program must be identified with unique identifying characters.
The start of apart program is often identified by the letter '0' or a colon
(:), followed by a four-digit number. The character marking the end of a
program is the '%' sign.
34
022 22 N180 X28.0
N10 G21 N190 X25.0
N20 M42 N200 X21.0 2 -20 .0
N30 G50 X271 . 0 2117.0 N2 1 0 X17.0
N40 G50 X27 1.0 2117 . 0 S4000 N220 X16.0
N50 T0303 N230 GOO X273.2 Z117.4
N60 G96 S120 N240 T0700
N70 M03 N250 G50 X22 0.0 Z164.0
N80 GOO X42.0 20.0 N260 T0606
N90 G01 X-2.0 F O. 2 N270 G96 S 1 00
N100 GOO Z2.0 N280 GOO Z-7 0 . 0 X42 . 0
N110 GOO X27l. 0 Z117 .0 N290 G01 X-2.0 FO.15
N120 T0300 N300 GOO X220.0 2164.0
N130 G50 X273. 2 2117 .4 N310 T0600
N14 0 T0707 N320 M05
N150 GOO X42.0 22.0 N330 M3 0
N160 G92 X36.0 Z- 60.0 F O. 2 ~
N1 70 X32.0 Z-40.0
..... Program llB
35
Learning Assignment 12
Program proving
Once apart program has been written and the supporting documentation
prepared, it is loaded into the machine and the documentation supplied to
the operator. The program and all relevant information must be checked,
either by viewing the program displayed on the MeU screen, or by using
a software package on a computer and then proving the program on the
machine. Errors that may be detected include the following:
errors in the part program:
• typing errors
• incorrect sign
• program omissions;
errors in the supporting details
• tool offsets
• feeds and speeds
• centres of arc.
Graphic simulation (see below) compares the programmed shape with the
required component shape (Figure 12.1). It doesn't check for correct
speeds, feedrates, tools and possible crash conditions. The part program
must be proof-tested on the machine by any of the following methods
before production starts; in fact, it is a good idea (and often necessary) to
prove the pro gram by more than one method.
K11
36
Testing method 1: Dry run
For this method of testing the part program is loaded into the MCU and
then run either block by block or in continuous mode with the feedrate
greatly reduced. For safety's sake it is run without a component blank in
position or, alternatively, without cutting tools in the tool-holders. This is a
satisfactory method for checking tool movements, but it does not allow for
checking the component size or the material removal rates.
A block of rigid plastic foam may be used in place of a component. This
allows the component shape to be cut, and so checked, without the risk of
damage to the taol.
The main disadvantage of this method is that it takes up valuable
machine production time.
actual route B
B
I
I
actual route
_ _ _ shortes route
from A 10 B
I
I
I
I
A I
I
I
I
37
~ Task 12.1 Pro gram proving
Cf)
~
03434
N10 G90 G94 G7l GOO G80 G49
N20 G92 X-350.0 Y240.0 Z120.0
N30 T10 M06
N40 G43 H10
N50 S2385 M03
N60 GOO X20.0 Y-53.75 Zl.O
N70 G8l X20.0 Y-53.75 Z-lO.O F235
N80 Y86.25
N90 X3.75 Y-70.0
N100 X36.25
NllO G80
N120 G49
N130 G28 X36.25 Y-70.0 ZlOO.O
N140 M05
N150 TOl M06
N160 M30
%
~ Prograrn 12A
03535
N10 G90 G94 G7l GOO G80 G49
N20 G92 X-350.0 Y240.0 Z120.0
N30 T10 M06
N40 G43 H10
N50 S2000 M03
N60 M98 P1OlO
N70 TOl M06
N80 M30
%
01010 (SUBROUTINE)
N10 GOO X-15.0 Y10.0 Zl.O
N20 G4l 026
N30 GOl Z-lO.O F135
N40 GOl YO.O
N50 X90.0 F270
N60 Y-44.0
N70 G02 X70.0 Y-66.0 R20.0
N80 GOl X56.77
N90 GOO Zl.O
N100 G40
NllO GOO Y-75.0
N120 G49
N130 G28 X100.O Y-75.0 ZlOO.O
N140 M99
~ Prograrn 12B
Run Program 12B using single step mode. Stop the program at line
N30 of the subroutine, change the Z value to Z-8.0 and re-run the
program.
Additional information
When computer-aided part programming software has been used to
prepare apart program, the cutter paths will have been post-processed to
suit a particular machine. It may not always be possible to run the part
program on the designated machine, so the program da ta may be
downloaded to the next most suitable machine. In this case, the part
program may have to be altered before it can be proved. The most likely
38
problems would be with available tooling or codes; if the machine
capacities are different, the feedrates and speeds may also require
modifying.
The cutting speeds and feedrates are calculated using selected data
concerning the properties of the tool material and workpiece material.
These optimum values are then included in the part program. When you
prove the program you may need to alter this cutting data, perhaps
because of excessive vibration or because the material is not homogeneous.
You can temporarily adjust these feeds and speeds at the control and then
edit the values in the program if required. Optimum speeds and feeds may
be reduced (with a resulting increase in cutting time), but they must not be
increased. This would result in a rapid reduction of tool life and poor
surface finish.
39
Learning Assignment 13
Tape handling
Part programs are often written away from the machine. This allows the
machine to be fully employed for production. The programs may be
transferred to the MCU, either via a direct computer link or by a punched
tape. Similarly, when the machining is completed the part program is often
stored for future use, either on computer discs or on punched tape.
The tape used is of standard size and may be made from paper, plastic
(M ylar), paper/plastic laminate or foil, depending upon ib intended usage.
Tape does not have the information storage capacity of computer discs but
it is much more robust for use in the workshop. It is available in different
colours and these coloured tapes are often used to relate to different types
of machine. It has several advantages in use:
• practical and reliable method of data storage
• may be used in most environments if kept dry
• damage can be easily identified
• data may be transferred from remote reader, or may be read directly by
machine tape reader.
Tape has certain disadvantages, too, however:
• not ideal for storing large amounts of data (it becomes bulky)
• editing the tape is difficult and time-consuming
• relatively slow for data transfer
• must be re-wound be fore being re-used.
It is possible to edit tape by splicing and patching but this is an inefficient
method. It is not often used nowadays because electronic tape punches
have combined tape readers, which make editing and production of tape
much easier. The tape to be edited is fed through the tape reader and, with
the tape punch and teletypewriter switched on, a new tape and a print-out
can be produced simultaneously (Figure 13.1 ).
40
optlcal reader
light souree
capstan rollers
AUTO REEL ON
r--© ~REVERSEJ
I REEL OFF
FORWARD STOP REWIND
o 0 0
When the part of the tape which requires editing is near, the tape is fed
through one line at a time. Then follow this procedure:
1 Switch the tape reader off.
2 Use the typewriter to input the correct code(s).
3 Switch the tape punch off and the tape reader on.
4 Feed the incorrect portion of tape through the reader.
S Switch the tape punch on and continue to produce new tape.
Always check whether the tape being produced is of ISO or EIA format
and whether the correct parity setting is being used. Use even parity in
track 8 for ISO standard tape code, and odd parity in track 5 for EIA
standard tape code.
When apart program has been proved it may be stored on tape and,
together with the necessary documentation of identity, saved until
required. When required the tape is read by a photoelectric reader (Figure
13.2) and the stored data is transferred electronically to the Meu.
01234
N5 G90 G71 G80 G49 GOO G94
N10 G92 X-250.0 Y200.0 Z300.0
N15 T04 M06
N20 G44 H04
N25 S2300 M03
N30 GOO X10.0 Y-15.0 Z1.0
N35 G81 X10.0 Y-15.0 Z-8.0 F180
N40 X20.0 Y-25.0 Z-13.0
N45 X30.0 Y-35.0 Z-16.0
N50 G80
N60 (continue with new tape and complete the program)
~ Progr8nl BA
Edit the tape to change the Z depth from Z-8.0 to Z-12.0, Z-13.0 to
Z-15.0, and Z-16.0 to Z-19.0 respectively. Use the punch editing
facility. The procedure is as folIows:
1 Load the tape through the tape reader until you reach the first data
to be edited and at the same time punch a duplicate tape.
2 Switch off the tape reader.
41
CI) 3 Type the new data you need.
~ 4 Switch the tape punch off and the tape reader on.
E:S 5 Step through the data on the old tape that has been amended.
6 Switch the tape punch on and start the tape reader to read to the
next edit position that has been amended. Repeat steps 1 to 4.
7 Feed the new tape through the tape reader to type your copy of the
corrected part program.
When computer software is used to produce apart program the cutting
data is post-processed to produce a tape file for a specific machine contro!.
This tape file can be transferred directly to the MCV or used to produce a
paper tape.
If the tape is loaded into the machine via the machine tape reader the
data are checked. The tape is then re-wound and the data verified.
Opaque paper tape must be used with optical tape readers, otherwise
reading errors will occur.
The speed that the tape is passed through the reader determines the
baud rate for reading the data (300 or 1200 bits per second, say).
It is always possible that errors may occur in transmitting data, whatever
method is used. This is why programs must be proved whenever they are
re-used.
42
Learning Assignment 14
CNC machine controllers use data in binary coded form - that is, using
numbers with a base of 2. This means the system uses only two digits, 0
and 1. This is ideally suited to the electronic switching used by computers,
known as digital switching. A CNC machine control unit uses digital
switching for data transfer.
With conventional binary co ding the numbers, and hence also the words
and blocks of information, would be long, with large numbers producing
long words. To use such words would require an unmanageably wide tape.
This problem is overcome by using a technique called binary coded
decimal (BCD). With this method each digit or letter in a programmed
word is given its own bit pattern. For example:
• true binary code: 111001 (= 57 denary)
• number transferred to tape in BCD: 5 101
7 111
• ••••• •••••••
••• •• ••••• ••••• •
•• •••••••••••••• • ••• •••• • ••
••••••• ••
• • • ••
• • •• • • • • • • • • • • • • • • •• • • •• •
• • • • • • • • ••
• • •• • •••
•• •• • • ••
• ••
••••• • •••••••• e;;'d
N 1 G 8 1 X 1 2 5 0 0 Y 0 4 8 0 0 F 6 1 1 S 5 17M 0 3
characler ~ 01
block
bloCk
.... Figure 14.1 Example of punched paper
tape
43
EIA code ISO code ASCII code
TAPE CODE
254mm c aracter
o
cooe channels
I! 88 8ffi 88
o 00'00 00
0 E
E
transportalion
t
~
T
o
U")
channel 0 0 0 0 0 0 0 0 N
00
code channels
n o
o 00
channel numbers
~ Figure 14.4 Standard paper tape layout
44
Preparing the paper tape
The prepared part program is transferred to the paper tape using a
teletypewriter (shown in Figure 13.1, page 40). This is an electronic-
mechanical device which operates as a typewriter in producing a typescript
of the part program whilst at the same time producing a punched paper
tape. Switching allows tape to be produced of whatever code or parity
required. Some teletypewriters will store a limited amount of the typed
program so that the typescript can be checked be fore that section of tape is
punched.
03333
N10G21G90G94GOO Set preparatory codes for
start
N20G92X-285.0Y378.0Z237.0 Transfer to component
datum
N30T05M06 Load tool no 5
N40G44H05 Select tool length offset
for tool no 5
N50S2000M03 Start spindle
N60GOOX40.0Y10.OZ1.O Rapid to first hole
N70G81Z-5.0F250 Select canned cycle, hole
depth and feedrate
N80X10.OY40.0 Co-ordinates of holes
(Note that co-ordinates
are modal and need not be
N90X40.0Y70.0 repeated)
N100X100.OY70.0
NllOX70.0Y40.0
N120X100.OYlO.O
N130X100.OY40.0
N140X1l5.0
N150Yl4.02
N160Y65.98
N170X55.0Y65.98
N180Yl4.02 Co-ordinates of last hole
N190G49G80 Cancel TLO; cancel canned
cycle
N200M05 Stop spindle
N210G28X55.0Y25.0Z100.0 Return to tool change
position through
reference point
N220M30 End of tape; re-wind
%
.... Prograrn 14A
45
Additional information
Electronic data transfer can be carried out at different speeds (baud rates).
Data transfer using paper tape is generally slower than transfer from
computer. Whichever method is used, every effort must be made to
eliminate errors during transfer.
The chart in Figure 14.2 shows that in all formats one of the eight tracks
is used for a parity check. In the format used for ISO-coded tape, each line
will contain an even number of holes. If the coded character only requires
an odd number, then an extra hole is automatically punched in track 8.
When the coded data is read by the tape reader, an error code is generated
if the reader detects a line with an odd number of holes, and the tape
reader will stop. A similar error-checking format is used for ASCII-coded
tape. EIA tape uses odd parity, with the parity hole being punched in
track 5.
46
Glossary
Offset A dis placement in the direction of the tool axis which represents
the difference between the tool length and the programmed tool length
47
Optimisation The arrangement of instructions in numerical control or
computer applications to obtain the best balance between the operating
efficiency and the use of the hardware
48
Index
absolute co-ordinates 5-6 programming protocol, safety aspects 8
adaptive control 9, 19 protective clothing 8
axes 4-7 proving programs 9, 36-9
49