|
This example illustrates the importance of using the two argument inverse tangent function atan2 for computing joint angles.
clear all
px_a = -76.00; % mm py_a = 131.64; % mm r_a = sqrt(px_a*px_a + py_a*py_a); % mm
theta1_ai = acosd(px_a/r_a) % deg
theta1_ai = 119.9992
theta1_aii = asind(py_a/r_a) % deg
theta1_aii = 60.0008
theta1_aiii = atan2d(py_a, px_a) % deg
theta1_aiii = 119.9992
theta1_aiii_atan = atand(py_a/px_a) + 180 % deg
theta1_aiii_atan = 119.9992
px_b = 97.70; % mm py_b = -116.44; % mm r_b = sqrt(px_b*px_b + py_b*py_b); % mm
theta1_bi = acosd(px_b/r_b) % deg
theta1_bi = 50.0014
theta1_bii = asind(py_b/r_b) % deg
theta1_bii = -50.0014
theta1_biii = atan2d(py_b, px_b) % deg
theta1_biii = -50.0014
theta1_biii_atan = atand(py_b/px_b) % deg
theta1_biii_atan = -50.0014
This MATLAB example illustrates a computation from the textbook Fundamentals of Robot Mechanics by G. L. Long, Quintus-Hyperion Press, 2015. See http://www.RobotMechanicsControl.info for additional relevant files.