General Question

Jonathan_hodgkins's avatar

Programming a stepper to have a "home" position?

Asked by Jonathan_hodgkins (684points) December 6th, 2017

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

Zaku's avatar

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.

funkdaddy's avatar

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?

ARE_you_kidding_me's avatar

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.

LuckyGuy's avatar

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.

Petrovisk's avatar

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

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther