Hello Guest it is July 18, 2026, 09:30:26 AM

Author Topic: G54 work offset changes after re-homing  (Read 1817 times)

0 Members and 1 Guest are viewing this topic.

G54 work offset changes after re-homing
« on: June 26, 2026, 09:28:10 AM »
Hi everyone,
I've been using Mach4 on my hobby CNC router for about six months and recently ran into a problem that I haven't been able to solve.
My normal workflow is to home the machine, set my G54 work zero with an edge finder, and run the first operation. If I stop the machine, power off the spindle, and later re-home the machine without touching the workpiece or vise, the G54 offset appears to have shifted. It's usually between 0.15 and 0.30 mm in X, while Y is almost always correct.
I first thought it was mechanical, so I checked the couplers, motor mounts, backlash, and limit switches. I also repeated the homing cycle five times in a row, and the machine consistently returns to the same machine coordinates. That makes me think the homing itself is accurate.
What's confusing is that the shift only shows up when I go back to the saved work offset. If I re-indicate the edge and set G54 again, everything lines up perfectly.
I'm using an Ethernet motion controller with the latest plugin, and the issue started a couple of weeks ago. I haven't changed my motors or switches, only updated Mach4.
Has anyone seen G54 behave like this after a software update? Is there a setting related to fixture offsets or work coordinate persistence that I should check before I start rolling back versions?
Thanks for any ideas.

Offline Tweakie.CNC

*
  • *
  •  9,362 9,362
  • Super Kitty
Re: G54 work offset changes after re-homing
« Reply #1 on: June 26, 2026, 10:33:22 AM »
What is the make and model of the motion controller you are using ?

Tweakie.
PEACE
Re: G54 work offset changes after re-homing
« Reply #2 on: June 26, 2026, 04:48:09 PM »
Hi,

Quote
If I stop the machine, power off the spindle, and later re-home the machine without touching the workpiece or vise, the G54 offset appears to have shifted. It's usually between 0.15 and 0.30 mm in X, while Y is almost always correct.

I think the problem is your use of Re-Home.

In an ideal world you'd be able to Home to the exact same location every time, but it reality even with the best home switches there is some 'dither'.

Remember that G54 is a group of numbers that describe the location of the Work Zero, or Part Offset if you prefer, FROM the Machine Zero point in machine units.
Lets say that the current G54 is x=210.5,y= 300.65,z=  100.8. Thus if you home the machine and then hit <GoTo Work Zero> the machine will move to x=210.5, y=300.65 (in machine coords) from
the machine zero (the DROs will display 0,0 in work coords)........but if that machine zero has differed at all, in any axis, since the last time you homed then the Machine Zero location will be out by the same difference.

I use Omron roller-plunger snap action microswitches for my home switches. I like them because of reliability and that they have a well defined and specified hysteresis. As a consequence I can
Home to within 0.02mm time after time.

Were you to use proximity switches they will often exhibit a range of 0.1mm to 0.5mm where the switch activates, and that could very easily describe the difference you are observing.

Some motion controllers, including the Ethernet SmoothStepper that I use allow the use of Index Homing. Thus if you Home the machine the machine will home to your existing switch, but THEN
move until that axis servo/stepper matches its index mark. The idea being that with regular mechanical or proximity switches you might achieve 0.25mm repeatability but with Index Homing you
could improve that to just a few um.

It was always my intention to use Index Homing on my machine, but I find that just the good snap action microswitches are good enough on their own without the extra complication of Index Homing.

To summarize I think your problem is caused by your machine not re-homing the the exact same location time after time.

As a matter of interest I seldom, if ever, turn my machine off, it will remain turned on for weeks or even months at a time, and  I'll Home but occasionaly. If the machine is on and it does not lose
reference due to a <Stop> or <Estop> then it does not need it.

Craig
« Last Edit: June 26, 2026, 04:50:33 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline cncmagic

*
  •  137 137
  • what me worry? heck...it ain't my machine anyway
