I'm using a nema17 stepper motor to position a disc anywhere from 0 to 315 degrees. I have a torsion spring around the shaft to return to the zero position, mostly for when power is shut off.
It works fine running clockwise (against the spring load) but when I reverse direction the return spring immediately snaps the disc right back to zero. The motor offers no resistance to the spring.
At the moment I'm using a simple forward/reverse stepper controller but eventually it will be controlled using an arduino mega. Seems like I'm going to need some code to deal with smooth motion in the same direction as the spring, maybe a 2 steps backward-1 step fwd pattern or something like that.
Can anyone suggest a technique or where to look for one?
You don't normally install a snap back on a stepper. You put in a zero sensor and step back until that trips. If the spring is strong enough to return the motor it will do so any time the motor moves in that direction - as you are finding. Change your motor or your approach.
What is the application?
Why do you need a spring return?
The only time I have seen a spring return on a motor is in a house central heating system valve.
The return spring is to make sure it resets and stays in the zero position when power to the motor goes off, either intentionally or during an outage. Other ways to do it of course but i'd like to avoid additional components. It's kind of a distributor with 8 outputs for a common input.
That is very important, can you post your code, especially the return movement, do you have a speed control on that movement.
You may have to step it back one step at a time in a loop.
Can you please post a schematic?
What is your stepper driver?
Tom, I take it all back. The problem I was seeing had to do with the changeover delay from fwd to reverse because I was manually pressing fwd & reverse buttons, which is waaaay too slow and lets the spring fully release before the motor torque has a chance to catch it. It actually works fine running in the same direction as the spring torque if I make sure it never has a chance to release, which is easy to do in the control code.