Need encoder help!
I'm having trouble getting a clean high/low response from my IR emitter-reciever module. I'm using an LED in series with the detector to show when it conducts and it only goes from dim to bright.
I scavenged several RPR-220 reflective modules from a discarded document feeder and found the datasheets online. My encoder disks are 'about' 3mm from the detectors. The disk resolution is 44. (I guess that means 44 pairs of stripes.) I put a 15-turn trimmer in series with the emitter to help find the sweet spot.
How do I get a clean high-low signal? Comparator? Schmitt trigger?
I scavenged several RPR-220 reflective modules from a discarded document feeder and found the datasheets online. My encoder disks are 'about' 3mm from the detectors. The disk resolution is 44. (I guess that means 44 pairs of stripes.) I put a 15-turn trimmer in series with the emitter to help find the sweet spot.
How do I get a clean high-low signal? Comparator? Schmitt trigger?
Comments
Also 3mm seems kind of far to me. Here's a picture of encoders I added to a Roboni-I robot.
As you can see, the sensor is awfully close to the gear with the stripes. The gear was transparent to IR so I added a layer of Al foil so the IR would reflect back to the sensor.
The P5587 encoders include a Schmitt trigger and works really well. You still need good light and dark areas. Some black material isn't so black when the light is IR. I originally used Gorilla tape for my black area in this experiment but switching to black masking tape made a big difference.
It's also a good idea to have a pair of encoders (quadrature) so you can detect which way the motor is turning. The quadrature encoders will also make sure you don't count transitions across the same boundary (going forward then back) as real movement.
Thanks.
The P5587 includes a Schmitt trigger internally. Make sure and look through the P5587 thread to see how it mounts. It's not really breadboard friendly.
I think I offered to post gerber files to PCBs for the P5587. Just let me know which PCB design you're interested in.
The gear was part of the robot's drive mechanism.
If you post photos of your motor (from several views) someone might have an idea on a good way to mount an encoder disk. Sometimes it's easier to mount one on a gear than directly to the motor's shaft.
One concern I have is if the sensor can distinguish the individual stripes at that distance. Is it "seeing" more than one stripe at a time?
I don't know how you have your setup wired but you want to protect the Propeller I/O pins from too much current through the clamping diodes. With the I/O pin set as an input, the current through the clamping diodes should not be more than 500uA (0.5mA). A 3.3K resistor will keep the pin safe from a 5V signal.
That's your problem. A Schmitt trigger or comparator can certainly be useful, but your sensor is seeing more than one stripe at a time, and no additional electronics will make this work reliably. You either need to get the sensor right up against the encoder, use a different sensor with a smaller aperture, or use a code wheel with (far) fewer stripes. Start with 6 or 8, and work your way up from there.
And another fun read about the merits of encoder-based dead reckoning: http://www.seattlerobotics.org/encoder/200108/using_a_pid.html
erco, great links. Thanks.
IOW, in technical parlance, that's a "YP", not an "MP".
Obscure "Boogie Nights" reference.
Larry: You can try moving your sensors closer to the disk. Per Gordon, the sensors' view of the disk is critical.
Folks often over-complicate encoders. The Big Trak toy of the 80s, which people could program for fairly accurate moves, had a wheel encoder with maybe 10 or 12 holes in it. (And at that it only had one of them. The two wheels were kept synced by using a novel magnetic differential clutch.) If you can get your 44 stripe encoder to work, that's great, but an 8 or 12 stripe wheel works very well, too. Beyond that the frustration quotient increases exponentially.
I'm getting an education from some of the best people in the business. If people spend time for my benefit, I learn the lessons. The important thing is I enjoy the heck out of the learning process.
Gordon, I'm listening. Thanks.
https://www.google.com/search?tbo=p&tbm=bks&q=%22Gordon+McComb%22&gws_rd=ssl#q=%22Gordon+McComb%22&start=10&tbm=bks
He's the man. Listen to him. Learn from him.
I was almost in a deadly wreck in one. I'm sure the inexperienced driver invented "drifting" racing that day. I never knew a car could actually travel sideways.
In same Corvair I put my foot through the rusted out floorboards in the back seat, and actually scraped it against the pavement rolling underneath!
(Incidentally, this was in the early 70s, so the car wasn't more than 10 years old at the time.)
My favorite comedian of all time, Ernie Kovacs, was killed in a first generation Corvair stationwagon, when he took a modestly high speed turn on Santa Monica Blvd over wet pavement -- bad combination for a Corvair.
On the other hand, my favorite auto writer and famed sexist curmudgeon Tom McCahill liked it.
Not to mention that racer Dan Gurney drove one for his personal car: http://corvaircenter.com/phorum/read.php?1,92023
And Don Yenko made the Stinger: http://www.yenkostinger.com/
And John Fitch made the Sprint: http://www.corvaircorsa.com/fitch01.html
My discussion at http://forums.parallax.com/showthread.php/149740-Rare-Wheel-Encoder-Sensors-Available-Strike-Now!