Stepper Motor 0 position?

Hi Guys,

A bit of background on why i'm asking this: I'm getting married in Las Vegas at the start of october, and my partner decided to decorate the card box for our party as a fruit/slot machine. I suggested that I could make a 'rigged' slot machine that always pays out a poker chip (our wedding favor) to the user.

I have the coin delivery system plans down, just going to use a servo to dispense each chip from a hopper.

The pictures on the machine will be 'randomly' laid out, but the plan is for the rotation to always end on a "Thank You" Message. - This is printed on a solid block, so all 3 pictures move simultaneously.

My trouble is, If I ask my stepper motor (NEMA 17) to do several rotations at a high RPM (300/400) and then stop at the zero position, how much possibility is there for it to loose steps and land on the wrong block?

I was thinking that I could use the built in hall effect sensor of an ESP32 to dial in on where 0 is, but how well will that work in practice? Is there a more elegant solution?

Thanks for your help!

A Hall effect sensor is unlikely to be very accurate in determining the zero position of a stepper shaft.

Most people use a microswitch and lever arrangement, or a disk with a slot or hole, together with an optical detector. Google something like "detect zero position stepper shaft" for ideas.

One example

Could you add a small “L” shaped tab (or even a screw sticking out) on the side of the block that would pass through a break-beam optical sensor?

Consider you will need to accelerate the stepper to the speed you want and then decelerate it to bring it to a stop.

Paul

Kodash:
My trouble is, If I ask my stepper motor (NEMA 17) to do several rotations at a high RPM (300/400) and then stop at the zero position, how much possibility is there for it to loose steps and land on the wrong block?

Assuming the motor is properly sized, powered and controlled (with acceleration) I reckon the risk of missing a step is so low that secondary precautions would not be worth the trouble.

You are going to need a detector for the HOME or ZERO position when the Arduino starts. If you use an optical switch for that you could test it on every revolution to verify that the step count remains correct.

…R
Stepper Motor Basics
Simple Stepper Code

also look up the AccelStepper library