AutoZero Scripts

This page contains links and information on the new AutoZero tool setting Scripts and Macros for both Mach3 and UCCNC.

This Autotool Zero feature is unique in that it allows the cutter to be set anywhere on the table referenced to either the stock surface or the table top using the nominal thickness of the material as a reference. Lets face it the material you buy at your local store is never the thickness they advertise it at. It is either thicker or thinner but never the advertised thickness. Now you can either spend your time measuring the material thickness for each job or you can do the smart thing and by changing how you zero your machine you can get perfect depth pockets and cut right through your material without cutting into your spoilboard.

How does it work?
Put simply the Macro askes for the material thickness when you zero your cutter and uses that to work out the Z height. If you sit the plate on the surface of the material then the offset is zero and the cutter will sit perfectly on the material surface . If sit the plate on the tabletop and enter a material offset of 12mm (1/2") then the cutter will be zeroed 12mm above the table top just as it would had you zeroed to the surface of a piece of 12mm stock. 

What's the difference?
By using the material offset and putting the plate on the table top the cutter will be zeroed 12mm above the table top. My putting the plate on top of the stock and zeroing there the cutter will be what ever the material thickness is from the table top. Since we know that 12mm is only the nominalthickness of the stock and it will be either thicker or thinner than that you will either not cut all the way through your stock or you will cut all the way through and into the spoilboard.

If you learn how to use this you will never need to measure the stock thickness again.

The video below highlights the problem with Stock thickness.

Scripts available here


Installation instructions here for both Mach3 and UCCNC 

Final words
I want to thank the following people for their contributions to this project.

Mach3 Script
Big TEX who created the original Script that this is based on.
Glen Higgs for the Pre Touch Test addition
My only contribution was to add the material offset thickness and a beep.
John Revill for creating this Macro and sharing it with the Community
My only contribution to this project was to make suggestions and let John do all the hard work. 


  1. Hi Peter,I am currently building a cnc router and I want to than you for your informative videos,been very helpful.

    1. Thanks, glad it helps

    2. hai I have 5 axi cnc bought from amazon , I have question so please this cell phone 2817505717 `

  2. Hi
    This will work for manual tool change auto lenth for multi tools

  3. We are ball screw manufacturer, if you need help, just contact with us.

    Wei Tai Transmission Limited Company is the head office in Taipei and acts for all of international trade activities to handle the shipment supplied from Shen-Han Shenzhen factory. We are looking for the new customers in your regions and it’s thankful if you can give us a chance to work together with. Please feel free to contact the following:
    Wei Tai Transmission Limited Company
    We chat ID: w0978377508
    You tube:
    Cell phone: +886978377508

  4. I have a issue with ypur script. I just changed the height of the sensor but sometimes it plunges down into the probe after probing?

  5. btw those scripts suck, there is a bug which can be dangerous.

    1. Would you like to elaborate as to your findings and the dangerous nature?

  6. Peter,
    How do I program an external push button to run a Z height auto tool zero?
    I tried to use OEM code 1010, which I wanted to run my auto tool zero macro for touching off for Z.
    I have buttons for the following:
    start ( code 1000 )
    toggle MPG ( code 103 )

  7. Peter,
    I looked into screen4 for a way to set-up a button on my pedant to auto tool zero....
    Thanks for any help.
    Kentucky USA

  8. Peter,
    Have you used any of the UCCNC versions 2.108 & above? they put in a set of probing routines that look promising but confusing, as well as a complete change to the UI...

    1. I have seen it but am not a fan of the new look though I like the addition of dimensions.
      Cheers Peter