Need help with the following macro. Essentially I am trying to create a ramping program for milling a rectangular cutout. What I am having trouble with is the stepdowns and the final depth where I want it to stop. I would like the macro to read the current value of Z and then adjust via the inputted stepdown from there, essentially I am trying to limit the length of code. I am unsure if I can read and pass off that value to calculate what the Z position should be for the step down or if I need to create an equation.

What I have so far: Disregard the W values in comment brackets, our machine has a primary W axis instead of Z (ram and spindle), unfortunately Cimco only reads Z in colinear axis.

O0032
(SNUBBERS - ROUGH BORES)
(THREE RECTANGULAR HOLES)
(IN SNUBBERS)
(7.440 BY 14.420)
(-.020 ON A SIDE)
(CHANGE G54.1 AS NEEDED)
(CENTER OF BORE)
(P24,P26,P29)

(B180.)
(V15.0)
(Z0.0)
(W-6.888)

#24=2.45 ( WIDTH IN X)
#25=5.94 (LENGTH IN Y)
#18=.03 (STEPDOWN DEPTH, R)
#4=2.5 (CUTTER DIAMETER, D)
#26=-3.81 (Z FINAL DEPTH, Z)

(T209,2.5 SECO HFM)
M31
M32
M33
M34
M35
M36
G00 B180.
G00 V15. (Z0.)
T209M6
G00G49G80Z0.0(W-2.0)
G00G54.1P26X0Y0
(Z0.)
G00G43H209Z0.(W0.)M7
S925M3
G01Z-.03(W-.03)F30.0
(MACRO START)
X-[#24+#4/2]
Y-[#25+#4/2] F60.
X[#24+#4/2]
Y[#25+#4/2]Z[#26-#18]
X-[#24+#4/2]
Y-[#25+#4/2]Z[#26-#18]
IF Z=#26 THEN GOTO N0032
N0032 X[#1+#4/2]
Y[#25+#4/2]
X-[#24+#4/2]
Y-[#25+#4/2]
X[#24+#4/2]
N115 Y0
N116 X0F25.0
N117 M05
N118 M09
N119 G00G49G80Z0.0W-2.0
N120 M00

%

Similar Threads: