Go to Post I have way too much time on my hands. - Brandon Martus [more]
Home
Go Back   Chief Delphi > Technical > Motors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-10-2014, 02:04
Gary Suter Gary Suter is offline
Registered User
FRC #2439
 
Join Date: Mar 2012
Location: Maui
Posts: 16
Gary Suter is an unknown quantity at this point
potentiometer code

How do you find values off of a potentiometer for an Andy Mark turn table? (what is the basic code for reading the values off of potentiometer?)
  #2   Spotlight this post!  
Unread 22-10-2014, 02:47
asid61's Avatar
asid61 asid61 is offline
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,215
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: potentiometer code

What language? You use the center pin of the potentiometer to find voltage when you connect the other two terminals to power and ground (one to power, the other to ground). Then you map that voltage between the maximum and minimum voltage you can get from the potentiometer (turn it all the way one way and all the way the other way to find that) and that's how you get your angle relative to the minimum and maximum.
  #3   Spotlight this post!  
Unread 22-10-2014, 10:03
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,735
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: potentiometer code

Part of the beta testing has included a new potentiometer class. It's basically a wrapper around an analog input that lets you specify the degrees per volt (360 * #turns/5 volts * any gear ratio you want to take into account) send an offset, then read back the values as degrees.

It's really slick and works perfectly from our testing (Java). We used it for a swerve drive project, which let us plug the potentiometer object straight into the PID loop to control steering the modules, which worked great as our equations returned an angle to turn to-do we didn't have to do any manual calculation on the value to convert it to volts to get it to work.
__________________
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
  #4   Spotlight this post!  
Unread 23-10-2014, 16:39
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,558
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: potentiometer code

Look at the AnalogChannl VIs/class.
Closed Thread


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 22:42.

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