Angle Sensing Potentiometer

I have recently used this potentiometer to sense the direction of a turret on a Vex robot. It is available from Digikey as P/N 490-2400-ND. It can sense almost a full 360 degrees. It allows full rotation with no mechanical stops.

The easiest way to connect a Vex shaft to it is to grind one corner of the shaft flat so that it just fits into the D-shaped hole on the pot. I have also carefully notched A V-shape into the flat of the D-shaped hole so that the square Vex shaft will slide through the hole. (I destroyed several pots before I got it right).

You can wire the red(+) and black(-) wires of an extension cable to the outside terminals (1 & 3). Wire the white (signal) wire to the center terminal (2) . Plug it into an analog port and read it like you would a light sensor.

I used rubber bands to attach the pot to a plus-gusset and mounted the plus-gusset on beams. The rubber bands hold the pot in place, but will stretch to accomodate any misalignment of the shaft.
So far this has worked great, and is much more compact and convenient than using a shaft encoder.

https://vexforum.com/gallery/files/1/4/6/1/anglepot.jpg

wow, that sounds like it works very efficiently:)

what does it do

It produces a voltage that is proportional to the angle of rotation of a shaft. This can be used to measure the angle of, say, a shoulder joint on an arm or the direction that a part is pointing.

o could you put it on the front of a robot and like detect objects with it like putm some meetal on the shaft and the the metal hits the stuff in front of it and detects was side it is on and how much it shoudl turn

ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff is the thing like a optical shaft encoder but more sentsitive

when you first turn your robot on, does it immediatly sense where it is positioned, or does it require movement?

It wakes up knowing exactly where it is.
That’s one nice thing about potentiometers. They provide an absolute position indication, unlike an incremental encoder that only provides information about relative movement from one (possibly unknown) location to another.

i was hoping you would say that. i will definatly have to look into buying some of them.

Nice!!!

FRC Team 957 used a much larger 10K Ohm potentiometer for our Arm positioning. This is small and compact, a lot can be done with these. on both the Vex and the FRC robots…

How do you program the pot? Like counting rotations not 0-1024bits

Depending on the resistance, the Analog to Digital Converter (ADC) return a value between 0 and 1023…

Is the vex microcontroller fast enough to send signals back and forth through the poteintmeter so that the robot could balance on one wheel?

srobot was developing the Vegway. using the Vex line follower sensor.

srobot’s programming was “quite reactive”, and could use some refinement, probably using a proportional-integral-derivative controller (PID controller).

Thanks Marko, that robot is really cool

Yes I know that, but I mean, how do I turn the 0-1023(10bit value) to an actual distance? But I have the answer (Found on ChiefDelphi)


//Constants and definitions:

// ANALOG INPUT 09 - RIGHT DRIVE WHEEL POT
#define RIGHT_WHEEL_POT	rc_ana_in09

#define DISTANCE_PER_REVOLUTION 32
#define REVERSE_DIRECTION	512L

void GetRightDistance (void);
long GetRightDistanceInches (void);

// Right wheel tracing variables.
extern long WheelRightCount;
extern long WheelRightPrevious;
//extern char WheelRightDirection;
extern unsigned char WheelRightFirst;

//Initialization code:

WheelRightInitial = GetAnalogValue (RIGHT_WHEEL);
WheelRightCount = 0;
WheelRightPrevious = WheelRightInitial;
//WheelRightDirection = 0;

//Not shown is other PWM and analog port initialization.

//The following function is called every OI message loop to track the pot position to count transition.

// Get rotation sensor distance.

// The GetRightDistance functions are called every OI message loop pass
// to count transitions of the pot.

void GetRightDistance (void)
{
unsigned int d;
long m; 					// Magnitude of distance moved.


d = GetAnalogValue (RIGHT_WHEEL_POT) // Get the pot reading.
m = d - WheelRightPrevious;			// Compute the difference.
m = (m >= 0) ? m : -m;			// Take the absolute value.

if (d > WheelRightPrevious) {		// Is the new value bigger?
    if (m > REVERSE_DIRECTION) {	// Yes. Direction reverse?
        --WheelRightCount;			// Yes. Increment Transition Count.
        WheelRightDirection = -1; 		// You must be going backward.
    }
    else 
        WheelRightDirection = +1; 		// Set the direction to forward.

} else if (d < WheelRightPrevious) {		// The new value is smaller?
    if (m > REVERSE_DIRECTION) {	// No. Direction reverse?
        ++WheelRightCount;			// Yes. Increment Transition Count..
        WheelRightDirection = +1;		 // You must be going forward.
    }
    else
        WheelRightDirection = -1;		// Set direction to backward.
}
// Do nothing if the distance is the same.
WheelRightPrevious = d;			// Save the last point for comparison.

} // GetRightDistance ()


//To get the distance traveled in user unit:

// The GetRightDistanceInches functions are called by autonomous mode 
// when the distance in user units is needed.

// Convert distance traveled to tenths of inches.
long GetRightDistanceInches (void)
{
    long d;

    d =	(1024 - WheelRightInitial) + 
((WheelRightCount - 1) * 1024) + 
WheelRightPrevious;
    return ((DISTANCE_PER_REVOLUTION * d) + 512) / 1024;

} // GetRightDistanceInches (void)


Or read this whitepaper http://www.chiefdelphi.com/media/papers/1743