encoders/gyros/potentiometers

okay, from what i know, encoders, gyros and potentiometers - they are very useful to programming.

has anyone managed to do the autonomous code without using these?

and if we were to use them, where exactly does each part go? i know the potentiometer is for the arm, but where exactly?

where does the encoder and gyro go?

and which encoder/gyro/potentiometer did everyone use? i looked up the encoder from grayhill (61k/4k) and most of the places were sold out. i finally found one but it was a 61k256 which is too much, we just want a 61k64 and that too it was like $70+! we want something cheap and still useful.

thnx. i looked all over but most forums touched on the topic. hopefully this will help ppl with the same qs.

Neha,

Autonomous mode can definitely be done without encoders, gyros and pots. There’s dead-reckoning and copy-cat approaches which provide means to do pretty useful autonomous modes. I’ll leave the copy-cat explanation to someone who’s actually done it.

Timed dead-reckoning - Run pwm01 and pwm02 at 180 for 5 seconds, then run pwm01 at 180 and pwm02 at 140 for another 2, then stop. After a lot of tweaking and adjusting the speeds and the times, you can get your robot to park behind the center goal, stopping your opponent from capping with the vision tetra. There’s quite a bit of useful stuff you can do, however don’t expect to do anything too accurate, like cap a vision tetra, with timed dead-reckoning.

Encoders - for your drivetrain, you want to mount these in a way that when your wheels spin, so will your encoders. I’ve seen some teams put them on idler gears, or extend the shaft coming out of the gearbox a little bit, slip some flexible tubing over it, then slip the shaft of the encoder into the other end of the flexible tubing. We are using the Grayhill 63R256 from DigiKey, however they are now sold out. (Sorry, although we only bought 3, knowing that 600 other teams would be needing these)

Potentiometer - same idea as the encoders, you want your pot to spin when you run the motor that moves your arm. The difference is your pot has LIMITS on it, meaning that you can spin it only a few degrees in each direction. There are multi-turn pots, but these too have limits on them, but are often easier work with (less gearing). Your arm too should have some movement limits on it - i.e. you can raise it a maximum of 12 feet high. The goal is to have your arm and pot hit their limits at about the same time. When you’ve done this, you can setup limits on your arm so your operator doesn’t over/under extend it, and you can even automatically slow down your motors when you get near your limits. Normally, we’ll use limit switches in addition to pots to check our limits just in case. For mounting them, a popular way is to put a gear or sprocket on the motor that runs your arm, and put a gear/sprocket on the pot and attach them.

Sorry I didn’t answer all your questions, but I’m don’t much like to comment on things our team personally hasn’t tried or done.

-SlimBoJones…

There are a whole lot of threads on which sensors to use. I suggest you spend a good hour or two researching.

As for doing autonomous, it is very possible to do something useful without those sensors as SlimBo said. Additionally, this year, with the camera, it is possible to do almost everything without those sensors and just with the camera.

Greetings Neha,

Welcome to the wonderful world of sensors.
Other people have touched on the pot and encoder issues so i wont really go into those.
The gyro can be mounted just about anywhere on your robot, but the ideal location would be in a safe protected area of the robot. What it does is sense change in the rotation of your robot along a certain axis. Depending on how you mount it, it will change the axis that it sense. The most common use for this sensor being the sensing of the robot turning and the direction it is turning. When used in conjuction with encoders on the wheels, the basic idea is that you sense how far you have turned with the gyro and sense how far you have moved with the rotary encoders. The pot is then used to sense the movement of other things, although rotary encoders can be used in the place of pots as they sense in a very similar way. Like stated above, another sensor to consider is the limit switch, which are really easy to use and just return a on or off signal and can be used to sense all sorts of stuff and can be used to provide software stops to prevent the robot from damaging itself.

Hope this information is helpful, good luck!

Me and my team added encoders into our autonomous code last yr.
What we did is just check what the counters were up to and see if they were up to what we had been waiting for… just like how we had added the time… except with the interrupts for the encoder are in there instead for counting

