View Full Version : Threading cycle


chrisryn
06-12-2008, 03:30 PM
I have come up with a macro for threading I haven't got to test it yet but thought I would post anyway. As soon as I test it I'll let you know how it works here is the code.

G65 P9011 X1.840 Z-1.3 F.0869 K4.0 Q0.005 R.125

X= major diameter of thread
Z= thread length
F= lead
K= number of passes you want to take
Q= depth of finish pass (diam)
R= thread hieght (diam)

Here is the macro. It is used in the same sense as G76(tool,speed, x and y position set before macro call). Once I test it I will put checksum code in it to make sure all required variables have been passed in the G65 call.

%
O9011
#100=[#18-#17] (Calculates depth of cut - finish depth)
#101=[#100/[#6-1]] (Calculates the depth of each pass)
#102=0 (Sets counter to 0)
WHILE [#102 NE [#6-1]] DO 1
G92 X[#24-#101] Z[#26] F[#9]
#24=[#24-#101]
#102=[#102+1]
END1
G92 X[#24-#17] Z[#26] F[#9]
M99
%




I will report back once it has been tested.

Edit due to typo.

chrisryn
06-12-2008, 04:04 PM
OK its been tested and it works. It makes a NICE!!!! thread. Managment was shocked. I was able to decrease the number of passes and take the spindle speed up to 2800 rpm on black steel tubing. No chatter whatsoever. I only have one problem I passed 4 passes to the macro but it runs 5. I guess I'll have to look over my math again. I'll try and get some pics up of the threads if I can find a camera.