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

Using a rotary encoder in place of a potentiometer

Discussion in 'Electronic and hardware generally' started by Alexey, Apr 26, 2017.

  1. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,897
    Location:
    London
    Balance:
    11,610Coins
    Ratings:
    +458 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    how many turns can they go to ?
  2. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,574
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 38 / -0
    My Motion Simulator:
    AC motor, Motion platform
    Really don't know, will depend on your supplier. I have required and used 3, 5 and 10 on different systems.
  3. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    hi guys a bit pleased with myself at this little test today , as you may or may not know I have been looking into usung Thaanos's Encoder2pos Interface to allow me to use Optical encoders as an alternative to Rotary Pots .. well 1st of all I have the units running well on my trial setup using Encoder2Pos Interface,Sabertooth 2x60 and trialed on two software interfaces
    1 AMC128USB, Ians BFF 6dof motion controller Software, encoder2pos interface with 600ppr Optical encoder..
    2 SMC3 Packet serial , encoder2pos interface with 600ppr Optical encoder , Sabertooth 2x60

    having had some success with the 1st option and after trying BlazinH's SMC Packet serial option I had a light bulb moment ( this may have already been attempted but for me it was a 1st...) anyways thinking that the Encoder2pos interface spits out 0 - 5V for a your actuator total distance travelled, once calibration is done then hmmmmm why not connect this to the ARD SMC setup .....:)

    after a little fine tuning i'll be dammed, the dam thing seemed to work a charm ...that was the YEEEE HAAA Baby moment.

    its early days yet and until I can get sorted Simtools V2 wise I need to do more tests , but have to say so far it look good . Will post Video once I tidy the man cave a wee bit and make spaghetti wiring look semi presentable ..

    Attached Files:

    • Like Like x 2
  4. Thanos

    Thanos Building the Future one AC Servo at a time... or 6

    Joined:
    Jul 6, 2017
    Messages:
    1,347
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    2,699Coins
    Ratings:
    +1,043 / 9 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    Don't forget, you need to have the SMC3 be steady in 50% while the encoder2position module calibrates, otherwise the motor won't move to both directions to complete the calibration. As soon the calibration on the Encoder2position is done, it indicates its ready by a LOW signal on pin A4 (HIGH during calibration).

    Encoder2position schematic.jpg

    This also means you need to be careful not to calibrate the motor while the SMC3 is performing motion from PC... perhaps you can alter it code to block motion and set the output to 50% while the A4 output is HIGH.
    • Informative Informative x 1
  5. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi @Thanos I actually cheated calibration wise for these initial tests, and triggered the limit switches manual as this setup did not use the actual test actuator ( don't trust it yet till I fit the limit switch activation relay, so with motor spinning I manually tripped the switches to simulate distance moved . just using the Encoder2pos PCB , USB power supply and sabertooth, motor as seen in the video .

    I then reconnected the calibrated Encoder2pos to the arduino and ran SMC utility. from what you describe i'll be able to do this without going down the road (calibrating whilst nit connected to smc ) mentioned above , so tonight's test will be using your advice ..

    Thanks guys , This is the sort of feedback I need to be able to post some good info jeep it coming guys .
    • Like Like x 1
    Last edited: Dec 4, 2018
  6. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,897
    Location:
    London
    Balance:
    11,610Coins
    Ratings:
    +458 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF

    Hi Alexy,

    How did you get on with this ?

    Is it possible to use a different arduino board that has more resolution than 255 values, and program the smc3 code to read the encoder values as a number rather than read a voltage ?


    Edit- the Arduino Due can handle 12 bit resolution or 4096 different values
    Last edited: Dec 28, 2018
  7. Alexey

    Alexey Well-Known Member

    Joined:
    Sep 23, 2014
    Messages:
    452
    Occupation:
    Electronics Technician
    Location:
    Adelaide, Australia
    Balance:
    8,060Coins
    Ratings:
    +620 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Arduino due would certainly benefit from the extra bits and speed. I haven't dived any further into this as my need for it has dissipated.

    The biggest problem with this is universality. It would need to have a replicatable calibration procedure that works with anyone's setup (not a big hurdle but needs a good solution).
    Apart from that, there really isn't a benefit to this compared to a good quality pot. This being due to repeatable accuracy. The big problem with step encoders can be a loss of positional accuracy due to poor code implementation or noise. A problem I was having was that after 30 mins of use I had lost a number of steps and hadn't figured out what the cause was.

    I'll probably visit this again in some time but sorry to say I work very slow with these things as I just don't have much time these days.
    • Like Like x 1
  8. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    335
    Location:
    Montreal, Canada
    Balance:
    2,415Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    DC motor, 6DOF

    Hi ,
    how goes your rig with yours encoders ?
    thanks
  9. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi guys , I realise this is an old Post but thought this device might be cost effective , Found these on E Bay and wondered if they would be something to possibly be used in place of Rotary Pots ,


    https://www.ebay.co.uk/itm/325mm-Pu...m=382418713094&_trksid=p2047675.c100005.m1851

    https://www.ebay.co.uk/itm/Pull-Rod...m=283280776305&_trksid=p2047675.c100005.m1851

    if the price and Specs are genuine I would buy one for testing but not sure about Quoted Operational speed 10 m/s ??

    can I ask you guys with a bit of tech/Electronics Knowledge to give these a glance over and let me know if these devices could be used for our Actuator . at £35 - 40 each price wise they seem OK

    Cheers
  10. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi @Flymen seems after a long time trying i had to admit defeat as i failed to get the Optical encoder option working to a safe repeatable standard ,

    So decided to Move back to Rotary Pots as feedback device for my actuators and will keep the Optical encoder interface and bits for future use, once more setup Information is out There.

    I Got it operational with FlyPt Hexpod But was seeing what I called lost or accumulated count wind up, which meant the actuator would Lose , normally if the actuator needed to do fast Long Moves back and forth ..

    so whilst looking for Multi turn Pots I came across the devices Above and had to ask for some tech advice form the crew here Cheers
    • Informative Informative x 1
  11. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi Crew , Small but positive update, so Basically after beating my self up trying to get the New Encoder2Pos Interface working i was about to call it Quits when @Thanos came to the rescue yet again .:)

    As mentioned in the AMC128USB posts i turns out the Optical encoder i was using was nit Compatible and led me to all sorts of test issues which eventually made me think i will have to stop and move on..

    Anyways Thanos Recommended an Encoder which he knew worked and so i opted to give this test one more try , The Encoder2Pos interface was fine the AMC128USB Barebones version was also fine and so once i added the new AMT103 Encoder all my lost position errors went and the Actuator now has a reliable Encoder Option fitted, so i once again had a safe to use powerful Actuator .

    Been stress testing it as much as i can , and so far the results have been very promising , my confidence that the actuator wont try to kill itself or the operator has increased tenfold and i have as yet not once seen the E-stop limit switches being tripped ,

    i have attached my pictorial connection diagram , and will post proper updates describing how i set the system up in the next few post .

    With the tests now going better i anticipate the next step will be to Buy more Encoders and retro fit them to my remaining 6 actuators ---Then finally after this long laayoff i can get to play with my fully working 6DOF platform

    more to come :)
    • Like Like x 2
  12. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,399Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Which encoder were you using before because looking at it I have bought one myself to test and it looks the same as the one you had lots of problems with. Was it one of these ?

    Wisamic 600p/r Incremental Rotary Encoder Dc5-24v Wide Voltage Power Supply 6mm Shaft

    www.amazon.co.uk/dp/B015GYY7XU/ref=cm_sw_r_cp_apa_i_xXSSCbF9D8MKA
  13. MarcoMade

    MarcoMade Active Member

    Joined:
    Jan 3, 2018
    Messages:
    150
    Occupation:
    Tecnico pc hardware/software MadeFix
    Location:
    italy
    Balance:
    157Coins
    Ratings:
    +62 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    fantastic project !!
    reading the encoder problems, I am reminded of very cheap and precise encoders used in common ink jet printers.
    these are ribbons with notches drawn on a well-stretched plastic strip that lets you know the exact position of the print head.
    have you thought about it?
    idea put there.
    good continuation
    Marco
    • Like Like x 1
  14. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi @SilentChill yeah mate you ended up doing what i did , these are similar to the ones i bought via flea bay and Nowt but grief trying to get system to work safely ..the AMT103 were Circa £18.00 A pop so now considering the price difference you would save a bucket load of hair pulling. note these amazon / flea bay type encoders work fine on other projects but found out they are just not really compatible at moment with the Encoder2Pos Encoder interface im using .

    Been manually testing this setup now through FlyPT for these last few days now, using my spare actuator, and there's a mile load of improvement, the main thing for me is that the actuator is safe again .. it was scary trying to get the system to work with the original encoder and to be honest i was about to chuck towel in and to his credit @Thanos set me on the right track , so once again im a happy camper .. i bought my 2 from Digikey UK ( funny thing is it was shipped form USA ??? ) no biggie as it was here in a few days .. .. Cheers @SilentChill

    What interface are you using with the encoder at the moment ?
    Last edited: Apr 14, 2019
  15. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,399Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF

    I'm going over to the 1280 when I eventually upgrade just getting all the bits together. Going 24v with the 2x60's. Got everything to make up one actuator just need to design the 3D printed parts.

    I bought one of those encoders as it was mentioned here https://www.xsimulator.net/communit...ode-we-currently-have-with-sabertooths.13152/

    The original one I posted would be better as it would fit straight onto the bottom of the motor so I may order one from Alibaba see if it works
    • Like Like x 1
  16. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    hi @MarcoMade thanks for the info , to be honest i have not looked at that option in detail , because there use in printers would imply less distance travel to what we need for these actuator (thats only my opinion mind you ) also getting my head around installation & setting these up for the actuators also might be problematic.

    Im saying this, but dont have a source for these, so not sure how customization would work out.. the idea g
    has merit, but the fitting and protection might be an issue ( remember these are only my thoughts ) the guys here may have a different take on this application , Cheers
  17. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi @SilentChill dont know if this will help , but i had the same issue of not having direct access to the motor shaft when fitting and Optical encoder Mysolution was too fit a fine toothed timing pulley bored out to suit motor shaft diameter secured with grub screw and mating continuous (3D printer sized) belt to drive the Encoder Mounting shaft gear at 1:1 ratio ( the encoder shaft was mounted in 3d printed housing which had dual bearings fitted so that no load would be transmitted to the encoder)

    The 3d printed housing and encoder mount is designed to be retrofitted to the actuator see attached photos in post AMC1280USB Motion Simulator Controller
    • Like Like x 1
    Last edited: Apr 14, 2019
  18. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,619
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,399Coins
    Ratings:
    +3,480 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF

    Yeah I've seen it :)

    Would be nice and easy for me just to put that on the bottom of the motor no need to have extra parts then, Ampflow motors have the shaft for it at the bottom
  19. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Aha LOL doh Ok @SilentChill forgot you were looking to change motors and thought you would be still using Parvalux units .. Keep us posted matey as to your adventures with the new setup.

    Each feedback option has its merits but hoping the Optical path will less maintenance ( says the man with only 3 hours of tame running on his platform LOL )

    As the AMT103v Sensors seem less Bothered by Noise and maybe your sensor as well, Then if you have direct access to the shaft, Mounting them there has to be the way to go, Nice One
  20. zhai1987

    zhai1987 Member

    Joined:
    Sep 7, 2021
    Messages:
    96
    Balance:
    320Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, AC motor
    Very good project, I use a push-pull potentiometer!
    upload_2021-9-28_9-43-28.png upload_2021-9-28_9-43-55.png
    Last edited by a moderator: Sep 28, 2021