Go to Post I think I speak to everyone who ever attended nationals there when I say...say it with me..."Please stand clear of the doors. Por Favor Metengan se alijados de las puertas." - Justin [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-05-2013, 16:09
bumblebee3339's Avatar
bumblebee3339 bumblebee3339 is offline
Team's main account
FRC #3339 (BumbleBee)
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Israel
Posts: 34
bumblebee3339 is an unknown quantity at this point
Talking How can I get an angle from a potentiometer?

As I know, you can use a potentiometer only as an analog I/O and get only the voltage.
How can I use this voltage to get my shooter angle for example?
Reply With Quote
  #2   Spotlight this post!  
Unread 05-05-2013, 16:41
Suitster's Avatar
Suitster Suitster is offline
Registered User
AKA: Ethan Pellittiere
FRC #3951 (SUITS)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Honeoye
Posts: 79
Suitster is on a distinguished road
Re: How can I get an angle from a potentiometer?

Assuming that your potentiometer has a linear output, all you need to do is create a linear equation. The way that it was accomplished on our team was we would measure the voltage and the actual angle at two positions, then solve for m and b, from there.
__________________
2012 FLR Regional Champs, with 1507 and 191
Reply With Quote
  #3   Spotlight this post!  
Unread 06-05-2013, 11:45
bumblebee3339's Avatar
bumblebee3339 bumblebee3339 is offline
Team's main account
FRC #3339 (BumbleBee)
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Israel
Posts: 34
bumblebee3339 is an unknown quantity at this point
Re: How can I get an angle from a potentiometer?

Oh, Ok
Thank you !
Reply With Quote
  #4   Spotlight this post!  
Unread 06-05-2013, 12:01
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,695
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: How can I get an angle from a potentiometer?

Even if the potentiometer reading isn't linear (i.e. there is a linkage that connects the potentiometer to a point on the arm), it's fairly simple to get a good equation. Plot several calibration points in Excel, then use the "Add Regression Line..." option by right clicking on the graph. Then select the various equation types until you have a line that best-fits the data. Selecting the 'Show Equation on Chart' will give you the equation to program.

Just make sure the potentiometer readings are on the X axis.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
Reply With Quote
  #5   Spotlight this post!  
Unread 06-05-2013, 13:02
Phalanx's Avatar
Phalanx Phalanx is offline
Formerly Team 1089 (Mercury)
AKA: Michael Reffler
FRC #5431 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 1999
Location: Lewisville, TX (previously NJ)
Posts: 384
Phalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond repute
Re: How can I get an angle from a potentiometer?

Depending on the quality of your Potentiometer you can use a simple formula to compute it's voltage reading to it's degree. I've used this with fairly good results. It all depends on much accuracy you require.

For example, let's take a 340 degree single turn pot....
Roughly we know it's voltage is from 0v to 5v.....
So if it we take 5v / 340 that means it's 0.0147 volts/per degree.
Take your voltage reading and divide it by your volts per degree to get your angle.

300 degree pot would be 0.0166 volts per degree.
270 degree pot would be 0.0185 volts per degree.
__________________
Don't just ask the experts, become one!
Leadership is not about ability. It's about responsibility!
Diagonally Parked in a Parallel Universe. It's okay we do Quantum Physics


Reply With Quote
  #6   Spotlight this post!  
Unread 06-05-2013, 17:18
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,533
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: How can I get an angle from a potentiometer?

Also be careful of the potentiometer you purchase. 10k resistive ones work well, but you really want to make sure you purchase a linear pot and not an audio pot. Pots for audio are not even close to linear....
Reply With Quote
  #7   Spotlight this post!  
Unread 07-05-2013, 09:12
bumblebee3339's Avatar
bumblebee3339 bumblebee3339 is offline
Team's main account
FRC #3339 (BumbleBee)
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Israel
Posts: 34
bumblebee3339 is an unknown quantity at this point
Re: How can I get an angle from a potentiometer?

Quote:
Originally Posted by Phalanx View Post
Depending on the quality of your Potentiometer you can use a simple formula to compute it's voltage reading to it's degree. I've used this with fairly good results. It all depends on much accuracy you require.

For example, let's take a 340 degree single turn pot....
Roughly we know it's voltage is from 0v to 5v.....
So if it we take 5v / 340 that means it's 0.0147 volts/per degree.
Take your voltage reading and divide it by your volts per degree to get your angle.

300 degree pot would be 0.0166 volts per degree.
270 degree pot would be 0.0185 volts per degree.
I like your way of thinking
I'll use that
Reply With Quote
  #8   Spotlight this post!  
Unread 07-05-2013, 11:12
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 432
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: How can I get an angle from a potentiometer?

Quote:
Originally Posted by Tom Line View Post
Also be careful of the potentiometer you purchase. 10k resistive ones work well, but you really want to make sure you purchase a linear pot and not an audio pot. Pots for audio are not even close to linear....
That's because they are logarithmic
http://en.wikipedia.org/wiki/Potentiometer#Resistance.E2.80.93position_relation ship:_.22taper.22
__________________
http://team2168.org
Reply With Quote
  #9   Spotlight this post!  
Unread 07-05-2013, 12:10
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,791
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: How can I get an angle from a potentiometer?

We had 3 pots on our robot this year, all connected to our climbing arm. For us, it wasn't a question of developing an equation that would convert between voltage and angle... it was figuring out what values matched the specific angles we wanted. For that, we had a "test" mode, where the pot values were spit out on the console. We simply manually moved the arm to where we wanted and read the values at that point! It took a little fine tuning, but those values could then be fed directly into our PID loop to get the arm to perform exactly the same for every climb.
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
Reply With Quote
  #10   Spotlight this post!  
Unread 07-05-2013, 12:23
apb2390's Avatar
apb2390 apb2390 is offline
Registered User
AKA: Andrew
FRC #1684 (Chimeras)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Lapeer, Michigan
Posts: 22
apb2390 is an unknown quantity at this point
Re: How can I get an angle from a potentiometer?

Quote:
Originally Posted by otherguy View Post
Most commercially available 'log' pots, like the ones you get at radioshack and Fry's, have more of a two-stage adjustment, as it's cheaper to make two parallel sections of resistive material than to actually taper the resistive material in a logarithmic fashion.

More info here: http://sound.westhost.com/pots.htm#taper
__________________
FRC 1684 (2012-2015)
2012: Programming
2013: Electrical
2014: Design / Electrical
2015: Design Lead / Electrical

4 Years, one Blue Banner. We did it.
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 21:04.

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