Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Jacobian Inverse Kinematics Explaination

Posted on 2005-03-10
Medium Priority
Last Modified: 2016-05-20
I'm attempting to solve a problem involving a robotic arm I'm designing. I have not had the high levels of math I may need but I've had Trig in college so I have some math skills.

The problem is solving what angles to move the joints to get to a specific point given any number of joints. It can't just work for 2 or 3 but 4 or more. I've found some information on the Jacobian Inverse Kinematics techniques but I don't understand them. Can someone walk me through a problem and explain things kinda simple? I would like to set up something like this:

A length = 10
B length = 9
C length = 8
D length = 7

Just to get some different lengths.

To make the angles easy I'll just call them angle A, AB, BC, CD. We can say that it all starts out at 0 degrees. So our current end position is now (34, 0).

        A                      B                   C               D
_____________ ____________ __________ ________

And we want to move to something like this. Make up a point to move to like (12, 10).  And hopefully we can move there but we'll assume the joints have no restrictions to the movements to make it easier maybe.
     /             \
B /                 \  D
 /                     \
| A

Hopefully someone can help me out with this!


Question by:wgordy
LVL 27

Expert Comment

ID: 13509637
If you have not restrictions, you can reach anywhere inside a circle of radius 34.

There are an infinite number of ways to reach to reach (12, 10)  which is radius=15.6  angle=50.2 deg

One way to do it would be to bend the joint at BC until the distance AD is 15.6, then rotate A to 50.2 deg

I don't know what would be optimum for a particular design.  It depends on the mass and torque available at each joint.

Do you want speed or strenght?

There is a lot of work on this sort of thing under the heading of 4-Bar Linkages and Burmeister Curves.  

LVL 22

Expert Comment

ID: 13509741
Here's a reference that goes pretty deep into how to best move the arm:


Also see this one for some Matlab code to do robot kinematics:


Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 13510367
It is 3 dimensional but I thought I'd just try to get the arm placement. The only joint that would be able to move more than one way would be the base for rotation. I can find how to rotate the base pretty easily.

Author Comment

ID: 13510443
I also am not really concerned with how much torque will be involved. It's using servos and it's light enough that it can extend straight out and pick up a simple block. I have the arm already working. It's made from balsa and some model plane servos. It's controled right now by moving some sliders on a vb form, one assigned to each servo. It's the test software that came with the mini ssc II that I'm using. = )
LVL 85

Expert Comment

ID: 13513291
With more than 2 joints, there are an infinite number of ways of reaching any point <34 away.  Do you have any preference among them?
perfered angle of the last joint?  prefered position of intermediate joints?
LVL 27

Expert Comment

ID: 13513321
Let me redefine the variables:      

   A  B  C  D   are the lengths of the segments

   a  is the angle between segment A and the X axis.
   b  is the angle between segment B and segment A.      0 deg means A and B are lined up and point in the same direction.


So the position of the end of the arm can be found by adding up the following four vectors.

It's easier to think about in terms of polar coordinates:

    (R=A, Ang=a)  +  (R=B, Ang=a+b)  +  (R=C, Ang=a+b+c)  +  (R=D, Ang=a+b+c+d)

But it's probably easier to calculate in Cartesian:

    (A*cos(a), A*sin(a))  +  (B*cos(a+b), B*sin(a+b))  +  (C*cos(a+b+c), C*sin(a+b+c))  + (D*cos(a+b+c+d), D*sin(a+b+c+d))

LVL 27

Expert Comment

ID: 13513495
Missing but infered from my previous post:

   c  is the angle between segment C and segment B.
   d  is the angle between segment D and segment C.

One strategy for simplifying operation of the arm, is to keep it flexed in W- or M-shape at half of its max extension.

That would mean keeping  b = d = -c

You rotate the arm by changing angle a, and extend or retract by chaging b c and d eqaully.

Author Comment

ID: 13520402
Thanks d-glitch, But that looks like it's the forward kinematics solution. I already know where I am, and where I need to be. The angles are the unknowns here. I know the angles I'm currently in, but what are the angles going to be when I'm at (x,y) after I move.

Author Comment

ID: 13520405
I don't know if I have figured out a prefered angle. Let's just say it's 45 degrees for everything.
LVL 27

Expert Comment

ID: 13521551
Well, I can do it in Excel with the function from my earlier post and the GOAL SEEK TOOL

This is our starting position:

A      10.00            a      0.00            
B      9.00            b      45.00            45.00
C      8.00            c      -45.00            
D      7.00            d      45.00            
Vector A      10.00      0.00            Tip of A      10.00      0.00
Vector B      6.36      6.36            Tip of B      16.36      6.36
Vector C      8.00      0.00            Tip of C      24.36      6.36
Vector D      4.95      4.95            Tip of D      29.31      11.31

The tip of the arm is at    (29.31, 11.31)  which is (R= 31.42, Angle= 21.10)

We want to get to    (      12.00, 10.00)  which is  (R= 15.62, Angle= 39.81)

This is one solution:
A      10.00            a      -16.49            
B      9.00            b      125.69            125.69
C      8.00            c      -125.69            
D      7.00            d      125.69            
Vector A      9.59      -2.84            Tip of A      9.59      -2.84
Vector B      -2.96      8.50            Tip of B      6.63      5.66
Vector C      7.67      -2.27            Tip of C      14.30      3.39
Vector D      -2.30      6.61            Tip of D      12.00      10.00
                              R      15.62
                              Angle      39.81
LVL 27

Expert Comment

ID: 13521633
Just to be clear --   My prodedure for finding a solution is as follows:

   1.  Caluculate your current (X,Y) postion.        Convert that to R and Theta.

   2.  Decide where you want to go in (X,Y).       Convert that to R and Theta.

   3.  Change angles  b c d   keeping     b = d = -c to get the new R

   4.  Change angle a to get the new Theta
