Hello Guest it is December 26, 2024, 11:05:10 AM

Author Topic: more tool change questions  (Read 7081 times)

0 Members and 1 Guest are viewing this topic.

more tool change questions
« on: December 17, 2008, 03:52:49 PM »
I have been trying to implement a rotary tool changer,it is rotated with a stepper motor
and I have it set as the "a"axis.I can enter a goa# on the mdi line and the turret works.
I found that a value of 1.64375 X tool # and it will rotate to that tool.Now I want to do it
with a brain or with a vb macro as below I must have something wrong
with this as I cannot get it to work!.I would rather use a brain as I would like to add
funcionality to my machines as I go.My turret is simple
-a pneumatic cylinder holds a lock closed, release with a signal
-read input from limit switch, to indicate lock is released,
- rotate turret and reclamp
-read lose of input from limit switch to indicate all is good.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 axis As String
  Dim zero 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 = 8 ' number of tools on turret
  steps_per_tool= 1.64375 ' 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)
 
' 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
   
    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
 
    While IsMoving()
    Wend
    Code "G01 " & axis   "F"     While IsMoving()
    Wend
    SetCurrentTool next_tool
    SetUserDRO holdingDRO, next_tool
    Code "G90" ' back to absolute movement
  End If
End If

' end of tool change   

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
Re: more tool change questions
« Reply #1 on: December 18, 2008, 09:17:06 AM »
Here is a repost of the M6 for a turret lathe with Paul-pin I posted up a while back:

Sub Main()

NumSlots=8
OldTurretPos=(GetOEMDRO(805))
OldToolSlot=Abs(GetOEMDRO(805)/45)
NextTool = GetSelectedTool()
NextToolSlot = (NextTool-1)*360/NumSlots


If OldToolSlot = NextToolSlot Then
SetCurrentTool(NextTool)
Exit Sub
End If

If NextTool>8 Or NextTool<1 Then
Message("Next Tool out of range")
Exit Sub
End If

MoveDis = (NextToolSlot-OldTurretPos)

 If Abs(MoveDis) >180 Then
   If MoveDis < 0 Then     
     MoveDis = 360 + MoveDis     
   Else     
     MoveDis = MoveDis - 360     
   End If     
 End If
 
ActivateSignal(OUTPUT3)  'Release Turret holding pin
Code "G4 P0.5"
While IsMoving ()       
Wend
Code "G00 G91 C" & MoveDis       
While IsMoving ()       
Wend

DeActivateSignal(OUTPUT3)  'Engage Turret holding pin     

SetCurrentTool(NextTool)
Code "G90"
End Sub

'scott
fun times
Re: more tool change questions
« Reply #2 on: December 20, 2008, 05:54:12 PM »
thanks poppa.I had to tweek it a bit but the tool change is working away nicely :)
Now on to my more involved tool changer.This one I think will have to
run thru the plc .It is on my mazak miil, 24 pockets, 5 proximity sensors to give an absolute position
lots of io for the tool swap arm and spindle orientate.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: more tool change questions
« Reply #3 on: December 20, 2008, 06:07:29 PM »
Keith, got any pics of the toolchanger on the Mazak? I will be making one for my Beaver mill at some point and I am looking for ideas on the best type to use, a carousel would be the easiest but would like to be able to load the next tool in the arm ready for action :)
Hood
Re: more tool change questions
« Reply #4 on: December 20, 2008, 07:32:06 PM »
Hood here are some pictues of the tool changer

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
Re: more tool change questions
« Reply #5 on: December 20, 2008, 07:36:26 PM »
Thanks Keith, much appreciated.
Hood