Rotary Position Sensors

Last year we tried 100k pots to sense arm joint position, but due to noise and lower-quality pots, along with position drift, results were poor.

Searching, I find many teams using encoders, but that seems like a pain to program (to me at least) and they only offer relative position, so you need a home position. (Yes, some encoders give absolute, but have you seen the prices?)

This year, I found a Vishay 601-1045 full 360 degree “smart” position sensor, which outputs a zero to five volt signal (actually just a bit less) to indicate 0 to 360 degrees absolute position. Mouser sells these for around $60.

Does anyone have any experience with these? I’d like to hear about it. Also, if you would share your opinions, that would be good too. (For more info, just google “Vishay 601-1045” and click on one of the links at vishay.com)

Don

What kind of pots were you using? I have always had excellent results with them

Don,

One thing you may want to try is to use a 1k or 2k potentiometer for your position measurement rather than the 100k. From Section 19.1 A/D Acquisition Requirements - of the PIC datasheet: “The maximum recommended impedance for analog sources is 2.5 k ohms.” When we’ve used higher resistance potentiometers, we’ve seen a noticeable lag in the A/D value from the actual position. However, other than the slight time delay in acquiring an accurate position measurement, I’ve used inexpensive Radio Shack pots as well as some Bourns precision potentiometers with good results. (Note that this is only for the RC, not the OI where 100k pots are required.)

Mike

Cheap ones, around $1 each. They seemed OK based on O-scope testing, not noisy or dead spots, but I suppose you get what you pay for. Based on your comment I will try some good quality pots (like Bourns) and see what happens. Thanks for the comments.

Don

Mike,
Thanks for the comments. I can see how a high impedance (100k) would contribute to noise, and we also noticed some lag buy (incorrectly, it seems) assumed it was related to the controller. As well as some better pots, I will also try some smaller ones and see what happens. I believe this may be the key to success, and for that I thank you.

Regarding the OI, the limiting factor there is the current the port can supply, and I agree, 100k is a great choice, but have heard of success with slightly lower values. I don’t need to try that, however, because our controller works great with the cheap 100k pots.

Don

Before passing into the PIC, the analog inputs pass though an RC filter and no other buffering circuitry! I have not measured the values of these components but it is possible that the minuscule amount of current that makes it though a 100k pot doesn’t have the OOMPH necessary to rapidly change the input value and overcome the RC filter. The RC datasheet recomments 250-100KΩ resistors and in the example diagram uses a 10KΩ. Now if we look at the PIC datasheet, in big bold letters on page 220: The maximum recommended impedance for analog sources is 2.5 kΩ.. My guess is that it is quite OK to go above 2.5Ω but as you do, your accuracy goes down. The rated accuracy of the AD converter is 1/2 bit.

Btw 100K pots are required for the OI because it measures the current that flows through the pots. I believe it does this so that it can tell when joysticks are disconnected. The RC on the other hand measures the voltage that is input to it. Pots are used as voltage dividers for the RC but current regulators on the OI.

If i had designed the RC, i would have put some sort of buffer circuit in place to make the inputs less subject to impedance.

In the past we used a 10K pot with good results. I’ve noticed that with cheap pots any side force on the shaft can make them noisy. We always use shield 3 conductor wire for the analog stuff. Try taking 4 or 5 samples and averaging for a filter. You should be able to use a pot with out resorting to a op amp low pass filter.

Thanks for your other comments, with which I agree and will try out.

For the quote above, I disagree. I do not believe that the OI is reading the current, instead it reads the voltage. My thought is that the 100k limit is there to avoid issues with excessive current draw.

The specs of the OI state that the inputs are Analog, 0-5 volts. Also, IFI gives instructions for using a Y cable to connect two joysticks to the same port, which would double the current. Finally, they specify an 8 bit A/D which measured voltage (although I agree, they could measure current through a sense resistor - but why?)

IFI also states that any voltage below 0.05 volts causes an output of 127 (so the 'bot doesn’t go into full reverse), and this is easy to do in code.

NEVERTHELESS. If IFI states so clearly “Always use 100k pots”, who am I to argue??

Don

If you look further on in the datasheet, they say that 10K is the real max. Also, a lot of this has to do with timing, and not due to voltage drop (which I know is what you said, but I am just reiterating it). I would argue that the speed that you are going to be able to change the value of a 1-turn pot in a FIRST competition is relitivitally slow and therfore wouldn’t cause a huge problem, espically when the theoretical limit of updating your motors is 26ms, but likely even slower than that. However, it probally is good advice to stick with 10k, 5k, or 1k. Someone can feel free to do out the math from the datasheet and proove me wrong.

I would have to agree with Rickersen2 on this one - or at least agree that it isn’t reading 0-5 voltage straight off the pin. First, if you open up a joystick, only two of the pins off the pot’s are connected. This doesn’t mean there isn’t a fixed resistance inside the OI, but that pin on the OI is not getting a 0-5 signal from the joystick. Second, I’ve tried hooking up straight 0-5 sources to the OI with no luck.

Since there seems to be some confusion on this subject… the reason IFI requires 100K ohm pots is because of the design of the analog input of the OI. Between the analog input pin on the OI and the actual connection to the microcontroller inside there is a pull-down resistor. This is also why you are not supposed to connect the other side of a potentiometer connected to the OI to ground (see OI reference guide page 5). The pull-down resistor creates a voltage divider with the potentiometer, such that even when the pot is turned all the way down the processor inside will still see some voltage. The effect of this is that the only way the OI will see 0v at the analog input is when nothing is connected to it.

The whole point of this setup is a safety mechanism. With this configuration, the OI knows if there is nothing connected to an analog input (because it will read 0v). Using the software inside the OI, they can remap a 0v input to send the value 127 to the robot. Bottom line: if you have a joystick plugged in to your OI and you’re using it to control your robot, and someone accidentally yanks out the joystick cord, do you want your robot to see 0 or 127? If your robot saw 0, it would suddenly go full reverse if the joystick was unplugged!

Now, the reason it has to be 100K ohm is because of the value of the pull-down resistor. If you use something less than 100K, you will be changing the minimum voltage that you can send into the OI which will limit the range of values that your robot will see in response to moving the pot.

I’m not sure but if you were to use a very small capacitor say .01(mu)F that would eleiminate the electrical noise

The part im not so sure about is whether or not FIRST will allow the capacitor right there or not,

Regards,
Cuog