Re: G54 work offset changes after re-homing
« Reply #3 on: July 09, 2026, 09:08:35 PM »
the accuracy of the Homing procedure is probably your issue. On my machine I have actual servos... so when they home, they hit the limit switch and then back off until they 'see' their encoder 'z' pulse... that's always the exact same place in their rotation. And eliminates any small discrepancy with a mechanical limit switch. If you are using only a limit switch, the accuracy will depend on the switch repeatability and the Homing speed. You can't eliminate this even if your homing procedure moves (backs off) some distance from the switch contact.  :o
any semblance of information posted to anything remotely  close to accuracy is merely coincidence. Use at you own discretion.. or play the lottery.. same odds
Re: G54 work offset changes after re-homing
« Reply #4 on: July 13, 2026, 05:29:36 PM »
Hi,
Mach4 has always done that, as did Mach3 before it.

The native homing procedure is:
1) the axis to be homed advances in the programmed direction at the programmed homing speed (as set in the Mach Control plugin)
2) On home switch activation the axis decelerates to a stop. Once the motion controller signals that the machine has stopped it then reverses that axis at the back-off velocity (as programmed in the
motion control plugin)
3) When the switch deactivates the motion controller decelerates the axis to a stop.
4) When the motion control signals Mach that all axes are stopped the Mach latches the axis position as reported by the motion controller in integer step units and resets Mach Machine Coordinate
Counter to zero.

There are a few variations on that general theme. For example instead of setting the Machine Coordinate counter to zero, Mach may set it to some Offset as programmed in the Mach Control plugin, Homing Tab.

Note that Mach does NOT provide a means to back off a certain distance, and never has. Starting, at first I believe with the PoKeys 57CNC motion control you could program the motion control to back-off
the home switch a programmable distance, as set in the motion control plugin. Many people found that useful and consequently all the other motion control manufacturers copied the same thing.
Thus when you program your machine to back-off the home switch by 75mm say, the actual process is that the axis homes to the switch until it activates, then backs off until the home switch deactivates,
i.e. the standard Mach homing procedure, but then the motion control drives an extra certain distance.

Index homing is another feature that is not native to Mach. It is a feature offered by the motion control.

The homing procedure with Index Homing is that the axis homes toward the home switch until it activates, then backs off only until the home switch deactivates, as per normal and standard Mach homing procedure
but then the motion control carries on the rotation of the axis stepper or servo UNTIL its index switch is activated. Then and only then does it signal Mach that all axes are stopped and Mach can latch
the machine position. That this is a feature of the motion control note that Index Homing is programmed in the motion control plugin.....not Mach's Control plugin.

So both programmable back-off distance and Index Homing are both features of the motion control and are not in fact native to Mach at all.

Note also that in every instance the core homing procedure is that the axis advanced is at the programmed speed and direction UNTIL the home switch goes active and then backs up UNTIL the switch
again goes inactive.
This places a very strict demand to the repeatability of a  home switch to activate and then reliably and precisely deactivate. Most people assume that a switch with zero dead-band is
the ideal, but in fact this is incorrect. Snap action microswitches has a very precise and repeatable dead-band, also called hysteresis, and thus despite having a difference in the moment of activation verses
deactivation they perform extremely well as home switches, better in my opinion than proximity switches which have at best, a poorly defined hysteresis.

Craig
« Last Edit: July 13, 2026, 05:36:18 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline cncmagic

*
  •  137 137
  • what me worry? heck...it ain't my machine anyway
Re: G54 work offset changes after re-homing
« Reply #5 on: July 14, 2026, 05:48:10 AM »
that's not the same thing... you are still relying on the mechanical switch contacts break and make... as I said, my system does it's procedure outside of Mach4 and uses the 'z' marker on the servo encoder. With the gearin I have and the encoder count, even being off a count or two, gives me an accuracy in excess of 0.0000001" repeatability.  :o
any semblance of information posted to anything remotely  close to accuracy is merely coincidence. Use at you own discretion.. or play the lottery.. same odds

Offline cncmagic

*
  •  137 137
  • what me worry? heck...it ain't my machine anyway
Re: G54 work offset changes after re-homing
« Reply #6 on: July 14, 2026, 05:52:35 AM »
and its not a process from my motion controller... the servo's have their own built in homing procedure. Usually even the motion cards/modules don't use the 'z' marker either. They are only as accurate as the switch make and break repeatability and their own characteristics. Could be off by thousands of an inch repeatability.  :o
any semblance of information posted to anything remotely  close to accuracy is merely coincidence. Use at you own discretion.. or play the lottery.. same odds
Re: G54 work offset changes after re-homing
« Reply #7 on: July 14, 2026, 03:02:42 PM »
Hi,
I use Delta servos, and they too have their own homing procedure but I don't use it. I still use Machs homing routine and features.

