Step-by-step Calculation of Joint Angles in 3dof Inverse Kinematics

Inverse kinematics is a method used to determine the joint angles of a robotic arm based on a desired position of its end effector. In a 3 degrees of freedom (3DOF) system, calculating these angles involves geometric and trigonometric principles. This article provides a step-by-step guide to performing these calculations.

Understanding the Robot Configuration

Before starting calculations, it is essential to understand the robot’s structure, including link lengths and joint types. Typically, a 3DOF robot has three rotational joints, each contributing to the overall position of the end effector in 3D space.

Step 1: Determine the Target Position

Identify the desired position of the end effector, represented by coordinates (x, y, z). These coordinates serve as the basis for calculating the joint angles.

Step 2: Calculate the Base Joint Angle (θ1)

The first joint angle, θ1, is typically the rotation around the vertical axis. It can be calculated using the projection of the target position onto the XY-plane:

θ1 = atan2(y, x)

Step 3: Calculate the Wrist Position

Subtract the contribution of the first joint to find the wrist position, which is the point where the last two joints operate. This involves calculating the planar distance:

r = sqrt(x² + y²) – link1_length

and the vertical distance:

s = z – link0_height

Step 4: Calculate the Elbow and Shoulder Angles

Using the Law of Cosines, compute the angles at the elbow and shoulder joints. Define:

  • D = (r² + s² – link2_length² – link3_length²) / (2 * link2_length * link3_length)

then, the elbow angle:

θ3 = acos(D)

And the shoulder angle:

θ2 = atan2(s, r) – atan2(link3_length * sin(θ3), link2_length + link3_length * cos(θ3))

Step 5: Finalize the Joint Angles

Convert all calculated angles to degrees if necessary. Verify the angles are within the robot’s joint limits before applying them.