0% found this document useful (0 votes)
57 views1 page

Final Ik

This document contains code to calculate the angles of two robotic arms given the lengths of the arms and coordinates of the end effector position. It defines variables for the arm lengths and end effector position. It then calculates intermediate values like the hypotenuse of the end effector position to calculate the angles of the first two arms using trigonometric functions. It also defines a new_arm function to calculate the angles for a third arm given its length and the end effector position.

Uploaded by

funroboticshere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views1 page

Final Ik

This document contains code to calculate the angles of two robotic arms given the lengths of the arms and coordinates of the end effector position. It defines variables for the arm lengths and end effector position. It then calculates intermediate values like the hypotenuse of the end effector position to calculate the angles of the first two arms using trigonometric functions. It also defines a new_arm function to calculate the angles for a third arm given its length and the end effector position.

Uploaded by

funroboticshere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import math as m

a1 = 425#float(input("Length of arm 1 = ")); #length of arm1


a2 = 425#float(input("Length of arm 2 = ")); #length of arm2

#coordinates of the end effector


x = 360.9096475#float(input("X coordinate = ")) #x = float(-6.486) PCB
y = 502.4678011#float(input("Y coordinate = ")) #y = float(-439.461) PCB

c = m.sqrt(x**2 + y**2); #hypothenuse of a triangle formed by x and y coord. of the


end effector

o = 45;
d = a2 * m.sin(m.radians(11.016))
xee = y+100*m.cos(o)
yee = x+100*m.sin(o)
cc = xee - d
k = m.sqrt(a2**2 - d**2)
dd = yee - k

fi1 = m.acos((a2**2 - a1**2 - c**2)/(-2*a1*c));


fi2 = m.atan(y/x);
fi3 = m.acos((c**2-a1**2-a2**2)/(-2*a1*a2));

theta1 = m.degrees(fi2-fi1); #angle of arm1


theta2 = 180-m.degrees(fi3); #angle of arm2

def new_arm():

a2_1 = 425
a3 = 100

o = 45;
d = a2 * m.sin(m.radians(11.016))
xee = y+100*m.cos(o)
yee = x+100*m.sin(o)
cc = xee - d #X coordinate
k = m.sqrt(a2**2 - d**2)
dd = yee - k #Y coordinate

c_1 = m.sqrt(cc**2 + dd**2);

fi1_1 = m.acos((a3**2 - a2_1**2 - c_1**2)/(-2*a2_1*c_1));


fi2_1 = m.atan(dd/cc);
fi3_1 = m.acos((c_1**2-a2_1**2-a3**2)/(-2*a2_1*a3));

theta1_1 = m.degrees(fi2_1-fi1_1); #angle of arm1


theta2_1 = 180-m.degrees(fi3_1); #angle of arm2

print ("Theta 3 = ", theta2_1)

new_arm()

You might also like