Chapter 2
Mathematical Foundations for Robot Motion
Bachelor Program in Mechatronics Engineering
Robotics and Kinematics
•
Bachelor
Mathematical Foundations for Robot Motion
Introduction
Robotics is built on the ability to describe position, orientation, motion, and interaction mathematically. A robot controller must convert physical geometry into numerical representations, compute desired motions, and determine actuator commands. These tasks depend on vectors, matrices, coordinate frames, trigonometry, calculus, numerical methods, and graph structures.
This chapter develops the mathematical language used throughout robotics and kinematics. The emphasis is not merely on manipulating equations, but on understanding what each quantity represents physically, when a model is valid, and how numerical computation affects engineering decisions.
Learning Objectives
After studying this chapter, you should be able to:
Represent points, directions, velocities, and forces using vectors.
Apply matrix operations to robot motion and coordinate transformations.
Define and transform quantities between coordinate frames.
Use trigonometry to model planar and spatial mechanisms.
Explain the role of derivatives, integrals, and Jacobians in robot motion.
Solve basic kinematic equations analytically and numerically.
Represent robot mechanisms and environments using graphs.
Assess modeling assumptions, singularities, numerical errors, and implementation limitations.
1. Quantities Used in Robot Modeling
A robotic model distinguishes between several kinds of quantities.
Quantity
Example
Mathematical type
Typical unit
Scalar
link length, mass
single number
m, kg, s
Point
joint location
position vector
m
Direction
axis orientation
unit vector
dimensionless
Configuration
joint angles
vector
rad or m
Velocity
joint speed, end-effector velocity
vector
rad/s or m/s
Force or torque
contact force, motor torque
vector
N or N·m
Transformation
frame pose
matrix
mixed position and orientation
A scalar has magnitude only. A vector has magnitude and direction. In robotics, vectors are often expressed relative to a selected coordinate frame. The same physical vector can therefore have different numerical components in different frames.
A position vector from the origin O to a point P may be written as
p = [ x y z ]ᵀ
where x, y, and z are coordinates measured in metres. A configuration vector for an n-joint robot is commonly written as
q = [ q₁ q₂ … qₙ ]ᵀ
where each qᵢ is a joint variable. Revolute variables are angles, normally expressed in radians; prismatic variables are displacements, normally expressed in metres.
Vector operations
For vectors a and b of equal dimension, addition is componentwise:
a + b = [ a₁ + b₁, a₂ + b₂, …, aₙ + bₙ ]ᵀ
The dot product is
a · b = ∑ᵢ₌₁ⁿ aᵢbᵢ
It produces a scalar and measures alignment. If a and b are nonzero, the angle α between them satisfies
a · b = ‖a‖‖b‖ cos α
where ‖a‖ is the Euclidean norm. Thus, perpendicular vectors have zero dot product.
The three-dimensional cross product is
a × b = [ a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁ ]ᵀ
It is perpendicular to both a and b. In mechanics, if r is a displacement from a reference point to a force application point and F is force, the moment is
τ = r × F
The units are N·m when r is in metres and F is in newtons. The cross product is defined in a right-handed three-dimensional coordinate system.
2. Matrices and Linear Algebra
A matrix is a rectangular arrangement of numbers. Matrices provide a compact representation of linear mappings, systems of equations, and coordinate transformations.
For a matrix A and vector x, the product Ax is defined only when the number of columns of A equals the number of entries in x. Matrix multiplication is generally not commutative: AB usually differs from BA. This is especially important in robotics because the order of rotations and translations changes the physical result.
A linear system can be written as
Ax = b
where A is an m × n coefficient matrix, x is the unknown vector, and b is a known vector. If A is square and nonsingular, the unique solution is formally
x = A⁻¹b
However, numerical software should normally solve Ax = b directly rather than explicitly computing A⁻¹, because direct factorization is generally more efficient and numerically stable.
Determinant, rank, and conditioning
For a square matrix, the determinant indicates whether the matrix is singular. If det(A) = 0, A has no inverse. The rank of a matrix is the number of independent rows or columns. In robot kinematics, rank loss often indicates a singular configuration in which some desired motion cannot be produced independently.
A problem is ill-conditioned when small errors in data produce large errors in the result. The condition number, commonly denoted κ(A), provides an indication of sensitivity. Large κ(A) warns that sensor noise, rounding, or calibration errors may strongly affect the computed solution.
Eigenvalues and eigenvectors
An eigenvector v and eigenvalue λ satisfy
Av = λv
for nonzero v. Eigenvalues appear in vibration analysis, stability studies, principal-axis calculations, and dimensionality-reduction methods. Although basic rigid-body kinematics relies more directly on rotations and transformations, eigenvalue methods become important in robot dynamics, control, and numerical optimization.
3. Coordinate Frames and Rotations
A coordinate frame consists of an origin and three mutually perpendicular unit axes. Robot motion is always described relative to frames. Typical frames include a world or base frame, one frame attached to each link, a tool frame, and a sensor frame.
A point P expressed in frame A is denoted by pᴬ. The superscript identifies the frame, not an exponent. A rotation matrix Rᴬᴮ maps vector components from frame B into frame A:
pᴬ = Rᴬᴮpᴮ
A valid three-dimensional rotation matrix satisfies
RᵀR = I, det(R) = +1
where I is the identity matrix. Consequently, R⁻¹ = Rᵀ. The transpose relation is a useful computational check: if a calculated rotation matrix is not approximately orthogonal, an implementation or numerical correction is required.
For a rotation of angle θ about the z-axis,
Rz(θ) = [ cos θ −sin θ 0; sin θ cos θ 0; 0 0 1 ]
The angle is positive according to the right-hand rule. Similar matrices exist for rotations about the x- and y-axes. In general, rotations do not commute; RₓRᵧ and RᵧRₓ represent different orientations.
Homogeneous transformations
A rigid pose combines rotation and translation. It is represented using a 4 × 4 homogeneous transformation:
Tᴬᴮ = [ Rᴬᴮ pᴬᴮ; 0 0 0 1 ]
where Rᴬᴮ is a 3 × 3 rotation matrix and pᴬᴮ is the position of frame B's origin expressed in frame A. A point is written in homogeneous form as
p̃ = [ x y z 1 ]ᵀ
and transformed by
p̃ᴬ = Tᴬᴮp̃ᴮ
The inverse transformation is
(Tᴬᴮ)⁻¹ = [ (Rᴬᴮ)ᵀ −(Rᴬᴮ)ᵀpᴬᴮ; 0 0 0 1 ]
This equation assumes a rigid transformation: the rotation is orthonormal and the bottom row is [0 0 0 1]. Transformations compose according to frame order. If frame B is expressed relative to C and C relative to A, then
Tᴬᴮ = TᴬᶜTᶜᴮ
The rightmost transformation acts first.
Coordinate frames and a homogeneous transformation between them
Figure: Coordinate frames and a homogeneous transformation between them
Figure: Two coordinate frames related by a rigid homogeneous transformation.
4. Trigonometry and Planar Robot Geometry
Trigonometry connects link lengths and joint angles to positions. For a planar two-link manipulator with link lengths l₁ and l₂ and joint angles θ₁ and θ₂, measured using the conventional serial-chain definition, the end-effector position is
x = l₁ cos θ₁ + l₂ cos(θ₁ + θ₂)
y = l₁ sin θ₁ + l₂ sin(θ₁ + θ₂)
The orientation of the final link is φ = θ₁ + θ₂. These are forward-kinematics equations: joint variables are known and Cartesian pose is calculated.
Inverse kinematics reverses the process. For a desired point (x, y), define r² = x² + y². The law of cosines gives
cos θ₂ = (r² − l₁² − l₂²)/(2l₁l₂)
A real solution requires the right-hand side to lie between −1 and 1. The two possible signs of sin θ₂ generally produce elbow-up and elbow-down configurations. The first angle can be obtained using
θ₁ = atan2(y, x) − atan2(l₂ sin θ₂, l₁ + l₂ cos θ₂)
The function atan2 is preferred to ordinary arctangent because it uses the signs of both coordinates and returns the correct quadrant.
Worked example: two-link planar arm
Let l₁ = 0.60 m, l₂ = 0.40 m, θ₁ = 30°, and θ₂ = 45°. Since trigonometric functions in software commonly use radians, the angles must be converted before computation: 30° = π/6 rad and 45° = π/4 rad.
The end-effector orientation is
φ = 30° + 45° = 75°.
The position is
x = 0.60 cos 30° + 0.40 cos 75°
≈ 0.60(0.8660) + 0.40(0.2588)
≈ 0.6235 m,
y = 0.60 sin 30° + 0.40 sin 75°
≈ 0.60(0.5000) + 0.40(0.9659)
≈ 0.6864 m.
Thus the pose is approximately (0.624 m, 0.686 m, 75°). The result is physically plausible because the distance from the base is approximately 0.927 m, which lies between |l₁ − l₂| = 0.20 m and l₁ + l₂ = 1.00 m.
5. Calculus of Robot Motion
Calculus describes how configuration changes over time. If q(t) is a joint-position vector, joint velocity is
q̇(t) = dq(t)/dt
and joint acceleration is
q̈(t) = d²q(t)/dt²
The units depend on the joint type. For a revolute joint, q̇ is rad/s; for a prismatic joint, it is m/s.
If velocity is known, position can be recovered by integration:
q(t) = q(t₀) + ∫ₜ₀ᵗ q̇(τ)dτ
The Jacobian relates joint velocity to Cartesian velocity. If the forward-kinematics function is x = f(q), then
ẋ = J(q)q̇
where
J(q) = ∂f(q)/∂q
For the planar two-link position equations, the Jacobian is
Therefore, when θ₂ = 0 or π, the Jacobian loses rank. These are singular configurations: instantaneous motion in some Cartesian directions cannot be generated independently, and inverse-velocity calculations become highly sensitive to errors.
For a six-dimensional spatial end-effector velocity, the Jacobian is often partitioned into linear and angular parts:
v = Jᵥ(q)q̇, ω = Jω(q)q̇
where v is translational velocity in m/s and ω is angular velocity in rad/s. Combining them into one vector requires careful unit interpretation because the two parts have different physical dimensions.
6. Numerical Methods for Robotics
Closed-form solutions are useful but not always available. Real robots may have offsets, complex geometry, joint limits, calibration errors, and redundant degrees of freedom. Numerical methods are then required.
Discrete integration
For a time step Δt and approximately constant velocity over the step, forward Euler integration is
qₖ₊₁ = qₖ + Δt q̇ₖ
This method is simple but introduces truncation error. Smaller time steps usually improve accuracy, although they increase computation and may amplify measurement noise if velocities are estimated from sensors.
Newton–Raphson iteration
To solve f(q) = xᵈ for a desired task value xᵈ, define the error e(q) = xᵈ − f(q). A Jacobian-based update is
qₖ₊₁ = qₖ + J(qₖ)⁺e(qₖ)
where J⁺ is the Moore–Penrose pseudoinverse. This is locally effective when the initial estimate is reasonable and the Jacobian is not severely singular. Near singularities, damped least squares is safer:
J⁺λ = Jᵀ(JJᵀ + λ²I)⁻¹
where λ > 0 is a damping factor. Larger λ improves robustness near singularities but reduces exactness and may slow convergence.
Numerical algorithms should include stopping criteria, such as a position-error tolerance, a maximum iteration count, and a joint-step tolerance. They should also enforce joint limits and reject solutions that collide with the environment.
Error sources
Important sources of error include:
sensor quantization and noise;
inaccurate link dimensions or joint-zero calibration;
floating-point round-off;
model simplifications such as ignoring compliance;
accumulated integration drift;
poor conditioning near singularities;
incorrect frame conventions or angle units.
A robust implementation checks dimensions, transformation orthogonality, joint limits, reachable workspace, and residual error after solving.
7. Graph Representations in Robotics
Graphs model relationships among entities. A graph G = (V, E) consists of vertices V and edges E. In robotics, vertices may represent links, joints, poses, sensors, or configuration states; edges may represent physical connections, allowable transitions, or collision-free paths.
A serial robot can be represented as a tree: each link is a vertex and each joint is an edge connecting a parent link to a child link. A mobile robot navigating a map may use a graph whose vertices are locations and whose edges are traversable paths. A weighted edge can store distance, travel time, energy, or risk.
An adjacency matrix A represents graph connectivity. For an unweighted graph, Aᵢⱼ = 1 when an edge connects vertices i and j, and Aᵢⱼ = 0 otherwise. For a weighted graph, Aᵢⱼ may contain the cost of moving from i to j. Directed graphs are required when movement costs or accessibility differ by direction.
Graph algorithms support robotics tasks such as:
breadth-first search for minimum-hop paths in unweighted graphs;
Dijkstra’s algorithm for nonnegative edge costs;
A* search when a useful admissible heuristic is available;
minimum spanning trees for network connection problems;
kinematic-tree traversal for propagating frame transformations.
A graph abstraction is powerful but incomplete. It may omit dynamics, uncertainty, robot shape, actuator limits, and continuous collision geometry. A path that is valid in a graph may still be impossible for the physical robot unless these constraints are checked.
8. Applied Case: Cartesian Placement by a Two-Link Robot
Background
Consider an illustrative two-joint planar robot used to place electronic components on a work surface. The first and second links have lengths 0.60 m and 0.40 m. The controller must place the tool at (0.70 m, 0.50 m).
Problem
Determine whether the target is reachable and calculate an inverse-kinematic joint configuration. Then identify a practical implementation risk.
Analysis
The target radius is
r = √(0.70² + 0.50²) = √0.74 ≈ 0.860 m.
The reachable radial interval is
|0.60 − 0.40| ≤ r ≤ 0.60 + 0.40,
or 0.20 m ≤ r ≤ 1.00 m. The target is therefore reachable.
Using the law of cosines,
cos θ₂ = (0.74 − 0.36 − 0.16)/(2 × 0.60 × 0.40)
= 0.22/0.48
≈ 0.4583.
Thus θ₂ ≈ ±62.7°. For the elbow-down solution, take θ₂ ≈ 62.7°. Then
θ₁ = atan2(0.50, 0.70) − atan2(0.40 sin 62.7°, 0.60 + 0.40 cos 62.7°)
≈ 35.5° − 24.4°
≈ 11.1°.
The second solution uses θ₂ ≈ −62.7° and produces a different θ₁. Both solutions should be checked against joint limits and collision constraints.
Approach and implementation
The controller should convert degrees to radians, evaluate the chosen solution, and substitute the resulting angles into the forward-kinematics equations. The residual position error should be checked. If the target changes continuously, a trajectory generator should limit velocity and acceleration rather than commanding an instantaneous jump.
Outcome and learning points
The point is reachable and has two geometric solutions. The case demonstrates that inverse kinematics is not always unique. It also shows why a mathematically valid configuration is not automatically an acceptable operating configuration: joint limits, self-collision, obstacles, singularity proximity, and actuator capabilities must be evaluated.
9. Professional Practice, Safety, and Contemporary Tools
Mathematical models influence physical motion, so errors can create safety hazards. Engineers should use independent checks, conservative limits, emergency-stop provisions, collision detection, and documented frame conventions. Safety-related control software should be verified and validated according to the applicable industrial or collaborative-robot standards and organizational procedures.
Robot software commonly uses numerical libraries for matrix operations, automatic differentiation for Jacobians, and simulation environments for testing. Automatic differentiation can reduce hand-derived Jacobian errors, but the resulting derivatives still require physical validation. AI-based perception or planning may improve adaptability, yet it does not remove the need for deterministic safety layers, bounded behavior, traceability, and human oversight.
Best practices include:
State frame names and transformation directions explicitly.
Keep radians, metres, seconds, and newtons consistent.
Use atan2 rather than an ambiguous one-argument arctangent.
Avoid explicit matrix inversion when solving linear systems.
Monitor Jacobian conditioning and singularity proximity.
Validate numerical results through forward substitution and residual checks.
Separate geometric planning from safety supervision.
Test nominal, boundary, failure, and sensor-noise conditions.
Challenges and Limitations
No mathematical model perfectly represents a physical robot. Rigid-link assumptions neglect elasticity, backlash, bearing friction, thermal expansion, and structural vibration. Coordinate-frame errors can produce large positioning errors even when individual equations are correct. Numerical methods may converge to an undesirable solution or fail near singularities. Graph models discretize continuous spaces and can miss narrow passages or dynamic constraints. Finally, accurate computation cannot compensate for poor calibration or incomplete environmental information.
Chapter Summary
Robot motion is described using scalars, vectors, matrices, coordinate frames, and transformations. Dot and cross products support geometric reasoning and mechanics. Rotation matrices represent orientation, while homogeneous transformations combine rotation and translation and compose according to frame order. Trigonometric equations provide forward and inverse kinematics for mechanisms such as planar two-link arms.
Calculus connects configuration to velocity and acceleration. The Jacobian maps joint velocity to Cartesian velocity and reveals singular configurations through rank loss. Numerical integration and Jacobian-based iteration solve problems that lack convenient closed forms, but they require attention to conditioning, convergence, units, and constraints. Graphs represent kinematic structures, navigation spaces, and planning costs. In professional robotics, mathematical validity must be combined with calibration, safety, verification, and physical feasibility.
Key Terms
Scalar: A quantity described by magnitude alone.
Vector: A quantity with magnitude and direction.
Dot product: An operation that produces a scalar measure of vector alignment.
Cross product: A three-dimensional operation producing a vector perpendicular to two input vectors.
Coordinate frame: An origin and oriented axes used to express quantities.
Rotation matrix: An orthonormal matrix representing orientation.
Homogeneous transformation: A matrix combining rotation and translation.
Forward kinematics: Computing pose from known joint variables.
Inverse kinematics: Computing joint variables for a desired pose.
Jacobian: The matrix of partial derivatives mapping joint rates to task-space rates.
Singularity: A configuration in which a Jacobian loses rank.
Rank: The number of independent rows or columns of a matrix.
Condition number: A measure of sensitivity of a numerical problem to perturbations.
Pseudoinverse: A generalized inverse used to solve non-square or rank-deficient systems.
Damped least squares: A regularized method for improving numerical behavior near singularities.
Homogeneous coordinate: An augmented coordinate used to represent translation through matrix multiplication.
Graph: A set of vertices connected by edges.
Adjacency matrix: A matrix encoding graph connections or edge costs.
Configuration space: The set of all robot joint states allowed by the model and constraints.
Residual error: The difference remaining after a computed solution is substituted into the original equations.
Review Questions
Short Answer Questions
What physical information is represented by a rotation matrix?
Why does the order of homogeneous-transform multiplication matter?
What is the difference between forward and inverse kinematics?
What does a Jacobian singularity indicate?
Why is atan2 preferred to a one-argument arctangent in inverse kinematics?
Long Answer Questions
Explain how coordinate frames and homogeneous transformations are used to describe a robot tool pose.
Derive the forward-kinematics equations for a planar two-link manipulator.
Explain the physical meaning of the dot product and cross product in robotic mechanics.
Discuss the advantages and limitations of numerical inverse-kinematics methods.
Explain how graphs can represent both robot mechanisms and navigation environments.
Analytical / Application Questions
For a planar robot with l₁ = 0.5 m, l₂ = 0.3 m, θ₁ = 20°, and θ₂ = 40°, calculate the end-effector position and orientation.
Determine whether the point (1.1 m, 0.2 m) is reachable by a planar two-link arm with link lengths 0.7 m and 0.4 m. Justify your answer.
A controller reports a rotation matrix whose columns are not mutually perpendicular and whose determinant is 0.96. Explain what this implies and propose a corrective validation procedure.
Multiple Choice Questions with Answers
Question 1
Which operation produces a scalar that measures the alignment of two vectors?
A. Dot product
B. Cross product
C. Matrix inverse
D. Homogeneous transformation
Correct Answer: A. Dot product
Question 2
For a valid three-dimensional rotation matrix R, which condition must hold?
A. RᵀR = 0
B. RᵀR = I and det(R) = +1
C. R = Rᵀ for every rotation
D. det(R) = 0
Correct Answer: B. RᵀR = I and det(R) = +1
Question 3
A planar two-link robot has link lengths 0.6 m and 0.4 m. What is its maximum distance from the base?
A. 0.2 m
B. 0.4 m
C. 0.8 m
D. 1.0 m
Correct Answer: D. 1.0 m
Question 4
In homogeneous transformation notation, what does the upper-left 3 × 3 block represent?
A. Mass
B. Rotation
C. Joint torque
D. Graph connectivity
Correct Answer: B. Rotation
Question 5
For a two-link planar arm, det(J) = l₁l₂ sin θ₂. Which configuration is singular?
A. θ₂ = 30°
B. θ₂ = 45°
C. θ₂ = 90°
D. θ₂ = 180°
Correct Answer: D. θ₂ = 180°
Question 6
What is the principal purpose of a robot Jacobian?
A. To map joint velocities to task-space velocities
B. To measure link mass directly
C. To replace all coordinate frames
D. To encode only graph edges
Correct Answer: A. To map joint velocities to task-space velocities
Question 7
Why is explicit computation of A⁻¹ usually avoided when solving Ax = b numerically?
A. It changes the units of b
B. It is generally less efficient and can be less numerically stable
C. It works only for rectangular matrices
D. It prevents matrix multiplication
Correct Answer: B. It is generally less efficient and can be less numerically stable
Question 8
Which algorithm is appropriate for a graph with nonnegative edge costs?
A. Dijkstra’s algorithm
B. Cross-product iteration
C. Euler-angle decomposition
D. Law of cosines
Correct Answer: A. Dijkstra’s algorithm
Question 9
A target at distance 0.86 m is given to a two-link arm with lengths 0.60 m and 0.40 m. Is the target radially reachable?
A. No, because the minimum distance is 0.86 m
B. No, because the maximum distance is 0.86 m
C. Yes, because 0.20 m ≤ 0.86 m ≤ 1.00 m
D. Yes, only because the links have equal lengths
Correct Answer: C. Yes, because 0.20 m ≤ 0.86 m ≤ 1.00 m
Question 10
What does a large condition number generally indicate?
A. The numerical problem is insensitive to errors
B. Small data errors may cause large solution changes
C. The matrix must be a rotation matrix
D. The graph has no edges
Correct Answer: B. Small data errors may cause large solution changes