View Single Post
  #5   Spotlight this post!  
Unread 05-02-2014, 21:01
RamZ's Avatar
RamZ RamZ is offline
Project Manager & Driver
AKA: Ram Zallan
FRC #0004 (Team 4 ELEMENT)
Team Role: Leadership
 
Join Date: Feb 2013
Rookie Year: 2012
Location: Los Angeles
Posts: 127
RamZ will become famous soon enoughRamZ will become famous soon enough
Re: Programming a Potentiometer

Quote:
Originally Posted by mmaunu View Post
A 10 turn potentiometer means that it can fully rotate 10 times before hitting its hard stops. If you slowly turn the knob on the potentiometer, it should turn smoothly and easily until you rotate it to the hard stop (either direction). If you then rotate it in the other directions, you should be able to get 10 full rotations before hitting the other hard stop. One of the hard stops corresponds to a signal of 5 volts and the other stop is a signal of 0 volts (don't worry too much about which is which).

10 turns * 360 degrees per turn gives 3600 total degrees of rotation. Divide that by 5 volts and you will get 720 degrees per volt. If you use the AnalogChannel class, the get() method will return a number in the range of 0 to 1023. Dividing 3600 degrees by 1024 values gives you something like 3.6 degrees per value.

When you mount the potentiometer, try to "center" the 10 turns in the center of your range of motion...you don't want to drive the potentiometer against its hard stops (that will break it). This also means that the shaft/arm/thingamajig that you are monitoring should need to rotate more than 10 times in its normal operating mode.

Good luck! I hope to see how it turns out in Las Vegas!
Thanks!
That makes it much easier for our thingamajig to work.
What exactly is the AnalogChannel class?
I clicked that link, and I couldn't figure out what it was used for.

Thanks
__________________
Team 4 ELEMENT
Project Manager & Driver
team4element.com facebook twitter instagram


Reply With Quote