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
Set up
A MATLAB script defines the arm parameters and workspace used by every model.
Joint space
A Simulink model feeds sinusoidal references to both joints.
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 θ₂).
Visualise
Simscape Multibody can optionally render the arm in 3D while it moves.