ECE183Semester 3 • 4 CreditsSpecialization Subjects

Mathematics For Robotics

Mathematics for Robotics covers coordinate systems, matrices, linear and nonlinear equations, Laplace transforms, numerical solutions of ordinary differential equations, interpolation, numerical differentiation and integration, probability, stochastic processes, calculus of variations, and Lagrangian dynamics for robot manipulators.

Syllabus PDF
6 Units • Notes • Model Answers • MCQs
Select Course Unit (6 Units)
Active: Unit 1
Unit 1:Unit 1: Coordinate Systems and Matrices
22 min read•High-Yield Unit Guide

Unit 1: Coordinate Systems and Matrices

Unit 1 Exam Focus & Core Takeaways

Review the core definitions, standard architectures, and syntax patterns below. Pay special attention to sections highlighted with bullet points for your mid-term and end-term subjective questions.

Unit 1: Coordinate Systems and Matrices

1. Geometric Foundations of Robotic Kinematics

Robotics is fundamentally the mathematical science of representing, predicting, and controlling the spatial pose, velocity, acceleration, and force transmission of physical bodies operating in three-dimensional space. The physical posture of an articulated manipulator, mobile robot, or aerial drone is defined through rigid-body spatial transformations relative to structured reference coordinate frames.

A coordinate system establishes a one-to-one mapping between abstract geometric points and numerical ordered n-tuples in R3\mathbb{R}^3. In robotic manipulation, kinematic state estimation, and sensor fusion, coordinate selection dictates the computational complexity of motion planning, inverse kinematics, and closed-loop dynamic equations of motion.

CODE
+---------------------------------------------------------------------------------------------------+
|                        ROBOTIC SPATIAL TRANSFORMATION HIERARCHY                                   |
+---------------------------------------------------------------------------------------------------+
|  WORLD / BASE FRAME {W}                                                                           |
|       |                                                                                           |
|       |--> Homogeneous Transform T_0 (Base to Joint 1)                                            |
|       v                                                                                           |
|  LINK 1 FRAME {1}                                                                                 |
|       |                                                                                           |
|       |--> Homogeneous Transform T_1 (Joint 1 to Joint 2)                                         |
|       v                                                                                           |
|  LINK 2 FRAME {2}                                                                                 |
|       |                                                                                           |
|       |--> Homogeneous Transform T_2 ... T_{n-1}                                                  |
|       v                                                                                           |
|  END-EFFECTOR / TOOL FRAME {E}                                                                    |
|       |                                                                                           |
|       |--> Spatial Mapping: ^W p = ^W T_E * ^E p                                                  |
|       v                                                                                           |
|  TARGET OBJECT / SENSOR FRAME {S}                                                                 |
+---------------------------------------------------------------------------------------------------+

2. Curvilinear Coordinate Systems in Robotics

Robotic workspace analyses frequently require transitioning between Cartesian space and curvilinear coordinate systems to exploit natural geometric symmetries (e.g., revolute joint arcs, SCARA cylindrical workspaces, or spherical wrists).

CODE
+---------------------------------------------------------------------------------------------------+
|                         ROBOTIC COORDINATE SYSTEMS COMPARISON                                     |
+---------------------+-------------------------------+---------------------------------------------+
| COORDINATE SYSTEM   | COORDINATES                   | SCALE FACTORS (h1, h2, h3)                  |
+---------------------+-------------------------------+---------------------------------------------+
| Cartesian (Rect.)   | (x, y, z)                     | (1, 1, 1)                                   |
| Cylindrical         | (r, theta, z)                 | (1, r, 1)                                   |
| Spherical           | (rho, theta, phi)             | (1, rho*sin(phi), rho)                      |
| Polar (2D Planar)   | (r, theta)                    | (1, r)                                      |
+---------------------+-------------------------------+---------------------------------------------+

2.1 Cartesian Coordinate System

The 3D Cartesian frame defines a point PP using mutually orthogonal axes x^,y^,z^\hat{\mathbf{x}}, \hat{\mathbf{y}}, \hat{\mathbf{z}} conforming strictly to the right-hand rule (x^×y^=z^\hat{\mathbf{x}} \times \hat{\mathbf{y}} = \hat{\mathbf{z}}):
p=[xyz]=xx^+yy^+zz^\mathbf{p} = \begin{bmatrix} x \\ y \\ z \end{bmatrix} = x \hat{\mathbf{x}} + y \hat{\mathbf{y}} + z \hat{\mathbf{z}}

  • Metric Differential Length:
    ds2=dx2+dy2+dz2ds^2 = dx^2 + dy^2 + dz^2
  • Differential Volume Element:
    dV=dx dy dzdV = dx \, dy \, dz

2.2 Cylindrical Coordinate System

Cylindrical coordinates (r,θ,z)(r, \theta, z) are natural for cylindrical-geometry manipulators (e.g., Stanford arm base, gantry systems) where motion consists of planar polar sweeps combined with axial linear elevation:
x=rcos⁡θ,y=rsin⁡θ,z=zx = r \cos\theta, \quad y = r \sin\theta, \quad z = z
where r≥0r \ge 0, 0≤θ<2π0 \le \theta < 2\pi, and z∈(−∞,∞)z \in (-\infty, \infty).

  • Scale Factors: hr=1h_r = 1, hθ=rh_\theta = r, hz=1h_z = 1.
  • Differential Length:
    ds2=dr2+r2dθ2+dz2ds^2 = dr^2 + r^2 d\theta^2 + dz^2
  • Differential Volume Element:
    dV=r dr dθ dzdV = r \, dr \, d\theta \, dz
    The factor rr represents the Jacobian determinant of the coordinate transformation, accounting for the tangential arc stretching at increasing radial distance.

2.3 Spherical Coordinate System

Spherical coordinates (ρ,θ,ϕ)(\rho, \theta, \phi) model spherical wrists, tracking radar gimbals, and omnidirectional sensor fields where motion radiates from a central pivot:
x=ρsin⁡ϕcos⁡θ,y=ρsin⁡ϕsin⁡θ,z=ρcos⁡ϕx = \rho \sin\phi \cos\theta, \quad y = \rho \sin\phi \sin\theta, \quad z = \rho \cos\phi
where ρ≥0\rho \ge 0 is radial distance, θ∈[0,2π)\theta \in [0, 2\pi) is azimuthal angle in the xyxy-plane, and ϕ∈[0,π]\phi \in [0, \pi] is zenith / polar angle measured from the +z+z axis.

  • Scale Factors: hρ=1h_\rho = 1, hϕ=ρh_\phi = \rho, hθ=ρsin⁡ϕh_\theta = \rho \sin\phi.
  • Differential Volume Element:
    dV=ρ2sin⁡ϕ dρ dϕ dθdV = \rho^2 \sin\phi \, d\rho \, d\phi \, d\theta

3. Differential Geometry & Field Integrals in Robotics

Robotic links possess distributed continuous mass and experience distributed hydrodynamic, aerodynamic, and contact forces. Transforming continuous spatial mechanics into rigid-body dynamics requires evaluating line, surface, and volume integrals.

CODE
+---------------------------------------------------------------------------------------------------+
|                            CALCULUS OF CONTINUOUS ROBOT LINK MECHANICS                            |
+---------------------------------------------------------------------------------------------------+
|  1. LINE INTEGRALS (Actuator Work & Trajectory Workspaces)                                        |
|     W = \int_C \mathbf{F} \cdot d\mathbf{r} = \int_a^b \mathbf{F}(\mathbf{r}(t)) \cdot \mathbf{r}'(t) dt |
|     - Accumulates mechanical work along the end-effector trajectory curve C                       |
|                                                                                                   |
|  2. SURFACE INTEGRALS & FLUX (Gripper Contact Pressures & Sensor Fields)                         |
|     \Phi = \iint_S \mathbf{F} \cdot \hat{\mathbf{n}} \, dA                                        |
|     - Computes net fluid thrust or tactile pressure normal to the sensor pad surface              |
|                                                                                                   |
|  3. VOLUME INTEGRALS (Link Mass, Center of Mass, & Inertia Tensors)                               |
|     Mass: m = \iiint_V \rho(\mathbf{r}) \, dV                                                     |
|     Center of Mass: \mathbf{r}_c = \frac{1}{m} \iiint_V \mathbf{r} \rho(\mathbf{r}) \, dV         |
|     Inertia Tensor: I_{ij} = \iiint_V \rho(\mathbf{r}) [\delta_{ij} r^2 - x_i x_j] \, dV          |
+---------------------------------------------------------------------------------------------------+

3.1 Divergence Theorem (Gauss's Theorem)

The Divergence Theorem equates the net outward flux of a vector field across a closed surface to the volume integral of its spatial divergence:
∬∂VF⋅n^ dA=∭V(∇⋅F) dV\iint_{\partial V} \mathbf{F} \cdot \hat{\mathbf{n}} \, dA = \iiint_V (\nabla \cdot \mathbf{F}) \, dV
In robotic continuum mechanics, this converts surface contact stresses into internal volume stress tensor divergences.

3.2 Stokes' Theorem

Stokes' Theorem equates the circulation of a vector field around a closed boundary curve ∂S\partial S to the surface integral of its curl:
∮∂SF⋅dr=∬S(∇×F)⋅n^ dA\oint_{\partial S} \mathbf{F} \cdot d\mathbf{r} = \iint_S (\nabla \times \mathbf{F}) \cdot \hat{\mathbf{n}} \, dA
In magnetic robotic actuation and conservative potential field path planning, Stokes' theorem validates whether a force field is conservative (∇×F=0  ⟺  ∮F⋅dr=0\nabla \times \mathbf{F} = \mathbf{0} \iff \oint \mathbf{F} \cdot d\mathbf{r} = 0).


4. Matrix Algebra & Spatial Transformations in SE(3)

Rigid-body kinematics operates on the Special Euclidean Group SE(3)SE(3), composed of rotations in the Special Orthogonal Group SO(3)SO(3) combined with translations in R3\mathbb{R}^3.

CODE
+---------------------------------------------------------------------------------------------------+
|                        HOMOGENEOUS TRANSFORMATION MATRIX STRUCTURE                                |
+---------------------------------------------------------------------------------------------------+
|                                                                                                   |
|          ^A T_B  =  [   ^A R_B (3x3)   |   ^A p_B (3x1)   ]                                       |
|                     [ -----------------+----------------- ]                                       |
|                     [    0   0   0     |        1         ]                                       |
|                                                                                                   |
|  WHERE:                                                                                           |
|  - ^A R_B : 3x3 Orthogonal Rotation Matrix in SO(3)  (R^T * R = I,  det(R) = +1)                  |
|  - ^A p_B : 3x1 Translation Vector in R^3 locating origin of frame B relative to frame A          |
|  - [0 0 0]: Perspective scaling row (zero for affine rigid transformations)                       |
|  - 1      : Homogeneous scale factor                                                              |
|                                                                                                   |
|  INVERSE HOMOGENEOUS TRANSFORMATION:                                                             |
|          (^A T_B)^{-1} = [   (^A R_B)^T   |   - (^A R_B)^T * ^A p_B   ]                           |
|                          [ ---------------+----------------------- ]                              |
|                          [    0   0   0   |            1          ]                               |
+---------------------------------------------------------------------------------------------------+

4.1 Rotation Matrices in SO(3)

A rotation matrix R∈R3×3R \in \mathbb{R}^{3 \times 3} transforms coordinate representations between two orthonormal bases without altering lengths or angles:

  • Orthogonality: RTR=RRT=I  ⟹  R−1=RTR^T R = R R^T = I \implies R^{-1} = R^T
  • Proper Orientation: det⁡(R)=+1\det(R) = +1 (distinguishing pure rotations from reflections where det⁡(R)=−1\det(R) = -1).
  • Canonical Elementary Rotations: R_y(\theta) = \begin{bmatrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix}, \quad R_z(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}$$

5. Matrix Decompositions in Robotic Computation

Modern robotics algorithms rely on structured matrix factorizations rather than direct matrix inversion to maximize numerical stability and compute efficiency.

CODE
+---------------------------------------------------------------------------------------------------+
|                        TAXONOMY OF MATRIX DECOMPOSITIONS IN ROBOTICS                              |
+---------------------+-------------------+---------------------+-----------------------------------+
| DECOMPOSITION       | FACTORIZATION     | MATRIX PROPERTIES   | ROBOTIC APPLICATION               |
+---------------------+-------------------+---------------------+-----------------------------------+
| LU Decomposition    | P * A = L * U     | Square A, general   | Forward dynamics, joint torques   |
| Cholesky            | A = L * L^T       | Symmetric Pos.-Def. | Manipulator inertia matrix M(q)   |
| QR Decomposition    | A = Q * R         | Orthogonal Q, tri. R| Numerically stable least squares  |
| Eigen Decomposition | A = V * Lambda*V^-1| Square, diagonalizable | Dynamic mode analysis, stability  |
| SVD                 | A = U * Sigma*V^T | Arbitrary m x n     | Kinematic singularities, Jacobian |
+---------------------+-------------------+---------------------+-----------------------------------+

5.1 LU Decomposition

Any nonsingular square matrix AA can be factored into a lower triangular matrix LL and upper triangular matrix UU with row permutation matrix PP:
PA=LUP A = L U

  • Robotic Relevance: Solves systems Ax=bA \mathbf{x} = \mathbf{b} via forward substitution (Ly=PbL \mathbf{y} = P \mathbf{b}) and back substitution (Ux=yU \mathbf{x} = \mathbf{y}) in O(n2)\mathcal{O}(n^2) time after an initial O(23n3)\mathcal{O}(\frac{2}{3}n^3) factorization, avoiding numerical errors inherent in computing A−1A^{-1}.

5.2 Cholesky Decomposition

For real symmetric positive-definite (SPD) matrices where xTAx>0\mathbf{x}^T A \mathbf{x} > 0 for all x≠0\mathbf{x} \ne \mathbf{0}, AA factors uniquely into:
A=LLTA = L L^T
where LL is a lower triangular matrix with strictly positive diagonal elements.

  • Robotic Relevance: The manipulator mass/inertia matrix M(q)M(q) in the Lagrangian dynamics equation:
    M(q)q¨+C(q,q˙)q˙+g(q)=τM(q) \ddot{q} + C(q, \dot{q})\dot{q} + g(q) = \tau
    is guaranteed by physics to be symmetric positive-definite. Cholesky decomposition computes forward accelerations q¨\ddot{q} twice as fast as LU decomposition with guaranteed numerical stability.

5.3 QR Decomposition

Factors an m×nm \times n matrix AA into an orthogonal matrix Q∈Rm×mQ \in \mathbb{R}^{m \times m} (QTQ=IQ^T Q = I) and an upper triangular matrix R∈Rm×nR \in \mathbb{R}^{m \times n}:
A=QRA = Q R

  • Robotic Relevance: Solves overdetermined kinematic calibration and sensor estimation problems min⁡x∥Ax−b∥2\min_{\mathbf{x}} \|A\mathbf{x} - \mathbf{b}\|_2. Because orthogonal transformations preserve Euclidean vector norms (∥Qv∥2=∥v∥2\|Q\mathbf{v}\|_2 = \|\mathbf{v}\|_2), QR factorization avoids squaring the condition number κ(A)\kappa(A), unlike normal equations (ATAx=ATbA^T A \mathbf{x} = A^T \mathbf{b}).

5.4 Singular Value Decomposition (SVD) & Robot Jacobians

Every real matrix A∈Rm×nA \in \mathbb{R}^{m \times n} has a Singular Value Decomposition:
A=UΣVTA = U \Sigma V^T
where U∈Rm×mU \in \mathbb{R}^{m \times m} and V∈Rn×nV \in \mathbb{R}^{n \times n} are orthogonal matrices, and Σ=diag(σ1,σ2,…,σp)\Sigma = \text{diag}(\sigma_1, \sigma_2, \dots, \sigma_p) contains non-negative singular values sorted in descending order: σ1≥σ2≥⋯≥σp≥0\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_p \ge 0.

CODE
+---------------------------------------------------------------------------------------------------+
|                         SVD & MANIPULABILITY ELLIPSOID ANALYSIS                                   |
+---------------------------------------------------------------------------------------------------+
|  ROBOT GEOMETRIC JACOBIAN:  v_e = J(q) * q_dot                                                    |
|                                                                                                   |
|  SVD FACTORIZATION:        J = U * Sigma * V^T                                                    |
|                                                                                                   |
|  MANIPULABILITY METRICS:                                                                          |
|  - Yoshikawa Manipulability Measure:  w = sqrt(det(J * J^T)) = sigma_1 * sigma_2 * ... * sigma_m  |
|  - Ellipsoid Principal Axes: Directed along columns of U (u_1, u_2, ..., u_m)                     |
|  - Semi-Axis Lengths: Scaled directly by singular values (sigma_1, sigma_2, ..., sigma_m)         |
|  - Singularity Condition: sigma_m -> 0 (Ellipsoid collapses, loss of directional mobility)        |
+---------------------------------------------------------------------------------------------------+

5.5 The Moore-Penrose Pseudoinverse

For redundant manipulators (n>mn > m), the Moore-Penrose pseudoinverse J+J^+ provides minimum-norm joint velocity solutions:
J+=VΣ+UT=JT(JJT)−1J^+ = V \Sigma^+ U^T = J^T (J J^T)^{-1}
where Σ+\Sigma^+ is formed by inverting non-zero singular values:
σi+={1σiif σi>ϵ0if σi≤ϵ\sigma_i^+ = \begin{cases} \frac{1}{\sigma_i} & \text{if } \sigma_i > \epsilon \\ 0 & \text{if } \sigma_i \le \epsilon \end{cases}

  • Damped Least Squares (Levenberg-Marquardt): Near kinematic singularities where σm→0\sigma_m \to 0, standard pseudoinverse causes joint velocities to diverge to infinity (q˙→∞\dot{q} \to \infty). Damped least squares regularizes the inversion:
    J∗=JT(JJT+λ2I)−1J^* = J^T (J J^T + \lambda^2 I)^{-1}
    smoothly bounding velocity while trading off instantaneous path tracking precision.