The fault is rarely in software: it is the belt, the pulley grub screw, or an overheating stepper driver. How to eliminate each in turn.