LVL 27

Expert Comment

ID: 13521654
Steps 1 and 2 are straight forward calculations.

Step 3 is harder.  You can do it by trial and error.  Or you can calculate R as a function of angle and make a lookup table.

Step 4 is easy.  Just an addition or subtraction.
LVL 27

Expert Comment

ID: 13522632
Requiring b = d = -c simplifies calculation by giving you a single solution for every point you can reach.
But you can't reach every point.

You can also require  b = c = d.  This has the same problem.

To cover the maximum area set   the end of  A at (10, 0)
                                                 the end of  C at ( 0,  7)
                                                 the end of  D at ( 0,  0)

Calculate the values of angle b c and d, and alway keep the same ratio.

Sorry I don't have the patience to do the calculations on my laptop.
LVL 27

Expert Comment

ID: 13522768
I also don't have anything better to do...

Let   b = 102.49*k
       c =   91.59*k
      d =   75.92*k   where k varies from 0 to 1

That will let you reach from   R=34  at  k=0      to      R=0  at  k=1


Author Comment

ID: 13537615
Nothing of what you've put up has any real meaning to my problem, d-glitch. If you don't know Jacobian Transpose please don't post. Solutions for working in excel are not an answer!
LVL 27

Expert Comment

ID: 13538008
>> Nothing of what you've put up has any real meaning to my problem.

I have given you the trignonometric expression for finding the position of the end of the arm as a function of joint angles.  
Did you have that before??  You cetainly need it.

I have given you an algorithm for finding the required joint angles to place the arm at any possible position.
I don't guarantee that is is the most efficient.  In fact I guarantee that it isn't.  But it's a start.

I used Excel for trigonometric calculations.  You would probably want to use Visual Basic.  But the calculations are the same.

If you want to j ump ahead to the Inverse Jacobian, you have to find the partial x- and y-derviatives of the arm position function I gave you for each joint angles as a function of position.  

LVL 27

Accepted Solution

d-glitch earned 2000 total points
ID: 13550091
This is a step-by-step numerical solution for moving the robot arm using the Inverse Jacobian techniques.

We find ourselves with the following joint angles and calulate our position e = [12, 10]:                                                            
a      b      c      d            X      Y                        
-35.82      59.03      59.03      59.03            12.00      10.00

The first step is to calculate the partial derivatives of position with respect to each joint angle.
Numerically, we can do this by adding 1 degree to each angle and calulating the new position.
The difference in position is the derivative with respect to that joint angle.

a      b      c      d            X+dx      Y+dy      
-34.82      59.03      59.03      59.03             11.82      10.21      de/da = [-0.176,  0.208]            
-35.82      60.03      59.03      59.03            11.72      10.07      de/db = [-0.277,  0.066]            
-35.82      59.03      60.03      59.03            11.79      9.92      de/dc = [-0.214, -0.078]
-35.82      59.03      59.03      60.03            11.92      9.90      de/dd = [-0.076, -0.096]

Now let us assume we want to move to position g = [22, 10]

              g - e = [22, 10] - [12, 10] = [10, 0]  so we want to move 10 units in the +x direction.

But we don't want to take too big a step, so we will try

              (g-e)/10 = [1, 0]    or 1 unit in the +x direction.

We have to solve the following equation for Ka  Kb  Kc  and  Kd

     Ka*de/da                 + Kb*de/db                  + Kc*de/dc                  + Kd*de/dd               = [1, 0]

     Ka*[-0.176,  0.208]   + Kb*[-0.277,  0.066]   + Kc*[-0.214, -0.078]   + Kd*[-0.076, -0.096] = [1, 0]

Ka thru Kd are the incremental changes required in the respective joint angles for a particular change in postion.
Solving this eqation is inverting the Jacobian.

There are an infinite number of solutions for this particular position.
I have arbitrarily chosen to set Ka = Kd = 0 because they have the smallest x-components.
There are many other criteria that would work, including the ones I suggested in my earlier posts.

     Kb*[-0.277,  0.066]   + Kc*[-0.214, -0.078]  = [1, 0]  has a unique solution     ==>  Kb = -2.17         Kc = -1.82

Now we have to increment the angle, and solve for the new position.
Here are the reslults:
a      b      c      d            X      Y                        
-35.82      56.86      57.21      59.03            13.00      9.96

We should be at [13.00, 10.00] and we are at [13.00, 9.96]
Less than 0.5% error in X position.  4% error in Y position.

You have to decide if this is good enough or not.

If it is, you recalculate all the derivatives and calculate the incremental angles for the next step.
One good thing is that the errors don't build up.  You take them into account in the next round of calculations.

If you need more precison, you can take smaller steps.

I will be happy to run through a similar calculation for any e and g positions you want to specify.

But there are some degenerate postions where the Jacobian breaks down.  One of them is

  a = b = c = d = 0  ==>  e = [34, 0]    The y-components of all the partial derivatives are zero.

Your software would have to look out for these situations and figure out how to handle them.
LVL 27

Expert Comment

ID: 13550262
At least one small error in the last post:

But there are some degenerate postions where the Jacobian breaks down.  One of them is

  a = b = c = d = 0  ==>  e = [34, 0]    It is the x-components of all the partial derivatives that are zero.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Guide to the PMT, FV, IPMT and PPMT Functions In MS Excel we have the PMT, FV, IPMT and PPMT functions, which do a fantastic job for interest rate calculations.  But what if you don't have Excel ? This article is for programmers looking to re…
Introduction On a scale of 1 to 10, how would you rate our Product? Many of us have answered that question time and time again. But only a few of us have had the pleasure of receiving a stack of the filled out surveys and being asked to do somethi…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question