Hello Guest it is April 25, 2024, 12:27:53 PM

Author Topic: 4th AXIS parametric hex with Z LOOP  (Read 4050 times)

0 Members and 1 Guest are viewing this topic.

4th AXIS parametric hex with Z LOOP
« on: October 07, 2011, 08:25:47 PM »
Code for a 4 axis virtical milling machine

This is what I found worked well when placing a cylinder into the 4th axis chuck and machining a hex. Also wanting to control the z depth and cutter diameter as shown. The custom M110 code just sends all my axis to machine home before and after code for safety.

I hope someone finds this as useful as I do.

example code;

O001(A AXIS PARA HEX W/Z LOOP)
(10/01/11 BPH)
(USING 4TH AXIS)
(X0 END OF PART)
(Y0 = CENTER OF A)
(Z0=FIN. TOP FACE)
G17G40G80
M110
G0G90G59X0.Y0.
G43Z2.0
#100=-.1(X WIDTH OF HEX)
#101=1.0(DIA. OF PART)
#102=[-60.](A = DIV. SIDES BY 360)
#114=6.(A PASSES)
#103=.200(CUTTER DIA)
#107=2.(Z PASSES)
#108=5.(FEED RATE)
#1002=[-.005](DOC Z)
#110=2.(Z RETRACT)
#112=0.(RESET A0.)
#1004=0.(RESET Z0.)
M3
M98P05L#107
G04P1000
G0Z2.0
#1004=0.(RESET TO Z0.)
#107=0.(RESET Z DOC TO 0.)
#102=0.(RESET A TO 0.)
#114=0.(RESET A DOC TO Z0.)
M110
M30
%




O05(SUB CUT HEX)
(DO MATH)
#104=[#103/2](CUTTER DIA./2)
#105=[#100+#104](SET CUTTER OUT OF HEX)
#106=[#101/2](PART DIA /2)
N100(START HEX)
Z.5
X[#105]Y[#106+#103]
M98 P10 L1 (call sub to feed down)
#112=0.(RESET A0.)
M98 P20 L#114 (CALL SUB TO ROTATE)
G04P500
M99


O10(Z LOOP CALCS)
#1004=[#1004+#1002](CALC NEW Z)
G0Z.5
Z[#1004](MOVE TO CUT DEPTH)
M99

O20(A LOOP CALCS)
#112=[#112+#102](CALC NEW A)
X[#105]Y[#106+#103]
G0A[#112](MOVE TO NEW A)
G04P500
Z[#1004]
G01Y[[#106+#103]*-1.]F#108
G0G90Z.5
M99