Go to Post It doesn't take money, just desire. - BillP [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   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
  #2   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
  #3   Spotlight this post!  
Unread 05-02-2014, 21:55
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

The link from the post above is to the java api (application programming interface). It lists the various ways to construct an object and the methods supported by the class. If you google "java FRC api", you can find many sites with the full api (here).

The AnalogChannel class in particular is, I believe, a class that allows you to gather values from any generic sensor that provides analog input (e.g. a gyro or a potentiometer).
__________________
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)

Last edited by mmaunu : 05-02-2014 at 23:45. Reason: Fixed hyperlink.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:59.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi