Inverse Kinematics for a 2-Joint Robot Arm Using Algebra


Here we have the same two link robot as we just looked at but this time we're going to solve it using an analytical approach, that is we're going to rely much more on algebra, particular linear algebra rather than geometry. We have an expression E, which is the homogeneous transformation which represents the pose of the robots endefector and we looked at this in the last lecture, we can write the endefector pose as a sequence of elementary homogeneous transformations. A rotation by Q1, a translation along the X direction by A1, a rotation by Q2 and then a translation in the X direction by A2. If I expand this out, multiply all the transformations together, I get the expression shown here; a three by three homogeneous transformation matrix representing the pose of the robot's endefector.

Now for this particular two link robot, we are only interested in the position of its endefector, it's X and Y co-ordinate and they are these two elements within the homogeneous transformation matrix, so I'm going to copy those out. So here again is our expression for X and Y and what we're going to do is a fairly common trick, we're going to square and add these two equations and I get a relationship that looks like this. Now I can solve for the joint angle Q2 in terms of the endefector pose X and Y and the robot's constants A1 and A2.

Now what I'm going to do is apply the sum of angles identity. I'm going to expand these terms, sine of Q1 plus Q2 or cos of Q1 plus Q2 and to make life a little bit easier, I'm going to make some substations, so where ever I had cos Q2, I'm going to write C2 and where ever I had sine Q2, I’m going to write S2. It's a fairly common shorthand when people are looking at robot kinematic equations. And here are the equations after making those substitutions. Looking at these two equations, I can see that they fall into a very well known form and for that form there is a very well known solution. So I'm going to consider just one of the equations, the equation for Y and using our well known identity and it's solution, I can determine the values for the variables little a, little b and little c and once I've determined those, then I can just write down the solution for Q1, which is the equivalent of theta in this particular case.

Here again is our expression for Q1, copied over from the previous slide and we may remember from earlier in our workings that we determined this particular relationship; X squared plus Y squared is equal to this particular complex expression. So I can substitute that in and do some simplification and I end up with this slightly less complex expression for Q1. And it is the same expression that I got following the geometric approach in the previous section.


There is no code in this lesson.

We repeat the process of the last section but this time consider it as an algebraic problem.

Professor Peter Corke

Professor of Robotic Vision at QUT and Director of the Australian Centre for Robotic Vision (ACRV). Peter is also a Fellow of the IEEE, a senior Fellow of the Higher Education Academy, and on the editorial board of several robotics research journals.

Skill level

This content assumes an understanding of high school-level mathematics, e.g. trigonometry, algebra, calculus, physics (optics) and some knowledge/experience of programming (any language).

More information...

Rate this lesson


Check your understanding


  1. zuhair says:

    it would be so difficult to solve for six dof robot. are there any other methods for solving?

    1. Peter Corke says:

      yes it is, but it can be done for certain cases which include almost all current industrial robots. In my toolbox, the ikine6s() function for instance. Watch the subsequent lessons about how to do it numerically

Leave a comment