How to get alfa and beta from this image

153 Views Asked by At

I developed a robotic arm with 2 bars. I would like to move this robotic arm to a X,Y coordinate. In order to do that I can set "alfa" and "beta" angles in the motor so they move the arm to the position I want. The problem is that I came up with 2 equations and 2 variables (alfa ($\alpha$) and beta($\beta$)) and I tried really hard but I still can't isolate $\alpha$ and $\beta$ so I can calculate it's value directly, using a microcontoller.

The robotic arm is like this:

enter image description here

I got these equations:

$$ L_1 \cdot \cos(\alpha) + L_2 \cdot \cos(\beta) = y$$ $$ L_2 \cdot \sin(\beta) - L_1 \cdot \sin(\alpha) = x$$

I tried many methods, many trigonometry identities but still couldn't isolate $\alpha$ and $\beta$ in terms of $L_1, L_2, x$ and $y$.

I appreciate all your attention. If you want to see the robotic arm that I am trying to build, it will look like this image below:

enter image description here

It's basically 2 bars that you can control 2 angles and move it to exact positions.

2

There are 2 best solutions below

5
On BEST ANSWER

If I were building this robot, instead of $\beta,$ I would use the angle that the two arms form relative to one another. That way as $\alpha$ changes you don't need to keep recalculating $\beta$.

I will call it $\gamma$. We can find it using the law of cosines

$x^2 + y^2 = L_1^2 + L_2^2 - 2 L_1 L_2 \cos \gamma$

$\beta = \pi - \alpha - \gamma$

Two more angles.

Lets imagine that there is a line from the origin to (x,y) closing up the triangle.

Let $\phi$ be angle at the origin.

$L_2^2 = x^2 + y^2 + L_1^2 - 2\sqrt{x^2+y^2}L_1 \cos\phi$

$\theta = \tan^{-1} \frac {y}{x}$ is the angle between the straight line from the origin to $(x,y)$ and the $x$ axis.

$\theta + \phi = 90 + \alpha$

And that should be enough tools to get you everything you need.

3
On

Ok first part will be very similar to the previous answer you already got from @Doug.

We want to build a triangle where the sides are $L_1,L_2,\sqrt{x^2+y^2}$

Add $\gamma$ to mean "leftmost" angle in triangle. We then have thanks to parallell lines that

$$\beta+\alpha+\gamma = \pi \Leftrightarrow \gamma = \pi-\alpha-\beta$$

$\gamma$ can be determined directly from cosine law and the sides. Then we need one more degree of freedom.

We can rewrite your second equation like this:

$$\sin(\beta) = \left(\frac{x+L_1\sin(\alpha)}{L_2}\right)$$ And then rewrite the gamma formula: $$\sin(\beta) = \sin(\pi-\alpha-\gamma)$$

Now you can combine these and use addition formula for sine a few times to solve for $\sin(\alpha)$. Once you have $\sin(\alpha)$ just plug it back in to get $\sin(\beta)$ and which quadrant should be obvious from these values.