Hi, I am working on a project where a bipolar stepper motor is (effectively) going to be winding up a string with load on it until its maximum position, then locking into place for a certain amount of time.
For clarity, imagine a stepper motor sitting at the top of a ramp. It is connected to a string, which is also connected to a very heavy block at the bottom of the ramp. The motor winds up the string, pulling the block up the ramp until the block hits a rigid obstacle and can no longer move forwards. The stepper motor detects this somehow, then holds its position for a certain amount of time (20 sec) before releasing.
Also, Every time the system runs, the block may be a different weight (the range of weights is very very small (I'd say MAX plus minus half a pound) but different every time nonetheless).
I think the torque on the motor will go up a lot in after the time the block hits the obstacle and before it stalls, so I want to detect when this is happening, and have that trigger the next event where the motor holds its position for 20 seconds.
Originally I was going to just have the motor detect when it has stalled (since the string will definitely be taut then) but I am worried about the string being under too much tension and worried about having the stepper motor stalled for too long or too many times (concerned about lifetime of motor). I also don't know how to detect a stall (don't understand the solutions that have been posted on forums in the past).
If you think that stall detection is a better method than torque increase detection, how would I go about doing this? I think probably I'd want to reverse the motor a tiny bit to decrease tension in the string and get it out of stall, then lock it in place...?
I saw there are some similar questions posted on forums in the past, but I wasn't entirely able to understand any of the answers. I'm also looking for the cheapest option.
I'm sorry this was a long post but I really wanted to make sure I explained what I was trying to do well enough, so thank you for taking the time to read and reply to me! I'm a mechanical engineer who knows very little about Arduino programming, so the more specific your explanation is the more helpful it will be for me. Thanks!