Hello Guest it is March 29, 2024, 04:21:26 AM

Author Topic: Definitive Tool Auto Zero Script  (Read 914 times)

0 Members and 1 Guest are viewing this topic.

Definitive Tool Auto Zero Script
« on: December 02, 2020, 08:43:59 PM »
Is there a definitive (tested, debugged, safe) tool auto-zero script available?  I've tried several I found here and elsewhere and they all seem to range from unreliable to dangerous in one way or another.  I just spent most of a day trying to find something that works and they all seem pretty slipshod.  Not for lack of effort, it just seems people solve their corner case and call the job done instead of publishing a robust solution to the general problem.  It seems the best option for meis to scrape together my own hack.

Am I just missing something obvious?  It seems a topic of interest, a related forum thread here has >8000 views in three years(!)

If there really is no really safe, reliable, recommended script out there, is anyone interested putting our heads together and writing one?

It seems like it breaks down into two use-cases:  The Auto Tool Zero (ATZ) button script and when a M6 macro calls the M6Start/End scripts.  For my use, I'd like the ATZ button to trigger a zero at the current location but M6 to safely move to the Auto Tool Change location and zero from there.

The problems I've seen in various scripts seem to break down into different categories:  Properly capturing & restoring machine state when the script runs, safely (but quickly) doing a rough 1st-pass find-zero without overrunning the touch-plate, ...

... Before diving in too deep, I'd better gage interest.  Maybe a good script is out there?
Think twice before you G0 -Z...

Offline ZASto

*
  •  423 423
    • View Profile
Re: Definitive Tool Auto Zero Script
« Reply #1 on: December 03, 2020, 12:22:05 AM »
I don't think that you will ever find definitive auto tool zero script.
There are many scripts around there. As you wrote some better than others.
I personally use scripts from BigTex toolsetter screen set, modified a little bit.
Essentially for zeroing there are 3 scripts: Tool Zero, Initial Setup and Zero Tool Setup.
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.
Re: Definitive Tool Auto Zero Script
« Reply #2 on: December 11, 2020, 02:42:10 PM »
Thanks for the suggestion ZASto.  I found your link to the Big-Tex script on another thread (for those interested it's https://www.dropbox.com/sh/7c5lmhl58lyhzn7/AACy4fPjUVi1RIX4Nh0Sm884a?dl=0) and took a look.  Although there's some good stuff in it, I'm not really keen on switching screensets, etc that it requires.  And anyway, I'm thinking of taking a new approach to zeroing and am part way through scripting my solution.

[A little background:  I'm a retired software engineer machining aircraft prototypes as a hobby.  I run big tools (1/2" shank) in metal and just recovered from a 'wrong-z crash' that hurt not just the tool, it hurt the machine (bent $pindle & z-$crew) so I'm being extra paranoid...  After talking with some experienced machinists who actually know what they're doing, I learned that zeroing directly is for newbs and the right way to do it is to zero onto a gauge-block, removing the block whenever jogging into the material, then checking clearance by sliding it in.  Much safer!  But that wasn't the cause of the problem, running a crappy script was.  (Not blaming here, except maybe a little for the Mach developer(s) who should have provided a template for 'the right way to do it', I bet that would have saved many tear$!).]

So, my big idea (ok, one of them) is this:  I use a spring-touchplate with about 1/4" spring travel.  For the manual tool change scenario (clicking the Auto Tool Zero (ATZ) button, not executing a T# M6 code) I want to manually jog down to touching a 1" gague block on top of the touchplate, then click ATZ.  The script will wait for contact to break (or possibly contact then break), then G90 G31 Z-1.125" (roughly speaking), limiting Z motion on the probe and reducing the risk of overrunning the plate if anything is wrong.  Yes, paranoid - but paranoid enough?

For a 'T# M6' tool change, I'd like to do a superset of this, moving down a known distance from the tool change position (using absolute positioning mode) and initiating the above stuff from there.

I know this is a little unconventional so I'm wondering what the more experienced folks think?

If it turns out well, I'd be happy to share the scripts, collaborate with others, etc to perfect it for all scenarios and prevent others from the $1000 cost & month of downtime I experienced from using but not fully understanding what was going on in that [name redacted to protect the guilty] script.
Think twice before you G0 -Z...
Re: Definitive Tool Auto Zero Script
« Reply #3 on: December 11, 2020, 02:48:33 PM »
By the way, if anyone has suggestions on how to interrupt a running script, please check https://www.machsupport.com/forum/index.php?topic=44050.0
Think twice before you G0 -Z...