i am running millturn successfully with a 7 tool gang block and i love it. now i want to automate the tool change for gcode programms i tested before.
in the manual you write that you have to change the m6atc script. i am not familiar with macro programming but i guess in case of a tool block the macro should be quite simple. i think it should be enough if the z axis moves up in machine coordinates to a safe position, lets say z-50.
would the script look like this?
Option Explicit
'********DO NOT remove or change the expand line or the included file contents******************
' MachStdMIll license terms REQUIRE that the copyright and License terms remain a part of this source file
#expand <Masters\Headers\CopyRightAndLicenseNotice>
'**************************************************************************************
' this is a template script for M6ATC.m1s
' This template is installed by MSM into <mach install dir>\MachStdMill\Profile Macro Masters\Templates
'
' the Auto Tool Changer implementer should flesh this template out with appropriate code.
' this script is called from MSMM6start for AutoTC mode
' the script will be looked for by M6Start in the macro dir for the current profile
' i.e. in "<mach install dir>\Macros\<GetActiveProfileName() >\" and the name of the script in that dir must be "M6ATC"
'
' this script is responsible for physically putting GetSelectedTool() into the spindle
' this script should returns when the tool mount is complete
'
' the routine should do all TC operations in G53 coordinates
' Routine is entered with G90 G00 G40
That is the template M6ATC script that is supplied as an example with MSM - you just added the line
When you change the mach tool change mode to ATC, MSM runs the M6ATC script for each tool change (for mill-turn a Txxyy gcocde).
first step is to put the template m6atc script in the right directory for your profile, change to ATC mode then so a tool change. You should see the msgbox dialog that confirms the script was called.
Then you can edit the script to do what you want for your tool changes.
You added the line
G53 Z-50
that will move the spindle up to absolute position Z-50.... since top of travel is normaly z=0, is that what you want?
I'd also think that you will need some X,Y moves to position the gang tool block to the tool you want next etc.
BTW, you don't nee to keep all the comments from the template script - they are just there to tell users what the script needs to do after a user makes a custom script.
hi dave,
i was reading a little bit about macros and was trying out the following macro:
Code "G53 G0 Z -50"
While IsMoving()
Wend
msgbox "M6ATC was called."
exit sub
at a toolchange the z axis moves up but further then z-50, it does not stop and nearly killed my end switch. after that i pressed estop and got an error where it said something with loop error in the m6start macro? the message box m6atc was called did not appear in that case.
before that i tried the atc macro without the z move and it seems to work, the tool offsets get applied. but it would be safer if i could raise the z axis up at every tool change.
i was googeling to find an answer but could not find one.
do you have an idea? the m6start and m6end macros are still in the same folder as the m6atc, is that correct?
G53 is always in machine coordinates. G53 means "machine coordinates" in gcode.
G53 G0 Z-50
will attempt to do a rapid move (G0) to machine coords Z=-50
So you told the machine to go to Z=-50. It tired.... if that is past the limit switch coordinate, then you probably need to check where machine coords Z=0 is physically.
Note that Z=-50 does NOT do a relative move (i.e. -50 units away from the current position).
The Msgbox did not show because you aborted the script execution during the Z-50 move (before the msg box lime).
Do not make any changes to the m6 scripts. Only change the the M6ATC script for auto tool changes.
yes i know that g53 is machine coordinates and i checked before that z0 is at the top of z travel and if the z axis moves downwards the z value gets negative. so z -50 should be 50mm below the end of z travel. but the axis goes further up.
in fusion 360 you have good possibilities to move the tools to a distance from the workpiece at the beginning and end of each operation. this is what i did with the manual tool change before. i did not define a tool change position in msm. each tool change i just hit the play button and everything ran fine.
is it not possible to leave the m6atc macro empty and i control my safe heights with fusion 360?
Here are the available combinations depending on the mach tool change mode:
mach = ignore: no tool change scripts are run at all. Mach will literally treat M6 and Txxyy as if they did not exist in the gcode.
mach = stop & wait: The M6 scripts are run for each tool change. See MSM manual for detailed info.
mach = ATC: MSM will run the M6atc script for each tool change. What you put in the M6atc script is up to the user. It can be an empty script if that is what you want for your system.