Stepper motor error.
There are 2 homing errors possible with stepper motors;
1. Mechanical (jumped steps)
This is the easy one. If a stepper motor is overloaded physically by some problem it will "jump steps". The armature of the stepper motor jumps to another position in the motors magnetic field. This commonly happens when your cutting tool tries to cut too deep or your machine tries to move too fast etc.
A typical 200 step motor has 4 full steps, times 50. So there are exactly 50 positions on the magnetic field and when it jumps steps it must jump to one of them. So the minimum error is exacty 1/50th of a rotation, or 7.2 degrees. So it is easy to detect if the motor has jumped steps, and easy to correct.
I forced my X axis motor to jump once, and recorded the results;
(before jump)
992 873
992 873
993 873
992 873
992 873
(after jump)
1008 873
1008 873
1007 873
1007 873
1007 873
The X axis is showing an error of about 0.16mm in each step, which is because my X axis leadscrew moves 0.16mm for every 7.2 degrees of motor rotation. Obviously it has jumped exactly one magnetic "pole" and the software can easily compensate by moving the machine 0.16mm.
2. Software/electrical (step pulse error)
This one is a little harder. If your software has glitched or your electricals have experienced a spike or surge, then the stepper motor driver may have received additional "step" pulses or lost "step" pulses.
The amount of error could be anything, in the resolution of your driver (ie in microsteps).
This error is hard to detect, as it may be smaller than the repeatability of your machine. If you get a fault like this the best solution would be to turn the drivers off, and when the drivers start up again they will be on the "home" step. Then you can do the test above and align the steppers to the correct 7.2 degree magnetic "pole" giving zero step error.
Homing procedures?
Obviously it is going to be up to your CNC software to decide how to handle initial homing (at turn on) and detect/correct homing errors.
The good news is for initial homing that it only needs to detect within +/- 3.6 degrees of motor rotation to find the correct magnetic pole, and then the system can be aligned to zero microstep error.
If your software re-homes everytime it goes back to the sensor, this can be good as it will compensate for errors or thermal expansion etc, but can be bad as it will always be changing.
I would be interested in hearing other people's homing/correction methods, or those used in standard CNC software. It might be good to start a discussion of the homing technique and possible changes to the sensor setup that might improve homing accuracy!
For my system I am currently aligning to the correct stepper magnetic pole and then using the native accuracy of the machine so technically there is zero microsteps error after homing, and any real error is caused by the mechanicals of the machine.
That's all I have for now, please comment and if you want me to do any specific sensor tests just speak up.