585,665 active members*
2,987 visitors online*
Register for free
Login
Results 1 to 14 of 14
  1. #1
    Join Date
    Nov 2017
    Posts
    591

    Zeroing machine coordinates on 1 axis?

    Im doing some work on my 4th axis that requires many turns, basically like a lathe would but with an endmill. Here's the issue, after running code like this, my A axis has made many rotations, sometimes 30 or more. Afterwards I want to get my A axis back to machine zero and this takes forever. My machine doesn't use home switches, it just has a stored location that machine moves to for home. If I send the machine home, it moves very slowly since the A axis has to unturn all those rotations. The other thing I can do is move the machine to x,y,z home position and then ref all home to zero everything including A without having to unturn all those rotations.
    Is there a better way to handle this? Like simply enter a code to zero A axis machine coordinates where it sits? If I can't do that, is there anything else I can do to make this easier? Typically I'm hand writing this type of code and use multiples of 360, so having it first move to a consistent angle isn't a concern since it's already there, just need it to zero in place

  2. #2
    Join Date
    Mar 2003
    Posts
    35538

    Re: Zeroing machine coordinates on 1 axis?

    Ref A
    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
    Nov 2017
    Posts
    591
    Quote Originally Posted by ger21 View Post
    Ref A
    I can put in a line of code "ref A"? Or there's a button somewhere? If it's a button, I haven't seen it, only ref all

  4. #4
    Join Date
    Mar 2003
    Posts
    35538

    Re: Zeroing machine coordinates on 1 axis?

    There's a button on the Diagnostics page.
    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
    Nov 2017
    Posts
    591
    Quote Originally Posted by ger21 View Post
    There's a button on the Diagnostics page.
    Ah, perfect. Thanks!

    If I wanted this to happen automatically in a program, how would I go about that? Could i do it with a simple macro?

  6. #6
    Join Date
    Nov 2017
    Posts
    591

    Re: Zeroing machine coordinates on 1 axis?

    I found the oem code, 1025. How do I activate this code in a macro? Still very new to scripting

  7. #7
    Join Date
    Mar 2003
    Posts
    35538

    Re: Zeroing machine coordinates on 1 axis?

    DoOemButton(1025)
    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)

  8. #8
    Join Date
    Nov 2017
    Posts
    591
    Quote Originally Posted by ger21 View Post
    DoOemButton(1025)
    Excellent! Thank you

  9. #9
    Join Date
    Nov 2017
    Posts
    591
    Quote Originally Posted by ger21 View Post
    DoOemButton(1025)
    Ok, wrote the macro, named it m100 (tried as m100 and m100.m1s). When running it in vb editor, it works as expected. When using it in gcode or by itself in mdi, does nothing.

    Ok, renamed it m3, works now. How do i know what m codes are useable? Originally picked m100 because it wasn't in the m code list and was easy to remember. Any specific reason why it didn't like m100?

  10. #10
    Join Date
    Mar 2003
    Posts
    35538

    Re: Zeroing machine coordinates on 1 axis?

    Try values over 300. I don't recall which are reserved. Over 1200 might be safer.
    If you use M3, then your spindle probably won't start any more.
    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
    Mar 2003
    Posts
    35538

    Re: Zeroing machine coordinates on 1 axis?

    Not sure what kind of results you'll get running it from g code, but add this after it.

    While IsMoving()
    Wend
    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)

  12. #12
    Join Date
    Nov 2017
    Posts
    591
    Quote Originally Posted by ger21 View Post
    Not sure what kind of results you'll get running it from g code, but add this after it.

    While IsMoving()
    Wend
    Crap, not sure why I didn't remember m3 was spindle on. Indeed the spindle will not start. How do I get it back? What does the m3 macro look like? Odd thing is, I saw the m3 on list of my macros, I opened it and it was blank, so figured it was for nothing so used it for the ref A. What should be in there?

    Ok, figured it out. Looked at m4, same but cw instead of ccw

    Saved the ref A as m1200. Seems to work fine without the while wend and I don't think I overwrote anything this time. I think I should probably start saving xml before messing around in the future

  13. #13
    Join Date
    Mar 2003
    Posts
    35538

    Re: Zeroing machine coordinates on 1 axis?

    I believe it's DoSpin(CW)
    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)

  14. #14
    Join Date
    Nov 2017
    Posts
    591
    Quote Originally Posted by ger21 View Post
    I believe it's DoSpin(CW)
    Yep, it is. Figured it out by looking at the m4

Similar Threads

  1. For crating VB Macro for zeroing tool, and rotating working coordinates
    By zeox in forum Mach Wizards, Macros, & Addons
    Replies: 1
    Last Post: 03-04-2017, 07:22 PM
  2. Properly zeroing axis on 4th axis setups
    By bebob1 in forum CNC Tooling
    Replies: 1
    Last Post: 04-16-2012, 02:27 PM
  3. V2XT Zeroing Z-Axis
    By slowbob in forum Bridgeport / Hardinge Mills
    Replies: 3
    Last Post: 01-27-2011, 07:32 PM
  4. Zeroing A Axis
    By findor in forum G-Code Programing
    Replies: 3
    Last Post: 10-30-2009, 11:59 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
  •