Programming a stepper to have a "home" position?
I am trying to program a stepper to rotate a certain angle and speed around a fixed point, everytime. However, when the power goes out, the program restarts and it’s location is lost. Any idea how I can get the stepper to remember to start at a certain location or remember it’s location within the arc?
Observing members:
0
Composing members:
0
5 Answers
Obviously it would need some way to sense or establish its location, or possibly to move or grope about to establish its location. And it could be good to have some logic for noticing when its assumptions about its environment are wrong.
There may be a clever trick for your particular implementation, but just knowing what we know, I’d say the only options are to either:
1) Add storage of some sort, something you can recall
2) Add verification of some sort, an observation that will make sure the position is as expected, and a routine to reestablish the correct position if it’s not
How to do that would completely depend on what you’re actually doing, right?
Not sure what you are using to drive it but there are options. If you want it to retain current position you will have to track it and store each step by incrementing or decrementing a variable stored in nonvolatile memory. If you just want it to return to a “home” position on restart then there are slick ways to do it but the best way depends on your setup, more info is needed if you care to elaborate.
In some applications when we shut down the motor moves to a park position before full shutdown. The delay might be 500–750 ms or so but that is enough time to put the toys away.
When restarting the keep-alive memory tell the motor where to start.
You could just count from an assumed home position, but that could be thwarted by a power failure in the middle of an operation, or by an external force moving the motor position while it should be a rest or deactivated. So you’ll need some kind of positional sensor as a minimum.
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.