FocusPaul,
You are getting much closer to understanding how things work. Good Job. I am not rich either and do not have absolute encoders on my machines. Ha Ha
G54 is one set Work Offset Coordinates, you can have others like G55, G56, G57, G58, G59, see the link below for an entire explanation
http://www.cnccookbook.com/CCCNCGCodeG54G92WorkOffsets.htmYou can actually save work offset coordinates inside of most CNC software programs like Mach3, Mach4, KmotionCNC, LinuxCNC, etc.
In Mach4, if you go to the "Offsets" tab at the top of the screen, and then to the "Fixture Table" button at the top middle of the screen. You will find a fixture offsets table. You can record various fixture offsets that you use repeatedly. Perhaps you have a fixture you position on your table in the same place each time you run a certain job. It is located at X=14.5, Y=15.6, if you record this in the table then after you home your machine and zero the DROs you can just put a G54 in your gcode and it will move to this offset location. Think of a garage at your house maybe it is a two car garage and you always park your Mercedes in the right garage and your Porsche in the left garage. In the case of your machine maybe you build guitars and you also machine the Neck at a certain position on your table, maybe G54, and then you might have another fixture that does the top of the guitar and the hole cut out, and you have that located at G55.
Now many users especially hobby users run one off jobs so they just do the G54 on the fly, they bolt down the material on their table and job over and find the corner of the material and zero the DROs and that is their G54.
"When I close M4 on machine position (X;Y)=(40;40), am I wrong in suspecting that M4 comes up with that latest machine coordinates it recorded?"
YES, Mach4 will come up with the last saved G54 position. So if you home your machine, zero the DRO and jog to 40,40 and then zero the DRO for X,Y, at that point Mach4 has G54 defined as 40,40
If you exit M4 now it will ask if you want to save the job position, if you say YES it will record 40,40 so when it starts up again it will show -40,-40, if you say NO it will keep that last recorded G54 position used.
If you want M4 to come up and show 0,0 when it starts, you need to home the machine before you turn off the machine and then zero the DROs and then exit. This way the M4 will know that no G54 position needs to be remembered.
"Of course, M4 cannot know if I have moved the mechanics while the software has been offline. So is M4 resetting machine coordinates to 0;0 on every start-up because it cannot know the "exact" position (missing encoders)?"
Absolutely TRUE, if you move the axis without Mach4 it has no idea of where things are when it starts. This is why we always must home the machine after startup so that is when it finally knows where it is on your given table. Very important to home the machine at the beginning. Let me give you an example of why this is important.
You start cutting a job and it is half way done, and suddenly your spindle hits a clamp you used to secure the material to the table. It breaks your cutting tool and you react and hit the ESTOP. After you stop shaking and calm back down you change the broken bit and now MACH4 is flashing because of the estop. You now need to home the machine, because you might have lost steps due to the accident and the location could be off slightly. Now after you home M4 again knows it is a absolutely 0,0. Now how will M4 get back to your G54 location. One way is to exit and have M4 save the location then start again, home, and G0 X0 Y0 will take you back to your job start location. I make it a habit to record my G54 location before a big job in Absolute Coordinates and write it on paper. This is a safeguard, so I know I can get back to the right spot. Once I zero my X and Y at the corner of my job, I then turn on absolute coordinates and record them, then I turn them off and I am back to zero zero for G54. Now you can restart the job and you will be exactly lined up again. You can also use the tool RUN FROM HERE to avoid doing the first part of the job again.
"It all comes down to: Why does it zero the machine coords on every start-up?"
Mach4 zeros machine coordinates when it starts because that is the only way it has of know exactly where it is on the table.
Think of it this way. When you turn on a Garmin GPS so you can find that wonderful Bar and Restaurant you have heard so much about, what is the first thing the GPS does? It has to find out where are you now. Then after it gets the satellite signals it shows where you are on a map. Now it can route you to your destination. If it never found your "HOME" position it has no idea how to send you on your way.
Understand now?
Russ