3018, GRBL, UGS, homing and machine coordinates

I hope this is the place for this :crossed_fingers:

I am new to using a 3018 engraver. I have been getting familiar with using the machine with UGS, have installed limit switches, and set it up for homing.

After a homing cycle, the machine coordinates become (in mm): X-199.0, Y-199.0 Z-1.0. I would like the coordinates to end up at all zeros.

I believe that the resulting coordinates are where it is after “pull-off”, ie, after the axis pulls away from the limit switch after making contact, which is 1mm.

So how does either GRBL (the firmware used in the 3018 control board) or UGS define what the resulting machine coords are after homing, and how can I change these?


Does your setting in UGS for where the origin reside match the machine? That looks like a setting between firmware and UGS is out of whack.

I’m not clear on what you’re asking, can you supply more details?

I used google and found a few examples. Here’s a video which might help: Using G-CODE files and setting ZERO in UGS | Quick Tip - YouTube

Thanks. That’s referring to setting the “soft” or workpiece zero/coords. I am talking about the machine coords. In UGS they are the smaller number below each X,Y,Z coord in the DRO pane. The machine coords after homing will always be the same. The soft zeros are volitile, and mean nothing after a power outage, in which case you’d have to start all over and find zero again. I home the machine, set up my project and set my soft zero, then record the the resulting machine coords on a piece of paper. Then if a power outage occurs I can easily get back to my zero based on the machine coords I recorded.

The machine coords it assigns after homing would (I assume) be something stored in the firmware. I was wondering if there is a way to change that.

Wanting to have the machine coords be exactly 0,0,0 after homing is probably more of an autistic thing as it makes more sense to my brain. The machine coords at the zero point of my workpiece would then reflect the exact distances from the homing position.

Might be related to your work coordinates settings. $# should list them.

See: https://www.diymachining.com/downloads/GRBL_Settings_Pocket_Guide_Rev_B.pdf

1 Like

If the machine coords after homing are 0,0,0, then after a power outage all I would have to do is home the machine and then send:

Z[some safe value above the work]
X[machineX I recorded after zeroing originally] Y[machineY I recorded after zeroing originally]
Z[machineZ I recorded after zeroing originally]

and not have to do any math (let’s see, do I subtract -199 or add?) I also wouldn’t have to record both the initial machine coords after homing, then again after zeroing. It would just be easier for my brain.

*Then set zero at this location and I’m back where I was.

Ah, nice guide to have, thanks!

home your machine and then enter at the console G92 X0 Y0 Z0 and see if that gives you 0,0,0

I should have requested you post what the $# returned but the above command should zero those stored offsets.

G92 X0 Y0 Z0 only sets the soft zero, machine coords stay the same.

Anyway, I think I have this figured out now:

I have my X,Y limit switches at -X,-Y position (“lower” “left” corner). Z limit switch is in +Z position. These are accordingly configured using $23:

$23 = 3 (Homing direction invert mask)
(See “Axis config table”: https://www.diymachining.com/downloads/GRBL_Settings_Pocket_Guide_Rev_B.pdf)

Now $130, $131 and $132 are X,Y,Z max travel, respectively. These are the values used for soft limits if enabled. In my case I had:

$130 = 200
$131 = 200
$132 = 200

In the case of my inverted homing directions, grbl is using $130 and $131 to calculate the machine position, ie:

machineX = 0 - $130 = -200(mm)
machineY = 0 - $131 = -200(mm)

This is the point where the limit switches close. After pull-off, which is 1mm,

machineX = -200mm + 1mm = -199mm
machineY = -200mm + 1mm = -199mm

as the spindle has traveled 1mm each in the positive direction.

So, I am able to accomplish what I want for X,Y using:


Of course this will only work if I don’t use soft limits (which I am not.)

The resulting Z will still always be -1mm (0 - 1mm travel after pull-off), as Z homing is not inverted. (As Z homing is not inverted, $132 has no bearing.) I apparently have no control over this* This is not a big deal to me; I can just remember to add 1 to the Z value when I resume my zero after a power outage (see 2 posts above.)

So now my settings are:

$20=0 (Soft limits disabled)
$130=1 (X - Max Travel)
$130=1 (Y - Max Travel)
$132=30 (Z - Max Travel) (inconsequential here actually)

The resulting machine position after homing is now 0,0,-1


*Actually, I came across something which talked about telling the firmware to use the after pull-off position rather than the limit switch break position to set machine zero. However, 1) I have not been able to find it again :frowning: , 2) It may have been for some firmware other than grbl, because I see nothing in $$ which would indicate a setting for that.

1 Like