Hello Everyone,

Our team needs to be able to rotate an axis a certain amount. However, we do not have an encoder (and can’t find one matching the specific motor online), don’t have room for a physical limit switch, and don’t want to rely on just a “time” of rotation as this varies depending on the charge of the battery… Any ideas or thoughts on alternatives would be greatly appreciated!



Is it possible to do a hard stop, or does the axis need to go varying distances?


It has to go different distances…


I know you said you didn’t have room to mount a limit switch but a very compact way of implementing a limit switch is incorporating some sort of cam on the shaft to depress it at a specific rotation point or multiple points. I’m not sure of any COTS parts that would allow this but it shouldn’t be that hard to fabricate.


Is there a relationship between Voltage of the battery and Angular Velocity, where we could calculate the time needed to rotate based off of the voltage of the battery? if so, how would we go about calculating this?


In a vacuum, there would probably be some sort of loose correlation between battery voltage and speed of the axis. You would lose that correlation the moment you put other mechanisms on your robot, though, since they will also draw power from the battery.

Realistically, you need to find some way to measure that position with a sensor whose sole purpose is to find the angle of this axis. A few ways that I can think of are:

  • Point a distance sensor at something mounted to the axis. This doesn’t work very well if the item is really small, or if you need more than 180 degrees of rotation (even 180 degrees would be hard to make accurate, though).

  • Couple a potentiometer to the shaft. In my opinion, encoders are easier to deal with than pots, but if a pot works where an encoder doesn’t, it might be worth it. If you have access to a 3D printer, you could probably make some pulleys that could be attached with o-rings or some similar setup. In some situations, this might be more versatile than an encoder.

  • Just find a way to mount an encoder. You mentioned that you couldn’t find an encoder for the motor you were using. What motor is that? Most encoders aren’t specific to just one motor, and can be attached to any shaft of the right size. If there is a shaft somewhere on this mechanism that ends near a possible mounting location for an encoder (meaning any pretty much flat surface over 1-2 inches in diameter), you can throw an E4T or CTRE Magnetic Encoder or any other general purpose encoder on there to measure this more precisely.

  • OR just slap a camera off to the side of the mechanism and use vision processing! That way, the programmers get to deal with it! /s

As far as limit switches go, beam break sensors or distance sensors can often be mounted in ways that a physical limit switch cannot.


Thanks For all your suggestions! I will look into your ideas… Thanks!


This. Depending how you’re rotating it, the encoder might not even need to be on any of your shafts that you have now. You could put it on an auxiliary idler shaft that is only contacting chain on a chain run, not transmitting any torque, and it’d probably work. I’ve seen intermediate shafts used successfully.


You will probably get much more useful and directly applicable suggestions if you post a bunch photos showing the overall, general arrangement of your robot, the area around your arm pivot, the gearboxes you are using, the areas around the ends of the travel of your arm etc. No one is going to steal ideas from you. You are doing what a lot of teams have been doing for many years.


As @philso said, when looking to add an encoder or potentiometer to the drivetrain, it helps to know the setup. If you are using a COTS gearbox to interface the motor to the arm, you should look into encoders designed to interface to that gearbox.