Random Tip: Tweaking with a Potentiometer

This is probably not news to many of you, but here is my random tip of the day:

**Use a potentiometer to configure your bot so you don’t have to run back to the programmer to tweak your constants.
**
I just finished helping a team build a line tracker bot, and rather than settle on a specific threshold for light-vs-dark, we plugged in a potentiometer and used that to set the threshold.

That worked so well (326 was our magic number) that we decided to use one to set the top speed too.

Once you have your bot performing just the way you want, you can read the values back using the On-Line Window and then hard-code them into your program. Or, you can just leave the pots on the final bot for on-the-fly adjustments.

Cheers,

  • Dean

Wow I never thought of that. Seems like a good way to switch other things too.

tip of the day? there will be more?

Go crazy! If you are using it to select more than 3 or 4 choices, you’ll need some way to report back what is selected. Maybe an LED that flashes some number of times.

I can’t promise to have flashes of inspiration every day, but I’ll post when something seems worth sharing.

Cheers,

  • Dean

Very good idea with the potentiometer.

Thanks

Technic-R-C

I think I found our new auto mode selector.

39 has been doing it for a while, it is really easy and effective.

I was wondering would it be possible to interface your own potentiometer.

I have a whole bunch but i am unsure of exactly how they are wired.

It is briefly described in the pdf included with the Vex Sensor Test at the bottom of this page.

It is pretty easy, though: Start with a linear-taper potentiometer in the 10K to 100K range like this one.

The potentiometer has three terminals. The center terminal (wiper) gets the white wire (analog signal). The outer two terminals are wired to the red (VCC) and black (GND) wires. Generally black goes on the left and red goes on the right, but it doesn’t really matter.

As you turn the potentiometer clockwise, the analog values will either go up or down, depending on which way around you wired the red and black wires. If you want it to go the other way, just swap the red and black wires.

If you notice that the values change a lot near one end of the potentiometer’s travel, and the numbers change very little at the other end, then you probably have an audio-taper potentiometer. It will still work, but the numbers don’t change linearly with the rotation angle.

Cheers,

  • Dean

Check out this lesson from the CMU robotics academy on how to make your own sensor (potentiometer). It is really easy and everyone can do it!

I think they link you wanted is:
<http://www.education.rec.ri.cmu.edu/roboticscurriculum/vex_online/lessons/home_brew/potentiometer/Potentiometer.html>
or this one:
<http://www.education.rec.ri.cmu.edu/roboticscurriculum/vex_online/resources/home_brew/potentiometer/Potentiometer.html>

Cheers,

  • Dean

I wonder if we could get enough auto modes out of one pot… we might need two. Anyone know how many settings you can pack on to a potentiometer without the danger of running the wrong code because the settings are to close to each other?

You get over 1000 values from the A/D conversion, but vibration and thermal drift will probably make it only possible to distinguish between every 4th value or so. That’ll leave about 250 possible settings. Of course, you aren’t going to dial in anything that fine unless you’ve got a feedback mechanism like an LCD display to know what number you are on.

You could probably make an 11-way selector by mounting this kind of knob on the potentiometer:

http://www.jameco.com/Jameco/Products/ProdImag/264911.jpg

Just read the analog value for each position and make a table. When checking the setting at run-time, just figure out which table value is closest to the one being read from the analog port, and there is your setting.

If you really wanted to push it, you could probably read the “half-way” points between each setting, getting 21 possible settings.

Oh, and you may have to create a unique table for each pot; i suspect there will be enough variance between pots to cause misreads if you try to discriminate too fine of an angle.

Cheers,

  • Dean

Being that is has to be FTC legal the nice marked knob is out but maybe I can use a marked up gear or something. Should work nicely.

You don’t have to leave the knob on the robot during a competition. The knob mounted on the shaft becomes a “tool” that you use to adjust the robot. You (carefully) pull the axle out of the potentiometer. Or, you leave the axle in and just remove the knob. Since the axle has 4 flat sides, it’ll self-align when you tighten it’s set screw.

  • Dean

Thats not a bad idea. :smiley:

As long as you put it on right each time.

Hmmm - I wonder if a Vex Gear with a screw through one or more of its holes would make a useful knob that I didn’t have to remove before the start of each match? And how might I use gears to give me a high resolution confirmation that the angle I set my knob to is aligned correctly within one of the angular zones my program expects to detect it in?

Blake