View Single Post
  #8   Spotlight this post!  
Unread 05-02-2014, 20:22
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 87
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: Programming a Potentiometer

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!
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote