View Single Post
  #5   Spotlight this post!  
Unread 06-02-2011, 23:48
mjbrauck mjbrauck is offline
Registered User
FRC #0768 (Techno Warriors )
 
Join Date: Jan 2006
Rookie Year: 2005
Location: maryland
Posts: 23
mjbrauck has a spectacular aura aboutmjbrauck has a spectacular aura about
Re: Can you use a potentiometer to control motor position?

Ok so it is still the same principle the value of the potentiometer represents the position of the arm and I assume you have some way of inputting the position you want the arm to be at so a simplified proportional control could be

MotorSpeed = (PotentiometerReading - DesiredPosition) *K;
Jag.Set(MotorSpeed);

K is a constant that scales the value you can just play with it till the arm stop at the appropriate position with out much oscillation.

You will also want to
A. constrain the value of MotorSpeed to max and min values of the motor
B. create some margin for error so it does not have to get to the exact value or else it will keep bouncing up and down till something breaks

Last edited by mjbrauck : 06-02-2011 at 23:56.
Reply With Quote