Renny Harlin

Forward and inverse kinematics of a 2-link manipulator

· 1 min read

The 2-link manipulator is a fundamental robotics system that is used by robot enthusiasts to understand the principles of kinematics. A 2-link manipulator consists of two rigid links connected by revolute joints, allowing for planar motion.

In this post, we will explore the forward and inverse kinematics of a 2-link manipulator.

Forward kinematics - Given joint parameters, what is the position of the end-effector

Inverse kinematics - Given the position of the end-effector, what are the joint parameters

2-R manipulator

In the above diagram,

  • Joint parameters:
    • θ1,θ2\theta_1, \theta_2
  • Link parameters:
    • l1,l2l_1, l_2
  • End-effector position:
    • x,yx, y

Forward Kinematics

The forward kinematics of 2-link manipulators is highly intuitive using geometry.

x=l1cos(θ1)+l2cos(θ1+θ2)x = l_1cos(\theta_1) + l_2cos(\theta_1 + \theta_2) y=l1sin(θ1)+l2sin(θ1+θ2)y = l_1sin(\theta_1) + l_2sin(\theta_1 + \theta_2)

Inverse Kinematics

Let ϕ=θ1+θ2\phi = \theta_1 + \theta_2

By geometry we know that,

tan(ϕ)=y/x tan(\phi) = y/x ϕ=Atan2(y,x)\phi = Atan2(y, x)

Now, if we square and add both the forward kinematic equations.
We get:

x2+y2=l12+l22+2l1l2(cos(θ2))x^2 + y^2 = l_1^2 + l_2^2 + 2l_1l_2(cos(\theta_2)) cos(θ2)=x2+y2−l12+l222l1l2 cos(\theta_2) = {x^2 + y^2 - l_1^2 + l_2^2 \over 2l_1l_2} θ2=Atan2(1−cos2(θ2),cos2(θ2)) \theta_2 = Atan2(\sqrt{1 - cos^2(\theta_2)}, cos^2(\theta_2))

Now, that we know θ2\theta_2

θ1=ϕ−θ2\theta_1 = \phi - \theta_2

And, that’s it. Both forward kinematics and inverse kinematics equations are derived.