detect large increase in torque on stepper motor?

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!

Also posted at:
https://stackoverflow.com/q/59760023

yes I asked on both forums!

It is very difficult to detect load changes or stalls with stepper motors. The current draw is essentially the same whether stalled or not.

If you are committed to using a stepper, use a shaft encoder to determine whether steps are skipped. If not, use a DC motor and a driver with a current monitor output.

jremington:
It is very difficult to detect load changes or stalls with stepper motors. The current draw is essentially the same whether stalled or not.

If you are committed to using a stepper, use a shaft encoder to determine whether steps are skipped. If not, use a DC motor and a driver with a current monitor output.

@jremington can you please explain to me what a shaft encoder does and how to implement it in my code? I'm assuming skipping steps happens when the torque is too high but before stalling, are there functions to define the number of steps skipped versus how close to stalling it is?

Let the lifting wire pass a spring loaded wheel and detect when that wheel moves more than You like.

Railroader:
Let the lifting wire pass a spring loaded wheel and detect when that wheel moves more than You like.

hi @Railloader, thank you for that suggestion, however the actual setup is a bit more complex than a ramp and string and block, so while that is a really nice idea it is not feasible for my purposes.

A shaft encoder detects shaft motion and reports the current shaft angle, either relative, or absolute. Google "shaft encoder" for the details.

If a stepper motor skips ANY steps, it is not doing what you want it to do. That can be due to improper driver configuration, improper power supply, improper load, attempting to step too quickly, etc.

An experienced engineer designs a stepper motor system with the worst case situation in mind, and it should handle the worst case without skipping any steps.

Okey. Let the entire lift unit be suspended in a way that it can move a little and detect abnormal move?

jremington:
A shaft encoder detects shaft motion and reports the current shaft angle, either relative, or absolute. Google "shaft encoder" for the details.

If a stepper motor skips ANY steps, it is not doing what you want it to do. That can be due to improper driver configuration, improper power supply, improper load, attempting to step too quickly, etc.

An experienced engineer designs a stepper motor system with the worst case situation in mind, and it should handle the worst case without skipping any steps.

I just did a tiny bit of research on this so maybe I just have a fundamental misunderstanding, but here is my thoughts:

It seems like to get the motor to skip steps, I would need to buy a motor that stalls close to my maximum possible load, or unsafely configure something else.

I want to have a safety factor of at least 2 on the motor's torque capability, and also the torque on the motor will be different every time because the weight of the box changes every time.

It just doesn't seem like this method would work for every situation, except for maybe the maximum load case. Maybe it would work for minimum load but then there would be so much extra tension in the string that its not worth doing?

I also can't find a good source to help me write code for the encoder to do anything, could you please maybe point me in the right direction?

Thanks so much for the help!

Use a conventional DC motor and measure the current continuasly.

Stepper motors are very inefficient and draw the same current regardless of load. So, the system MUST be designed with the maximum load in mind, and usually with safety factor of 2.

If you are concerned about minimizing power consumption, use a brushed DC motor instead.

Based off of your original description of a ramp etc, seems to me a limit switch would suffice. But then you shot down Railroader’s suggestion because your system is more complex than a ramp and block.

Maybe give more details about this “more complex” system and folks can better help you.

jremington:
Stepper motors are very inefficient and draw the same current regardless of load. So, the system MUST be designed with the maximum load in mind, and usually with safety factor of 2.

If you are concerned about minimizing power consumption, use a brushed DC motor instead.

This means the TORQUE is the same because the current is the same.

You can detect the stepper motor reaction by hinging the mounting and using a spring and a microswitch to determine then the stepper rotates because of the load.

Please explain you design for winding your string.

Paul

DangerToMyself:
Based off of your original description of a ramp etc, seems to me a limit switch would suffice. But then you shot down Railroader's suggestion because your system is more complex than a ramp and block.

Maybe give more details about this "more complex" system and folks can better help you.

Hi, sure! The device is mounted to a door. The string is attached to a motor (mounted to a door) and a lever arm, which is paralell to the floor. On the other end, the lever arm is attached to the shaft of a door handle (the part before the knob or handle). The motor will pull the string down, pulling the lever and twisting open the door handle. Every handle requires a different degrees of rotation to fully unlatch the door, a different amount of torque, and have different shaft sizes, so the amount of force it will take to unlatch the door and the amount of rotations the motor will need to spin is different every time. By "obstacle" I was referring to the point where the door is fully unlatched, so any additional turning would be applying extra force to the handle and more tension to the string. I do not want the lever arm or handle to undergo unneccesary forces. Once the handle is pulled down all the way so that the door is unlatched, the motor needs to hold its position for enough time for the user to push the door open, then unwind the string however much it wound it up, so that the handle goes back to normal position.

I don't have the space for much extra hardware which is why I didn't think the spring idea would work. Also, I'm not actually pushing up against an obstacle. I just looked up limit switch (never heard of that) is that the same thing? I think I was imagining I would have to build the system myself so I was imagining a large spring and wheel system.

What is the over all purpose for this design? Unlock and open doors? Then skip the handles and arms and use convtional door opening devices.

Railroader:
What is the over all purpose for this design? Unlock and open doors? Then skip the handles and arms and use convtional door opening devices.

I am building a device to unlatch doors that can be quickly mounted to any door without having to change the door's existing hardware.

Are you designing for a certain shape door handle? In our house for example, we have some smooth round knobs, and some with lever handles that you can open with an elbow when your hands are full.

So you need something that can a turn a knob up to 90 degrees to release it?

I am guessing you do not have door knobs in your country. Otherwise you would know it is ONLY the knobs that hold the square shaft in place. Remove the knob with it's shaped fitting into the bezel of the door and the shaft falls out.

Paul