Threading on Lathe

More
02 Nov 2010 13:15 #5023 by dp427tt
Threading on Lathe was created by dp427tt
I am trying to write a threading operation for my smithy lathe. Below is the code, but it will not load. Here are the errors I am getting.

line 9 cannot G01 with no feed rate (this probably just needs changed to G00)
line 11 k word missing with g33/g33.1
If some of you guys that know more about code than me could look this over, I would appreciate it.

G20
G64
(TOOL #3 60 DEG. 1/8 0.003 RADTHREADING)
T03M6
G18 G7
G00 X1.1 Z.0461 S200 M3
G94
N1 G00 X1.2 Z.0312
N2 G01 X.9828
N3 G33 Z-.3729 F.031
N4 G00 X1.2
N5 G00 Z.0201
N6 G01 X.9699
N7 G33 Z-.3729 F.031
N8 G00 X1.2
N9 G00 Z.0117
N10 G01 X.9603
N11 G33 Z-.3729 F.031
N12 G00 X1.2
N13 G00 Z.0055
N14 G01 X.9531
N15 G33 Z-.3729 F.031
N16 G00 X1.2
N17 G00 Z.0009
N18 G01 X.9478
N19 G33 Z-.3729 F.031
N20 G00 X1.2
N21 G00 Z-.0008
N22 G01 X.9459
N23 G33 Z-.3729 F.031
N24 G00 X1.2
N25 G00 Z-.0008
N26 G01 X.9459
N27 G33 Z-.3729 F.031
N28 G00 X1.2
N29 G00 Z-.0008
N30 G01 X.9459
N31 G33 Z-.3729 F.031
N32 G00 X1.2
G00 X2.
G00 Z1.
M5
M2
%

Please Log in or Create an account to join the conversation.

More
02 Nov 2010 13:22 #5024 by andypugh
Replied by andypugh on topic Re:Threading on Lathe
Two points:
EMC2 doesn't need line numbers, and ignores them.
Do you have a reason not to use G76?
www.linuxcnc.org/docview/html//gcode_mai...76:-Threading-Canned

Please Log in or Create an account to join the conversation.

More
02 Nov 2010 13:26 #5025 by andypugh
Replied by andypugh on topic Re:Threading on Lathe
To answer your actual question,

Line 9, you can either change it to a G0, or add an F (feed) to the G1 line.

iLine 11: EMC2 G33 uses a K parameter not an F parameter (it describes a slightly different concept, and you probably don't want G33 to alter your feed rate for other operations). Just swap the F to a K and it ought to work.

Please Log in or Create an account to join the conversation.

More
02 Nov 2010 13:26 #5026 by dp427tt
Replied by dp427tt on topic Re:Threading on Lathe
So G76 is what I need? Where do I need to put the G76.
The line #'s are just there because that is the way my software posted it out.

Thanks!

Please Log in or Create an account to join the conversation.

More
02 Nov 2010 13:36 #5027 by dp427tt
Replied by dp427tt on topic Re:Threading on Lathe
andypugh wrote:

To answer your actual question,

Line 9, you can either change it to a G0, or add an F (feed) to the G1 line.

iLine 11: EMC2 G33 uses a K parameter not an F parameter (it describes a slightly different concept, and you probably don't want G33 to alter your feed rate for other operations). Just swap the F to a K and it ought to work.


Thanks alot. I will give it a shot!

Please Log in or Create an account to join the conversation.

More
02 Nov 2010 13:36 #5028 by andypugh
Replied by andypugh on topic Re:Threading on Lathe
dp427tt wrote:

So G76 is what I need? Where do I need to put the G76.


G76 will replace just about all of your code.
(Do an air-cut first, I have a feeling that some numbers (I J and K) might need to be doubled/halved in G7 mode.)
I assume that you have a spindle encoder fitted?

G20
G64
(TOOL #3 60 DEG. 1/8 0.003 RADTHREADING)
T03M6
G18 G7
G00 X1.1 Z.0461 S200 M3
G94

G00 X1.2 Z.0312
G76 Z-.3729 P 0.031 I 0.2 J 0.02 K 0.0541 R1.5 Q29.5 H2
M2
%

Please Log in or Create an account to join the conversation.

More
26 Sep 2011 03:18 #13449 by M4MazakUser
g76 is a wonderful thing !! BUT !!

as the example in the manual (online) shows, it dosent return to the driveline for the next pass, but moves to the drive line plus the depth of cut away from the driveline. this can be a problem with small bores, creating tool clearance issues!

hopefully someone important reads this! :woohoo:

Please Log in or Create an account to join the conversation.

More
26 Sep 2011 09:39 #13450 by andypugh
M4MazakUser wrote:

as the example in the manual (online) shows, it dosent return to the driveline for the next pass, but moves to the drive line plus the depth of cut away from the driveline.


Is that how it works? I have noticed that the diameter changes on the return pass, but thought that was it adding extra cut, not it returning to the drive-line after an overshoot.

I don't think that there is any good reason for it, and actually think that every return stroke should be exactly on the drive-line (you should be able to have a clearance to the tooth of less than the tooth depth)

Please Log in or Create an account to join the conversation.

More
27 Sep 2011 12:46 #13472 by andypugh
I have asked about, and the current behaviour is a consequence of this commit:
git.linuxcnc.org/gitweb?p=emc2.git;a=commit;h=0f38a96f

I tried undoing those changes, and threading looks a lot more like you would expect. I haven't been convinced that the changes have the claimed effect.

I might try to do some actual testing, as it has caught me out too.

Please Log in or Create an account to join the conversation.

More
06 Oct 2011 03:54 #13693 by M4MazakUser
wow- from a commit 4 years ago!

thanks for the prompt reply, -i'm still getting over some fever i had. so i ain't been online.

i only noticed the behaviour when trying to cut a small dia sq thread,and had to resort to
this....

####################################################
(info: G33 style threading Internal)
o<th_33> sub
#<ToolNumber> = #1 (= 1 Call Tool or 0)
#<Speed> = #2 (= 300 rpm)
#<diameter> = #3 (= 50.0 Diameter)
#<pitch> = #4 (= 2.0 Pitch)
#<inital_depth> = #5 (= 0.35 Inital Depth)
#<thread_depth> = #6 (= 1.2 Depth Px0.866)
#<spring_pass> = #7 (= 1 Spring Passes)
#<z_start> = #8 (= 5.0 Z Start)
#<z_end> = #9 (= -15.0 Z End)
#<x_offset> = #10 (= 0.5 X Clearance)
#<Coolant> = #11 (=8 8 is on, 9 is off)

(LOGOPEN,paramnum)
; Tool change
O120 if [#<_Tool:Number> NE #<ToolNumber>]
; Change Tool
M09 ; coolant off
O121 if [#<_Tool:Number> LT 20] ; front turret
G00 Z#<_Frontchange:Z>
G00 X#<_Frontchange:X>
O121 else ; Rear turret
G00 Z#<_Rearchange:Z>
G00 X#<_Rearchange:X>
O121 endif
G49 ; cancel toolength offset
T#<ToolNumber> M06
O121 if [#<_Tool:Number> LT 20] ; front turret
G00 Z#<_Frontchange:Z>
G00 X#<_Frontchange:X>
O121 else ; Rear turret
G00 Z#<_Rearchange:Z>
G00 X#<_Rearchange:X>
O121 endif
G43 G7 G97 S#<Speed>
M03
M#<Coolant>

#<_Tool:Number> = #<ToolNumber>
O120 else ; No tool change -continue.
M#<Coolant>
O120 endif

#<thread_depth> = [#<thread_depth> * 2]
#<x_offset> = [#<x_offset> * 2]
#<inital_depth> = [#<inital_depth> * 2]
#<Cut_Dia> = [#<diameter> - #<thread_depth>]
#<drive_line> = [#<Cut_Dia> - #<x_offset>]
#<Cut_Dia> = [#<Cut_Dia> + #<inital_depth> ]
#<Cut_increment> = [#<inital_depth> * 0.72]
#<spring_pass_num> = 0
G00 X#<drive_line> Z#<z_start>
(log,DrvLine = #<drive_line>)
(log,CutDia = #<Cut_Dia>)
(log,CutInc = #<Cut_increment>)
; in here
o101 while [#<Cut_Dia> lt #<diameter>]
G00 X-#<Cut_Dia>
G33 Z#<z_end> K#<pitch>
G00 X-#<drive_line>
G00 Z#<z_start>

O121 if [#<Cut_increment> LT 0.01] ; minimum cut depth
#<Cut_increment> = 0.01
O121 else
#<Cut_increment> = [#<Cut_increment> * 0.2]
O121 endif
(log,CutInc = #<Cut_increment>)
#<Cut_Dia> = [#<Cut_Dia> + [#<Cut_increment> * 2]]
O131 if [#<Cut_Dia> GT #<diameter>] ; maximum cut
#<Cut_Dia> = #<diameter>
O131 else o101 while [#<Cut_Dia> lt #<diameter>]
#<spring_pass_num> = [#<spring_pass_num> + 1]
O131 endif
(log,CutDia = #<Cut_Dia>)

O122 if [#<spring_pass_num> GT #<spring_pass>] ; spring cuts
#<Cut_Dia> = [#<diameter> + 1]
O122 else
O122 endif
(log,DrvLine = #<drive_line>)
(LOGCLOSE)
o101 endwhile
G00 X-#<drive_line>
G00 Z#<z_start> M09
o<th_33> endsub

################################################################

Which was a lot of writing for such a small item.

hopefully this can be sorted out, as on small diameter internal threads tool ridgidity/clearance is a big issue.

Please Log in or Create an account to join the conversation.

Time to create page: 0.123 seconds
Powered by Kunena Forum