Hello Guest it is January 27, 2022, 04:18:24 PM

Author Topic: Macro, Gear/Spline cutting, Incremental profiling  (Read 3455 times)

0 Members and 1 Guest are viewing this topic.

vmax549

*
Macro, Gear/Spline cutting, Incremental profiling
« on: August 02, 2009, 10:51:11 PM »
This is an gear/spline cutting macro that cuts the tooth profile incrementally. It has a programable front end that ask you the important questions.

It cuts a step section of the profile then indexes o the next tooth, when it completes a full rotation it runs the next step  and indexes.

Its use is for gears/splines that IF you remove too much material from one side of a shaft/gear it may cause warping due to unstressing of the shaft/gear.



'M2227 Gear/Spline cutting Macro with Incremental Tooth Profiling
Sub Main()
'MsgBox(" In CONFIG set {ROT 360 rollover} & {Ang Short Rot on G0}")
Setvar(1,Question("Number of Teeth/Splines?"))
Setvar(8,Question("Tooth/Spline DEPTH?"))
Setvar(10,Question("# of steps to depth"))
Setvar(5,Question("X End of CUT?"))
Setvar(7,Question(" INFEED Feedrate"))
Setvar(9,Question(" CUTTING Feedrate"))
N0:
Setvar(20,Question("Infeed AXIS?.... Y(0).... Z(1)"))
Setvar(2,(360/Getvar(1)))       '(angle To turn chuck)
Setvar(3,-.1)            '(y clearance)
Setvar(4,0)            '(X start of cut)
Setvar(6,0)            '(starting A position)
Setvar(11,(Getvar(8)/Getvar(10)))   ' Step value
Setvar(12,0)            'Current depth
'**********
If Getvar(20)=0 Then GoTo n1
If Getvar(20)=1 Then GoTo n11
If Getvar(20)>1 Then MsgBox" Selection MUST be 0 or 1,,, Restart MACRO"  
GoTo n0
'***Y Infeed***
N1:
CODE"G0 X#4 Y#3 Z0"
While ISMOVING()
Wend
CODE"G0 Z0"
While ISMOVING()
Wend
CODE"G0 A0"
While ISMOVING()
Wend
Code"#6=0"
Code"#12=[#12+#11]"
'**********
N2:
Do While Getvar(6) <= 359.9  
CODE"G1 Y[#12-.010] F#7"
While ISMOVING()
Wend
CODE"G1 X#5 F#9"
While ISMOVING()
Wend
CODE"G1 Y#12"
While ISMOVING()
Wend
CODE"G1 X#4 F100"
While ISMOVING()
Wend
CODE"G0 Y#3"
While ISMOVING()
Wend
CODE"G0 X#4"
While ISMOVING()
Wend
CODE"#6=[#6+#2]"
While ISMOVING()
Wend
CODE"G0 A#6"
While ISMOVING()
Wend
GoTo N2:
Exit Do
Loop
'**********
If Getvar(12) < Getvar(8) Then GoTo N1 Else GoTo n10
'***Z infeed***
N11:
'**********
CODE"G0 X#4 Y0"
While ISMOVING()
Wend
CODE"G0 Z#3"
While ISMOVING()
Wend
CODE"G0 A0"
While ISMOVING()
Wend
Code"#6=0"
Code"#12=[#12+#11]"
'***********
N21:
'***********
Do While Getvar(6) <= 359.9  
CODE"G1 Z[#12-.010] F#7"
While ISMOVING()
Wend
CODE"G1 X#5 F#9"
While ISMOVING()
Wend
CODE"G1 Z#12"
While ISMOVING()
Wend
CODE"G1 X#4 F100"
While ISMOVING()
Wend
CODE"G0 Z#3"
While ISMOVING()
Wend
CODE"G0 X#4"
While ISMOVING()
Wend
CODE"#6=[#6+#2]"
While ISMOVING()
Wend
CODE"G0 A#6"
While ISMOVING()
Wend
GoTo N21:
Exit Do
Loop
'**********
If Getvar(12) < Getvar(8) Then GoTo N11 else goto n10
'**********
N10:
Code"M5 M9"
End Sub
End
        


« Last Edit: August 02, 2009, 10:54:46 PM by vmax549 »