Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: jnibecke on August 02, 2007, 04:03:28 PM

Title: Lathe Threading With Backlash
Post by: jnibecke on August 02, 2007, 04:03:28 PM
Is it possible to take in the backlash on the x axis before threading starts.  As of now my threads cut ok but when they get to the point where the chamfer is cut the x backlash has to be taken in causing the last part of the thread to be a full circle :(.
Title: Re: Lathe Threading With Backlash
Post by: Chaoticone on August 02, 2007, 09:22:22 PM
Have you tried to use backlash comp?

Title: Re: Lathe Threading With Backlash
Post by: jimpinder on August 03, 2007, 04:43:55 AM
Whilst I don't fully understand which chamfer it is you want to cut, surely this must be a problem for CNC machines. On a manual lathe, where movement of the tool is mechanically tied to the spindle, the practice was to stop the spindle (which stopped the tool in the right proportional position) and then withdraw the tool. Cutting should always take place in the same direction, because of backlash.

On a CNC lathe where normally the spindle fires up before the tool is in position, or the tool is withdrawn with the spindle still turning, you will get a circular cut, unless you float the tool off the thread and loose the depth of the cut. I would have thought, therefore, you must start the lathe off the workpiece to allow both spindle and tool to get to the corrct speeds and then come into the workpiece on the move, so to speak, but then when you copme to withdraw the tool at the other end of the thread, either float off or suffer a circular cut. Which ever you use, you must always cut in the same direction.
Title: Re: Lathe Threading With Backlash
Post by: wnevels on August 04, 2007, 02:55:24 AM
You can go past x then back to apply the backlash prior to the entry move.  However this will have pressure on the wrong side of your x screw as you enter the part.  Which will increase the part radius by the amount of the backlash.

Your probaly already using a G0 to retract but if not add that. 

Title: Re: Lathe Threading With Backlash
Post by: DAlgie on August 04, 2007, 11:06:52 AM
Wes, G76 doesen't work like that, it's a canned cycle with it's own retract, pull out distance, etc figured in. Problem here is the machine backlash, as are many of the problems reported on this forum. As Brett said, you need to enable backlash in Mach, but this is only for "reasonable" amounts of backlash, if you have a half turn on the X axis leadscrew, not much here will help you. Time to invest in a ballscrew probably.
Title: Re: Lathe Threading With Backlash
Post by: wnevels on August 04, 2007, 12:09:05 PM
sorry it was late never thought about g76 your right i'm wrong
Title: Re: Lathe Threading With Backlash
Post by: jnibecke on August 06, 2007, 09:52:58 PM
I am using g76 and I have backlash enabled.  Unfortunately  the backlash is taken up just before the chamfer is cut.  Which means that the cutter is left at the same location for just a few moments.  Since g76 is a canned cycle there is not much I can do.  It seems possible that the writers of the canned cycle could take in the backlash before the thread starts to cut.  So that when the x axis moves to retract the cutter there is no backlash to take in?
Title: Re: Lathe Threading With Backlash
Post by: Brian Barker on August 06, 2007, 10:04:09 PM
Have a look at the 1076.m1s macro... this is your can cycle and you can change it to make you happy if you like

' 07/12/05 Fixed last pass for ID threads Brian
' 07/10/05 Added code for Dia/Rad mode for infeed and pullout.  Brian
' 07/05/05 Fixed the mindepth per pass code, and added a lock to keep it in the min depth. Brian
' 07/05/05 Added in the code for minDepth per pass and took out the number off passes from test. Brian
' Current as of 07/04/05 G32 added back in for infeed. --Art

' Code "G01 Z" & Z_pass_start Added to the infeed move to take the Z out of the in feed move           

' Date 11/14/04 G64 and G61 taken out to see if the G32 works better (thanks Steve).           

' No G64 or G61 in code so user can test.           

' Testing the problem with the depth           

' Notes are being added as work is done           

' Test added to the macro           

' Decrement bug fixed           

' Added call to GetMinPass 11/14/04 -- Art           

' Cleared default Chamfer. Program will set to optional default.           

' Set PI to value earlier in file so Retract_dis woudl be OK           

' Date 11/13/04 G61 and G64 added to the macro to see if it will fix the bad thread pass           

' also added was the chamfer in degrees default is now one pitch of the thread           

' min Decrement added default is .001 as a Test           

' 23/12/04 - Sandvik, Kennam sequences added - Rudy         

'1/9/05 - Added in the Macro calls for the Cut type and Feed Type. I also changed the code that sets the Z_Pass_Stat pos

'               The Calcs were done as ABS But now are done INC this was done for alt flank infeed.   


' To test set TEST = 1=true and it will write to a Teach.Tap and will add notes           


Test = False        'test = false turns it off           

if GetUserLED(1053) then Test = True           



Min_Decrement = GetMinPass()  'test of min decement           


SetUserDRO 1240, tXStart()  'diagnostics fill           

SetUserDRO 1241, tEndX()           

SetUserDRO 1242, tZStart()           

SetUserDRO 1243, tEndZ()           

SetUserDRO 1244, tLead()           

SetUserDRO 1245, tTaper()           

SetUserDRO 1246, tClearX()           

SetUserDRO 1247, tFirstPass()           

SetUserDRO 1248, tFirstPass()           

SetUserDRO 1249, tInFeed()           

SetUserDRO 1250, tgetInfeedType()           

SetUserDRO 1251, tgetCutType()           


PI = 4.0*atn(1.0)           

XClearance = tClearX()           

StartX = tXStart()           

StartZ = tZStart()           

EndX = tEndX()           

Total_depth = abs(StartX - EndX)           


EndZ = tEndZ()           

Pitch = tLead()           

Taper = tTaper()           

InFeed_Angle = tInFeed()           

Spring_Pass = tSpring()           

First_pass_Depth = tFirstPass()           

Depth_Lastpass = tDepthLastPass()           

cut_type = tGetCutType()           

seq = tGetInfeedType()           

npass = GetUserDRO(1022)           


Cut_Dir = 1       

MinDepth = 0
IF cut_type = 2 Then Cut_Dir = -1       



Retract_dis = tChamfer()           

Retract_dis = (Retract_dis * PI)/180           

Retract_dis = round ( ABS (StartX - EndX)* tan(Retract_dis) , 4 )           


If IsDiameter() = 1 Then

Retract_dis = Round (Retract_dis /2 ,4)

End If

If test = true then           

   OpenTeachFile( "ThreadTest.tap")             


   Code "(Taper = " & taper & ")"           

   Code "(Infeed Angle = " & InFeed_Angle & ")"           

   Code "(Total_Depth = " & Round(Total_Depth,4) & ")"           

   Code "(StartZ = " & StartZ & ")"           

   Code "(EndZ = " & EndZ & ")"           

   Code "(Seq = "&seq & " )"           

   Code "(Min_Decrement = " & Min_Decrement & " )"
       If IsDiameter() = 1 Then

          Code "(Dia Mode )"


          Code "(Rad Mode )"

       End If                 
End If           


'Section to see if the Thread is an OD or an ID Thread           

if StartX < EndX Then           

   ID_OD = -1           


   ID_OD = 1           

End if           


' Section to see the direction of the Thread           

If StartZ > EndZ Then           

  Right_Left = 1           


  Right_Left = -1           

End if           


'Calc the infeed in radians from degrees           

InFeed_Angle = (InFeed_Angle * PI)/180           

'Calc the distance X needed to make the taper angle           

Taper = ABS (StartZ - EndZ-Retract_dis)* tan((Taper * PI)/180)           

'set last pass to 0           

Last_pass = 0           

'Feed per Rev mode for the out feed move           

Code "G95"           

'Start pass counter at 1           

Pass_counter= 1           


'Move the tool into the start position plus X clearance           

Code "G0 X"&StartX+XClearance*ID_OD & " Z"&StartZ 'Move to start position if not there           

'Move to the X in to the start pos           

Code "G0 X" &StartX           

Z_pass_start = StartZ


'Do Loop is to rough out the thread           




' Calc Decrement and clip if necessary           

if seq = 1 then           

  if pass_counter = 1 then           

     Cut_Depth = (Total_depth/sqr(npass-1)*sqr(0.3))           


     Cut_Depth = (Total_depth/sqr(npass-1)*sqr(pass_counter-1))           

  end if           


  Cut_depth = (First_pass_Depth*  pass_counter  ^ .5)           

end if           


Decrement =  ABS(Cut_depth - Prev_Cut_Depth)           
 If  Decrement  < Min_Decrement OR MinDepth =1 Then           

     Cut_depth = Prev_Cut_Depth + Min_Decrement           

     Decrement = ABS(Cut_depth - Prev_Cut_Depth)
     MinDepth = 1           

     If test = true then Code "(Min decremant being used)"           

 End if           


 Depth_pass_start=  StartX - Cut_Depth * ID_OD           

 Prev_Cut_Depth = Cut_Depth           


' now do the thread line           

' This section is to test the depth and see if it is over           

' If it is over then set it to the last pass depth and set last_Pass to 1           

 If   ID_OD = -1 Then           

  If Depth_pass_start >= EndX -Depth_Lastpass Then           

    Decrement =  Decrement  - (Depth_pass_start - (EndX - Depth_Lastpass))           

    Depth_pass_start =  EndX -Depth_Lastpass           

     If test = true then  Code "(Last Pass ID_OD =-1)"           

    Last_pass = 1           

  End if           


  if Depth_pass_start <= EndX +Depth_Lastpass Then           

    Decrement = Decrement - (EndX + Depth_Lastpass - Depth_pass_start)           

    Depth_pass_start = EndX +Depth_Lastpass           

     If test = true then  Code "(Last Pass ID_OD = 1)"           

    Last_pass = 1           

  End if           

 End if           


 If test = true then Code "(Decrement = " & Round(Decrement,4) & " pass " & pass_counter & ")"           


 'Calc the start point of the thread with respect to the infeed angle           

If IsDiameter() = 1 Then

ZinfeedShift =  ( ABS(Decrement) * Tan(InFeed_Angle)*Right_Left )/2


ZinfeedShift =  ( ABS(Decrement) * Tan(InFeed_Angle)*Right_Left )

End If   

 Z_pass_start= Round( Z_pass_start- Cut_Dir * ZinfeedShift,4)                 


 ' Infeed move to start the thread           

 Code "G01 Z" & StartZ           

 Code "G32 X" & Round (Depth_pass_start ,4) & " Z" & Round (Z_pass_start ,4) & " F"&Pitch           

 Code "G32 X" & Round (Depth_pass_start + Taper * ID_OD ,4) & " Z" & Round (ENDZ +Retract_dis *Right_Left ,4) & " F" &Pitch           

 Code "G01 X" & Round (StartX+(XClearance+ Taper) * ID_OD ,4) & " Z" & Round (ENDZ,4)  & "F" & Pitch           

 Code "G00 X" & Round (StartX+XClearance * ID_OD ,4) &" Z"& StartZ           

 Code "G00 X" &StartX           

 Pass_counter = Pass_counter + 1           

 If  Last_pass =1 or Pass_counter = 200 Then           

  Exit do           

 End if           


If cut_type =1 Then 'This code is for the alternating flank infeed     

   IF Cut_Dir = 1 Then   

      Cut_Dir = -1   


     Cut_Dir = 1 

  End If 

End If 


Call SetUserDRO(1022, pass_counter-1)           

IF Depth_Lastpass <> 0 Then           

  If test = true then Code "( Last pass at depth of " & Depth_Lastpass & ")"           

  Code "G01 Z" & StartZ           

  Code "G32 X" & EndX & " Z" & Round(Z_pass_start ,4) & " F"&Pitch           

  Code "G32 X" & Round (EndX + Taper* ID_OD  ,4) & " Z" & Round (ENDZ +Retract_dis *Right_Left ,4) & " F" &Pitch           

  Code "G01 X" & Round (StartX+(XClearance+Taper)* ID_OD ,4)  & " Z" & ENDZ  & "F" & Pitch           

  Code "G00 X" & Round (StartX+XClearance * ID_OD ,4)  &" Z"&StartZ           

  Code "G00 X" &StartX           

End if           


IF Spring_Pass >0 Then           

Pass_counter= 0           



  If test = true then Code "( Spring pass number " & Pass_counter+1 & ")"           

    Code "G01 Z" & StartZ           

    Code "G32 X" & Round (EndX ,4) & " Z" & Round (Z_pass_start ,4) & " F"&Pitch           

    Code "G32 X" & Round (EndX + Taper * ID_OD ,4) & " Z" & Round (ENDZ +Retract_dis*Right_Left ,4) & " F" &Pitch           

    Code "G01 X" & Round (StartX+(XClearance+Taper) * ID_OD,4) & " Z" & ENDZ  & "F" & Pitch           

    Code "G00 X" & Round (StartX+XClearance *ID_OD ,4) &" Z" & StartZ           

    Code "G00 X" & StartX         

    Pass_counter = Pass_counter + 1           

  Loop While  Spring_Pass > Pass_counter           

End If           

Code "G00 X" & StartX + XClearance *ID_OD & " Z" & StartZ 

If test = true then CloseTeachFile()           

If test = true then LoadTeachFile()           

Title: Re: Lathe Threading With Backlash
Post by: DAlgie on August 06, 2007, 10:53:53 PM
Whenever I manually cut a thread, screwcutting, or single point as it's called, I machine that grove you are talking about in before doing the thread itself, this is typical in this operation I believe, and doesen't weaken the stud as long as the groove is no deeper than the root of the thread. When cutting threads the easy way, with a CNC lathe, it does the tool retract as you are talking about here automatically, which is a cool feature, but really doesen't improve the thread in any way, or the strength of the stud. So, unless it has major drawbacks to the operation, I say don't worry about it too much. Another thing to look at is, what RPM are you running these threads at? For a pitch of, say, 24tpi I would turn the spindle at maybe 300 rpm, this is tied to the acceleration your machine is capable of, and not so much the diameter because you try to not work the tool too much in case of breaking it, quite common with screwcutting. Too high of an RPM and you leave the control no time to try to retract the X axis.
Title: Re: Lathe Threading With Backlash
Post by: Brian Barker on August 07, 2007, 08:33:34 PM
Dave.... I hate to be a party pooper but if you cut the grove you are making the shaft weaker...  The Grove is making what is called a stress concentration (takes me back to my senior design classes in collage). So the best is if you can have a grove with nice round corners at the bottom and no grove would be the best.

Sorry just wanted you to know
Title: Re: Lathe Threading With Backlash
Post by: wnevels on August 07, 2007, 09:33:21 PM
Backlash doesn't get applied until the X axis move is completed, then after a time period has elapsed(Shuttle accel default 1 second) then the backlash is applied.
so editing G76 won't help.  G32 would need a small move of x(.0001)prior to the start of the camfer, then the timer would start(shuttle accel would have to be small 0.0001 sec) then the x move for the taper.   


Title: Re: Lathe Threading With Backlash
Post by: DAlgie on August 07, 2007, 09:59:18 PM
True, and I do that if time permits it (often doesen't!) but the groove is no weaker than the thread that the same tool cut, only difference is that the thread is a helix so has one pitch of the thread higher than the root, but the root is still the stress riser anyway. Main point here is still, not a lot of major advantages to the CNC tool pullout as far as strength, but it is really cool and has a neat appearance.