Method for automatic alignment recovery of a spur gear