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?
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.
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
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
Grbl Wiki has an FAQ about that: Why is Grbl in all negative coordinates after homing? Or it so annoying and not what I'm used to
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.