Pull `t` out of trig functions and solve it

78 Views Asked by At

I'm trying to come up with an analytical solution for inverse kinematics for my robot; but some of my trig has left my brain!

The robot is very simple; with one rotary and one prismatic joint. I'm looking to calculate the rotation; which is t.

I've got the below equation which gives me the z co-ord from t and e & w which are constants that I need to tune the robot.

z = e*sin(t) + cos(t)/sin(t)*(-x - e*cos(t)) + w

So basically; I just need to solve the above for t.

I did the below attempt at simplification; and then I get stuck.

z = e*sin(t) + cos(t)/sin(t)*(-x - e*cos(t)) + w
z = e*sin(t) - x*cos(t)/sin(t) -e*cos^2(t)/sin(t) + w
z - w = (e*sin^2(t) - x*cos(t) - e*cos^2(t) ) /sin(t)
z - w = (e*(1 - cos^2(t)) - x*cos(t) - e*cos^2(t) ) /sin(t)
z - w = (e - e*cos^2(t)) - x*cos(t) - e*cos^2(t) ) /sin(t)
z - w = (e - 2e*cos^2(t)) - x*cos(t) ) /sin(t)

Is this going down the correct path to solve? How do I go from here toward getting to the form t = ...

Thanks

2

There are 2 best solutions below

3
On BEST ANSWER

Exact solution involves solving a degree 4 polynomial equation.

Let $t=2s$ and convert all trig functions to $\tan(s)$

$$ z={\frac {3 e\tan \left( s \right) }{1+ \left( \tan \left( s \right) \right) ^{2}}}-{\frac {x}{2\tan \left( s \right) }}+\frac{\tan \left( s \right) x}{2}-{\frac {e}{2\tan \left( s \right) \left( 1+ \left( \tan \left( s \right) \right) ^{2} \right) }}-{\frac {e \left( \tan \left( s \right) \right) ^{3}}{2+2\, \left( \tan \left( s \right) \right) ^{2}}}+w $$ Let $T = \tan(s)$, we have to solve a quartic equation $$ \left( -e+x \right) {T}^{4}+ \left( 2\,w-2\,z \right) {T}^{3}+6\,e{T} ^{2}+ \left( 2\,w-2\,z \right) T-e-x = 0 $$ Once we solve that for $T$, our answer is $t = 2\arctan T$.


An example to illustrate the "let $t=2s$" part. Suppose we want to solve $\sin t = (\cos t)+1$ for $t$. Let $t=2s$, $$ \sin(2s)=\cos(2s)+1 . $$ Convert everything to $\tan$ $$ \frac{2\tan s}{1+\tan^2 s} = \frac{1 - \tan^2 s}{1+\tan^2 s}+1 \\ \frac{2\tan s}{1+\tan^2 s} = \frac{2}{1+\tan^2 s} $$ so we get $$ 2\tan s = 2 $$ Write $T = \tan s$, our equation is $2T=2$. This has solution $T=1$. Then $\tan s = 1$ so $s \arctan 1 = \pi/4$. Finally, $t=2s = 2(\pi/4) = \pi/2$.

2
On

Let $t=2 \tan^{-1}(y)$, simplify and expand to get $$-(e+x)+ 2( w- z)y+6 e y^2+ 2( w- z)y^3+ (x-e)y^4=0$$ which is a quartic and could be solved with radicals (don't try - it would lead to monsters !).

If you are able to provide bounds for $t$, it could be possible to do a few things (I hope !).

For example, if $y$ is supposed to be small, consider the equation as the start of a Taylor series and use series reversion to get $$y=Z+\frac{3 e }{z-w}Z^2+ \left(\frac{18 e^2}{(w-z)^2}-1\right)Z^3+O\left(Z^4\right)\qquad \text{with} \qquad Z=\frac{e+x}{2( w- z)}$$

Edit

If $t$ is small, we could build the $[1,3]$ Padé approximant and get the estimate $$t=\frac{(e+x) \left((e+x) (11 e+2 x)+6 (w-z)^2\right)}{2 (w-z) \left((e+x) (11 e+2x)+3 (w-z)^2\right)}$$