1732 views

# A potentiometer to encoder conversion in ROBOTC?

1. 4 years ago

### Jacob Wall

25 Feb 2012 Kirkland, WA 4770

So, I've run into a slight problem with my team. We have a system with four motors, and we need to be able to synchronize those motors, however two are monitored by a potentiometer, while two are monitored by an encoder. I was wondering if there was a way to convert the output from the potentiometer and the encoder into some sort of common units, so we can perform the necessary calculations and apply them to the motor? How is the output of the potentiometer compared to the output of an encoder?

2. ### magicode

25 Feb 2012 4542

I don't have the answer, but you can find out pretty easily. Push a shaft through an encoder an a potentiometer at the same time. Then find out how much the potentiometer moved vs. how much the encoder moved. I've done this and it works nicely. The potentiometer may not be exactly linear, so depending on how precise you need this to be, you can turn it to several increments and check the values, or better yet, write a program to do it for you.

3. ### devinc

25 Feb 2012 Murrieta,CA 569C

please do not tell me this 4 motor system happens to be on a drive or on something that runs in more that 270 degrees. I have seen way too many people put a potentiometer on a wheel on their drive, and they always wonder why it won't work.

4. ### MarkO

25 Feb 2012 Albany, Oregon, USA, North Wes...

@devinc please do not tell me this 4 motor system happens to be on a drive or on something that runs in more that 270 degrees. I have seen way too many people put a potentiometer on a wheel on their drive, and they always wonder why it won't work.

I don't have the Vex Potentiometers, but if there like typical Potentiometers, they will Break, if Exceeded.

@magicode I don't have the answer, but you can find out pretty easily. Push a shaft through an encoder an a potentiometer at the same time. Then find out how much the potentiometer moved vs. how much the encoder moved. I've done this and it works nicely. The potentiometer may not be exactly linear, so depending on how precise you need this to be, you can turn it to several increments and check the values, or better yet, write a program to do it for you.

The "Real World", unlike Programming is Rarely Perfect...

Because of of the Linearity of the Potentiometer, and the "placement repeatability", some other sorts of Parameters may be needed to provide a Complete Solutions to this problem..

First, the Encoders are always Relative to the starting Count, Usually from Zero, to the MAX VALUE of your Travel, where as the Potentiometer will Start with a High Value or Low Value, depending on how they are Installed and Move to the Opposite Value..

Also, due to Backlash , you might get Different Results from the Encoders and Potentiometers when reaching the Same Point, depending on the Direction of Travel.

Encoders will Most Likely need a Limit Switch at Each End of the Travel, so as to know when you reached it.

A "placement repeatability" test can be formed, Say for Instance, if You Know your Encoder is Started at Zero, and counts through 1267, you run the Travel from One Limit Switch to the Other, Multiple Times. If the Counts consistently reach Zero and 1267, at the Respective Ends, your "placement repeatability" is Really Good. If it is kind of close, say it Varies at the Zero End from +5 to -7, you then have a Range that you know is "close" to the End", and any Points in the Middle of Your Travel, can be OFF by that Range...

Potentiometer might need Limit Switches as well, and a "placement repeatability" test can be performed on them as well.

If you have "placement repeatability" Issues, and Limit Switches at Both End of Travel, you might need to:

Reset the Encoders to Zero and Always Count Up, rather than Count Back Down, and have Separate "Look-up Tables", for each Direction.

Sample the Potentiometer at the Limit Switch when at Each End of Travel and have Separate "Look-up Tables", for each Direction.

If "placement repeatability" is Off by a Range that is within your Margin of Error, there is not likely much reason to change anything..

Then by Making a Table to match the Encoders and Potentiometers values at the same Position/Location, you can then know when your Motors are at the correct place..

Good Luck in getting everything working..

( A Critical Example of "placement repeatability" is in Pick-n-Place machines , especially ones that assemble very small electronic devices...)