Heres the Matlab code, I start with x and y and when I pass it through IK and Fk I get back the correct x and y thus I am confident that IK and Fk are correct.
x = 10; y = 10; z = 0;
a2 = 7.5; a3 = 9;
r = sqrt(z^2 + y^2);
th1 = atan2(y,x);
th3 = acos((r^2 + x^2 - (a2^2 + a3^2))/(2*a2*a3));
th2 = atan2(x,z) - atan2(a3*sin(th3), (a2 + a3*cos(th3)));
T0 = compute_dh_matrix(0,0,0,0);
T01 = T0*compute_dh_matrix(0, -pi/2, 0, th1);
T02 = T01 *compute_dh_matrix(7.5, 0, 0, th2-pi/2);
T03 = T02 *compute_dh_matrix(9, 0,0 , th3);
T03(1:3,4)
%ans =
%
% 10.0
% 10.0
% 0
I have tower pro micro servos SG90 for base, shoulder and elbow joints.I am giving power using a mobile charger which outputs 5V and 2A.Now I want to try drawing some simple shapes with this robot I tried giving it the sequence of x and y locations with z=0, but the results seem not good.Do I need another DOF on the end effector?Is there any way to map x-y to the theat_start - theta_end for every angle?This is the diagram of the robot,
I have a small change as my zero position is upright not with a bend like below but the rotation and angles are the same..
Now I am trying to draw in X, Y plane as Z is zero all the time.a2 and a3 are the link lengths.I don't know how to control the speed of the servos I just hacked the sweep code from Arduino.I just want to draw some basic shapes or a line, I tried giving (9,9), (10,10) and (11,11) thinking it will draw a line.
These images show my setup in detail.I haven't taken all the offsets yet.I was getting close but not exact x and y that I entered into the IK->FK functions so I thought I could just work with less accuracy to get results quick.If you can help with IKfor offsets it would be great too.
I really hope this is a problem that you guys consider as per the rules and as I have done work on FK and IK I hope this question makes sense.Thank you.