"lazy Suzan" return to zero

Hey all, I have what is easily described as a lazy Suzan that is driven direct by a stepper motor. Now I have the stepper running just fine, simple code moving 18 deg (10 steps) waiting 10 second and going again ad infinitum. Now when audrino powere off for the night the stepper loses hold. Keeping hold on at all times not an option. When I start again the next day I would like to be able to use either an optical sensor or hall effect, to find exact zero ( start position) buy rotating " lazy Suzan" until the sensor trips. What would be the best sensor to use, how would it be best to program? Can "until" statements be used?

Any who thanks all for any help, suggestions, criticisms ect :slight_smile:

Ps the project is an automatic case annealer for rifle brass aka New Case Neck Annealing Machine

C doesn't have an "until", but it does have a "while"

That looks like a very neat bit of kit. As mentioned C has a "while" construct so you can just keep stepping the motor slowly while the device is not at the start position.
Do you need to do this though, can you not just start the machine from a random position? I am imagining the machine rotates the cartridges continuously through the flames, but perhaps it stops them in the flames hence you need to locate them.

Would a cam operating a microswitch be accurate enough for you. The machine holds ten cartridges so you could have a cam with ten "highs" mounted on the shaft to operate a single fixed microswitch. This would mean the machine would start at the next cartridge. With two switches you could step fast till the first is triggered then more slowly till the second is hit.

If you intend using a magnet/Hall effect switch, and the device is running hot, you may need to pay attention to the Curie point of the magnet

Why not just use some kind of physical limit switch to define HOME. On start up, rotate the device until the limit switch is triggered. Then, you are home.

Radman; the turntable stops at the station so the case can be rotated within the holl it's sitting in so must be able to stop on target.

PaulS; a micro switch with a small dimple in line with home would work nicely but it can't trigger early and if you get over run then what? Could be fixed With radmans 2 switch and single stepp till the next is triggered.

Have some thinking to do.... Lol keep any more ideas comming!

PaulS; a micro switch with a small dimple in line with home would work nicely but it can't trigger early and if you get over run then what?

I'm not sure I see the problem. Read the switch. If it isn't pressed, you aren't home. Step once. Read the switch. Repeat until you are home.

If you use some form of microswitch/beam break that detects an inserted cartridge then a simple
do
rotate till cartridge
delay
loop
will only stop at positions that have cartridges in so no delay heating fresh air.

I'm not sure I see the problem.

There is 36deg between cartridges. If the stepper is stepped slowly it will take a while to increment round. On the other hand if the stepper is stepped quickly then the inertia of the lazy Suzan may cause it to make the motor slip if you try to come to a dead stop. The Suzan does not look very massive so a lot depends on the strength of the motor. However in my (limited) experience of stepper motors they behave in a very reproducable way. The code could accelerate the rotation up to a maximum then decelerate down when a microswitch triggers and I bet you you would hit the spot every time - at least to the mechanical accuracy of when the switch triggers. My first idea of two switches may be overkill.

the turntable stops at the station so the case can be rotated

  • neat, I understand how it works now.

Maybe overkill, but I`m thinking optical encoder strip or wheel from an old printer.

Or make your own...

2 switches. Step at high speed until the first one breaks, and then step slowly to the second.

1 switch with a large target. Step rapidly until the switch breaks, reverse slow until the switch makes, and then forward again slow until the switch breaks.