xyproblem perhaps:Why use a stepper motor? You wouldn't "shut off" a stepper, it would lose position.Do you need hold position and have a small range of movement, suggests either a servo or a small DC motor+worm-gear+limit switches.What is the scale of this anyway - how much torque is needed? How rapidly does theshaft need to turn? How much angular accuracy is needed?
Why use a stepper? It's what is available at the time without additional purchases.
Scale? Rather small. Talking shaft sizes of 6mm.Speed .... Very slow. It will take 30 minutes to go from one stop to the other.
Accuracy... Not all that important. As long as it stops/starts from close to physical stops. And rotates smoothly and at a steady pace.
Torque .. A little is necessary and the motors available are geared up a bit.
It does not damage a stepping motor if the shaft rotation is blocked while it is powered. Simply put a perpendicular pin through the shaft, and add some external means to block the shaft rotation at 8 o'clock and 4 o'clock. Send more than enough steps to accomplish the total rotation in the desired direction, and you are done.
What would be the best method for the system to know where the motor is positioned and which way to rotate?
if it stopped in the middle would it matter which direction was chosen first?If you have a micro-switch at each end the system will know that the motor has turned the shaft all the way clockwise or counterclockwise, or neither. If you just rely on crashing physical end stops you won't have that data.
It will indeed matter.
What should happen when the power is restored? The Arduino will have no means to tell where the stepper is or whether it should move towards A or B.
I guess one option would be to record the position (either A or B) to the EEPROM memory every time the end-stop is reached. And then at startup if neither end-stop is pressed the Arduino can read the EEPROM memory to figure out which direction the motor should be going. Because the end-stops are only pressed once every 30 minutes the EEPROM memory won't wear out...R
Write/Erase Cycles: 10,000 Flash/100,000 EEPROM