How to solve a large 6-variable non-linear matrix determinate equation for all unique values.
Show older comments
I have a large jacobian matrix (to large to post) that is in terms of six variables: theta_1 thru theta_6, these variables are symbolic.
After taking the determinate, I need to solve the resulting equation for all possible unique values, this limits theta_n to be between [0,2pi) or [-pi,pi). There are additional maximum/minimums for each theta value but that is not critical right now.
Using the solve function has it running for an exceedingly long time and still not result, is there a faster way?
Code:
clear all
a = sym([0 174.0 0 0 0 0]');
d = sym([116.3 0 0 118.2 0 130]');
alpha = sym([pi/2 0 pi/2 -pi/2 pi/2 0]');
syms theta_1 theta_2 theta_3 theta_4 theta_5 theta_6;
T_0_1 = robot_transform(a(1), alpha(1), d(1), theta_1);
T_1_2 = robot_transform(a(2), alpha(2), d(2), theta_2);
T_2_3 = robot_transform(a(3), alpha(3), d(3), theta_3);
T_3_4 = robot_transform(a(4), alpha(4), d(4), theta_4);
T_4_5 = robot_transform(a(5), alpha(5), d(5), theta_5);
T_5_6 = robot_transform(a(6), alpha(6), d(6), theta_6);
T_0_6 = T_0_1 * T_1_2 * T_2_3 * T_3_4 * T_4_5 * T_5_6;
inputT = T_0_1;
Z1 = inputT(1:3,3);
inputT = inputT*T_1_2;
Z2 = inputT(1:3,3);
inputT = inputT*T_2_3;
Z3 = inputT(1:3,3);
inputT = inputT*T_3_4;
Z4 = inputT(1:3,3);
inputT = inputT*T_4_5;
Z5 = inputT(1:3,3);
inputT = inputT*T_5_6;
Z6 = inputT(1:3,3);
jacobianW = [Z1 Z2 Z3 Z4 Z5 Z6];
jacobianT = jacobian(T_0_6(1:3,4),[theta_1 theta_2 theta_3 theta_4 theta_5 theta_6]);
jacob = [jacobianT; jacobianW]
d = det(jacob);
disp('Solving determinate for singularities');
solution = solve(d==0, [theta_1 theta_2 theta_3 theta_4 theta_5 theta_6])
The function robot_transform
function T = robot_transform(a, alpha, d, theta)
T = [cos(theta) -sin(theta)*cos(alpha) sin(theta)*sin(alpha) a*cos(theta);
sin(theta) cos(theta)*cos(alpha) -cos(theta)*sin(alpha) a*sin(theta);
0 sin(alpha) cos(alpha) d;
0 0 0 1];
end
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!