perfect stop with a step motor and a switch ?

Hello Arduino community !!! im trying to make a perfect rotation of a plate with a step motor mounted with a reduction gear ! now mi question is... is posible to use a switch to make a quick stop like.... press a button and when the plate touch the switch make a quick stop when the switch is pressed and then continue making other action.

or maibe can be posible to replace the switch with one of this so when the mark on the plate pass over the sensor the step motor stops there quickly

im asking al this because i need a lot of precision on this plate.

if anyone has other ideas are welcome

thanks a lot !

You are using s stepper motor? Check the switch or photo interrupter before each step. If the switch Is activated don't step.

If you stop quickly you can not go as fast without it over running, but yes stop sending pulses to the motor and it will stop moving.

thanks for the quick answers ! but im using the step library and the steps are defined on the setup... i want something like emm you move slowly the motor to the point of one sensor when the sensor is activated the motor stops.. then the arduino makes other process when that process finish the plate rotate again to the other sensor and stop there... and like that 4 times because is a bottling process and the plate has 4 stops and 4 process .

THANKS !

What step libary? Link please.

Well post a simple code example of what you are trying to do and we will see if we can help. Maybe the answer is not to use a libary but to write your own code.

Whilst I have never used a stepper motor I have always naively assumed that you could move one a defined number of steps and hence control where it stops and starts. Is this not the case ?

yes it is
but as far as I can understand, OP doesn't know in advance ho many steps the motor has to move.
As Groundfungus said, one solution would be to move step by step and check the sensor between each step.

The motor will have a fixed number of steps per full rotation so it would not be difficult to work out how many steps are needed in order to move to a particular position I would have thought. After all, the OP mentions a mark on the plate to indicate where it should stop and the position of that would need to be determined anyway.

The motor will have a fixed number of steps per full rotation

true......... if there is no backlash in the reduction gear, but ....

The backlash will be there anyway.
If the original proposal to move the plate to a marked position is implemented then, when it reaches the marked position the drive will be stopped and the plate will relax back due to the backlash. The application is a bottling process, so I suspect that no great precision will be required unlike, say, a drive for an astronomical telescope to point to a star.

The hardest requirements to meet will be fast movement and accurate stopping which may be mutually incompatible.

The hardest requirements to meet will be fast movement and accurate stopping which may be mutually incompatible.

That was the exact point I was making in reply#2.