Quote
you are still relying on the mechanical switch contacts break and make...

That is correct, and yet with quality snap action microswitches those switch activation and switch deactivation points are well specified and repeatable. As I posted earlier I get
0.02mm repeatability with good snap action microswitches. It was always my intention to refine that using Index Homing, as my ESS offers that feature......but I soon realised that 0.02mm
or eight tenths of one thousandth of an inch is in fact pretty damned good and I don't really need more than that.

Quote
gives me an accuracy in excess of 0.0000001" repeatability.  :o

I can well believe that you can calculate that level of precision but will not get within a bulls roar of it in practice. The thermal expansion of a steel ballscrew is vastly more than that.
The thermal coefficient of expansion of steel is 12um per degree C per meter. Thus if your ballscrew is say 600mm long and the temp varies by 4C from yesterday when you homed last then
the variance when you home today is 0.6 x 4 x 12=28.8um or 1.1 thousandths of an inch if you prefer. What advantage actually materialises when thermal expansion alone may be
many more times the resolution of you homing routine?.

Once I realised just the thermal expansion alone would well and truly exceed the resolution of  Index Homing (as I originally intended to do) and  was not going to make my machine
any better in practice, then I decided against the extra complexity(of Index Homing). Indeed my mother warned me that indulging in such self deceiving practices would likely be bad for my vision!

Craig
« Last Edit: July 14, 2026, 03:06:54 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline cncmagic

*
  •  137 137
  • what me worry? heck...it ain't my machine anyway
Re: G54 work offset changes after re-homing
« Reply #8 on: July 14, 2026, 05:37:57 PM »
yes... you can't actually calculate your accuracy without knowing the expansion of the components, this is simply a calculated number..... however if you calculate that your best accuracy is +/- 0.010" then don't be surprised when in practice you only manage +/- 0.030" or worse. . but when I design motion systems I need to know the necessary accuracy required and ensure that my gearing and other components are well with my spec. I normally go at least 10x my required accuracy. So if I need 0.001" then my design needs to show at least the ability to repeat within 0.0001"... we are drilling a 0.007" hole in a fuel nozzle... so repeatability was a major concern. Now, I didn't expect to hold 0.0001" in actual practice... parts needed to go into a fixture, but if I can show that the motors themselves could hold +/- 5 counts, and a count was 0.00005" then I could say my tolerance was +/- 0.00025" theoretical. I also need to determine the max rpm for my ballscrew (i try not to run them higher then maybe 60% of the max) and likewise the max pulse rate (freq) that both the servo and the motion board can manage. Again, I try to stay well below the max for either. just good design practices  :o
any semblance of information posted to anything remotely  close to accuracy is merely coincidence. Use at you own discretion.. or play the lottery.. same odds
Re: G54 work offset changes after re-homing
« Reply #9 on: July 14, 2026, 06:40:51 PM »
Hi,
I use 5mm pitch ballscrews direct coupled to the servos. I have used the electronic gearing feature of the servo drives to effectively have a 5000 count per rev encoder, which in
turn results in a linear resolution of 1um (0.000039"). As a matter of practice I consider the smallest usable resolution of my machine is 5um (0.0002").

I have measured the repeatability of my homing procedure and it is at worst 0.02mm or 20um (0.0008"), and mostly it 0.01mm or 10um (0.0004"). Note that this is just with
good quality snap action microswitches. That I could do better by using Index Homing is not especially relevant as the homing procedure as is good enough.

Every once in a while I will mill a piece of aluminum with a 20mm or 25mm diameter boss and then very carefully measure how 'out of round' it is. The last time I did it was, about six months ago,
 9um (0.00035") out of round. This is a highly practical test, not only measuring the absolute accuracy of your machine but also its repeatability (multiple passes are taken and thus
any irrepeatable deviation would be obvious) while under actual cutting conditions, thus including flexure of the tool, spindle and machine, albeit under lightly loaded conditions but actually loaded.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'