Gposai GB
Gposai GB
GUIDE
®
brembana
macchine
A trademark of CMS SpA
CNC Machining Centres
CMS S.p.A.
Costruzione Macchine Speciali
Via Antonio Locatelli, 49
24019 ZOGNO (Bergamo) Italia
Tel. +39 (0) 345/64.111 - Fax +39 (0) 345/64.281
http:\\www.cms.it - E-mail: [email protected]
OSAI
Published by:
All rights reserved. This publication may not be reproduced, wholly or in part in any form, by any means, or for
any purpose. It may not be given to third parties, and its contents may not be used by or in any way divulged to
third parties unless expressly authorized by CMS S.p.A. In no circumstances may CMS be held responsible to
third parties for any damages incurred as a result of the use of this publication.
Trademarks are the property of their respective owners.
FOREWORD
CMS S.p.A.
Servizio Clienti
1-1 . . . . . . . . . . . . . . . . . . . . . . . . CHAPTER 1
1-1 . . . . . . . . . . . NUMERICAL CONTROL MACHINES
2-1 . . . . . . . . . . . . . . . . . . . . . . . . CHAPTER 2
2-1 . . . . . . . . . . . . . . . . . . . . . WORKING SPACE
2-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 MOVEMENT DIRECTIONS
2-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 MEASUREMENT UNITS
3-1 . . . . . . . . . . . . . . . . . . . . . . . . CHAPTER 3
3-1 . . . . . . . . . . . . . . . PROGRAMMING LANGUAGE
Index
Programming guide
CHAPTER 1
NUMERICAL To meet the increasingly difficult challenges of a very dynamic
CONTROL marketplace, the most effective technological response to the
requirements of modern industry, such as:
MACHINES
– reducing machine setup times
– extending flexibility of use
– increasing productivity
– improving product quality level
– ensuring conformance to new safety standards,
lies in the development of NUMERICAL CONTROL machines.
The basic concept behind this technology is revealed by the word
NUMERICAL. All machine functions are actually controlled by an
electronic device in which each magnitude is represented by numbers.
This device receives its instructions from us in the form of an
ALPHANUMERIC code which is automatically converted into
mechanical machine movements and written “instructions” which are
carried out in sequence.
For example, to make a motor run at different speeds, we do not pull a
lever or push a button, but simply “instruct” the machine to run at
“1500” or “12000” rpm. Similarly, to make a cut of a certain length,
we do not mechanically adjust the limit switch, but rather “instruct”
the machine to cut to the distance required, “X1200”.
The acronym NC, standing for Numerical Control, refers in particular
to an electronic system capable of “understanding” numerical orders
and controlling the machine drives accordingly.
If the electronic system also includes a computer, we use the acronym
CNC, Computerized Numerical Control.
If the system is controlled by a powerful Mainframe Computer
(usually connected to several machines) through a communications
line, the acronym DNC, Direct Numerical Control, is used.
1-1
Programming guide
4 X
5
Z
1 2 Y
Printer
2D
digitizing
table
Personal computer
Plotter
3D
digitizing
N
table
C
pr
og
ra
m
5
6
4
7
3
2
8
CNC
work center CN unit
1-2
Programming guide
Structure a1
Structure a2
1-3
Programming guide
Structure a3
Structure a4
Type b1
1-4
Programming guide
4
6
3
7
8
2
1
Type b2
Type b3
Type b4
1-5
Programming guide
The numerical control system can accept “coded” data input in various
ways:
– through manual keyboard entry
– by reading a punched tape
– by reading a magnetic tape or disk
– directly through a “serial” input port, via a cable
and several of these options are available on the same machine.
In each case the system can also store in its “memory” all the data
received, even after the machine has been switched off, and can carry
out the work programs an infinite number of times in the sequential
order in which they were written.
1-6
Programming guide
CHAPTER 2
WORKING SPACE 2.1 MOVEMENT DIRECTIONS
Whatever the TYPE or STRUCTURE of the machine, for
programming purposes the signs and movement direction conventions
are reduced to those for the most simple machines with the workpiece
locked firmly onto the table and the operating unit vertical,
perpendicular to the table plane and mobile along three axes.
If, in actual fact, it is the table that moves, the manufacturer simply
inverts the movement sign of the corresponding axis to ensure perfect
compatibility with this abstract model.
Movement directions are aligned with a right-handed coordinate
system in which the axis directions can be easily identified using the
RIGHT HAND RULE.
If you look at your right hand, pointing upwards with the palm facing
inwards, the thumb, the index finger and the middle finger indicate
respectively the X, Y and Z axes.
2-1
Programming guide
Z Y
Z Y
2-2
Programming guide
The three main planes of the coordinate system are identified precisely
by the SEQUENCE of the axes that define them:
the XY plane has a positive x towards the right and a positive y
upwards and corresponds to the table plane as seen from above;
the YZ plane has a positive y towards the right and a positive z
upwards and corresponds to the vertical plane as seen from the right of
the machine;
the ZX plane has a positive x towards the right and a positive z
upwards and corresponds to the vertical plane as seen from behind the
machine.
XY
X G17 Y
G18
ZX
X Y
G19
YZ
X Y
2-3
Programming guide
0 18 19 20 21 22
X
20.56
20.562
X
origin
P3
P5
2-4
Programming guide
Z+
Y+
machine zero
X- X+
Y-
Z-
To move out of this initial safety position, with the tool at the top right
and at the back of the space where workpieces may be placed, the
“absolute” coordinates of the points to be reached inside the work
“box” will all be negative.
2-5
Programming guide
NOTES
2-6
Programming guide
CHAPTER 3
PROGRAMMING The programs the machines can run are written in a specific
LANGUAGE LANGUAGE in ISO code (an international standard).
Like any other language, it has its own VOCABULARY,
GRAMMAR and SYNTAX, and may be written in a particular
STYLE.
The vocabulary is the complete set of words or instructions that the
NC system can understand and the appropriate Programming Manuals
should be consulted for any information in this regard.
Grammar and syntax explain the rules for using the words and
commands available, and above all their logical sequence (syntax).
For further details, you should consult your Manuals. In this chapter
we will consider the most frequently used rules, i.e. those which are
useful for initiating the operator in the use of the system.
In particular, we will examine the language STYLE techniques
characterizing the CMS STYLE. In other words, an organic approach
to program structuring and the use of certain commands rather than
others on the basis of the experience acquired by our instructors, the
ongoing interchange of mutually useful information with our very
broad clientele, and an extensive series of programs and proven
applications and running in various parts of the world.
In this short Programming Guide we do not intend to rehash the
contents of the manuals provided by the Numerical Control system
manufacturers. We will therefore explain just a few of the most
frequently used programming “words” or “KEYS”, discussing step by
step the instructions required to prepare simple programs and adding,
only if necessary, a few short Geometry Revision Notes where a
“brush-up” may be useful.
3-1
Programming guide
machine zero
Y+
1000
X+
P3
R 50
P4 P5
50
194.586
P6
94.586
650
R 100
P2 P7
172.91
P9
300
P8
P1 R 40
68.44
194.586 100 350 50 100
For the time being, we will ignore the workpiece locking commands
which will be presented later.
Let us consider the entire sequence of instructions step by step, giving
the machine the appropriate instructions for each operation. First of
all, we must position the tool above the workpiece. This is done with a
rapid traverse that brings the tool from machine zero into the correct
position above the starting point of the required PATH.
If we had to move the axes one at a time, we could, for instance, move
the Y axis first, by 650 mm in the negative direction, and then the X
axis, by 1000 mm also in the negative direction.
3-2
Programming guide
We can now bring the tool down, initially at fast speed (without any
need to specify it again, as the G00 command given previously
remains active):
Z20
and then to lower the tool onto the workpiece at a lower speed
(supposing that the correct cutting height is, for example, Z=-5) we use:
3.6 G01
3-3
Programming guide
+25 P2 +5
P2
da
–21 +18
X
db
+10
P1
P1
+4 +18 X –15
3-4
Programming guide
3-5
Programming guide
(x – 305.414, y – 350)
P7
R 100
(x – 305.414, y – 450)
P8
(x – 236.974, y – 522.91)
3-6
Programming guide
R 10
0 R 40
P9
(x – 136.974, y – 522.91)
absolute
G90 G02 X-136.974 Y-522.91 I96.974 J-552.91
incremental
G91 G02 X0 Y0 I40 J0
3-7
Programming guide
We will now illustrate the use of some keys specific to the OSAI
numerical control system, i.e. the three-letter keys additional to the
standard G, T and M type keys.
Of these we will now use the key:
Circular interpolation can take place in any plane, XY, YZ and XZ,
chosen using the appropriate three-letter key:
(DPI,X,Y) interpolation in the XY plane
(DPI,Y,Z) interpolation in the YZ plane
(DPI,Z,X) interpolation in the ZX plane
G02 G03
G17
G1 8
9 G1
G0 2
3 G0
X Y
G0 3
2 G0
3-8
Programming guide
If we define a given arc by indicating two points, 1 and 2, and the radius R, the only possible
doubt lies in whether we are referring to the minor or the major arc of the plane angle.
Now that we know how to move a tool along a path, let us consider,
for instance, how we would use the same program to make two
identical parts one after the other. This will clarify the meaning of the
terms SETTABLE ORIGIN and program NESTING.
Y+
2500
1000
X+
650
ORA 2 ORA 1
3-9
Programming guide
We could use the same cycle described above and, at the end of the
work path, after raising the tool in the vertical Z axis, move it in the
absolute mode to the starting point of the second workpiece. But it is
much better to use Settable Origins:
3.12 (UAO,...)
Any movements made after entering this key can be related to a
maximum of 9 new origins, different from the “MACHINE ZERO”,
which can also be recalled however using (UAO,0).
The X,Y, Z values of these origins can be modified directly on the
machine. The advantage they offer is immediately evident, i.e. even if
the workpiece positions change on the machine, there is no need to
modify the program. All that is required is an adjustment in the
appropriate ORA table of the value of the corresponding origin setting.
Also, using “nesting”, we can avoid the need to rewrite the left-hand
path instructions that are identical to those for the right-hand path.
We thus discover the benefits of structured programming:
– easier readability of programs
– assurance that any changes are automatically made throughout.
N.B.: To make movements in respect of the machine zero, we use the
G79 code which is not modal.
(CLS,name) Calling subroutines
Subroutines may be called from up to 3 different levels. A main, or
“grandfather”, program can call any number of “father” subroutines,
and each of these in turn can call any number of “son” subroutines.
Any routine can be used as the main program, provided it contains the
M30 end of program key.
SUB2
(CLS,SUB1) (CLS,SUB1)
(CLS,SUB2)
M30 M30
PRG1 SUB1
SUB2 SUB3
(CLS,SUB1)
(CLS,SUB2) (CLS,SUB3)
M30
3-10
Programming guide
If we set the ORA1 origin at X-1000, Y-650 and the ORA2 origin at
X-2500, Y-650, the main program takes the following form:
(DIS,“CAPO”)
(UAO,1)
G00 G79 Z0
G90 G40 X0 Y0
M21 right-hand workpiece locked
T11
M3 S18000
(CLS,FREGIO) subroutine FREGIO called
M5
M11 right-hand workpiece unlocked
M00 stop before starting on left
(UAO,2)
G00 G79 Z0
G90 G40 X0 Y0
M22 left-hand workpiece locked
M3 S18000
(CLS,FREGIO) subroutine FREGIO called
M5
M12 left-hand workpiece unlocked
M30
while the subroutine FREGIO, which is called twice to make the two
pieces in sequence, takes the form:
(DIS,“FREGIO”)
G00 Z20
G01 Z-5 F1000
G91 X0 Y300 F3000
X194.586 Y194.586
X100 Y-50
X350 Y0
G03 X50 Y-50 R50
G01 X0 Y-94.586
G02 X68.44 Y-172.91 R100
G01 X100 Y0
G02 X0 Y0 I40 J0
G90 G00 Z20
where we have also used a three-letter code, DIS (meaning display), to
display the name of the program being run on the Numerical Control
video. This code can be used to display on the video any message
written between the quotation marks.
3-11
Programming guide
MACHINE 0
Hpr=100
ZMACHINE=310
Z(UAO,1)
WORKPIECE 0
B
H workpiece=20
H underpiece=25
worktable
3-12
Programming guide
3-13
Programming guide
G27
limit speed
t
3-14
Programming guide
G41 G42
Using codes G41 and G42, cutter compensation is enabled and, using
G40, it is disabled. The programming of the workpiece geometry
follows the path of the finished part and the “cutter center” is
automatically displaced by a value equivalent to the radius recorded
in the compensation table.
The following example clarifies the use of these techniques.
3-15
Programming guide
55
5
Ø 40
50
16
R 40
ORA1
Ø 20
20
150
250
50
400 50 30
500
420
180
8
500
3-16
Programming guide
The design of the program required to make the part starts with an
analysis of the machining operations to be performed:
a) cutting the contour;
b) cutting the groove.
The overall program will therefore consist of a “father” (or main
ANTINA) program and two “son” programs (or subroutines). Next the
tools required are selected:
– for the first path, a cutter with nominal diameter of 40 mm; radius
compensation is selected to take care of any differences (see
CONTOR);
– for the second path, a tool with a diameter equal to the actual width
of the groove, 20 mm, is selected and the groove path followed
corresponds to the “cutter center” (see CANALE).
Consequently, two different kinds of lead-in to the workpiece are
selected:
– for the external path a lead-in arc and a symmetrical lead-out with
a 5 mm overlap;
– for the internal path, the tool is gradually lowered into the groove
which is machined in a single pass with a symmetrical lead-out at
the end, again with a 5 mm overlap.
Finally, a common workpiece origin is selected for both cycles at the
center of the two lead-in/lead-out quarter circles.
The values of this position are memorized as ORA1.
The cutter compensation value for the first operation is recorded in the
machine memory, K=40 (diam.=40).
(DIS,“ANTINA”)
(UAO,1)
G00 G79 Z0 safety return to Z=0
G90 X-250 Y50 traverse to ORA1 origin
at the programmed path point
M21 vacuum workpiece locking
T 11.1 M6 head 11 called, comp.1 enabled
M3 S12000 machine start up at 12000 rpm
Z20 position at 20 mm above
(CLS,CONTOR) CONTOR program called once
G00 G79 Z0
G90 X-300 Y-50
M5 motor switched off
T12.3 M6 head 12 called, comp.3 enabled
M3 S18000 machine start up at 18000 rpm
3-17
Programming guide
Z20
(CLS,CANALE) CANALE program called
G00 G79 Z0
M5
M11 unlocks workpiece
M30 end “father” program
(DIS,“CONTOR”)
G00 G91 Z-50 incremental down stroke
G01 G41 X-50 F4000 cutter radius comp. enabled
with 4 m/min. feed
G03 G28 X50 Y-50 R50 quarter circle lead-in
G01 X250 contour path blocks
r-40
Y-250
r-40
X-500
r-40
Y250
r-40R X255
G29 G03 X50 Y50 R50 quarter circle lead-out
G01 G40 X-55 cutter radius comp. disabled
G00 Z50 return up stroke
(DIS,“CANALE”)
G91 G01 G28 X50 Z-36 F4000 lead-in with Z down stroke
G29 X200
Y-150
X-400
Y150
G28 X205
G29 X50 Z36 lead-out with Z up stroke
Observe carefully the BLOCK sequence. Note that for the first path
(CONTOR), the finished part profile is programmed and the cutter
center path is displaced outwards by the compensation function. For
the other path (CANALE), instead, the cutter center path is located
precisely in the middle of the groove.
The r key inserts an automatic link between the rectilinear paths.
3-18
Programming guide
3>
N
3
N1
N12 > N4 >
>
>
N
11
5
<
20
N
>
N
N
28
<
N26 > N21 > N27 > N22 >
N10 >
N23 >
N6 >
N25 >
< N24
<
7
N
N
9
< N8
<
Now consider the machining of the outside.
For this path, the automatic NC generated link option was selected.
Thus only the horizontal and vertical segments were programmed as
far as the points where they intersect. The link path with its desired
radius was obtained by entering the key r.
3-19
Programming guide
If, however, we wanted to guarantee the width of the groove even after
the tool used had been sharpened several times, we would have to use a
smaller diameter tool and follow the groove path twice, on the two sides.
Using this technique we could also make the groove corner radius
smaller, 10 mm for example.
The path of the side being machined by the cutter is programmed with
automatic links. A 0 radius link is used on the internal corner so that
the tool can “roll” around it smoothly and without any break in
continuity, while a 10 mm radius link is used on the external corner.
In this case, the tool is on the inside in relation to the programmed
profile and, consequently, the compensation value cannot exceed
the radius value.
The program now becomes:
(DIS,“CANALE”)
N20
N21 G91 G27 G41 G01 X20 F4000
N22 X60 Z-24
N23 X200
r0
N24 Y-130
r0
N25 X-380
r0 Programmed point,
the arc is machined as
N26 Y130 an automatic link
r0 with compensation on
N27 X200
N28 G03 X0 Y20 R10
N29 G01 X-220
r10
N30 Y-170
r10
N31 X420
r10
N32 Y170
r10
N33 X-220 Programmed point,
the arc is machined as
N34 G40 X-60 Z24 an automatic link
N35 X-20 with compensation on
3-20
Programming guide
z=0
lead-in
z=-24
20
side-change
lead-out
3-21
Programming guide
Below are the most commonly used techniques for enabling and
disabling cutter radius compensation:
1 2
1 2
2
The actual cutter center path is modified in the first case with a
“parallel” type movement, following a diagonal route to the outside of
the path, and in the other two cases with a “perpendicular” type
movement, shortening segment 1 to bring the cutter edge in contact
with the next programmed profile.
With two lead-out blocks, 4 and 5, disabling with G40 in block 4:
5 4
4 5 4
3-22
Programming guide
5 20 30 7
7
R
R
5
5
7
START
29
34.5
R
7
7
33.5
65
27
10
9 35 11
3-23
Programming guide
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
3-24
Programming guide
18.75 31.25
20
R
R 30
10.969
17.55
50
6.581
120
102.45
R 15
60
100
3-25
Programming guide
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
_______________________________________ _______________________________________
3-26
Programming guide
The example shows that before writing the blocks, it is absolutely essential to dimension the drawing
correctly, adding the necessary dimensions as required for programming.
In this case, if the drawing indicates the value of the two radii of the “S” as R1 = 30 mm and R2 = 50 mm
and the distance between F and D as 50 mm, the other dimensions must be calculated correctly
(or measured on the scale drawing).
and therefore
BC = BE – CE = 62.45 – 50 = 12.45 mm
as BD is equal to AF = 30 mm,
CD = BD – BC = 30 – 12.45 = 17.55 mm
A B
K C
30
17.55
G
H
D
F L
6.581
50
18.75 31.25
50
3-27
Programming guide
It is essential to know the geometry of right-angled triangles as this is very useful for calculating the
coordinates required.
Below is a table of the most frequently used formulas:
c = a2 + b 2
a–b a = arctg a/b
b = 90° – a
b = c2 – a 2
a–c a = arcosin a/c
b = 90° – a
b a = c2 – b 2
c b–c a = arccos b/c
a
b = 90° – a
a
b b = a/tga
a–a c = a*sina
b = 90° – a
b = a*tgb
a–b c = a/cosb
a = 90° – b
a = b*tga
b–a c = b/cosa
b = 90° – a
a = b/tgb
b–b c = b/sinb
a = 90° – b
a = c*sina
c–a b = c*cosa
b = 90° – a
a = c*cosb
c–b b = c*sinb
a = 90° – b
3-28
Programming guide
G02 G03
G17
G1 8
9 G1
G0 2
3 G0
X Y
(DPI,X,Y) etc.
G0
2 G 03
X–
Y–
G79 absolute programming (referred to the machine home position
x
G00 y
z
Tool
a position
G00 [Z]
b Z
G00
Y
rapid traverse OP X
G01
Z
Y
X
OP
Z G02
Y
X
OP
Z G03
Y
X
OP
3-29
Programming guide
X–
X–
Y
tool
G40
centre
F..
Y
R
G41 CRC (cutter radius compensation) left-hand
X
F..
Y
R
G42 CRC (cutter radius compensation) right-hand
X
t
G27 block transition with speed reduction
F
t
G28 no speed reduction
F
t
G29 fine exact positioning
3-30
Programming guide
M03
M3 spindle clockwise revolution
M04
M4 spindle counter-clockwise revolution
M05
M5 spindle stop
3-31
Programming guide
NOTES
3-32