|
Re: Motor using Encoder as Limit Switch?
When you read an encoder, you get a value that represents how far it has turned. You can use that value to enforce minimum and maximum travel on your motor. When the encoder is above a certain value, don't let the motor travel any farther forward. When it's below a certain value, don't let the motor travel any farther backward.
But if you don't guarantee that you're always starting up the robot with the motor in the same position, the encoder value won't always represent a consistent position.
|