Symbolic parameters not supported in nonpolynomial equations

71 views (last 30 days)
Hi,
I am trying to solve the kinematic equation to get the inverse one of a robot. When using vpasolve it gives me the error: Symbolic parameters not supported in nonpolynomial equations. I don't understand why... Can you help me please ?
Here there is my code:
syms theta_1 theta_3 XE YE
[S] = vpasolve([XE_EQ YE_EQ], [theta_1 theta_3]);
with:
> XE_EQ =
XE == 30*cos(theta_1 + theta_3 + pi/12) + 250*cos(theta_1) + 100*cos(theta_1 + pi/12)
> YE_EQ =
YE == 30*sin(theta_1 + theta_3 + pi/12) + 250*sin(theta_1) + 100*sin(theta_1 + pi/12)

Answers (2)

Ameer Hamza
Ameer Hamza on 21 Sep 2020
This simply means that the equations are too complicated to be solved symbolically. Robot kinematic equations rarely have a closed-form inverse kinematic solution. Mostly, you need to rely on a numerical method. For example
f = @(theta_1, theta_3) [30*cos(theta_1 + theta_3 + pi/12) + 250*cos(theta_1) + 100*cos(theta_1 + pi/12);
30*sin(theta_1 + theta_3 + pi/12) + 250*sin(theta_1) + 100*sin(theta_1 + pi/12)];
x = [350; 30]; % required x-y position
eqs = @(theta) f(theta(1), theta(2)) - x;
theta0 = [0; 0];
theta_sol = fsolve(eqs, theta0);
theta1_sol = theta_sol(1);
theta3_sol = theta_sol(2);
  2 Comments
Adrien Luthi
Adrien Luthi on 21 Sep 2020
Thank you for your answer ! Your solution works but I am looking to have all the posible joints solutions to arrive at a certain XE and YE.
Ameer Hamza
Ameer Hamza on 21 Sep 2020
Yes, as I mentioned, such equations do not have closed-form solutions. You cannot get a simple closed-form equation for all values of XE and YE. However, you can do something like this: https://www.mathworks.com/help/fuzzy/modeling-inverse-kinematics-in-a-robotic-arm.html if you have a fuzzy logic toolbox. It estimates an approximate inverse kinematic model based on data points.

Sign in to comment.


Walter Roberson
Walter Roberson on 21 Sep 2020
vpasolve() has two different execution modes.
If the system of equations is polynomial in all of the variables, then vpasolve() does a solve() of the polynomial system, followed by vpa() . The solve() parts find all of the exact solutions (or placeholders for them that solve() knows how to manipulate), and the vpa() part converts them all into as close to decimal as it can. When this is used, it is permitted for there to be more variables than equations, and the solutions will be expressed in terms of some of the extra variables.
Otherwise, if the system of equations is not polynomial in all of the variables, then vpasolve() uses numeric root finding techniques using a modified newton-raphson . In order to use numeric techniques, the number of equations must exactly equal the number of variables.
You were providing two equations in four variables -- theta_1, theta_3, but also your XE and YE are symbolic. But the only mode in which you are permitted to have more variables than equations is the case where you are working with polynomials.
The only time in which you can use vpasolve() to find solutions that are parameterized in a variable, is the case of system of polynomials.
You are trying to solve non-polynomials numerically but parameterized in two variables, XE and YE. vpasolve() cannot handle that.
You will need to either switch to solve() [which might or might not work, and will take a fair while to decide either way), or else you need to supply specific numeric values for XE and YE and solve numerically based upon those... Ah, it cannot find the solution using solve()
Ameer's suggestion to go completely numeric is also quite reasonable for the case where you are providing specific numeric XE and YE values.
  2 Comments
Adrien Luthi
Adrien Luthi on 21 Sep 2020
Thank you very much for your clear explanation. I understand what I have done wrong now but still can not figure how solve those equations. Before using fsolve, I have tried to used solve() but it did not fin any solution...
Which function do you recommend me to find all the possible solutions for a XE and YE given ?
Thank you in advance !
Walter Roberson
Walter Roberson on 21 Sep 2020
There might be an infinite number of solutions, or there might be no solutions.
I have Maple working on it, but it is taking Maple a fair while to compute. Exact solutions to trig equations are often pretty complicated.

Sign in to comment.

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!