Basically you will need to keep track of how many steps the motor moves. I would guess that the motor will not be allowed to move randomly, so if the "first command" is 20 steps CW " then the second command" of 20 steps CCW would bring it back.
I the motor can be moved by something else and the "start and end" position needs to be found a simple two position Encoder could be rigged. A switch at each position. When the switch is hit the counting of steps begins.
Bookmarks