I have a motor that drives a rail which I need to know the position of.
I have an AM102 encoder attached to the motor. But am unsure how to get a position from it.
I have powered it up and attached the two outputs to my Teensy 3.0. In my program I can see the value changing as I manually move the motor. (Either 1023 or 0 if I recall correctly).
I am wondering how I can use this to determine position. I'm guessing that I can determine position by counting how many times the value changes from 1024 to 0 and then multiplying that number by a distance (not sure how to get that value). But when the system is first turned on, how will it know the initial position? Is there a way to get this from the encoder or some other device/method?
n.b. I also have an Atmega328P which I've been told may how me determine position how would I use this?
Question summary:
- How do I get the distance multiplier?
- How do I get initial position?
No comments:
Post a Comment