Skip to content
All projects

MATLAB & Simulink · RoboticsMATLAB

Simulink 2-DOF Arm

Joint-space sine tracking and a Cartesian square path through closed-form inverse kinematics.

θ1θ2θ1 refθ2 refCARTESIAN · IKJOINT SPACE · SINE

Overview

The planar two-link arm is the hello world of robot kinematics, and this project works through both ways of commanding one. In joint space, each joint follows a sine wave. In Cartesian space, the end-effector traces a square and the joint angles come from inverse kinematics.

The same closed-form solution drives the interactive arm at the top of this site.

How it works

  1. Set up

    A MATLAB script defines the arm parameters and workspace used by every model.

  2. Joint space

    A Simulink model feeds sinusoidal references to both joints.

  3. Cartesian space

    A second model generates a square path and resolves each point to joint angles with θ₂ = acos((x² + y² − L₁² − L₂²) / 2L₁L₂) and θ₁ = atan2(y, x) − atan2(L₂ sin θ₂, L₁ + L₂ cos θ₂).

  4. Visualise

    Simscape Multibody can optionally render the arm in 3D while it moves.