View Single Post
  #9   Spotlight this post!  
Unread 05-02-2013, 14:23
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 307
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: Equation for converting potentiometer voltage into angle?

Here is the equation we used last year:

positionDeg = (analogPot->GetAverageVoltage() - INHERENT_ZERO) * VOLTAGE_TO_DEGREES;

where INHERENT_ZERO was a value we measured and defined within our code for the position we chose to view as zero degrees;
and VOLTAGE_TO_DEGREES was a value calculated ahead of time to convert the voltage over a 90 deg travel into degrees. (This is simple to do because it is just a linear conversion. Take the difference of the pot voltage at 0 and at 90 and then divide by 90 to get this value.)

Hope that helps.
__________________