okay, i want to know what encoders/pots/gyros everyone else is using:
optical or mechanical?
what type?
from where?
and if possible, how much?

thanks!

Optical. It’s worth the extra money. I bought two kinds of Grayhill encoders from Digikey, $5 mechanical encoders and $20 optical encoders. If you’re constantly spinning the encoder, it’ll probably keep up with the number of revolutions. However, I found out on a click-by-click basis that the mechanical ones aren’t as reliable. Using Kevin Watson’s encoder code, I would get a printf of, say, 2. Then I would turn the encoder one click, and suddenly the count would be 12. This is no fault of the code, but rather of the encoder taking a bit of time to settle into place, thus making and breaking contact several times. I’ve found the optical encoders to be significantly more reliable, both when being constantly actuated, and when clicked slowly.

Potentiometers are what are used for volume controls etc. on sound equipment.
You can get them at places like Radio Shack even (but be sure you get a linear one between 10k and 100k).

Potentiometers are good for measuring the position of a moving part of your robot like an arm. You hook them to one of the analog inputs as shown in the RC manual from Innovation First. Then the value from the input tells how far it has been rotated.

This fall I started a thread asking many similar questions about encoders.
Here is the link for that thread: http://www.chiefdelphi.com/forums/showthread.php?t=31122

and here are some others:
http://www.chiefdelphi.com/forums/showthread.php?t=26243
http://www.chiefdelphi.com/forums/showthread.php?t=30830

Also, browse through the white papers here on Chief Delphi about the implementation of encoders, gyros, and pots.
Here is the paper for 1227’s codefrom 2004, which uses all of these sensors.
Here is a paper about gyros.
Here is a paper about quadrature output encoders.

I am sure you have looked at www.kevin.org/frc which has many many things valuable to programming.

Hope this helps, and most importantly, keep asking questions!

– Jaine

Minor correction - 1227’s code is from 2004.

You will be pleased to know that the kit came with a pair sensors very similar to encoders. They are Called HAL effect sensors. Basically they sense metal things extremely near them. They are meant to to be mounted so that they are almost up against the teeth of a gear or sprocket. each time the gear/sprocket rotates and and a tooth passes them, they output a pulse. You can count these pulses to figure out how far you have gone. With some trickery you can also figure out how fast you are going. The only difference in the output from these and the output from encoders is that encoders can tell you what direction you are going. These cannon. This really isn’t a problem if you assume your robot is moving in the direction you are telling it to.

As far as potentiometers go, any 100k potentiometer will do. Potentiometers are extremely useful for figuring out the position of some mechanism with a limited range of motion. When connected to an analog input as described in the RC manual, they will tell you their exact position. Potentiometers are available from radio shack for a few bucks.

Gyros are useful too, but if you are new to all of this i would probably stick toward safer options. There is a gyro included in the kit, buti have not messed with it at all. It will tell you your radial acceleration. If you want to turn this into a heading, you must take the second integral of this. If you have no idea what a second integral is then ask someone in calculus.

It should be noted that there are no gyros in the kit. What you think is a gyro is really an accelerometer. The accelerometer will never feasibly measure how much you have turned. It is great as a tilt sensor or something similar, but without knowing your center of rotation and the mass rotating around that center, you will never get a reasonable readout of how much you have turned. The accelerometer in the orientation you are thinking of reads the centripetal acceleration, not radial acceleration.

I stand corrected. He is right. My science fair project involved true radial accelerometers. My mind is on those.

Let me elaborate a bit on what mschulkind is saying about measuring tilt. Most accelerometers can measure static acceleration (gravity). If you tilt the accelerometer it will no longer be entirely be in the axis of gravity and its reading will decrease. Basically you mount an accelerometer so that it is aligned with the vertical axis, it’s output will be porportional to cos X where X is the angle away from vertical that the accelerometer is pointed.