VEX Forum A potentiometer to encoder conversion in ROBOTC?
 Portal Register Gallery Wiki Members Calendar Search Today's Posts Mark Forums Read Rules

 UNOFFICIAL Answers - Ask the Community! Community Members can provide UNOFFICIAL answers to the questions from the "locked" forum above.

#1
02-24-2012, 10:34 PM
 Jacob Wall Junior Member VEX # 4770 Join Date: Oct 2011 Location: Kirkland, WA Posts: 15
A potentiometer to encoder conversion in ROBOTC?

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
02-24-2012, 10:48 PM
 magicode Senior Member VEX # 4542 Join Date: Sep 2010 Posts: 608 Images: 8
Re: A potentiometer to encoder conversion in ROBOTC?

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.
__________________
It's not a bug, it's a feature.
#3
02-24-2012, 11:18 PM
 devinc Senior Member VEX # 569C Join Date: May 2010 Location: Murrieta,CA Posts: 524 Images: 1
Re: A potentiometer to encoder conversion in ROBOTC?

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.
__________________
569A, B, & C Mentor
#4
02-25-2012, 02:41 PM
 MarkO Senior Member Join Date: Aug 2006 Location: Albany, Oregon, USA, North Western Hemisphere, Planet Tera Posts: 2,340 Images: 10
Re: A potentiometer to encoder conversion in ROBOTC?

Quote:
 Originally Posted by 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.

Quote:
 Originally Posted by 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...)

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)