1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Anyone use rotary encoders for feedback?

Discussion in 'DIY Motion Simulator Building Q&A / FAQ' started by Yoder_, Sep 10, 2014.

  1. Yoder_

    Yoder_ New Member

    Joined:
    Jul 5, 2014
    Messages:
    28
    Occupation:
    IT Dude
    Location:
    Oklahoma, USA
    Balance:
    400Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Just wondering if anyone uses rotary encoders. It seems like most people use cermet or hall-effect pots. I've been playing with rotary encoders, and I'm really liking the precision of them. Is there a disadvantage (assuming you have the ability to interface with them (e.g - not a JRK)?
  2. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,622Coins
    Ratings:
    +1,835 / 32 / -1
    In my opinion, the only disadvantage to using encoders is that they don't retain their positional information at power down. Therefore, they must be homed in some way in order to know where center position is when they are powered up. Except for that, they are in ways better than pots if you are able to get a high resolution out of them because they won't degrade with usage. However, the hall effects do not degrade either as long as you don't exceed the sideload force they are rated at. Otherwise, some have had issues with shaft wear therefore requiring lubrication to keep them running smoothly.
    • Agree Agree x 2
  3. Yoder_

    Yoder_ New Member

    Joined:
    Jul 5, 2014
    Messages:
    28
    Occupation:
    IT Dude
    Location:
    Oklahoma, USA
    Balance:
    400Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    I have an incremental encoder, and it has an index signal that blips once per revolution. I've been using it so far for index, and it seems to work well. Another disadvantage to incremental encoders is it ties up an (at least one) external interrupt pin on the Arduino per encoder.

    However, there are absolute position encoders that produce a unique grey code output for each position. As such, they don't require an index solution like micro switches, and don't require interrupts. They do seem costly compared to the incremental encoders though.
  4. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,622Coins
    Ratings:
    +1,835 / 32 / -1
    Since you didn't specify I should have stated I was referring to use with an optical incremental encoder in particular since that is what is most commonly used.
  5. Yoder_

    Yoder_ New Member

    Joined:
    Jul 5, 2014
    Messages:
    28
    Occupation:
    IT Dude
    Location:
    Oklahoma, USA
    Balance:
    400Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Yeah, sorry, I should have specified. I'm interested in both, but only have experience with incremental encoders.
  6. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,622Coins
    Ratings:
    +1,835 / 32 / -1
    Also by saying, "if you can get a high enough resolution out of them", I was referring to connecting them to the motor shaft vs the gearbox shaft.
    • Agree Agree x 1
    • Informative Informative x 1
  7. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    I was told today by Dimension that their Kangaroo will use it's teach routine for encoder signals and will automatically home to midpoint. They see no reason to use pots since most encoders have more resolution. Did I misunderstand?
  8. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,622Coins
    Ratings:
    +1,835 / 32 / -1
    An encoder will have more resolution if it can be used on the motors shaft instead of on the gearboxes shaft. But theoretically, a pot is an analog device and has an infinite resolution so when used on the gearboxes shaft using a pot is better imho. Also encoders don’t retain positional information at power down so they must be homed at power up. This can be done a few ways with the kangaroo but the best would be to use end point stop switches at both extremes of the axis’s travel. At power up it will move to both ends until the switches are triggered and then the halfway point between these will become the home position. Pots retain their position so stop switches and homing is not required when using them although stop switches are still a good feature to have from a safety standpoint.
    • Agree Agree x 1
    • Informative Informative x 1
  9. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Stupid question on my behalf, does a hall effect count as an encoder?
  10. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    Last edited: Nov 14, 2014
  11. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    A couple videos showing the Kangaroo and it's teaching mode. Potentiometers would almost always be cheaper, but the Encoder seems "interesting" if you believe in the value of digital vs analog. The Kangaroo is very "friendly" to encoders with an I terminal for three channel "indexed" incremental quadrature encoders and L1,L2 terminals for limit switch option. Picking a 1024 pulse/rev encoder gives accuracy of 0.4 degrees for 180 degree of motor travel--that is probably about 1/8" of shoulder movement on a shaker seat. Most potentiometer linearity limits in that range.

  12. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    Also there are "hall effect" potentiometer equivalent position sensors like these.
    http://www.potentiometers.com/select_hall.cfm

    My understanding is that if the output is 0-5V then it is an analog pot, however it delivers that output, where an encoder is digital in that it delivers digital pulses that must be counted by a computer or microcontroller. The Hall effect is the production of a voltage difference (the Hall voltage) across an electrical conductor, transverse to an electric current in the conductor and a magnetic field perpendicular to the current. It was discovered by Edwin Hall in 1879.
  13. telfel

    telfel Active Member

    Joined:
    Feb 16, 2011
    Messages:
    170
    Balance:
    4,736Coins
    Ratings:
    +118 / 3 / -0
    Have modified a couple of my motors the accept these encoders AMT 103 kit

    less than £16.00 each + £3.00 for connecting cable

    [​IMG]

    dip switches for setting pulse counts, adapters to fit various diameter shafts, alignment tools for installation.

    Working ok on a test bed, with homing switch on output shaft
    regards Terry
    • Like Like x 1
  14. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    Looks like a nice product. Here is a video..unfortunately I do not speak German but I get the point. Nice idea for the shaft connection. Would love to see a picture of your homing switch set up. The Kangaroo provides for limit switch inputs and also has a connection for a "index" or homing position.
  15. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    Looks like the AMT103 has the index output "Z" ?
    http://datasheet.octopart.com/M313X0001-CUI-datasheet-15696199.pdf
  16. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,622Coins
    Ratings:
    +1,835 / 32 / -1
    This is the hall effect pot (from your link) several of us have been using now instead of a standard pots. http://www.potentiometers.com/Series6120.cfm They are 12bits and commonly available in 360, 180, and 90 degree models and you can special order if you need something different. They are accurate to +-.1 degrees by my testing.

    A 1024ppr encoder is equivalent to 10bits at 360 degrees. Both the kangaroo and the roboclaw use 12bit analog to digital converters. So using a 12bit hall effect pot is equivalent to 4096ppr @ 360, 8192ppr @ 180, and 16384ppr @ 90 degrees. Another thing worth noting is a 90 degree 12bit hall effect pot using a 10 bit adc to read it is also equivalent to 12bits at 360 degrees resolution.

    That said, we use pots at the gearbox shaft. If you use a 1024 ppr encoder on the motor shaft instead, and you are using a 25:1 gearbox for example, that is the same as 1024 * 25 = 25600ppr in comparison to when using the gearbox shafts output. And you can’t beat an optical encoder for accuracy I don’t think because when there is no movement, there should be no drift or hysteresis.

    Also, since the kangaroo has a built in microcontroller, it can count index pulses as you mention just like an arduino or other microcontroller can. And talking about all this lead me to think about something I haven’t considered yet when using the kangaroo. Maybe the key to using it with motion platforms is using encoders! I couldn’t get an auto tune to complete on 90 degree halls. It moved to fast, went out of range, and gave an error. Maybe the feedback is just to slow for the kangaroo when its using the gearbox shafts output. Also, just like the roboclaw, the kangaroo is largely developed with robots in mind, and not motion platforms. Using pots for feedback with the kangaroo is not ideal for motion platforms partially for this reason. Do you think you will give it a try with encoders @stroutmail?
    • Agree Agree x 1
    Last edited: Nov 15, 2014
  17. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    Yes. I think I will try the encoder route. The heavy duty optical ones like Omron are REALLY expensive so trying to find a good candidate for reasonable price. The capacitive ones like at103 look interesting.

    I don't think using the motor shaft rather than gear output is necessary as long the encoder has enough pulses per revolution. I will try to use 180 degree of shaft rotation.

    The worm gear motors do not commonly have the exposed motor shaft..those that do are mostly planetary. Worm vs planetary is another raging debate I am sure but I prefer the worm design. If i need more than 180 degrees I will run the encoder off a pulley.

    The ability to program various speeds promises some interesting possibilities to test. Seems like encoders make the system more "smart".

    Probably time for a mockup test to experiment with concept.
  18. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,622Coins
    Ratings:
    +1,835 / 32 / -1
    My post above was for comparison purposes but I forgot to mention that those high resolutions are not really necessary. When using 180 degrees of a 1024ppr encoder directly on the gearboxes shaft you will have 512 positions to use (actually less since you need to allow some of it for overshoot at both ends). That is more than enough positions for most simulator designs. But it seems logical that a system that uses pid control would benefit from having a higher resolution input. And , it appears to me anyway, that encoders are typically used on the motors shaft.
  19. DanielDk

    DanielDk Member

    Joined:
    Feb 27, 2012
    Messages:
    38
    Balance:
    386Coins
    Ratings:
    +12 / 1 / -0
    Just as an fyi. Using an encoder sucks up a lot of resources on the interface cpu, this coupled with the need to catch ALL ticks from the encoder pretty much meas that you need dedicated hardware to do encoder counting. The high PPR and high RPM = a lot of consumed resources.

    I can recommend the Arduino DUE as it has hardware support for 1 quadrature encoder. It does both speed and position directly in hardware, leaving the cpu free to do other stuff.
  20. DanielDk

    DanielDk Member

    Joined:
    Feb 27, 2012
    Messages:
    38
    Balance:
    386Coins
    Ratings:
    +12 / 1 / -0
    BTW i use Arduino DUEs and Omron E6B2-CWZ5B encoders with no issues at all. Also because of the high precision of encoders - the 32bit arm architecture comes in handy :)
    • Informative Informative x 1