Thanks for the replies, I have looked into motors with fitted encoders, and they would certainly solve the problem of missing steps, but they are all beyond what I can afford.
The main gist of my question relates more to the behaviour of G28.1;
For instance, if this line appears in my gcode:-
G28.1 Y40
the DRO reads down from 40 until the home switch is triggered, then instantly reads 547.0000.
If I film the DRO, and slow the film down to maybe 3 frames a second, I can see what value the DRO was showing the instant the switch was triggered.
THAT is the value I want to be able to read into a variable in a macro, as it tells me how far the machine travelled in order to get to the switch.
What I would like to know is, how can I do something just like G28.1, but without it 'jumping' to the value 547 or whatever when the switch is tripped.
I know I can do 'G31 Y0', if my Y home switch is also configured as my probe, but I already use a different switch as my 'probe', with the Z axis. And as far as I can tell, mach only allows you to configure one port/pin as a probe.