Saturday 11 October 2014

Inverse Kinematics on MENTOR Arm - Part 2

As mentioned in the previous post we are using IK only for 2dof (on x and y plane). By that we calculated the joint angles on the Top and Bottom arm for the given x,y,z coordinates. 

Using the conversion from cartesian coordinate system (x,y,z) to cylindrical coordinates (ρ,theta2,r) the joint angle for base arm (theta2) was calculated.

Angle - Base arm


To calculate the joint angles the function "jointAngles" is used. The x,y,z coordinates of the palm that we get from the leap motion data are passed as an array "v" into the function and theta2 - base angle, angle2 - Bottom angle and angle3 - Top angle are returned as the output. 

one important thing to notice here is, when calculating the inverse tan we have used the function math.atan2 which comes with the javascript math library. The use of this is it uses two arguments instead of one and gather the signs of the inputs in order to return the appropriate quadrant of the computed angle.

Once the angles are computed they are passed to functions, "moveBase", "moveShoulder" and "moveElbow" respectively. As mentioned in the previous posts, mentor arm consists with potentiometers for every DC motor. This can be elaborate with the function of a servo motor. The motor is attached by gears to the control wheel. As the motor rotates, the resistance of the potentiometer changes and with that angle rotated and the direction is calculated.



No comments:

Post a Comment