Anda di halaman 1dari 12

Lesson Sixteen: Coordinate System Techniques

Coordinate System Techniques


In this lesson, well show some advanced implications of what can be done with
coordinate systems. For the most part, this lesson applies to machining centers. But
there are some points well make about turning center coordinate systems as well.
G52 - temporary shift of program zero on machining centers
As you know, all coordinates going into your programs are taken from program zero if
you work in the absolute mode. In most cases, this makes programming simpler.
However, there is one time when specifying coordinates from one centralized program
zero point is rather cumbersome.
If, for example, you have multiple identical machining operations to perform, it can be
helpful for manual programmers to develop a subprogram that machines but one of the
operations. This subprogram can be recalled and executed for as many operations as are
required. However, if the subprogram is written in the absolute mode from the
centralized program zero point, when it is repeated, it will perform the same operation in
the same location (not machining in a different location). For this reason, many
programmers will develop the subprogram in the incremental mode, ensuring that the
machining operation will take place in different locations.
Developing any series of motions in the incremental mode is tedious and error prone.
Though its only available on newer Fanuc controls, G52 will allow you to temporarily
shift the program zero position from the centralized location to a more convenient
position relative to the machining operation being performed. When this command is
given
N060 G52 X4.0 Y3.0
the control will shift the program zero point from the centralized location (specified in the
currently instated fixture offset) to a location of X4.0 and Y3.0. If you wish to switch
again, the command
N175 G52 X7.0 Y5.0
will shift program zero again. Note that these values are not accumulative. This
command will still shift from the centralized program zero point (not from the last shifted
location).
When youre finished using this technique, you must remember to shift the program zero
point back to its original position. The command
N250 G52 X0 Y0
will do just that. Here is an example that stresses the use of G52. The next drawing
shows the workpiece to be machined.

Lesson Sixteen: Coordinate System Techniques

Drawing shows workpiece for G52 example. Note multiple pockets must be machined.

Here is the main program:


O0006 (Main program number)
N005 G54 G90 S600 M03 (Select coordinate system, absolute mode, turn the spindle
on)
N010 G00 X0.75 Y0.75 (Move to beginning point of left most slot)
N015 G43 H01 Z.1 (Instate tool length compensation)
N020 G52 X0.75 Y0.75 (Shift program zero to lower side of left-most slot)
N025 M98 P1006 (Execute program O1006 to machine the first slot)
N030 G52 X1.625 Y0.5 (Shift program zero to lower side of second slot)
N035 M98 P1006 (Execute program O1006 to machine second slot)
N040 G52 X2.5 Y0.75 (Shift program zero to lower side of third slot)
N045 M98 P1006 (Execute program O1006 to machine third slot)
N050 G52 X3.375 Y0.5 (Shift program zero to lower side of fourth slot)
N055 M98 P1006 (Execute program O1006 to machine fourth slot)
N060 G52 X4.25 Y0.5 (Shift program zero to lower side of fifth slot)
N065 M98 P1006 (Execute program O1006 to machine fifth slot)
N070 G52 X0 Y0 (Shift coordinate system back to normal position)
2

Lesson Sixteen: Coordinate System Techniques


