Hi Chris,
If you have a jig with 6 identical parts located on it, you do not want to have to set 6 lots of offsets.
G54 to G59 are global fixture offsets, that is, you can set each one up with a different fixture datum then when you use that fixture again you have to set all six datums again. We do not want to do that we want to set one datum and all the other parts are in known locations so we can use 1 global and any number of local datums in this case 6.
To program each location on the fixture you use G52, this is a local datum that is relative to the fixture offset in use.
So, we set the fixture datum using G54, then in our program we have G52's that represent the positions of the individual parts on the fixture, these are hard coded into the program as they never change.
This program would drill the 2 holes in each part in the diagram below. Every time we would use this fixture we would set G54 X0 Y0 at the bottom left side and the Z on top of the job and the program sets all the local datums as it needs them.
Before anybody tells me :-
If I wanted to make things even better I could use incremental or absolute subs or macros to make the program even smaller, but lets start simple.
%
(USE FIXTURE OFFSET G54)
G21 G40
T1 M6
G54 G00 G90 G43 X0 Y0 Z25. H1 S750 M3 (MOVE TO FIXTURE DATUM)
(FIXTURE LOCATION 1)
G52 X20. Y20. (SET FIRST LOCAL DATUM)
G00 X-5. Y0 (MOVE TO FIRST HOLE)
G81 Z-10. R1. F125. (DRILL FIRST HOLE)
X5. (DRILL SECOND HOLE)
G80 (CANCEL DRILLING)
G52 X0 Y0 (CANCEL LOCAL DATUM)
(FIXTURE LOCATION 2)
G52 X50. Y20.
G00 X-5. Y0
G81 Z-10. R1. F125.
X5.
G80
G52 X0 Y0
(FIXTURE LOCATION 3)
G52 X80. Y20.
G00 X-5. Y0
G81 Z-10. R1. F125.
X5.
G80
G52 X0 Y0
(FIXTURE LOCATION 4)
G52 X80. Y50.
G00 X5. Y0
G81 Z-10. R1. F125.
X-5.
G80
G52 X0 Y0
(FIXTURE LOCATION 5)
G52 X50. Y50.
G00 X5. Y0
G81 Z-10. R1. F125.
X-5.
G80
G52 X0 Y0
(FIXTURE LOCATION 6)
G52 X20. Y50.
G00 X5. Y0
G81 Z-10. R1. F125.
X-5.
G80
G52 X0 Y0
M5
M30
%
I hope this makes things a bit clearer.
Graham.