Solve non-linear symbolic system equation in matrix form
Mostrar comentarios más antiguos
Hi all,
I am currently working on the inverse kinamtics of an 7-DOF robotic arm. After finding the translation matrices with the help of the DH-parameter I now want to calculate the inverse kinematics. The results will be later translated to c++ so I am calculating symbolic. Matlab offers the function 'solve' to find solutions of nonlinear systems. Unfortunately it gives me empty results for the desired angles (phi1 and phi2). I will now insert my matlab code for the first two angles. It would be great if someone could help me with this problem. Thanks for your help
%MATLAB 2017
%Symbolic Values
syms q1 q2 q3
syms d_bs d_se
syms Pex Pey Pez
%%Forward Kinematiks ------------------------------------------------------
%Translation matrices
A01 = [cos(q1),0,-sin(q1),0 ; sin(q1),0, cos(q1),0 ; 0,-1,0,d_bs ; 0,0,0,1];
A12 = [cos(q2),0, sin(q2),0 ; sin(q2),0,-cos(q2),0 ; 0, 1,0,0 ; 0,0,0,1];
A23 = [cos(q3),0, sin(q3),0 ; sin(q3),0,-cos(q3),0 ; 0, 1,0,d_se ; 0,0,0,1];
%%Inverse Kinematiks ------------------------------------------------------
%q1 & q2
Eq1 = [Pex;Pey;Pez;1] == simplify(A01*A12*A23 * [0,0,0,1]')
[phi1, phi2] = solve(Eq1, [q1, q2]) %the result should be phi1 = atan(P_e.y / P_e.x), phi2 = arcos((P_e.z-d_bs)/d_se)
1 comentario
John D'Errico
el 15 de Mzo. de 2020
Editada: John D'Errico
el 15 de Mzo. de 2020
You have 4 equations, in two unknowns.
Eq1
Eq1 =
Pex == d_se*cos(q1)*sin(q2)
Pey == d_se*sin(q1)*sin(q2)
Pez == d_bs + d_se*cos(q2)
1 == 1
That one of the equations is the trivial 1==1 is silly at best.
But there will in general be no analytical solution to even the problem of three equations in two unknowns. And since the left hand sides of those equations are 3 completely unknown values, then no solution exists.
What did solve tell you? Empty results. No exact solution can be found. Period.
In some rare cases, if the values Pex, Pey, and Pez are exactly known AND they have very specific relatinoships between the values, then a solution will exist. However, as long as those numbers are measured floating point numbers taken from the real world, that event has essentially probability zero of ever happening.
Respuestas (1)
Sebastian D.
el 15 de Mzo. de 2020
0 votos
Categorías
Más información sobre Nonlinear Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!