N075 G91 G28 Z0 M19 (Return to tool change position)
N080 M30 (End of program)
Note that each G52 shifts the program zero point to the lower Y axis center of the slot
(point 1 in the tool path drawing). This becomes the point of reference (program zero)
for the subprograms movements. Here is the subprogram written in the absolute mode.
All coordinates programmed after a G52 are shifted to the temporary coordinate systems.
Note that you must remember to shift back to the original coordinate system (done in line
N070) when youre finished. Now, here is the subprogram being called that machines
one slot. Note that it is written in the absolute mode.
O1006 (Subprogram to machine one slot)
N1 G00 X0 Y0 (Move to point 1)
N2 G01 Z-0.25 F2.5 (Plunge into slot)
N3 Y1.75 F5.0 (Mill to point 2)
N4 G41 D31 X-0.25 (Instate cutter radius comp, move to point three)
N5 Y0 (Mill to point 4)
N6 G03 X0.25 R0.25 (Circular mill to point 5)
N7 G01 Y1.75 (Mill to point 6)
N8 G03 X-0.25 R0.25 (Circular mill to point 7)
N9 G1 G40 X0 (Move away to point 8)
N10 G00 Z0.1 (Rapid out of slot)
N11 M99 (End of subprogram)
Once again, notice that all coordinates in this subprogram are taken from the center of
the slot in X and the center of the lower radius in Y. This is made possible by the G52
commands in the main program.
G53 - rapid movement relative to the machines zero return position
Almost all of the movements you make in a CNC program are specified from the
program zero point (if you work in the absolute mode). And in general, the program zero
point makes an excellent origin for the various cutting movements needed in your
program. However, there are certain times when causing motion relative to the
machines zero return position can be very helpful.
Note that with most machines, and especially with machining centers, the zero return
position is very close the plus over-travel limits. If this is the case, any coordinate
specified in the G53 command will be negative. Also, G53 automatically invokes the
rapid mode, meaning you can only make positioning movements (not cutting movements)
with G53. The command
N050 G53 X-2.0 Y-3.0
will rapid the machine to a location two inches to the negative side of the zero return
position in X and three inches negative of the zero return position in Y.
Another way to send the machine to the zero return position
You were probably taught to use a G28 command to send the machine to its zero return
position. The command
N080 G91 G28 X0 Y0 Z0

Lesson Sixteen: Coordinate System Techniques


