|
Holding a position in our arm
Heres the deal:
We have a revolute double jointed arm; say we wnat to hold the lower portion of the arm in one place; how would we do so?
We have a potentiometer mesaureing the position values of the arm. Lets say we want the arm at a target val of 180. The arm is plugged into pwm02. We made some simple if/then statements...
Please ignore syntax.
sensor = Get_Analog_Value(rc_ana_in02);
targetval = 180;
if (sensor < targetval)
{
pwm02 = (127 + 53);
else
{
pwm02 = (127 - 53);
}
This makes the arm oscillate at the target value, and it oscillates way too much. How can we essentially LOCK the arm through programming?
|