Register for free
Login
487,779 reg. members
487,779 reg. members
Page 1 of 2 12
Results 1 to 12 of 23
  1. #1
    *Registered User*
    Join Date
    Oct 2013
    Posts
    6

    Mach3 ATC & Auto Tool Zero

    Hello everyone
    Does anyone know how to activate the Auto Tool Zero for every ATC perform a tool change. I've tried desperately to read almost anything about it in the MACH3 related pages, but without any luck. My m6 macro and auto z zero work fine separately. I am no expert in this area, so I appreciate a simple way to fix it.
    Thanks in advance

  2. #2
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    30700
    You need to modify your M6 macro and combine the auto zero macro with it. There is no simple way to fix it, if you can't write your own macros.
    Gerry

    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
    Registered
    Join Date
    Oct 2008
    Posts
    1626
    I do not know VB script, but I have managed to cut and past a few things from one macro into another. I always test carefully when I do this since I don't always know exactly what each line is supposed to do.
    Bob La Londe
    http://www.YumaBassMan.com

  4. #4
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    30700
    It's not a good idea to call a macro from another macro in Mach3. The chances of it not working correctly are very high. If you really want to try it, the code for your auto zero macro is probably embedded in the button. In Mach3, go to Operator, Edit Button Script and click the Auto Zero button. You should see the code open in the editor. You'll want to save this as a standalone macro in the macros folder. You'll need to look in the programmers reference manual to find the command to call a macro from within a macro. I don't know what it is off the top of my head.
    Gerry

    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
    Registered
    Join Date
    Oct 2008
    Posts
    1626
    I wasn't talking about calling a macro from a macro. I was talking about just copying the contents of the macro using a text editor.
    Bob La Londe
    http://www.YumaBassMan.com

  6. #6
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    30700
    No, the OP was.
    Gerry

    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)

  7. #7
    Registered
    Join Date
    Oct 2008
    Posts
    1626
    You can also run g-code from a macro, but it requires a certain syntax. I don't do it often, so I would have to go look at my tool change macro to remind myself how.
    Bob La Londe
    http://www.YumaBassMan.com

  8. #8
    *Registered User*
    Join Date
    Oct 2013
    Posts
    6
    Thanks for your inputs
    My idea from the beginning was to using a call-function or similar to connect those 2 macros together. My "Auto tool zero" is saved as "HiddenScript" in the macro folder. I am more or less abandoned this idea and instead I have tried to implement "auto tool zero" into the "auto tool changer" macro (something similar to what Bob describes). This concept works well enough except for one thing. I have to zero z axis every time I need to change tools as otherwise the tool change will add z ofset til z movement when my machine moves down towards the tool magazine. In other words, the machine movement in z direction is more than that which is specified in the program because z ofset. You can see what I have arranged below, I would really appreciate any kind of suggestion or link to some relevant sites.

    Sub Main()
    OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
    x = GetToolChangeStart( 0 )
    y = GetToolChangeStart( 1 )
    z = GetToolChangeStart( 2 )

    tool = GetSelectedTool()
    NewTool = tool

    '----------------Tool Changer Macro (Bed Type)----------------------

    MaxToolNum = 4 'Max number off tools for the changer
    ToolDown = -50 'Z Pos to Get or drop a tool
    ToolUp = 0 'Z Hieght to Rapid from tool to tool

    '--------------------Auto Tool Zero---------------------------------

    PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
    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
    Else
    Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
    End If
    '-------------------------------------------------------------------
    If NewTool = OldTool Then
    Exit Sub
    End If
    While NewTool > MaxToolNum
    NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
    Wend
    Code "G00 G53 Z" & ToolUp
    While IsMoving()
    Wend
    Call MovePos(OldTool)
    While IsMoving()
    Wend
    Code "G53 Z" & ToolDown
    Code "G4 P.75"
    While IsMoving()
    Wend
    ActivateSignal(Output1) 'Turn On Draw bar to release the tool
    Code "G4 P1.0" 'Wait for the tool to release
    'SystemWaitFor (7) 'Wait for the tool Release Limit switch
    Code "G53 Z-0.5" & ToolUp
    Call MovePos(NewTool)
    While IsMoving()
    Wend
    Code "G53 Z" & ToolDown
    Code "G4 P.75"
    While IsMoving()
    Wend
    DeActivateSignal(Output1) 'Turn Off Draw bar to Clamp the tool
    Code "G4 P1.0" 'Wait for the tool to Clamp
    While IsMoving()
    Wend
    Code "G53 Z" & ToolUp
    Call SetUserDRO (1200,NewTool)
    SetCurrentTool( NewTool )

    '-----------------------------Auto Tool Zero-----------------------------

    Code "G0 X100 Y100" ' Move to Probe position
    Code "G4 P5" ' this delay gives me time to get from computer to hold probe in place
    Code "G31Z-10 F100" '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 axact 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, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
    Code "G4 P0.25" 'Pause for Dro to update.
    Code "G0 Z1." 'put the Z retract height you want here
    Code "(Z axis is now zeroed)" 'puts this message in the status bar
    Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted
    End Sub
    '---------------------------Tool Positio-------------------------------------
    Sub MovePos(ByVal ToolNumber As Integer)

    Select Case ToolNumber
    Case Is = 1
    Xpos = 120.00
    YPos = 20.00
    Case Is = 2
    Xpos = 140.00
    YPos = 20.00
    Case Is = 3
    Xpos = 160.00
    YPos = 20.00
    Case Is = 4
    Xpos = 180.00
    YPos = 20.00

    End Select

    Code "G53 X" & XPos & " Y" & YPos
    End Sub
    Main

  9. #9
    Registered
    Join Date
    Oct 2008
    Posts
    1626
    Do you have limits installed on your machine? If so home reference the machine every time power it up, and make your tool change moves in absolute coordinates, not relative machining coordinates. Am I missing something?
    Bob La Londe
    http://www.YumaBassMan.com

  10. #10
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    30700
    My "Auto tool zero" is saved as "HiddenScript" in the macro folder.
    Actually, no, it's not. The code is embedded in the button in the screenset. "HiddenScript" is just a temporary file used when the editor opens macros that are embedded in buttons. HiddenScript.m1s will hold the contents of the last file opened in the editor, and can constantly change.
    Gerry

    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)

  11. #11
    *Registered User*
    Join Date
    Oct 2013
    Posts
    6
    Dear Gerry
    Thank you for your reply
    My problem or question from the beginning was how I can find that code which is embedded in the button of screenset and how the syntax should be formulated in atc macro to call z zero macro. I have found some documents on the web but I can not figure them out. I have also noticed that there is no connection between m6Start file and m6End file. I think if I need to add some code to atc marco, so it should be m6End macro I need to modify, and not m6Start. You may say it, if you think that I am completely hopeless

  12. #12
    *Registered User*
    Join Date
    Oct 2013
    Posts
    6
    Dear Bob
    Thanks for reply
    I test the program offline, and therefore I do not use Limit function. I think I need to add something at the very beginning of the script that can zero z reference before it wears a tool change. In order to better understand my intention please look at it here Legacy Auto Tool Change with Touch and Go - YouTube

Page 1 of 2 12

Similar Threads

  1. G100 + Mach3 2010 screen auto tool zero
    By Menatep in forum G-REX
    Replies: 4
    Last Post: 05-02-2014, 11:13 PM
  2. Mach3 and Auto Tool Zero / Mach Blue Probing by Big-Tex
    By TomiY in forum Machines running Mach Software
    Replies: 9
    Last Post: 11-15-2012, 09:24 PM

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
  •