Solving Jacobian matrix for singularities
140 views (last 30 days)
Show older comments
Daniel Arezoomande
on 29 Oct 2021
Edited: Daniel Arezoomande
on 2 Nov 2021
Hello everyone!
In our assignment we have been tasked with deriving a Jacobian with the help of a provided DH table for a 6DOF robot (UR5). I'm pretty sure I managed to create my jacobian. The next task is specified as follows:
"Analyze the robot for any singularities and if any identify at what joint positions (angles) the singularities occur."
So after a few youtube videos I have concluded that you get the singularities when the matrix for the Jacobian = 0, in other words J[6x6]=0. So my first question to you is if I have understood it correctly.
[Edit] My assumption was incorrect, it's the determinant of the Jacobian that has to equal 0, in other words: det(J[6x6])=0.
If I have understood it correctly, I believe that I can use a solver where I input my my equation as J[6x6]=0 where my variables are TH1, TH2, TH3, TH4, TH5 and TH6. My second question to you would be how I would go about creating a solver for this.
I'm quite new to this so please forgive me if I'm making no sense. For clarification, my Jacobian matrix is entirely symbolic, that means every element is described with some combination of cos(THn), sin(THn) and constants which I have defined as symbolic to keep the matrix somewhat readable.
syms TH1 TH2 TH3 TH4 TH5 TH6
syms d1 d4 d5 d6
syms a2 a3
[d4*cos(TH1) + d6*(cos(TH1)*cos(TH5) + cos(TH2 + TH3 + TH4)*sin(TH1)*sin(TH5)) - a2*cos(TH2)*sin(TH1) - d5*sin(TH1)*sin(TH2 + TH3 + TH4) + a3*sin(TH1)*sin(TH2)*sin(TH3) - a3*cos(TH2)*cos(TH3)*sin(TH1), -cos(TH1)*(a3*sin(TH2 + TH3) - d5*(cos(TH2 + TH3)*cos(TH4) - sin(TH2 + TH3)*sin(TH4)) + a2*sin(TH2) - d6*sin(TH5)*(cos(TH2 + TH3)*sin(TH4) + sin(TH2 + TH3)*cos(TH4))), cos(TH1)*(d5*cos(TH2 + TH3 + TH4) - a3*sin(TH2 + TH3) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), cos(TH1)*(d5*cos(TH2 + TH3 + TH4) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), d6*cos(TH1)*cos(TH2)*cos(TH5)*sin(TH3)*sin(TH4) - d6*cos(TH1)*cos(TH2)*cos(TH3)*cos(TH4)*cos(TH5) - d6*sin(TH1)*sin(TH5) + d6*cos(TH1)*cos(TH3)*cos(TH5)*sin(TH2)*sin(TH4) + d6*cos(TH1)*cos(TH4)*cos(TH5)*sin(TH2)*sin(TH3), 0]
[d4*sin(TH1) + d6*(cos(TH5)*sin(TH1) - cos(TH1)*cos(TH2 + TH3 + TH4)*sin(TH5)) + a2*cos(TH1)*cos(TH2) + d5*cos(TH1)*sin(TH2 + TH3 + TH4) - a3*cos(TH1)*sin(TH2)*sin(TH3) + a3*cos(TH1)*cos(TH2)*cos(TH3), -sin(TH1)*(a3*sin(TH2 + TH3) - d5*(cos(TH2 + TH3)*cos(TH4) - sin(TH2 + TH3)*sin(TH4)) + a2*sin(TH2) - d6*sin(TH5)*(cos(TH2 + TH3)*sin(TH4) + sin(TH2 + TH3)*cos(TH4))), sin(TH1)*(d5*cos(TH2 + TH3 + TH4) - a3*sin(TH2 + TH3) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), sin(TH1)*(d5*cos(TH2 + TH3 + TH4) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), d6*cos(TH1)*sin(TH5) - d6*cos(TH2)*cos(TH3)*cos(TH4)*cos(TH5)*sin(TH1) + d6*cos(TH2)*cos(TH5)*sin(TH1)*sin(TH3)*sin(TH4) + d6*cos(TH3)*cos(TH5)*sin(TH1)*sin(TH2)*sin(TH4) + d6*cos(TH4)*cos(TH5)*sin(TH1)*sin(TH2)*sin(TH3), 0]
[ 0, a3*cos(TH2 + TH3) + (d6*sin(TH2 + TH3 + TH4 - TH5))/2 + a2*cos(TH2) + d5*sin(TH2 + TH3 + TH4) - (d6*sin(TH2 + TH3 + TH4 + TH5))/2, a3*cos(TH2 + TH3) + (d6*sin(TH2 + TH3 + TH4 - TH5))/2 + d5*sin(TH2 + TH3 + TH4) - (d6*sin(TH2 + TH3 + TH4 + TH5))/2, (d6*sin(TH2 + TH3 + TH4 - TH5))/2 + d5*sin(TH2 + TH3 + TH4) - (d6*sin(TH2 + TH3 + TH4 + TH5))/2, -d6*(sin(TH2 + TH3 + TH4 + TH5)/2 + sin(TH2 + TH3 + TH4 - TH5)/2), 0]
[ 0, sin(TH1), sin(TH1), sin(TH1), cos(TH1)*sin(TH2 + TH3 + TH4), cos(TH5)*sin(TH1) - cos(TH1)*cos(TH2 + TH3 + TH4)*sin(TH5)]
[ 0, -cos(TH1), -cos(TH1), -cos(TH1), sin(TH1)*sin(TH2 + TH3 + TH4), - cos(TH1)*cos(TH5) - cos(TH2 + TH3 + TH4)*sin(TH1)*sin(TH5)]
[ 1, 0, 0, 0, -cos(TH2 + TH3 + TH4), -sin(TH5)*sin(TH2 + TH3 + TH4)]
If additional information is needed I will provide what I can, thank you for your time!
2 Comments
Paul
on 29 Oct 2021
As to question 1, are you sure the singularities are defined when J = 0? Is it possible you meant that the singularities occur when the determinant of J is zero?
Accepted Answer
Paul
on 29 Oct 2021
Edited: Paul
on 29 Oct 2021
Becase this is an assignment, here's some code and hints to get started
syms TH1 TH2 TH3 TH4 TH5 TH6
TH = sym('TH',[1 6]); % gather up the unknowns into a single array, makes some things easier
syms d1 d4 d5 d6
syms a2 a3
% define the Jacobian as a single 6 x 6 matrix
J = [
d4*cos(TH1) + d6*(cos(TH1)*cos(TH5) + cos(TH2 + TH3 + TH4)*sin(TH1)*sin(TH5)) - a2*cos(TH2)*sin(TH1) - d5*sin(TH1)*sin(TH2 + TH3 + TH4) + a3*sin(TH1)*sin(TH2)*sin(TH3) - a3*cos(TH2)*cos(TH3)*sin(TH1), -cos(TH1)*(a3*sin(TH2 + TH3) - d5*(cos(TH2 + TH3)*cos(TH4) - sin(TH2 + TH3)*sin(TH4)) + a2*sin(TH2) - d6*sin(TH5)*(cos(TH2 + TH3)*sin(TH4) + sin(TH2 + TH3)*cos(TH4))), cos(TH1)*(d5*cos(TH2 + TH3 + TH4) - a3*sin(TH2 + TH3) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), cos(TH1)*(d5*cos(TH2 + TH3 + TH4) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), d6*cos(TH1)*cos(TH2)*cos(TH5)*sin(TH3)*sin(TH4) - d6*cos(TH1)*cos(TH2)*cos(TH3)*cos(TH4)*cos(TH5) - d6*sin(TH1)*sin(TH5) + d6*cos(TH1)*cos(TH3)*cos(TH5)*sin(TH2)*sin(TH4) + d6*cos(TH1)*cos(TH4)*cos(TH5)*sin(TH2)*sin(TH3), 0;
d4*sin(TH1) + d6*(cos(TH5)*sin(TH1) - cos(TH1)*cos(TH2 + TH3 + TH4)*sin(TH5)) + a2*cos(TH1)*cos(TH2) + d5*cos(TH1)*sin(TH2 + TH3 + TH4) - a3*cos(TH1)*sin(TH2)*sin(TH3) + a3*cos(TH1)*cos(TH2)*cos(TH3), -sin(TH1)*(a3*sin(TH2 + TH3) - d5*(cos(TH2 + TH3)*cos(TH4) - sin(TH2 + TH3)*sin(TH4)) + a2*sin(TH2) - d6*sin(TH5)*(cos(TH2 + TH3)*sin(TH4) + sin(TH2 + TH3)*cos(TH4))), sin(TH1)*(d5*cos(TH2 + TH3 + TH4) - a3*sin(TH2 + TH3) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), sin(TH1)*(d5*cos(TH2 + TH3 + TH4) + d6*sin(TH5)*sin(TH2 + TH3 + TH4)), d6*cos(TH1)*sin(TH5) - d6*cos(TH2)*cos(TH3)*cos(TH4)*cos(TH5)*sin(TH1) + d6*cos(TH2)*cos(TH5)*sin(TH1)*sin(TH3)*sin(TH4) + d6*cos(TH3)*cos(TH5)*sin(TH1)*sin(TH2)*sin(TH4) + d6*cos(TH4)*cos(TH5)*sin(TH1)*sin(TH2)*sin(TH3), 0;
0, a3*cos(TH2 + TH3) + (d6*sin(TH2 + TH3 + TH4 - TH5))/2 + a2*cos(TH2) + d5*sin(TH2 + TH3 + TH4) - (d6*sin(TH2 + TH3 + TH4 + TH5))/2, a3*cos(TH2 + TH3) + (d6*sin(TH2 + TH3 + TH4 - TH5))/2 + d5*sin(TH2 + TH3 + TH4) - (d6*sin(TH2 + TH3 + TH4 + TH5))/2, (d6*sin(TH2 + TH3 + TH4 - TH5))/2 + d5*sin(TH2 + TH3 + TH4) - (d6*sin(TH2 + TH3 + TH4 + TH5))/2, -d6*(sin(TH2 + TH3 + TH4 + TH5)/2 + sin(TH2 + TH3 + TH4 - TH5)/2), 0;
0, sin(TH1), sin(TH1), sin(TH1), cos(TH1)*sin(TH2 + TH3 + TH4), cos(TH5)*sin(TH1) - cos(TH1)*cos(TH2 + TH3 + TH4)*sin(TH5);
0, -cos(TH1), -cos(TH1), -cos(TH1), sin(TH1)*sin(TH2 + TH3 + TH4), - cos(TH1)*cos(TH5) - cos(TH2 + TH3 + TH4)*sin(TH1)*sin(TH5);
1, 0, 0, 0, -cos(TH2 + TH3 + TH4), -sin(TH5)*sin(TH2 + TH3 + TH4)];
theta = sym('theta',[1 6]);
J = subs(J,TH,theta); % use theta to make the output use greek letter symbols
assume(theta,'real'); % the angles are real, so let's assume that to be the case
D(theta) = simplify(det(J),100) % compute the determinant
% a trivial solution for D == 0, is a2 = 0 or a3 = 0, so let's assume those are not true
assume(a2 ~= 0);
assume(a3 ~= 0);
% now need to solve D(theta) == 0, note: there is one obvious solution
% check out the solve() function, and its option ReturnConditions
% doc solve
13 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!