163
« on: May 03, 2021, 09:32:04 AM »
I have seen A LOT of people asking about a tool length offset macro.
I made this Macro Program (G Code) for my tool length offsets.
This is not a Macro in the sense of Mach4 Macros. This is a Macro B Program. It is G Code.
Put the 9001 and 9002 programs in the Subroutines folder in the Mach4 Directory.
Put two buttons on the screen to probe the tool length offset and to probe a rotating tool. One or both, you do you.
Put the attached scripts into the appropriate button script.
This will probe the current tool that is active in Mach4.
This Macro Program will set the tool offsets at a Machine Position. So homing the Z Axis is a must for this to work well for you.
This will set every tool to the same position (your tool setter). So you can (and need to) set your Z Work Offset with any tool that has been touched off.
You MUST have your Tool Height Offset active when you set your Z Work Offset.
You MUST have your Tool Height Offset active when you set your Z Work Offset.
You MUST have your Tool Height Offset active when you set your Z Work Offset.
The rotating tool probe will use the diameter value in the tool table. So be sure to put something in there if you intend to use that one.
It will offset half of the diameter and rotate CCW and probe slow. This is for tools tool large for the tool setter (exp: Face Mills)
You will see variables inside the code that you will need to change for yourself.
Tool Setter X and Y positions.
Feedrate for fast probe and slow probe.
Lift Height after fast probe.
ETC.....
Just be sure to adjust to your own needs.
I also use G31 instead of G28 so I be sure you have something 0.000 in #5183 (I think it's #5183) so it will go to Z Home; or change it to G28, or take it out and make sure you put a safe Z in there first.
USE AT YOUR OWN RISK.
I am using Mach4 Hobby so I'm not able to do conditions in the Macro Program for safety checks.
Check the macro manually first. Get it set up, hit the probe button and press the tool setter manually and be sure everything works.
As always when using CNC Machines, be safe and diligent.