+ Reply to Thread
Results 1 to 16 of 16

Thread: Need encoder help!

  1. #1

    Default 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?
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  2. #2

    Default Re: Need encoder help!

    I would think the LED in series would cause trouble. The signal isn't meant to provide much current. If you used it with a QuickStart's I/O pin P16 to P23, then you could have your LED and signal too. (That was supposed to sound like "have your cake and eat it too.")

    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.

  3. #3

    Default Re: Need encoder help!

    Duane, so the P5587 is a breakout board that includes a Schmitt trigger? I'll order at least four on Monday. How can I get a gear like the one in the picture? A gear on the inner motor shaft would eliminate the slight wobble I see from my wheel mounted reflective disk.
    Thanks.
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  4. #4

    Default Re: Need encoder help!

    Quote Originally Posted by lardom View Post
    Duane, so the P5587 is a breakout board that includes a Schmitt trigger?
    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.

    Quote Originally Posted by lardom View Post
    How can I get a gear like the one in the picture? A gear on the inner motor shaft would eliminate the slight wobble I see from my wheel mounted reflective disk.
    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.

  5. #5

    Default Re: Need encoder help!

    Duane Degn, I'm learning. After reading your post then researching 'Schmitt trigger' and comparators I realized I had to digitize the signal. The bright-to-dim response I saw was analog. I placed the IR detector about 6mm from the encoder disk based on what I thought was a recommendation from the datasheet. I'll move the detector as close as I can to the disk.
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	6mm from encoder.jpg‎
Views:	17
Size:	69.4 KB
ID:	109705   Click image for larger version

Name:	RPR-220 top view.jpg‎
Views:	16
Size:	88.7 KB
ID:	109706  
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  6. #6

    Default Re: Need encoder help!

    I know I had to experiment with what material the stripes were made from and I also had to experiment with the distance of the sensor to the stripes to find the best combination.

    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.

  7. #7

    Default Re: Need encoder help!

    It's not connected to the Propeller yet. I'm testing with a 6V battery pack, a multimeter and a 'point and shoot' camera. I used a trimmer to control current to the emitter. It's clear I have to get the detector closer. I'll redesign the circuit.
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  8. #8

    Default Re: Need encoder help!

    Quote Originally Posted by lardom View Post
    IMy encoder disks are 'about' 3mm from the detectors. The disk resolution is 44. (I guess that means 44 pairs of stripes.)
    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.

  9. #9

    Default Re: Need encoder help!

    You could add an aperture (blinders) to limit your sensor's field of vision. And measure the output (scope) from the IR PTX before filtering or Schmitt trigger. Here's an interesting old read on troubleshooting a homebrew encoder sensor: http://list.dprg.org/archive/1998-July/005620.html

    And another fun read about the merits of encoder-based dead reckoning: http://www.seattlerobotics.org/encod...ing_a_pid.html
    "Give a man an inch, and right away he thinks he's a ruler." Maxwell Smart

  10. #10

    Default Re: Need encoder help!

    Gordon, I had grey hair before I discovered my passion for programming. During my college years I believed it was unbearably tedious. Solving 'problems' excites me. The charge I get from solving things fades quickly so I'm constantly seeking new challenges. I'm already thinking about leaning to control my bot with an rc controller.
    erco, great links. Thanks.
    Last edited by lardom; 07-22-2014 at 06:44 AM. Reason: new post
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  11. #11

    Default Re: Need encoder help!

    Quote Originally Posted by GordonMcComb View Post
    That's your problem.
    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.
    "Give a man an inch, and right away he thinks he's a ruler." Maxwell Smart

  12. #12

    Default Re: Need encoder help!

    The mechanical construction of your plywood (yea, plywood!) bot ought to make it real easy to adjust the distance between the sensor and code wheel. A slot in either the base or sensor mount can allow you to test various distances. You ought to be able to adjust it so the sensor is just a hair width away from the wheel. Of course, all wheels will have run-out (wobble), so be sure the servo screw is all the way tight, and adjust the sensor for its closest distance.

    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.

  13. #13

    Default Re: Need encoder help!

    Quote by erco;
    ...Per Gordon, the sensors' view of the disk is critical.
    I owned "Troubleshooting and Repairing VCRs" by Gordon McComb at a time when I thought I was smart because 'I knew' that a Basic Stamp had nothing to do with postage. Shortly after I bought "What's a Microcontroller" I bought "Robot Builder's Bonanza".
    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.
    Larry

    If the grass is greener on the other side...it's time to water your lawn.

  14. #14

    Default Re: Need encoder help!

    Gordon's quite knowledgeable, he knows about everything. Micros (even them Ardweeny things), robots, VCRs, jukeboxes, PCs, Macs, web commerce, software, even a bit about Corvairs.

    https://www.google.com/search?tbo=p&...art=10&tbm=bks

    He's the man. Listen to him. Learn from him.
    "Give a man an inch, and right away he thinks he's a ruler." Maxwell Smart

  15. #15

    Default Re: Need encoder help!

    Well, here's what I know about Corvairs.

    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.

  16. #16

    Default Re: Need encoder help!

    Quote Originally Posted by GordonMcComb View Post
    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
    "Give a man an inch, and right away he thinks he's a ruler." Maxwell Smart

+ Reply to Thread

Similar Threads

  1. Activity Bot Encoder VS Digital Encoder
    By blittled in forum Robotics
    Replies: 1
    Last Post: 12-03-2013, 04:17 PM
  2. Abz encoder
    By alumbrin in forum BASIC Stamp
    Replies: 5
    Last Post: 11-30-2012, 01:23 AM
  3. Looking for a better encoder
    By qiuqiuaaa in forum General Discussion
    Replies: 0
    Last Post: 11-27-2011, 09:52 AM
  4. Incremental Encoder --> Absolute Encoder
    By crgwbr in forum SX Chips and Programming Tools
    Replies: 10
    Last Post: 10-07-2006, 12:42 AM
  5. encoder
    By Archiver in forum BASIC Stamps Archive
    Replies: 4
    Last Post: 10-05-2002, 01:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts