First year using sensors. Any advice?

Our team has enough depth in terms of mentors and students that we’d like to add some sensors to our robot. Since we’ve literally never added a single sensor to any of our robots, I was wondering if we could solicit some advice.

Our specific application: We have an arm that wants to rotate back and forth through a 90-degree turn. The arm is connected to a window motor. What manner of sensor should we use? I’m assuming some type of rotary encoder?

Thanks! :slight_smile:

Use a potentiometer and connect it to an analog input.

Or use an encoder and connect it to DIO on the DSC.

Or use a couple of limit switches if you just want to go from extreme to extreme without wanting to control at positions in-between.

Do some research. There are hundreds of recent posts about this topic. Do a little reading to get some background, then come back here and ask questions. We’ll be glad to help.

Search keywords:

potentiometer, encoder, PID, limit switch, load balancing, surgical tubing

For an arm application, I think potentiometers are a better choice then a typical rotary encoder.

They are easier to interface and debug (3 wires to a analog port that you can test with a multi-meter, vs 4 wires to 2 digital inputs that you need to test with an oscilloscope)
They provide absolute angle (typical rotary encoders only give relative position, which is a problem if you start with the arm in an different location)
They are significantly cheaper ($4 at radioshack or $10-15 for a high quality pot from digikey, vs $40 or more for a rotary encoder)
They are available locally
In my experience, they are much more robust then encoders

The main disadvantages of potentiometers are that they are noisy and have less resolution then encoders have never been an issue for us when used on an arm.

Whatever sensor you chose to use, put some thought into how you will test your system. Think about what happens if your sensor is not set up correctly or the software does not read the sensor correctly. Will the mechanical system get damaged?

For example, you may want to disconnect the motor from the arm, command the arm to move one way, move the arm manually and verify that the software stops the motor with the arm at the correct angle.

Be sure to allow for the momentum of the mechanical system and the reaction time of the system so that you are not trying to sense the position just as the arm is hitting a hard stop. If you do that, the motor may try to drive the arm past the hard stop.

Question from a student, since they don’t have an account:

We’ve decided to go with potentiometers, but are there any recommendations for type/brand/store? There are too many options on the DigiKey site.

Here’s a nice potentiometer from Digikey: Bournes 3852A-282-502AL for $9.35.

Make sure you use your Digikey PDV, if you haven’t already.

Digikey site takes a bit of getting used to.

Here’s the search process I did to find a 10K potentiometer.

Click on Product Index

select Rotary Potentiometers – Linear

narrows it to 2700 options

set resistance to 10k ohms and check the In Stock checkbox, then apply filters

now 245 options

you’re likely going to mount it via a through hole, so select that mounting option and apply filters

now 97 options

now sort the result by price, low to high (ascending order)

ok, now to pick from the low priced options:

now look at the other product attributes that are available and see which ones you care about

do you care about how long the actuator is? Filter on Actuator Length
do you care about the shape of the actuator? Filter on actuator type
do you care about how it mounts? Filter on adjustment type

Go look at the pictures of some of the items if you can’t figure out what the product attributes mean.

http://www.digikey.com/product-detail/en/P160KN-0QD15B10K/987-1308-ND/2408885 might be a good starting point. $0.84 each in qty 1.

If you then go to the manufacturer’s spec sheet for those, you can see all of the options they offer, and work backwards from the manufacturer’s part number if there’s a different configuration you want.

Micheal

The part that Joe linked to is a good quality part and should work just fine for you. It would normally be found in high quality industrial or military grade equipment unlike the consumer grade parts found at Radio Shack.

You want to use something in the range of 2kOhm to 20kOhm. The industrial equipment I design (similar to the CRio) is frequently connected to 10kOhm potentiometers. In most robotics applications, you will want to use a “linear” potentiometer with a 1/4 diameter shaft.

The shafts are typically made from aluminum and are easy to cut if too long. Just clamp the end of the shaft in a bench vice and cut it with a hacksaw. Mount it by drilling a hole that fits the threaded part of the body. Mark the location of the anti-rotation device that sticks out from the body. Drill a second hole that is large just enough to accomodate the anti-rotation device. Make sure you use the washers and lock washers under the nut.

The coupling to your arm does not need to be very substantial since it should take very little force to turn the potentiometer shaft. We used a piece of surgical tubing forced over the shaft then pushed into the shaft (1/2 inch OD tube, 3/8 inch ID) of the dumper my son built.

Make sure that the potentiometer still has travel beyond the two ends of the 90 travel that you want. Lastly, do not use the potentiometer as the “hard stop” that prevents the arm from travelling beyond a certain point or you will break the potentiometer.