Hi,
My reason for doing it was to make it possible to save the position for all coordinates and then be able to shut down the machine and pc (for what ever reason) in a random position. Then I could start it all again (the next day maybe) and load all positions and continue where I stopped.
The correct approach is to at the start of the new session reference (home) your machine and THEN using your stored
work offsets resume the job from where you left off. For this to be effective you need accurate homing. I use roller plunger
microswitches and achieve 0.02mm repeatability. Using index homing would allow even closer (1 um) repeatability
but as it transpires 0.02mm is adequate for me.
You can, as you have done, use persistent registers, or you could write them to a file. I do this with circuit board programs.
The file name of the stored data is the same as the Gcode etch file with "OFFSET' appended.
Note however that such explicit methods are strictly not required because the current Work Offsets (G54, G55, G56....etc)
are stored at shutdown and restored at restart, ie they are stored in persistent registers.
If you shut down your machine and record both the work coordinates and the machine coordinates and then restart the machine
and restore the coordinates at restart. That would work IF the machine did not move, you can usually be assured that is so.
However if you use microstepping with your steppers then in effect your machine will 'move'. Lets say you use 1/8th
microstepping. At the moment of shutdown (when you recorded your coordinates) the machine was at the third of the eight
microstepps between full step positions. When you restart your stepper driver will be at a fullstep position and you will
have lost that 3/8th of a step. Having said that the loss of precision is likely to be small and may well be tolerable.
There is a workaround that would allow you to proceed with that solution if you wish. It relies on doing an effective
'home in place' at the end of your session and then at restart programmatically unlinking the motors and doing a 'dummy
move to the stored original machine coordinates' doing another 'home in place'.
I have one this before, it was confusing as hell but it did work. Let me know if you want further details.....you poor sick little
puppy!
Craig