|
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.
|