Cozmicray is right, the encoder resolution has to be better than the steppers. Which means tons of interupts to deal with. ( You can't try to poll the encoder ).
The better way is a separate cpu that reads encoder and steps and only in case of skipped steps, sends an alarm interupt to the printer-cpu.
The better way is a separate cpu that reads encoder and steps and only in case of skipped steps, sends an alarm interupt to the printer-cpu.