584,802 active members*
4,769 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 22
  1. #1
    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
    Join Date
    Mar 2003
    Posts
    35538
    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

    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
    Oct 2008
    Posts
    2100
    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
    Join Date
    Mar 2003
    Posts
    35538
    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

    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
    Oct 2008
    Posts
    2100
    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
    Join Date
    Mar 2003
    Posts
    35538
    No, the OP was.
    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)

  7. #7
    Join Date
    Oct 2008
    Posts
    2100
    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
    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
    Join Date
    Oct 2008
    Posts
    2100
    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
    Join Date
    Mar 2003
    Posts
    35538
    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

    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)

  11. #11
    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
    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

  13. #13
    Join Date
    Oct 2008
    Posts
    2100
    Thank you for the video. I always like to watch good systems work. I was just making sure you understand that if you are to setup well for a consistent process that is always relative to an exact position on the machine you really need to be working with two sets of coordinates.

    One set is zeroed when you reference your machine home, and those are absolute machine coordinates.
    The second set is zeroed relative to the part when you setup a job.

    Your tool changes should be based on absolute machine coordinates.

    You can have lots more sets of coordinates than that when you start setting up different offsets if you have fixed fixtures and jigs on your machine, but that will get you started.
    Bob La Londe
    http://www.YumaBassMan.com

  14. #14
    Join Date
    Mar 2003
    Posts
    35538
    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.
    If the auto zero macro is in the button, then you can't call it from the tool change macro. If you save the auto zero macro as M1111.m1s (Can be any unused M code #), then you can call it from the ATC macro with :
    Code "M1111"

    But, as I said before, I wouldn't recommend doing it that way.

    Couple questions about your macro.

    1) How are you setting Z zero? Are you placing a plate on the workpiece?

    2) How do you plan to auto zero after the tool change? What is at X100 Y 100?
    What Bob was saying above, is that it's bad practice to use:

    Code "G0 X100 Y100" ' Move to Probe position

    The reason is that this position is in the current work coordinates, and will change if you change your X and Y zero positions.

    You should be using:

    Code "G53 G0 X100 Y100" ' Move to Probe position

    Which moves to X100 Y100 in Machine coordinates. So, as long as you home the machine each time you turn it on, it will ALWAYS go to the same spot.


    If you are setting Z zero to the top of your workpiece, then running the auto zero at X100 Y100 will NOT set Z zero to the correct height unless X100 Y100 is also the top of your workpiece. You probably need to implement a fixed plate in addition to a moveable plate, and do it like I do in my 2010 Screenset or the Big Tex screenset. The difference between the two plates is stored in the screenset, and is used to set Z zero after a tool change. Watch the video to see how it works.

    Mach3 2010 Auto-Zero - YouTube

    I believe that what they are doing in the video only works because they are setting Z zero to the center of the rotary axis, so it never changes.

    Also, if you have Mach3 configured for ATC on M6, then M6End is NOT used at all. When Mach3 sees an M6, it will run M6Start, and then continue on with the g-code.
    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)

  15. #15
    Join Date
    Oct 2008
    Posts
    2100
    Not to muddy the waters, but they could have an offset programmed for the rotary axis in the OPs posted video.
    Bob La Londe
    http://www.YumaBassMan.com

  16. #16
    Join Date
    Mar 2003
    Posts
    35538
    Then it would only work for stock of a specific dimension.
    You normally can't change tools and auto zero to a fixed location unless there is some reference between the actual zero position and the position you are zeroing to.
    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)

  17. #17
    Join Date
    Oct 2008
    Posts
    2100
    I would have the offset set to center of the axis, not stock surface. You have a tool zero, and then you program the offset to the center of the axis from there. Designing parts is no harder. You just set your stock surface at the starting radius of your stock in CAM.

    I know, in ordinary 3 axis milling we usually set stock surface to zero, but we don't have to. We can use whatever is convenient for the machine setup or the part geometry.

    Anyway, I am muddying the waters and probably not helping the OP by going off on this tangent.
    Bob La Londe
    http://www.YumaBassMan.com

  18. #18
    Join Date
    Mar 2003
    Posts
    35538
    I would have the offset set to center of the axis, not stock surface. You have a tool zero, and then you program the offset to the center of the axis from there.
    What's the point of that, as they're both basically the exact same thing. Unless you want your zero plate at some other Z height.

    I know, in ordinary 3 axis milling we usually set stock surface to zero, but we don't have to. We can use whatever is convenient for the machine setup or the part geometry.
    But if you zero to a fixed location like in the Legacy video, you're Z zero MUST be the same every time, a fixed location from the plate. Or, you need to use a dual plate technique.

    My assumption is that the OP isn't using a rotary axis, but that just happens to be what the video is showing?
    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)

  19. #19
    Join Date
    Oct 2008
    Posts
    2100
    In the video he shows they are not the same thing. Atleast it does not look like it to me. The point might be that you can have preprogrammed offsets for lots of things. The corner of a vise square on the table, the center of a lathe chuck used for holding round parts, and the center of the axis of a rotary axis on the machine. You could also have your z-zero plate out of the way below the table or some other location as it appears to be in the video clip we saw.

    I've recently started playing with things like this on my big (big for me) milling machine, and its really convenient to always know exactly where the corner is of all three vises I have bolted to the table. I don't even have to go there and zero. I just refference home and select the preprogrammed offset.

    Anyway... I don't think this is really helping the OP. Not yet anyway.
    Bob La Londe
    http://www.YumaBassMan.com

  20. #20
    Join Date
    Oct 2013
    Posts
    6
    Dear Gerry and Bob
    I really appreciate your feedback, it has helped me a lot
    My plan is actually that the machine would automatically zero absolute coordinates with the fixed mounted limit switches at start up (using a specific button ) . But it is another separate project. I am as I said before not an expert in this area and that is why I have to take it step by step.
    Bob ,,,, Immediately I assume the macro written in my previous thread is based on absolute machine coordinate. ( I'll test it for a job that involves several tool changes )
    And now I'm going back to Gerry's questions
    I have an idea to place a permanent reference plate in the same row as the tools and the code would be something like , Code " G53 G0 X80 Y20 " ' Move to Probe position (thanks Gerry )
    I thought obviously I could settle for a fixed mounted reference plate by determining workpiece height in the cam file, but I am now unsure whether this is possible ! ?
    Once again Thank you Gerry for the exciting video with many inspiring features. I will in near future download both screenset and related document to see what I can learn about it

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, 10:13 PM
  2. Problema con "Auto Tool Zero" en Mach3
    By lamartinada in forum Spanish
    Replies: 0
    Last Post: 11-23-2013, 11:51 AM
  3. 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
  4. 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
  •