584,858 active members*
4,592 visitors online*
Register for free
Login
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2014
    Posts
    11

    MACH3 AUTO TOOL ZERO MACRO

    Hi guys,
    I have to say I have absolutely no idea on how to write VB SCRIPT, and now having LIMIT switches on my machine with the add bonus of managing to wire up a AUTO TOOL ZERO probe on to the BOB.
    I searched the net for examples of AUTO TOOL ZERO macros, and finally found something that I could roughly understand and work with from GURUBREW on youtube.

    After loading it, and playing, and adding what I thought was logical to it, it looks like this ( now I know in the eyes of you experts in this field this might look like a horror movie) but it worked the way I wanted it to, apart from one line of code,
    ( as shown in red ).

    I would like to substitute this part of code with the following instruction.

    PAUSE OR STOP, AND WAIT, FOR IN INFINATE AMOUNT OF TIME. ( i might have the urge for a cup of tea)
    DURING THAT TIME IT WILL ALLOW ME TO POSITION THE POBE,
    AND ALLOW ME TO MANUALLY JOG THE Z AXIS DOWN TO 5MM ABOVE THE PROBE.
    (I have 75mm of travel on my Z axis and having to wait for it go down slowly time wasted.)
    THEN ON PRESSING ONLY THE "ENTER" KEY WILL CONTINUE WITH THE SCRIPT.


    ************************************************** ************************************************** *************


    CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
    CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
    CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state

    DoButton( 24 ) 'REF ALL HOME Z
    DoButton( 23 ) 'REF ALL HOME Y
    DoButton( 22 ) 'REF ALL HOME X
    DoButton( 25 ) 'REF ALL HOME A

    If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
    DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
    Code "G0 X-25Y-25. F50" 'move to Z zero probe position

    Code "G4 P5" ' this delay gives me time to get from computer to hold probe in place

    Code "G90 G31Z-10. F50" 'probing move, can set the feed rate here as well as how far to move
    While IsMoving() 'wait while it happens
    Wend
    ZProbePos = GetVar(2002) 'get the exact point the probe was hit
    Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
    While IsMoving ()
    Wend
    Call SetDro (2, 10.0) ' PROBE THICKNESS
    Sleep 200 'Pause for Dro to update.
    Code "G28. F100" 'MOVE Z Y X A BACK TO HOME POSITION
    While IsMoving ()
    Wend
    Code "(Z axis is now zeroed)" 'puts this message in the status bar
    Code "F" &CurrentFeed 'Returns to prior feed rate
    Else
    Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
    End If
    If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
    Code "G91"
    End If
    If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
    Code "G0"
    End If

    I you think you can help, then I look forward to your comment, then I can realy start cutting something.....

  2. #2
    Join Date
    Mar 2003
    Posts
    35538

    Re: MACH3 AUTO TOOL ZERO MACRO

    PAUSE OR STOP, AND WAIT, FOR IN INFINATE AMOUNT OF TIME. ( i might have the urge for a cup of tea)
    DURING THAT TIME IT WILL ALLOW ME TO POSITION THE POBE,
    AND ALLOW ME TO MANUALLY JOG THE Z AXIS DOWN TO 5MM ABOVE THE PROBE.
    (I have 75mm of travel on my Z axis and having to wait for it go down slowly time wasted.)
    THEN ON PRESSING ONLY THE "ENTER" KEY WILL CONTINUE WITH THE SCRIPT.
    I'm not sure you can do that.
    You can try adding a Msgbox, but it might not let you jog around. Try adding:

    Msgbox "Press OK to Continue"
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Mar 2014
    Posts
    11

    Re: MACH3 AUTO TOOL ZERO MACRO

    Thanks for the input Ger21,
    I tried adding that this morning, and yes, as you and myself suspected it stopped/paused the script which is good, but does not allow for any other key to be pressed.
    Yet again my brain has thought of something that seems to be a logical procedure, but cant be done automatically.

    I think, I will just have to remove the first part of the script, so that I have to :-

    REF ALL HOME via its own button and ensure all DRO's are "0"ed.
    MDI a movement to the probe position,
    Manually move the the Z axis down to above the probe.
    Then run the AUTO TOOL ZERO MACRO.

    OR just run it, as is, and I just have to wait for it ............

    LOL, Dont ya just love technology

  4. #4
    Join Date
    Mar 2003
    Posts
    35538

    Re: MACH3 AUTO TOOL ZERO MACRO

    REF ALL HOME via its own button and ensure all DRO's are "0"ed.
    MDI a movement to the probe position,
    Manually move the the Z axis down to above the probe.
    Then run the AUTO TOOL ZERO MACRO.
    This is pretty much the way that everyone else does it.


    One thing you can do is put the Ref All stuff in it's own macro, and add it to the initialization string, so it homes automatically the first time you press reset, when you turn on the machine. You shouldn't need to home the machine each time you need to auto zero. Just when you start the machine, and then again if you hit a limit or Estop.

    Most people just jog over to the probe position, as it's probably easier and faster than using MDI, and the exact location typically isn't critical.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  5. #5
    Join Date
    Mar 2014
    Posts
    11

    Re: MACH3 AUTO TOOL ZERO MACRO

    Thanks again ger21,
    But after deep thought during my late shift at work tonight, I have decided to stick with my play'ed with, version of gurubrews macro, proudly it works, so, all be-it slower than I imagined, it just mean's I cant just GO and make a cup of tea, so I'll just have to text the missus to bring me one, lol

  6. #6
    Join Date
    Jun 2013
    Posts
    61

    Re: MACH3 AUTO TOOL ZERO MACRO

    I am having trouble with autozero, it was working fine but after new drivers and breakout board it won't work. Well it worked for a bit but now won't move the Z down. So I tried this script, it moves it down but the touch plate doesn't do anything when it strikes it. It is working in the diagnostics screen I get a green light for my plate when it touches. Any ideas??

  7. #7
    Join Date
    Mar 2014
    Posts
    11

    Re: MACH3 AUTO TOOL ZERO MACRO

    Sorry for not replying sooner only just seen the email notification, mm not sure, but silly question are you getting a green light when you put sensor on the bed as well if there is, then the macro will detect this and won't run it a safety feature in case of a short in the circuit.

Similar Threads

  1. Adding an Auto Z Zero probe macro for Mach3
    By D O N in forum Uncategorised WoodWorking Machines
    Replies: 4
    Last Post: 07-26-2019, 03:40 PM
  2. Mach3 ATC & Auto Tool Zero
    By KNA in forum Mach Software (ArtSoft software)
    Replies: 21
    Last Post: 02-03-2015, 10:16 PM
  3. G100 + Mach3 2010 screen auto tool zero
    By Menatep in forum G-REX
    Replies: 4
    Last Post: 05-02-2014, 10:13 PM
  4. Need to asign a M number to this auto tool zero macro.
    By glengeniii in forum Mach Wizards, Macros, & Addons
    Replies: 4
    Last Post: 12-31-2011, 11:26 PM
  5. Ayuda con Auto Tool Zero en Mach3
    By hmoltedo in forum Spanish
    Replies: 0
    Last Post: 12-06-2011, 02:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •