This year we need some sort of sensor to tell us the angle of rotation of a axel or something of the sort, similar to how a servo can do it. I would use a servo but I’m afraid of forcing them to rotate. Last time I checked your not supposed to do that…
A potentiometer would perform the task nicely. It is used to measure the angle of the input shaft, and outputs a variable resistance (which, when hooked up correctly, translates into an analog voltage which is read by the analog board).
With some intense calculations made in the code, you could use the accelerometer, but this only gives you position of your robot and will not account for slippage. I don’t think there will be any sensor that would work best for that. I would lean towards calculations in code but that might be because I’m a little biased.
Didn’t even think about potentiometers. I like that. And code calculations
You have an axle you want to measure. It is probably for an arm (the OP did not specify). Assuming its for an arm (which has a rotational limit), a potentiometer would measure the exact position at all times and output an analog signal to the cRio. No math necessary (Except to scale the 0-5v into a different range if you want, but you could use the voltage raw without issue). Whenever we have a rotational joint which software has control to adjust, it is standard practice for us to put a potentiometer on it and automate control of it. We always use potentiometers, because they are absolute (you know where you are even if you just booted up, something a quadrature encoder does not give you) and reliable.
The potentiometer that we have “stops” after a certain degrees of rotation (<360). Is there a potentiometer that has “unlimited” amount of rotation? Or how else/what sensor could I use?
Edit: It took me a while to actually reply so by the time I replied, the answer was already given… So my new question is how do I attach an encoder to a window motor and what encoder should I use? Also, what is the difference between magnetic encoders and digital encoders? We have used encoders on the AM gen 1 shifter before but don’t know how to use it in any other application.
You could use a multi-turn pot (one that has a range covering more than one turn)
Or you could use a magnetic encoder. When you attach the circular magnet to a shaft, it measures the angle of the magnet and outputs a value which is analog which you can read with the cRio’s ADC. Two of them come in the kit. Note that every time the angle hits 0 degrees, it wraps around to 360 degrees (same with 360 degrees to 0 degrees).
Wherever fine potentiometers are sold. There are no particular restrictions on what kind you can use (as long as you don’t violate any other robot rules).
A potentiometer has three connections. They all go to an input on the Analog Breakout. Using a standard PWM extension cable, the black wire (ground) goes to one end of the pot, the red wire (+5 volts) goes to the other end, and the white wire (signal) goes to the pot’s wiper.
In general, single turn pots have ~270 degrees of rotation. Don’t depend on all of them having this specification. Check the data to be sure and then expect something less. Never use the entire 270 degrees.