447
« on: December 02, 2020, 01:18:27 PM »
Forget the G55 and the others, set G54 to a fixed place on the fixture and then use G52 to provide a local offset for each part.
This way you program one part and use the code in subs to do the other parts with G52 set to the fixture point of the other parts.
Example
You have 6 parts set out on a 3 x 2 grid about 50mm pitch we have 3 tools, T1 spot drill, T2 5mm drill, T3 M6 tap
Datum is X & Y rear right corner, Z face of fixture, part finished height from fixture is 10.00MM
So here is some of the best free code you will ever get.
%
O0001 (MAIN PROGRAM)
G21 G40 G00 G17
G91 G28 X0 Y0 Z0
G52 X0 Y0 Z0 (clear any offset)
N1(SPOT DRILL)
T1 M6
G54 G00 G90 G43 X0 Y0 Z50. H1 S1500 M3
G52 X0 Y0 Z10.
M98 P0002
G52 X-50. Y0 Z10.1
M98 P0002
G52 X-100. Y0 Z10.05
M98 P0002
G52 X-100.15 Y-50. Z10.02
M98 P0002
G52 X-50. Y-50. Z10.1
M98 P0002
G52 X0 Y-50. Z10.05
M98 P0002
G91 G28 Z0
M1
N2 (5MM DRILL)
T2 M6
G54 G00 G90 G43 X0 Y0 Z50. H2 S1500 M3
G52 X0 Y0 Z10.
M98 P0003
G52 X-50. Y0 Z10.1
M98 P0003
G52 X-100. Y0 Z10.05
M98 P0003
G52 X-100.15 Y-50. Z10.02
M98 P0003
G52 X-50. Y-50. Z10.1
M98 P0003
G52 X0 Y-50. Z10.05
M98 P0003
G91 G28 Z0
M1
N3(M6 X 1.0 TAP)
T3 M6
G54 G00 G90 G43 X0 Y0 Z50. H3 S250 M3
G52 X0 Y0 Z10.
M98 P0004
G52 X-50. Y0 Z10.1
M98 P0004
G52 X-100. Y0 Z10.05
M98 P0004
G52 X-100.15. Y-50. Z10.02
M98 P0004
G52 X-50. Y-50. Z10.1
M98 P0004
G52 X0 Y-50. Z10.05
M98 P0004
G91 G28 Z0
G52 X0 Y0 Z0
M30
O0002(SPOT DRILL)
G00 X-10. Y-10.
Z10.
G82 Z-2.75 R1. P500 F.1 M8
X-40.
Y-40.
X-10.
G80
G52 X0 Y0 Z0
G00 Z50.
M99
O0003(5MM DRILL)
G00 X-10. Y-10.
Z10.
G81 Z-12. R1. F.2 M8
X-40.
Y-40.
X-10.
G80
G52 X0 Y0 Z0
G00 Z50.
M99
O0004(M6 TAP)
G00 X-10. Y-10.
Z10.
G84 Z-14. R3. F250. M8
X-40.
Y-40.
X-10.
G80
G52 X0 Y0 Z0
G00 Z50.
M99
%
The output on screen in Mach3 could be messed up but will work just fine, in Mach4 it should be perfect.