Hello Guest it is July 18, 2019, 06:10:41 PM

Author Topic: M6 Start Macro Help  (Read 1194 times)

0 Members and 1 Guest are viewing this topic.

M6 Start Macro Help
« on: September 25, 2017, 01:27:23 AM »
M6 ATC macro Gurus I need your help!..
I have a linear tool mount ATC machine with 8 tool ATC linear rack at the rear of my machine. I have a script setup to make my machine go to the tool coordinates, BUT...
I need the gantry to stop in the correct Y position, Move the Z down to the tool rack height , then Y back to slide the old tool into the holder, spindle release, Z up, X over to new tool, Z down to new tool, spindle lock to new tool, Y forward with new tool out of tool slot, Z up to Z home, spindle starts and runs the next tool path.
Anyone have something I can throw into Mach3 and just edit the tool locations and XYZ coordinates to fit my machine?
Below is what i have so far.... Found this online.
 It seems to work well other than the positions of the move in and out for tools at the tool holders. This is set up for tools that drop down and pick directly up from the tool holder, Mine have the slots the tool holder slides onto and out. The coordinates are not set in the code below.
Thanks in advance for any help...

'ToolChange Macro For Bed type tool changer
Sub Main()
OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
'Tool Changer Macro (Bed Type)
MaxToolNum = 8      'Max number off tools for the changer
ToolDown   = -4 'Z Pos to Get or drop a tool
ToolUp     = 0.0    'Z Hieght to Rapid from tool to tool
If NewTool = OldTool Then
   Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Code "G00 G53 Z" & ToolUp
While IsMoving()
Wend
Call MovePos(OldTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
ActivateSignal(Output1) 'Turn On Draw bar to release the tool
Code "G4 P1.0"    'Wait for the tool to release
'SystemWaitFor (7) 'Wait for the tool Release Limit switch
Code "G53 Z-2.5" & ToolUp
Call MovePos(NewTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output1) 'Turn Off Draw bar to Clamp the tool
Code "G4 P1.0"    'Wait for the tool to Clamp
While IsMoving()
Wend
Code "G53 Z" & ToolUp
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted
End Sub

Sub MovePos(ByVal ToolNumber As Integer)

Select Case ToolNumber
       Case Is = 1
         Xpos = 3.568
         YPos = 112.219
       Case Is = 2
         Xpos = 9.812
         YPos = 112.219
       Case Is = 3
         Xpos = 15.969
         YPos = 112.219
       Case Is = 4
         Xpos = 22.308
         YPos = 112.219
       Case Is = 5
         Xpos = 28.559
         YPos = 112.219
       Case Is = 6
         Xpos = 34.881
         YPos = 112.219
       Case Is = 7
         Xpos = 41.076
         YPos = 112.219
       Case Is = 8
         Xpos = 47.289
         YPos = 112.219
End Select

Code "G53 X" & XPos & " Y" & YPos
End Sub
Main   

Offline Tweakie.CNC

*
  • *
  •  7,845 7,845
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: M6 Start Macro Help
« Reply #1 on: October 03, 2017, 01:28:58 AM »
I have never used an ATC so cant be of much help.

Somebody here on the forum must be using ATC and hopefully they can offer some advice on changing this macro to suit your situation.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.