Welcome to Our Community

Some features disabled for guests. Register Today.

CONTROL - help making macros to move router to back corner?

Discussion in 'Control Software' started by CartesianPlain, Apr 19, 2021.

  1. CartesianPlain

    Builder

    Joined:
    Oct 29, 2020
    Messages:
    10
    Likes Received:
    1
    Hey everyone,

    So first of all - big thanks to the people that made CONTROL. The software is working flawlessly and is really easy to understand and has helped me through my first CNC experience.

    I want to make a few MACROS that move the cutting head out of the way, say to the back corner. I attempted my first macro by adding a G0 to the X and Y of the back corner. This worked great until I ZERO'd the machine at the work piece, thus changing the coordinates of the back corner.

    What is the proper way to send the cutting head to an absolute position on the machine? And what are the other best practices for adding macros? Do I need to add any G-Code before my movements to specify units, or add any G-Code after to reset anything back to a useable state?
     
  2. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,761
    Likes Received:
    1,352
    Use the machine co-ordinates - if you just use G0 it stays in the current workplace co-ordinate system. If you put G53 at the start of the line followed by your G0 move it will, for that line only, move to the machine co-ordinate you specify. If its the same position you want to move to every time you can use G28 and G28.1 - after you have homed the machine go to the point you want grbl to remember and send G28.1. When you want to go to that position send G28. Remember though to keep an eye on your Z clearance - it will go to the position you set by the most direct route, regardless of anything that is in the way.
    Alex.
     
    sharmstr likes this.
  3. CartesianPlain

    Builder

    Joined:
    Oct 29, 2020
    Messages:
    10
    Likes Received:
    1
    Thank you Alex, I just tried your G53 suggest. My macro was:

    Code:
    G20
    G53
    G0 Z0
    G53
    G0 X31 Y30
    
    Unfortunately this did not work as I had hoped. After homing the machine, this command worked as expected. But if I was to ZERO the machine at a different location, this macro still wanted to move relative to it. I'm ZEROING the machine in CONTROL by jogging to a point and then hitting the SetZero XYZ button - which I'm under the impression zeros the "work" coordinates, but as you described shouldn't affect a move to the machine coordinate with G53 - but it was not behaving that way.

    Mike
     
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,750
    Likes Received:
    4,265

    Needs to be on ONE LINE :): Ie "G53 G0 Z0"
    See G Codes

    and above

     
    sharmstr and Alex Chambers like this.
  5. sharmstr

    sharmstr OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 23, 2018
    Messages:
    2,059
    Likes Received:
    1,448
    Another issue you may run into is your move to Z0. If you are homing with limit switches, then G53 G0 Z0 will hit your switch. Ideally, you want to use the same value as your pull off value in grbl settings. Something like G53 G0 Z-5
     
  6. CartesianPlain

    Builder

    Joined:
    Oct 29, 2020
    Messages:
    10
    Likes Received:
    1
    Got it thanks everyone. Also took some figuring out that the back-right corner is "machine zero" :)
     
  7. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,750
    Likes Received:
    4,265
  8. CartesianPlain

    Builder

    Joined:
    Oct 29, 2020
    Messages:
    10
    Likes Received:
    1
    Thanks sharmstr, I found this out the hard way as well :)
     
    sharmstr likes this.
  9. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,761
    Likes Received:
    1,352
    Best way to learn - those lessons tend to stick. :rolleyes::)
    Alex.
     
    sharmstr likes this.
  10. sharmstr

    sharmstr OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 23, 2018
    Messages:
    2,059
    Likes Received:
    1,448
    I just realized I gave you mm values. For the sake of any newbies finding this thread later, please note that the code posted by CartesianPlain is in inches. My suggestion to use Z-5 is in mm. Yikes. :)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice