Hello Guest it is October 20, 2019, 03:46:50 PM

Author Topic: controlling lathe tool turret  (Read 4106 times)

0 Members and 1 Guest are viewing this topic.

controlling lathe tool turret
« on: February 18, 2008, 08:06:30 PM »
I am building a couple of multi station tool turrets for my 14x40 and 9 x 20 lathes and need advice/guidance on controlling them with mach. They will work pretty much like the turret on larger lathes, I will need to energize an air solenoid to push the turret forward off the indexing pins and then tell a servo motor # of steps and direction to turn to index to the proper tool called out in the m6 command line. How should I go about this ? Is there a plugin or macro already written for rotary tool turrets? thanks
Re: controlling lathe tool turret
« Reply #1 on: February 18, 2008, 09:55:28 PM »
Hi here is how I controll mine I have 8 macros m21 - m28 each one represents 1 turret position m21 = pos 1 and so-on

Rem THIS IS TOOL 1 
Code "g0"
Code "Z3.0"     
Code "M15"     
Code "G4 P500"           
Code "B0.00"     
Code "M6T0101"     
Code "G43H1"   
Code "G4 P125"     
Code "M16" 
Code "G0"
CODE "G54"
     

M15 ACTIVATES A SOLENOID TO PUSH THE TURRET OUT
B AXES 1" = 360 DEG 8 STATION TURRET .125 = POSITION 2 .250 = POSITION 3 AND SO - ON
M16 DEACTIVATES THE SOLENOID

You can see it in action on youtube.com search for milehigh51

i can email you all 8 macros if you find this helpful

Roy

Offline Graham Waterworth

*
  • *
  •  1,889 1,889
  • Yorkshire Dales, England
    • View Profile
Re: controlling lathe tool turret
« Reply #2 on: February 19, 2008, 03:27:09 AM »
Here is one I did using the M6Start.m1s macro.

Graham.


' (C) Graham Waterworth Mach forum.
' rough draft for a push forward and lock back type tool changer
' this has not been tried on any tool changer
' use/modify it as you wish, I take no responsability
' for any damage to you or your equipment.

If IsLoading() Then
  ' do now't, program loading
Else

' dim some vars

  Dim next_tool As Integer
  Dim current_tool As Integer
  Dim steps_per_tool As Integer
  Dim max_tools As Integer
  Dim holdingDRO As Integer
  Dim rotateCW As Integer
  Dim moves As Integer
  Dim fast_feed As Integer
  Dim axis As String
  Dim zero As Integer
  Dim push_turret as Integer

' set up some vars

  zero = 0
  axis = "A" ' change to what ever axis you use for tool changer
  rotateCW = 0 ' set to 1 for CCW and 0 for CW rotation
  max_tools = 6 ' number of tools on turret
  steps_per_tool = 100 ' set to what ever it needs to be
  holdingDRO = 1050 ' or what ever you have set screen dro to
  next_tool = GetSelectedTool()
  current_tool = GetUserDRO(holdingDRO)
  fast_feed = 2500 ' set to safe rapid rotation speed
  push_turret = OUTPUT1 ' set to required output

' do some tool changing

  If next_tool > max_tools Then
    Message "Tool number too high, program stopped."
    Code "M30"
    End
  End If
  If next_tool<1 Then
    Message "Tool number too low, program stopped."
    Code "M30"
    End
  End If
  If next_tool=current_tool Then
    ' do nowt, we got it already
  Else
  ' lets do some changing
    If next_tool>current_tool Then moves=next_tool-current_tool 
    If next_tool<current_tool Then moves=max_tools-current_tool+next_tool
    ActivateSignal(push_turret)
    rapid_move = moves * steps_per_tool
    If rotateCW =1 Then
      rapid_move = zero - rapid_move
    End If
    Code "G92 " & axis & "0"
    Code "G91 G94 G61"
    Code "G01 " & axis & rapid_move & "F" & fast_feed
    Code "G04 P250"
    While IsMoving()
    Wend
    DeactivateSignal(push_turret)
    SetCurrentTool next_tool
    SetUserDRO holdingDRO, next_tool
    Code "G90" ' back to absolute movement
  End If
End If

' end of tool change   
Without engineers the world stops

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: controlling lathe tool turret
« Reply #3 on: February 19, 2008, 03:42:47 AM »
I use a PLC to work my turret and tool post, most of the routine is in the ladder within the PLC and I simply call the tool change by the normal T101, T202,T301 etc etc.
Both the turret and toolpost are worked via hydraulics, there is an unclamp then a rack to move the turret/post to the next position then clamp, this continues until the correct tool is reached as signalled by the combination of limit switches active.
 The M6 macro has the info in it for this to happen, heres a snippet of the first part


Old_Tool=GetCurrentTool()

New_Tool=GetSelectedTool()

If GetSelectedTool<1 Then
MsgBox("Tool Number Out Of Range")
End
End If

If GetSelectedTool>10 Then
MsgBox("Tool Number Out Of Range")
End
End If

If GetSelectedTool=GetCurrentTool Then
End
End If


If getselectedtool=1 Then
Do
Call setmodoutput (9,1)
If GetInPut (0)Then Exit Do
Loop
End If
Call SetModOutput (9,0)


If getselectedtool=2 Then
Do
Call setmodoutput (9,1)
If GetInPut(1)Then Exit Do
Loop
End If
Call SetModOutput (9,0)

and so on for all ten tools.

Hood
Re: controlling lathe tool turret
« Reply #4 on: February 21, 2008, 08:03:10 AM »
Hood,

how many outputs did your PLC have and how did you time the circuit?  did you add positional switches to let it know its selected the right tool?  can you recommend a PLC or let us know which on you used?

thanks
jerry

Offline Chaoticone

*
  • *
  •  5,607 5,607
  • Precision Chaos
    • View Profile
Re: controlling lathe tool turret
« Reply #5 on: February 21, 2008, 09:43:25 AM »
I'm pretty sure Hood used a DL06 from Automation Direct.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!