Hello Guest it is December 26, 2024, 06:23:54 AM

Author Topic: Mach 3 atc on boxford lathe  (Read 29344 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach 3 atc on boxford lathe
« Reply #10 on: April 19, 2023, 01:17:44 PM »
Will give that a go tomorrow. Thank you
Re: Mach 3 atc on boxford lathe
« Reply #11 on: April 20, 2023, 08:43:47 AM »
Yesss! That works spot on thank you both very much :)
One final thing could tell me how I could get the atc to move to a safe position prior to the tool change? Thank you again
Re: Mach 3 atc on boxford lathe
« Reply #12 on: April 23, 2023, 11:30:25 AM »
I guess it would have to read the current position, then move to say machine 0,0 do the atc change and then move back to last dro position so that it would keep the same position for the program?

Offline TPS

*
  •  2,539 2,539
Re: Mach 3 atc on boxford lathe
« Reply #13 on: April 23, 2023, 12:56:46 PM »
here:
https://www.machsupport.com/forum/index.php/topic,36624.msg251085.html#msg251085

you can find a macro i poted some year's ago it shows how to move to "safe" position first.
this will also make necessary to have the axis referenced/homed to know for sure the position
in machinecoords.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach 3 atc on boxford lathe
« Reply #14 on: April 23, 2023, 04:08:22 PM »
would this move it to position using the previous script and added in from your script the x and z axis moves?

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

' NOTE current values are for a Boxford 125/160 lathe
' 8 position tool changer using MM calibration.
' set axis steps per to 20

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 steps_after_pawl As Integer
  Dim max_tools As Integer
  Dim rotateCW As Integer
  Dim moves As Integer
  Dim fast_feed As Integer
  Dim slow_feed As Integer
  Dim axis As String
  Dim zero As Integer
  Dim to_pawl 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
   
   ' stepper driver should be set to 1 step NO MICRO STEPPING!
   
  steps_per_tool = 900 ' number of steps needed to move 1 tool position (45 deg)
  steps_after_pawl = 100 ' set to amount to clear pawl after move (5 deg)
  steps_to_lock_back_on_pawl = 140 ' number of steps to lock onto pawl (7 deg)
  next_tool = GetSelectedTool()
  current_tool = GetCurrentTool()
  fast_feed = 1000 ' set to safe rapid rotation speed
  slow_feed = 200 ' set to safe creep speed back onto pawl.

' 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

Message "ATC X-Axis to TC position"
      Code "G90 G53 G0 X2"
      While IsMoving()
         Sleep(15)
      Wend

      Message "ATC Z-Axis to TC position"
      Code "G90 G53 G0 Z2"
      While IsMoving()
         Sleep(15)
      Wend
  Else
  ' lets do some checking
    If next_tool > current_tool Then moves = next_tool - current_tool 
    If next_tool < current_tool Then moves = max_tools - current_tool + next_tool
   ' work out how far to move
    rapid_move = (moves * steps_per_tool) + steps_after_pawl
    to_pawl = zero - steps_to_lock_back_on_pawl
   ' reverse moves if needed   
    If rotateCW = 1 Then
      rapid_move = zero - rapid_move
      to_pawl =  Abs(to_pawl)
    End If
   ' set axis to zero
    Code "G92 " & axis & "0"
    Code "G91 G94 G61"
   ' start the move
    Code "G01 " & axis & rapid_move & " F" & fast_feed
    Code "G04 P250"
    While IsMoving()
    Wend
   ' move back to locking point
    Code "G01 " & axis & to_pawl &  " F" & slow_feed
    While IsMoving()
    Wend
   ' tell mach3 new tool
    SetCurrentTool next_tool
    Code "G90" ' back to absolute movement
  End If
End If

' end of tool change   

Offline TPS

*
  •  2,539 2,539
Re: Mach 3 atc on boxford lathe
« Reply #15 on: April 24, 2023, 02:13:29 AM »
modified your code a little bit:

Code: [Select]
' (C) Graham Waterworth Mach forum.
' rough draft for a lock back to pawl type tool changer
' this has not been tried on any tool changer
' use/modify it as you wish, I take no responsibility
' for any damage to you or your equipment.

' NOTE current values are for a Boxford 125/160 lathe
' 8 position tool changer using MM calibration.
' set axis steps per to 20

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 steps_after_pawl As Integer
  Dim max_tools As Integer
  Dim rotateCW As Integer
  Dim moves As Integer
  Dim fast_feed As Integer
  Dim slow_feed As Integer
  Dim axis As String
  Dim zero As Integer
  Dim to_pawl 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
   
   ' stepper driver should be set to 1 step NO MICRO STEPPING!
   
  steps_per_tool = 900 ' number of steps needed to move 1 tool position (45 deg)
  steps_after_pawl = 100 ' set to amount to clear pawl after move (5 deg)
  steps_to_lock_back_on_pawl = 140 ' number of steps to lock onto pawl (7 deg)
  next_tool = GetSelectedTool()
  current_tool = GetCurrentTool()
  fast_feed = 1000 ' set to safe rapid rotation speed
  slow_feed = 200 ' set to safe creep speed back onto pawl.

' 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

       'X-Axis not in reference
If GetOEMLED(807) Then
DoButton(3)
Sleep(500)
Message ("X-Axis not referenced -> Abort !!")
                Code "M30"
Exit Sub
End If

'Z-Axis not in reference
If GetOEMLED(809) Then
DoButton(3)
Sleep(500)
Message ("Z-Axis not referenced -> Abort !!")
                Code "M30"
Exit Sub
End If


      Message "ATC X-Axis to TC position"
      Code "G90 G53 G0 X2"
      While IsMoving()
         Sleep(15)
      Wend

      Message "ATC Z-Axis to TC position"
      Code "G90 G53 G0 Z2"
      While IsMoving()
         Sleep(15)
      Wend

  ' lets do some checking
    If next_tool > current_tool Then moves = next_tool - current_tool
    If next_tool < current_tool Then moves = max_tools - current_tool + next_tool
   ' work out how far to move
    rapid_move = (moves * steps_per_tool) + steps_after_pawl
    to_pawl = zero - steps_to_lock_back_on_pawl
   ' reverse moves if needed   
    If rotateCW = 1 Then
      rapid_move = zero - rapid_move
      to_pawl =  Abs(to_pawl)
    End If
   ' set axis to zero
    Code "G92 " & axis & "0"
    Code "G91 G94 G61"
   ' start the move
    Code "G01 " & axis & rapid_move & " F" & fast_feed
    Code "G04 P250"
    While IsMoving()
    Wend
   ' move back to locking point
    Code "G01 " & axis & to_pawl &  " F" & slow_feed
    While IsMoving()
    Wend
   ' tell mach3 new tool
    SetCurrentTool next_tool
    Code "G90" ' back to absolute movement
  End If
End If

' end of tool change   
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach 3 atc on boxford lathe
« Reply #16 on: April 26, 2023, 03:55:14 PM »
works perfect, thank you very much  8)