for, example, will send the machine straight to its zero return position. In our basic
courses we recommend using G28 for two reasons. First, it is universal (older controls
do not have G53). Second, the axis origin lights will come on at the completion of a
G28.
However, many programmers dont like the G28 command. Its hard to understand (due
to the intermediate movement made), it requires you to switch to the incremental mode
(if you use our recommended method), and you must remember to re-select the absolute
mode at the beginning of the next tool.
As long as you have a newer control (that has G53) and dont care about the axis origin
lights coming on, the command
N080 G53 X0 Y0 Z0
will send the machine to its zero return position. Simply replace all of your G28
commands with G53.
Use with manual pallet changers
Some CNC users place after-market manual pallet changers on their vertical machining
centers. These devices require that (at least) the axis be sent to a precise location in order
for the pallet change to occur. If you try to program this position using the program zero
point as the origin, the positioning command will change for every program (and even for
every setup if you dont make qualified setups. On the other hand, the position of the
pallet change in X is constant as it relates to the zero return position. Once you determine
its position (by measuring it once), you can use the same G53 command to send the X
axis to the appropriate position. If for example, you measure this position as being
negative 8.3765 from the zero return position, use the command
N050 G53 X-8.3765
any time you wish to send the machine to its pallet change position.
Common turret index position on turning centers
With geometry offsets, you can have the turning center index the turret just about
anywhere. The control will constantly keep track of where the program zero point is,
even if you have a different tool change position for every tool. This makes for very easy,
safe, and efficient tool changing.
Even with all the benefits of geometry offsets, some turning programmers like to index
the at a common position - and this position will be different for every tool relative to the
program zero point. However, it will be a consistent distance from the machines zero
return position. Say for example, a setup person moves the turret to a safe index position
that is 5 inches to the left (negative) of the Z axis zero return position and determines (by
indexing the turret) that this is a good safe index position. In this case, the command
N060 G53 X0 Z-5.0
will can be included before every turret index and the turret will be positioned to the
common turret index position.

Lesson Sixteen: Coordinate System Techniques


G54-G59 - fixture offsets
Most basic course stress the use of fixture offsets for assigning but one program zero
point per program. They also assume that you will be using the machines zero return
position as the point of reference for program zero entries. To actually determine
program zero assignment values, many teach beginners to actually measure them during
the setup, right on the CNC machining center.
While these basics are important, and they truly help a beginner understand how fixture
offsets work, they arent very efficient, especially if you make a lot of repeated qualified
setups. (By qualified setups, we mean setups that can be repeated in exactly the same
manner time after time. If a setup is truly qualified, the program zero assignment values
will be the same every time the setup is made.)
The two ways to use fixture offsets
As stated, basic CNC courses commonly teach but one of the ways to use fixture offsets
(using the machines zero return position as the point of reference for fixture offset
entry). But there is another way to assign fixture offset values that may be more
appropriate to your needs. Regardless of which method you use to assign fixture offsets,
programming remains exactly the same, meaning you can easily switch methods without
having to change your programs.
Using the machines zero return position as the point of reference
Again, this is the method commonly taught in basic CNC courses. With this method, the
setup person enters the distances from the machines zero return position (spindle center
in X and Y and spindle nose in Z) to each program zero point in the appropriate fixture
offset registers. Since the zero return position is commonly located close to the
machines plus over-travel limits, these values will commonly be negative. If multiple
program zero points must be assigned (two or more workpieces in the setup, for
example), these techniques are simply repeated for each program zero point.
Shifting the point of reference for program zero assignment value entries
Using the machines zero return position as the point of reference is somewhat
cumbersome. The actual values will be rather random, and might be very difficult to
predict. Believe it or not, with Fanuc and Fanuc-compatible controls, you can actually
shift the point of reference for program zero assignment values to a location that makes
more sense. Program zero assignment values will make sense and it may be quite easy to
determine them without measuring.
Youve probably noticed fixture offset number zero on the fixture offset page of the
display screen. If youve been working from the machines zero return position, the
values in fixture offset number zeros registers are zero. This fixture offset actually lets
you shift the point of reference. If the registers in fixture offset number zero are all zero,
the amount of shift from the zero return position is nothing (youre working with the zero
return position as the point of reference).
Shifting the point of reference for sub-plates
Look at the next drawing. A special sub-plate is mounted on the table. Note that every
four inches, a precise 0.5000 reamed hole is machined. Every other four inches, theres a
1 / 2-13 tapped hole. So every two inches there is either a location hole (reamed) or a
mounting hole (tapped). Ideally, this sub-plate will be located on the machine table with

Lesson Sixteen: Coordinate System Techniques


keys, so it can be removed and replaced without a change in position. (Note that several
tooling suppliers offer this kind of sub-plate, or you could make your own.)

Gray 0.500
reamed holes
Black -13
tapped holes

Machine at zero
return position

2 centers

Sub-plate
Drawing shows a sub-plate mounted on the table of a vertical machining center.

Notice that each row of holes is marked (stamped or etched) with a number and each
column is marked with a letter. This makes it very easy to designate specific holes. For
the previous drawing, hole C3 is a reamed hole, three holes from the left and three holes
up.
With this location device, you can easily shift the point of reference for program zero
assignment value entries. Say you wish to work from the lower left hole in X and Y and
the top surface of the workpiece in Z. With the sub-plate mounted on the table, measure
the distance in X and Y from the zero return position (center of spindle) to the lower left
hole. For Z, measure the distance from the spindle nose (at zero return) to the top of the
sub-plate. For most machines, these will be very large negative values.
When you enter these values into fixture offset number zero, you effectively shift the
point of reference for program zero assignment values to the lower left hole in X and Y,
and the top of the sup-plate in Z. From this point on, all program zero assignment values
will be taken from the lower left hole in XY and the top of the sub-plate in Z.
Look at the next drawing that shows some simple component location tooling. (Again,
many tooling suppliers offer this kind of component tooling. If you do make your own
sub-plate, you may want to match the design of the most popular tooling suppliers so you
can still use standard, and readily available, component tooling.)

Lesson Sixteen: Coordinate System Techniques

4.0000

2.0000

2.0000
1.0000
Drawing shows component tooling used with sub-plate

With this corner locator, the edge being located will be precisely in line with the left-most
location hole in the sub-plate, making it very easy to calculate the distance from the lower
left hole to the location surfaces on the corner locator. Look at the next drawing.

Hole C5
7
5
4
3
2
1
A

Sub-plate
Drawing shows simple setup made with corner locator.

Lesson Sixteen: Coordinate System Techniques


The setup person is told to place the corner locator in holes E5 & G5 (for location) and
hole F4 (for clamping). In this case, the X location surface (program zero in X) is
precisely eight inches from the left hole in X. The Y location surface is precisely eight
inches from the lower hole in Y. With fixture offset number one appropriately set
(shifting the point of reference to the lower left hole), the program zero assignment
values in X and Y for this setup will be 8.0 in X, and 8.0 inches in Y. Though the
drawing doesnt show it, if program zero in Z is the top of the workpiece, the program
zero assignment value in Z will be the distance from the top of the sub-plate to the
location surface in Z (1.0 in this case) plus the thickness of the workpiece. If the
workpiece is 0.75 thick, the Z axis fixture offset value will be 1.75.
Notice how simple the sub-plate and component tooling make it to calculate program
zero assignment values (of course, they also make it quite easy to physically make
setups). And, knowing which location holes will be used, the programmer can include a
G10 in the program to keep the setup person from even having to enter it. For the
previous example, the command
N005 G90 G10 L2 P1 X8.0 Y8.0 Z1.75
will enter the values into fixture offset number one (note that the L word value for fixture
offset setting does vary from one control model to another). In this way, the setup person
does not have to do anything when it comes to program zero assignment during setup.
We have effectively eliminated program zero assignment tasks from setup.
Shifting the point of reference for horizontal machining centers
Most horizontal machining centers incorporate a rotary device (indexer or rotary axis)
inside the table. This allows the machine to expose several surfaces of the workpiece (or
several workpieces) to the spindle for machining during the cycle. Many horizontal
machining centers also incorporate two-pallet pallet changing devices to allow the
operator to be loading one pallet while the other is being machined.
When designing fixtures, most tool designers will dimension the locators from the center
of rotation. In this case, the programmer will know the position of all location surfaces
(which correspond to program zero positions for X and Z) from the center of rotation as
the program is written. If you shift the point of reference from the machines zero return
position to the center of rotation in X and Z, you can easily specify program zero
assignment values right in your program with G10 commands. The next illustration
shows a horizontal machining center from above (X and Z).

Lesson Sixteen: Coordinate System Techniques

Machine at
zero return
X shift
Center of
rotation

Z shift

Drawing of a horizontal machining center from above, showing X and Z shift values

For the Y axis, it may be best to shift the point of reference to the machine table top. The
next drawing shows the value as viewed from the front of a horizontal machining center.

Lesson Sixteen: Coordinate System Techniques

Y shift

Drawing shows Y shift amount.

Whether you are using a sub-plate on a vertical machining center or a horizontal


machining center, and as long as you make qualified setups, these techniques virtually
eliminate all program zero assignment-related tasks from setups. This can mean a great
reduction in setup time!
Dealing with alignment problems after a crash
If you are making qualified setups and including G10 commands in your program to enter
program zero assignment values, the machine must, of course, stay in alignment. This is
true regardless of whether you are using the machines zero return position for the point
of reference for fixture offset entries or you have shifted the point of reference. If you
have a crash or other mishap, part of fixing the machine should include recalibrating each
axis to make sure the zero return position is in the same location it was before the crash.
However, not all companies do so. If, of course, the zero return position has shifted, the
G10 commands in all programs will no longer be correct.
This is yet another application for the common fixture offset (fixture offset number zero).
It can be used to specify the amount of misalignment so all G10 commands will be
correct. It may be easiest to visualize how the common offset can be used for this
purpose by considering the sub-plate example shown earlier. After a crash, and if the
machine is not perfectly re-aligned, simply re-measure and re-enter the distances from the
zero return position to the lower-left hole in XY and the top of the sub-plate in Z. Since
the sub-plate hasnt changed, all G10s used prior to the mishap will now be correct.

10

Lesson Sixteen: Coordinate System Techniques


The same is true for shifting the point of reference to the center of rotation on horizontal
machining centers. Simply re-measure and re-enter the shift amounts, and your G10
commands will be back on track.
If you are using the zero return position as the point of reference, the common offset will
include but a small value in each axis (just the amount of misalignment). To determine
these small values, simply re-measure the program zero assignment values for the current
setup. Compare your measurement to the values in the G10 command. The difference in
each axis will be the amount of the each register in the common fixture offset.
Using the common offset to handle machine differences
As you know, one way to use tool length compensation is to store the length of each tool
in the tool length compensation offsets. One benefit of this method is that tool length
compensation values can be measured off line, while the machine is running production
for another job. The time the machine is down between production runs can be reduced
if tools are assembled and measured while the machine is still in production.
If no regard is given to the common offset, the device used to hold each tool as it is being
measured must match the spindle of the machine that will be using the tool. And if you
have two or more identical machines that have slightly different spindle bores, your tool
setter is probably compensating for this machine difference as tools are measured. A
given tool will have a different tool length compensation value for each machine.
Say you wish to set up a series of commonly used tools that will be readily available for
whichever machine needs them first. In this case, the tool length compensation value
must work for all machines. One way to accomplish this is to store the deviation from
one machine to the next in the Z axis register of the common offset.
48 fixture offset option
Fanuc controls come with but six fixture offsets which for most applications is more than
enough. However, there are times when more are required. Consider, for example, a
horizontal machining center that has a pallet changer. You may, for example, want to
assign one program zero point for each side of each pallet. In this case, you will need
eight fixture offsets (four sides times two pallets).
Fanuc offers an option when it comes to fixture offsets. When this option is purchased,
youll have forty-eight fixture offsets available, but programming is slightly different.
With this option the G code G54.1 is used to invoke fixture offsets. An H word in the
G54.1 command specifies which fixture offset is being invoked. The command
N005 G54.1 H25
for example, invokes fixture offset number twenty-five.
What can a spindle probe do for you?
We have been stressing the importance of minimizing, if not eliminating, the tasks related
to program zero assignment that must be done during setup. This in turn, reduces setup
time. However, if you cannot justify making qualified setups, the task of measuring and
entering fixture offset values must be done during setup right on the machine, while the
machine is down between production runs. In this case, you must do everything possible
to make these tasks as easy (and quick) as possible.

11

Lesson Sixteen: Coordinate System Techniques


This is a great application for a spindle probe. The spindle probe will automatically
measure and enter fixture offset values in less than one minute. If you rarely make
qualified setups and must measure program zero assignment values on the machine on a
regular basis, a spindle probe makes the best alternative for assisting with program zero
assignment.
Running out of fixture offsets?
As stated, Fanuc controls come standard with six fixture offsets. If you need more on a
regular basis, you should purchase the 48 fixture offset option. However, if you seldom
need more than six fixture offsets, there is a way of handling this problem. In fact, youll
only need one fixture offset!
We point out right away, however, that this technique eliminates one of the main
advantages of fixture offsets. When you use fixture offsets, of course, you separate the
task of program zero assignment from the program itself. With this technique, program
zero assignment values must be entered into programs.
With this technique, youll be using a series of sub-programs (one subprogram for each
program zero assignment). Its helpful to make the subprogram numbers in a special
series (say the 6000 series). When you invoke subprogram number O6001, for example,
youll be changing to coordinate system number one. When you invoke O6002, you be
changing to coordinate system number two, and so on. In each subprogram there will be
a G10 command that enters the appropriate program zero assignment values into fixture
offset number one. Right in the subprogram, well invoke fixture offset number one
(with G54) to ensure that the coordinate system is selected. Here are two sample
subprograms. You can, of course, have as many subprograms as your control allows
(most controls allow at least 100 programs to be stored).
O6001 (Coordinate system number one)
G90 G10 L2 P1 X-12.2736 Y-9.1273 Z-11.1276
G54
M99
O6002 (Coordinate system number two)
G90 G10 L2 P1 X-13.2663 Y-5.3387 Z-10.4596
G54
M99
To invoke the appropriate coordinate system, simply include an M98 command in the
main program. For example, the command
N010 M98 P6001
invokes coordinate system number one.

12