Shop OBEX P1 Docs P2 Docs Learn Events
POTs vs optical encoders accuracy for motor control? — Parallax Forums

POTs vs optical encoders accuracy for motor control?

henry99henry99 Posts: 67
edited 2008-09-21 16:47 in BASIC Stamp
Most high end servo motors I've seen·have an optical encoder with 10 to 13 bit (1024-8192 pulses) resolution per revolution.

What kind of accuracy can I reasonably expect with a POT mounted on a rotating gear shaft?· I can use a high resolution 12bit dac but at what point is repeatable accuracy governed by temperature or other uncontrollable effects?

I've been playing with a simple voltage divider and notice fluctuations of 1-2 digits with an 8bit dac.· Is this common?·

Can I improve on this with some sort of wheatstone bridge circuit?

Absolute conversion of the resistance isn't necessary as I just want to build a lookup table that "dac value of 97=10.5 degrees rotation", etc but it seems a bit noisy even when just sitting still.

Also, is there a source of inexpensive high resolution optical encoders out there (absolute or incremental)?· I would think this is a very high demand product but most optical encoders I've seen that you mount to the end of a rotating shaft are in the $250 range where I can buy a POT with a gear on the end of the shaft for like $1.

Thanks for any help!

Comments

  • ercoerco Posts: 20,259
    edited 2008-08-22 14:29
    You don't want to hear "you get what you pay for", but that's exactly what's going on here. Pots are cheap and require only one Stamp input, but they·give you a low-res, noisy analog signal that will fluctuate over time. Temperature may even cause variations in some situations. Adding a wheatstone bridge is unlikely to add any stability or accuracy. Optical encoders are much more demanding, both mechanically and electrically. The encoder wheel·demands the utmost mechanical accuracy on installation. If it isn't perfectly centered and perpendicular to the shaft (which must be rock solid and true), you will get erroneous readings. And the optoelectronic readers (phototransistors)·must be properly aligned to the tracks they read. All that electromechanical accuracy come at a price.

    People can and so make their own encoders, it is rewarding work that teaches you the appreciation for the accuracy required. Have a peek at··http://www.qsl.net/oe5jfl/encoder.htm··· and http://groups.csail.mit.edu/mac/users/pmitros/encoder/




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-08-22 15:00
    POTs are analog and subject to non-linearity and noise. Encoders are digital and ideally don’t have any in-between states or jitter. If your hardware can handle the encoder I would recommend that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • henry99henry99 Posts: 67
    edited 2008-08-22 20:03
    US Digital makes an Optical Encoder POT replacement: http://www.usdigital.com/products/encoders/incremental/rotary/shaft/s5/

    but it costs $75 a pop.

    Isn't there something like that but a lot cheaper?

    I'm kind of shocked the are priced so high for something that seems so easy to manufacture on a mass scale. I would imagine you could easily make that sort of thing on a MEMs fabrication factory and pump them out at fractions of a cent each.

    Building my own seems like reinventing the wheel. Certainly I cannot reproduce the accuracy of the encoder disc they can make in a clean room with a robot.

    However, I do remember a long time ago, optical encoder discs inside a $10 mouse with a mechanical ball so that can't be that exotic either.

    The US Digital S5 seems ideal for my needs. I would just mount a little gear sprocket on it and attach it to my motor to get a very accurate reading.

    That said, both the S5 and motors with built in encoders are expensive.

    Is there no hobby supply of inexpensive encoders and motors with encoders?
  • kenwtnkenwtn Posts: 250
    edited 2008-08-22 20:17
    Look at DIGI-KEY http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=P12334-ND Price is 0.75

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When you spend 10 times what it cost to build it yourself - That's when it becomes a HOBBY !

    ···································································
  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-22 20:41
    kenwtn,
    You get what you pay for. The encoders you referenced are designed for volume control / tone control use and have at most 24 positions per revolution.
  • kenwtnkenwtn Posts: 250
    edited 2008-08-22 20:52
    Sorry I will stop posting replies and stick to only asking questions

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When you spend 10 times what it cost to build it yourself - That's when it becomes a HOBBY !

    ···································································
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-22 21:33
    There are also magnetic encoders, such as this U.S digital unit with <0.5 deg. resolution ($36). Or, you could try rolling your own with this Melexis rotary position sensor, which DigiKey carries.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • metron9metron9 Posts: 1,100
    edited 2008-08-23 00:39
    Depending on how fast your motor rotates you can use gears to make a 24 PPR go to 240 ppr for example a rotating shaft at 10rpm would rotate another shaft at 100 rpm and you would use the encoder on the 100rpm shaft.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-23 02:04
    I certainly wouldn't recommend an encoder with mechanical switch closures (e.g. the cited DigiKey part) for that kind of punishment! You really need a non-contact encoder for motor apps.

    -Phil
  • henry99henry99 Posts: 67
    edited 2008-08-23 03:02
    Hmm that magnetic shaft encoder looks pretty sweet from US Digital since it'd be easier to interface than . Any idea if magnetic interference is an issue?

    PWM absolute output is way better than the S4 quadrature output since you'd probably need a dedicate chip with interrupt and counter to not miss a pulse http://www.usdigital.com/products/encoders/incremental/rotary/shaft/s4/

    The S4 is more reasonably priced at $46 but still high.

    Doesn't anyone make products like US Digital but cheaper?

    I doubt anyone pays $46 for an encoder unless it's a $1000+ part.

    I would think $5-10 would be a reasonable price. An encoder so much easier to assemble than a winding a motor and you can buy motors for $1.
  • henry99henry99 Posts: 67
    edited 2008-08-23 04:44
    Still not super cheap but I think I found a good solution out of the digikey catalog: http://www.amtencoder.com/

    Seems very hobbiest friendly and slips right onto the shaft of any motor.

    The upcoming AMT 202 and 203 with SPI output looks very nice compared to other options.
  • ZootZoot Posts: 2,227
    edited 2008-08-24 01:19
    These from US Digital are cheaper ($22) and I think have higher resolution. www.usdigital.com/products/encoders/incremental/rotary/kit/e4p/. These snap onto any shaft up to .25" and the encoder housing can either be screwed to the motor housing or fastend with included adhesive tape. A number of robot kit producers are shipping these same encoders with kits (albeit at closer to $32). They're pretty nice.

    Also rolling your own is not that hard and then you can customize. I made some nice encoders using Hammamatsu emitters/detectors ($5) and laser-printed encoder disks that I spray mounted to old CD discks. Total cost was about $7 (but it did take some time -- if the U.S. Digital's would have fit my motors I would have used them on that project, I think).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • jpylejpyle Posts: 41
    edited 2008-08-24 03:43
    http://www.geology.smu.edu/~dpa-www/robo/Encoder/pitt_html/encoders.html

    · This article shows how to construct your own, it you are up for it. I have made 3 sets and they all
    work great. This set-up is for· Pittman motors. The Hamatsu parts are about $2.00 each,·using two for each motor for a quadrature out-put. Very clean signal.· They are not as difficult to build as they look, with few
    parts.·· John
  • jpylejpyle Posts: 41
    edited 2008-08-24 03:46
    · Sorry Zoot, I did not read your post about the same encoders before I posted mine.· John
  • ZootZoot Posts: 2,227
    edited 2008-08-24 18:02
    jpyle -- where did you get the hammamatsu's for $2? I paid $4.95 each for mine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • ercoerco Posts: 20,259
    edited 2008-08-24 19:51
    $2.25 for the Hamamatsu P5587·at· http://www.junun.org/MarkIII/Info.jsp?item=48

    Some interesting alternatives to the Hamamatsu module:

    $1.19·· http://www.sparkfun.com/commerce/product_info.php?products_id=246
    appears to be only IR LED/PTX, no filter or Schmidt trigger

    Pololu has digital and analog output sensors, $3.49 for a single or $15 for an 8-sensor array at http://www.pololu.com/catalog/category/7.·If you·have room for a·LARGE encoder disk several inches in diameter (0.375" per ring) you could use this array to read your 8-bit encoder disk directly.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • jpylejpyle Posts: 41
    edited 2008-08-24 23:26
    ·· erco has the info--I found this free code wheel "maker" to print out GOOD encoder discs. I have virus checked and been using for a month or so. Might want to give it a look.· John
  • wiebelwiebel Posts: 7
    edited 2008-09-21 12:31
    I have to say that Pots aren't that bad. As erco says "you get what you pay for" and the cheapest solutions are pots. But on the other hand you can easily pay >200$ for Pots that do deliver the needed linearity and accuracy. It all depends on your needs. Pots are really simple to use and automatically deliver an absolute position even for multiple revolutions. -wiebel
  • ercoerco Posts: 20,259
    edited 2008-09-21 16:47
    weibel: Very valid points. Precision pots are available and affordable even on eBay:

    10K pots· 3/$15 http://cgi.ebay.com/Vishay-Spectrol-Precision-Potentiometers-3_W0QQitemZ140268695727QQihZ004QQcategoryZ47076QQssPageNameZWDVWQQrdZ1QQcmdZViewItem·

    joystick $55· http://cgi.ebay.com/PRECISION-JOYSTICK-WITH-POTENTIOMETERS-MADE-BY-BOWMAR_W0QQitemZ260288637961QQihZ016QQcategoryZ55834QQssPageNameZWDVWQQrdZ1QQcmdZViewItem·

    They will certainly last longer and give more consistent and reliable results than the $2 "Shack" pots. Of course, the amount of accuracy required in any application is a major consideration. Regular servos with cheap analog pots work well for a lot of applications. This original post mentioned optical encoders with 10-13 bit accuracy, that's likely overkill for many apps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.