View Full Version : Angle Sensor for Vex
tacman1123
01-06-2006, 13:25
I'm looking for a rotation sensor for the Vex, an angle sensor. I have the optical shaft encoder, but I see that it doesn't measure the direction that the shaft is rotating, so it's impossible to use it to calculate the angle.
The new Mindstorm NXT kit will have angle measurements (to 1%) built into their servo motors, something which I think will increase the precision of Mindstorm bots significantly.
I've also played around with the idea of using the optical shaft encoder and some other mechanism for seeing which direction an axle is turning, but can't come up with anything that immediately responds to a change in direction. An angle sensor is really what I'm looking for.
Thx,
Tac
I don't know how to do an angle sensor, but an idea I've had is to attach an intake roller to an axle, then position a limit switch so the metal end of it gets hit by the intake roller. Since the roller and metal are flexible, they can bend and let the roller spin. The roller spinning one way will trigger the limit switch, the other way it won't.
I haven't tested this of course, just an idea.
Greg Marra
01-06-2006, 20:23
Was it the VEX sensor or the KOP sensor that pulsed for a slightly different length of time one direction than the other?
The other option would be to get a quadrature encoder, which has two inputs that fire in one order for one direction, and the other for the other direction. It involves using interrupts to listen to which one goes first, but would solve your problem.
If you don't need 360 degrees, a potentiomiter works well. We used one this year to measure the tilt of our robot's shooting mechanism. Of course you would need to do some calibration to match the voltage values with the angles that you want to find.
I don't know how to do an angle sensor, but an idea I've had is to attach an intake roller to an axle, then position a limit switch so the metal end of it gets hit by the intake roller. Since the roller and metal are flexible, they can bend and let the roller spin. The roller spinning one way will trigger the limit switch, the other way it won't.
I haven't tested this of course, just an idea.
I can't believe I completely forgot about potentiometers. Probably because they're not standard for Vex and I was assuming he was looking for Vex parts.
A potentiometer would be a very effective use for this, most of them can measure close to 300 degrees of rotation. Alot of them are single turn, some can be turned a few times (I've seen up to 10 turn ones), and there are a few rare continuous-rotation potentiometers that can handle infinite revolutions. They would only require one pwm cable soldered on to the POT and one analog input to hook it up to for each POT.
The KOP gear tooth sensors have different pulse lengths for different directions, Vex encoders are blind to direction. I should probably clarify my idea above was for sensing direction with a Vex encoder, since I failed to mention that in the post.
If you're trying to tilt something to a specific angle (rather than just measure somethings angle), you could just use the Vex servos as they can be set to specific positions. I'm not entirely sure what the conversion from PWM values to degrees is, but I'm sure it could be found.
Tom Bottiglieri
02-06-2006, 00:29
If the motors are the sole thing controlling the motion of the robot, you can just look at the output signal to determine whether they are moving forward or backward.
0-126 Backward
127 Neutral
128-255 Forward
If you don't need 360 degrees, a potentiomiter works well. We used one this year to measure the tilt of our robot's shooting mechanism. Of course you would need to do some calibration to match the voltage values with the angles that you want to find.
Can you give some detailed info on what size pot you used, and how you hooked it up?
RoboMadi
30-06-2006, 11:06
Well you can use couple, but it depends on how you use them. For example pot. are good but not that reliable, as they don't give you a precise reading (eg if you set Position A at 210, it might not remain the same and fluctuate).
I recommend using Infrared sensors, if you are mounting it on an angle and trying to find/set a certain distance.
Other than that, this (http://sensors-transducers.globalspec.com/Industrial-Directory/angle_sensor) might help you a bit.
What kind of accuracy and range are you looking for this sensor?
If you want to experiment with potentiometers you can find them in random parts bins at electronics stores (radio shack has them in those racks of parts). They're usually like $5-$10. I'm not sure what type of resistance the POT would need to work with Vex.
Just wanted a wide enough range to determine when the arm was all the way down, all the way up, and an idea of where its at in the middle. I want to control an articulated arm to determine position upon bot startup and set both arms to their neutral positions, then use the sensors to detect extension and make sure the upper arm is limited while the lower arm is in its neutral position, and make sure the lower arm cannot close if the upper arm is beyond a certain point. I was thinking of using the pots connected to chain drives to do gear reduction to get a analog input for the entire range of motion along both arms.
John Gutmann
30-06-2006, 18:12
IF you make the right kinda of endcoder, OR find one somewhere, just by looking at how the encoder beam is broken you can tell which direction the wheel is spinning.
For example if you have 2hall effects next to each other on a sprocket
and a tooth hits the left on before hitting th right one then it is traveling one direction, and the inverse is also true for the other direction.
UPDATE*** I used 2 50k pots (1 for each arm) and linked them directly to the pivot axle of the arm to get my readings. I know get analog values from 0 to 86 or so that I can use to determine if I am close to the arms limit for range of motion. Wiring was easy as I took a pwm extension cable and cut off the female end to solder it to the pot (center & either outer tap on pot, signal & ground on controller end). To mount it to the shaft I had to cut off some of the length (RS's pots are like 3-4 inches) and then I used a dremel to hollow out the shaft so it would fit over an axle. Origionally, I had drilled another hole in the side of the shaft for a set screw, but the walls are to thin to get any turns, so I have resorted to gluing the pot to the axle. Once accomplished, it is a simple thing to read the value of the pot to see where the arms are.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.