First, switching the drive on and off should not have any effect (excecpt maybe a few stray encoder counts) switching the controller on and off is what will cause you to lose track of position.
One posible solution is to use an anolog feedback rather than an incremental quarature encoder. With analog feedback your postion is absolute rather than rleative.
The other solution is to move to a known location. This is done by using either a home or a limit switch. Take a look at:
Home and Index in Motion Control.
Regards,
Amaury
NI Applications Engineer