Shop OBEX P1 Docs P2 Docs Learn Events
reading a wheel encoder — Parallax Forums

reading a wheel encoder

mwalimumwalimu Posts: 44
edited 2010-07-16 21:06 in Propeller 1
I am vexed by trying to read a wheel encoder. I am using a roomba wheel. It' pretty straight forward, an IR emitter/receiver pair with 32 blades. The problem is that I can't get my program to reliably read the number of on/off transitions.

I tried tying the receiver to a pin directly. No good. I did find that if I used a pull up resistor(10K), it would read on or off. However, my program would read a larger amount of transitions than actually occured. My guess is that as the blade passes the emitter there is a region where the pin state rapidly bounces between 0 and 1.

I was more successful with RC time. I could count transitions, but my program couldn't keep up with the wheel when I increased it's speed. I found I could improve performance if I increased the limit diode on the emitter, but not enough to work properly at full speed.

I'm not sure if I'm having a hardware or a software problem, so I thought I'd through the question out and see anyone else has used the prop to get a similar emitter/receiver type wheel encoder to work.

Comments

  • LeonLeon Posts: 7,620
    edited 2010-07-16 21:06
    When I had a similar problem I used a 74HC14 Schmitt trigger to clean up the transitions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
Sign In or Register to comment.