Shaft encoders

Does anyone know what you can do with optical
Shaft encoders. In the manual it says it can help during autonomous
But it doesn’t say how. Thanks

Encoders are for counting the amount of axle rotations. You can tell how far your robot has gone/going by attaching it to the wheel or how high up your lift is/did go. There are so many uses for these but the ones listed above are the most common.

I would suggest that if your size limitations allow, consider placing the encoder on a free-spinning wheel, rather than a motorized one. If your drive ever slips, or your bot hits another bot and the wheels just rotate, a free spinning wheel will measure the actual travel of the bot
Motorized wheel with encoder==measurement of motor rotations
Free-spinning wheel with encoder==measurement of actual bot movement on field

The extra wheel will also add extra support, you just have to make sure you have room for the 3rd wheel. If you would like, I can send you a pic of our setup.

Hope this helps
May your axles remain ever straight,
1200E New Divide

Thanks. I wasn’t sure if they had another use like potentiometers.

I have personally never used a potentiometer…I know that encoders can be used for a ton of uses, such as setting the position of an arm during autonomous, running an intake a certain amount during autonomous, etc. etc.

I know encoders can also be used for similar functions during opperator control, but I’ve never done it personally. If you have a specific task you want to accomplish, just ask, and I may be able to help you out…

Prior to the introduction of the VEX potentiometer, many teams used an encoder as a way to determine how far an arm rotated up or down. There was a little more involved in programming it than the potentiometer since you had to keep track of the number of encoder ticks in each direction to determine the amount of rotation either forward or backward.

That is a great idea. I never thought of that.

I am going to introduce this to my team the next meeting.

We might add another omni (free spinning) so this could be a good option. Thanks!

definitely, glad i could help! hope it works out, it really is a good idea

We like to keep all of our wheels powered so we don’t have any traction issues while driving, and so if we get stuck up on something…well so we can’t get stuck up on something. Additionally, adding more wheels is adding more weight.
If all of your wheels are chained/geared together, the chances are very small that any will slip, unless you are geared for torque or have a lot of motors on your drive base (or your robot is very light).

Shaft encoders can be nice for arms because they are a little more robust. Potentiometers measure resistance, which can vary with temperature and other things. You also have to install them such that when the arm goes through its full range of motion, you are not hitting the end (hard stop) on the sensor. We’ve had problems with the white plastic part that holds the axle stripping. However, they are small and have finer increments of measurement, so each have their own uses.

Make sure to zero your shaft encoders or use a change in the value so you always go to the same distance.

Yeah, i broke the little internal stop thing yesterday… (sounds very technical, i know). But i was so pleased when it worked as usual after. I wasnt expecting it, and it was a nice surprise!

I also like to have the wheel with an encoder on it driven. If your robot does tip slightly and a driven wheel is touching the ground, but not the one with an encoder on it, the robot would continue driving more than the intended distance. Also, what if the wheel with the encoder on it slipped?

As far as I know the stop is just a piece of plastic that helps to hold the pot together, so breaking it shouldn’t really do much, except that if you go off the end of your resistor strip (if that’s even possible) you’ll be reading lots of resistance (so values will be very low as little voltage is returning).

I like having a 6-wheel drive with all wheels chained together so none of the wheels ever slip (yay).

The potentiometer measures up to around 250 degrees of movement. This means that it shouldn’t be a problem for most arms. If your arm traverses more than that, you can just gear down to a different axle that the potentiometer is on. As for the white part stripping and all, I’ve never had any problems with it. In fact, I think that the potentometer is the most accurate sensor that VEX offers. The problem with using a shaft encoder for the arm is that you don’t get movement as smooth as you would with a potentiometer. The encoder has only 90 ticks per revolution. That means that you can only be accurate to within 4 degrees. Counting the length of an arm and the give between gears, that can be a big difference. The potentiometer on the other hand is an analog sensor. It can theoretically measure an infinite range of values. The ADC only allows you to read from 0 - 1203 however. Over 150 degrees, that’s 0.2 degrees of accuracy.

The Cortex uses 4x decoding of encoders, for 360 counts per revolution.
It also has an 12-bit ADC for 4098 positions (4x more than 1023).

In easyC, it returns a 10-bit number with the GetAnalogValue for some reason, but there’s another function (GetAnalogValueHR) which gets the full 12-bit result. RobotC returns the 12-bit number in SensorValue.

I guess that those stats are for the PIC then.

Potentiometers are great sensors, and we use them for our arm, but you could also use encoders to achieve similar accuracy by putting it on the powered axle (so it goes 7x more if it’s 1:7, etc.)

Let’s look at facts from both sides


  • Incremental sensor (Bad for an arm or fixed-range device as you need another sensor to zero it)
    *Fairly high resolution (1 degree) - This is neither good nor bad, just a statement
  • Harder to break, it has no end stops
  • Requires two digital IO ports other than port 10 (which is not interrupt-capable), plus another IO port (of either type) for a limit switch if you use one


  • Absolute sensor (Good for arm or fixed-range device as it is always calibrated without another zeroing sensor)
    +Very high resolution (12 bits precision at ~270 degrees = 15 counts per degree), although analog noise limits this to about 10 useful bits (still almost 4x encoder)
  • Easier to break, it has end stops which can be broken and the small white plastic thing can round out if you don’t know what you are doing.
  • Physically much smaller than an encoder and easier to package
  • Requires a single analog IO port

And now, my opinion:
-Potentiometers are better for arms, as the natural range of an arm is about that of a potentiometer, it’s easier to package, and it’s absolute (so I don’t need a limit switch to reset it). I never like the idea of booting up the robot unfolded, folding it up, and having it have no idea where it is (it should always know where it is, at any time).

-Encoders are better for lifts, because vex does not make 10-turn pots. If vex made 10-turn pots (hops over to product suggestion forum), I would be very happy.

I’ve seen the encoders to have some “drift,” though, so it’s probably a good idea to have a limit switch on the arm to reset it…


Bump switches also work well, and they are fine as your arm’s hard stops on the bottom as they don’t really break as far as I can tell.

True. I’ve actually seen them work better in some circumstances. (i.e. if you have a really heavy 1103-style lift)