QUESTION: Problem when implementing inverse kinematics for a SCARA robot arm


First of all, I just want to say that I have a very limited knowledge within robotics, but it’s an area I’m interested in and really want to learn more about. To improve my knowledge, I’m currently working on a project where I want to build an automated Zen garden, similar to this:

The idea is to build a SCARA robot using two arms. At the end of the second arm, I’ll attach a magnet that will move the metal ball in the above gif.

The idea is to sample (x, y) coordinates from a polar equation that draw some kind of pattern (e.g.*sin%283*theta%29%2C+polar). When I have the list of (x, y) coordinates, I’ll iterate over the (x, y) coordinates and use inverse kinematics to compute the angles of the first and second arm, to end up at the (x, y) coordinates. Then I translate that into steps of two stepper motors controling the two arms.

So far I’ve implemented it in a simulation, where I use Matplotlib animations to plot the trajectory of the arms. I’ve been able to get the end-point of the second arm to end up at the correct (x, y) coordinates, BUT I have a problem.

Every time the y-coordinate shift from being negative to positive or positive to negative (i.e. pass the x-axis), the first arm flips 180 degrees. See this gif for an example of the simulation:

I have really tried analyse the math and think of a way to fix it, but haven’t come up with a solution. Can someone that has experience implementing inverse kinematics for SCARA robots using trigonometry point me in a direction of how I can fix this?

Here are the equations I’m currently using:

submitted by /u/maktattengil
[link] [comments]