2. Mathematical Modelling and Spatial RepresentationIntroduction and ContextRobotic systems operate in physical space, but their controllers and planning algorithms operate on mathematical representations. A robot must know where its links, joints, tools, sensors, and objects are located relative to one another. It must also describe how these entities are oriented. Mathematical modelling provides the language for this description. Spatial representation is therefore not merely a matter of drawing coordinate axes. It establishes a formal relationship between physical geometry and computational operations. The quality of this representation affects forward kinematics, inverse kinematics, trajectory generation, collision detection, calibration, visual servoing, simulation, and robot programming. An error in a frame assignment or rotation convention can propagate through an entire robotic system and produce a physically unsafe motion. This chapter develops the principal mathematical tools used to represent robotic motion: coordinate frames, vectors, rotation matrices, Euler angles, quaternions, homogeneous transformations, and the Denavit–Hartenberg (D–H) convention. The emphasis is on interpretation, computational use, assumptions, and professional practice. Learning ObjectivesAfter studying this chapter, the reader should be able to: 1. Explain the role of coordinate frames in robotic modelling. 2. Represent points, directions, and rigid-body orientations using vectors and matrices. 3. Construct and interpret rotation matrices about principal axes. 4. Compare Euler angles, rotation matrices, and quaternions. 5. Formulate homogeneous transformations and compose spatial motions. 6. Assign Denavit–Hartenberg parameters to serial manipulators. 7. Identify singularities, convention errors, and numerical limitations. 8. Apply these representations to a practical robotic modelling problem. Frames, Vectors, and the Geometry of MotionA coordinate frame consists of an origin and three mutually orthogonal unit axes. A frame is commonly denoted by \(\{A\}\), with origin \(O_A\) and axes \(x_A,y_A,z_A\). A geometric point is independent of the frame used to describe it, but its coordinates depend on that frame. If point \(P\) has coordinates \(^{A}p=[p_x\ p_y\ p_z]^T\) in frame \(\{A\}\), the superscript identifies the reference frame. This notation is essential in robotics because the same point may be expressed in the base frame, a link frame, a camera frame, or the tool frame. A position vector describes a point relative to an origin. A free vector, such as velocity or force, describes magnitude and direction but not a particular location. This distinction matters when transforming forces and moments. A direction vector has no translational component, whereas a point does. Confusing points with vectors can lead to incorrect use of transformation matrices. A rigid-body pose consists of position and orientation. Position requires three independent quantities; orientation also requires three degrees of freedom. A rigid body in three-dimensional space therefore has six degrees of freedom, commonly represented as \[ \mathcal{X}=\begin{bmatrix}x&y&z&\text{orientation parameters}\end{bmatrix}^T. \] The choice of orientation parameters determines the mathematical properties and practical limitations of the model. Rotation Matrices: The Primary Representation of OrientationThe orientation of frame \(\{B\}\) relative to frame \(\{A\}\) is represented by a rotation matrix \(^{A}R_{B}\). Its columns are the unit axes of frame \(\{B\}\), expressed in frame \(\{A\}\): \[ ^{A}R_{B}=\begin{bmatrix} ^{A}x_B & ^{A}y_B & ^{A}z_B\end{bmatrix}. \] A vector expressed in frame \(\{B\}\) is converted to frame \(\{A\}\) by \[ ^{A}v=^{A}R_{B}\,^{B}v. \] A valid rotation matrix belongs to the special orthogonal group \(SO(3)\). It satisfies \[ R^TR=I,\qquad \det(R)=+1. \] Thus, \(R^{-1}=R^T\). Orthogonality preserves lengths and angles, while the positive determinant excludes reflections. For rotations about the principal axes, \[ R_x(\theta)=\begin{bmatrix}1&0&0\\0&\cos\theta&-\sin\theta\\0&\sin\theta&\cos\theta\end{bmatrix}, \] \[ R_y(\theta)=\begin{bmatrix}\cos\theta&0&\sin\theta\\0&1&0\\-\sin\theta&0&\cos\theta\end{bmatrix}, \] \[ R_z(\theta)=\begin{bmatrix}\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\0&0&1\end{bmatrix}. \] The order of multiplication is significant. In general, \(R_xR_y\neq R_yR_x\). This noncommutativity reflects the physical fact that sequential rotations about different axes produce different final orientations. For example, under a fixed-axis, or extrinsic, convention, a sequence may be written as \(R=R_z(\alpha)R_y(\beta)R_x(\gamma)\). Under a moving-axis, or intrinsic, convention, the interpretation differs even when similar symbols are used. Every engineering document should therefore state the axis sequence and whether the rotations are intrinsic or extrinsic. Euler Angles and Orientation SingularitiesEuler angles describe orientation using three successive rotations. Common sequences include Z–Y–X, often called yaw–pitch–roll, and Z–X–Z. Euler angles are compact and intuitive, especially for human interpretation and user interfaces. Their principal weakness is coordinate singularity, commonly called gimbal lock. In a Z–Y–X representation, when the pitch angle approaches \(\pm90^\circ\), two rotation axes become aligned. One degree of freedom is then lost in the parameterization, even though the physical rigid body still has three rotational degrees of freedom. Euler angles are therefore suitable for reporting orientation, defining task specifications, and communicating with operators, but less suitable as the sole internal representation for interpolation or numerical control. A controller that interpolates angles independently may produce undesirable paths or encounter discontinuities at angle wrapping boundaries. QuaternionsA unit quaternion represents orientation as \[ q=\begin{bmatrix}q_0&q_1&q_2&q_3\end{bmatrix}^T, \qquad q_0^2+q_1^2+q_2^2+q_3^2=1. \] For a rotation of angle \(\theta\) about unit axis \(u=[u_x,u_y,u_z]^T\), \[ q=\begin{bmatrix}\cos(\theta/2)\\u_x\sin(\theta/2)\\u_y\sin(\theta/2)\\u_z\sin(\theta/2)\end{bmatrix}. \] The quaternion and its negative represent the same physical orientation. This double-cover property must be considered during interpolation: selecting inconsistent signs can cause an interpolation algorithm to travel along the longer rotational path. Quaternions avoid the coordinate singularity associated with Euler angles and require fewer parameters than a general 3-by-3 matrix, although the unit-norm constraint must be maintained. They are widely used in robot software, inertial navigation, spacecraft attitude control, motion capture, and sensor fusion. Spherical linear interpolation, or SLERP, provides smooth constant-speed interpolation between orientations when the quaternion signs are selected consistently. Rotation matrices remain valuable because they transform vectors directly and are easy to combine with translation. In practice, a system may use quaternions for estimation and interpolation, rotation matrices for geometric computation, and Euler angles for display. Homogeneous Transformations and Rigid-Body PosesA homogeneous transformation combines rotation and translation in one matrix: \[ ^{A}T_{B}=\begin{bmatrix} ^{A}R_{B} & ^{A}p_{B}\\ 0\ 0\ 0 & 1 \end{bmatrix}. \] Here, \(^{A}p_B\) is the position of the origin of frame \(\{B\}\) expressed in frame \(\{A\}\). A point is represented in homogeneous coordinates as \(\bar p=[p_x\ p_y\ p_z\ 1]^T\), so that \[ ^{A}\bar p=^{A}T_B\,^{B}\bar p. \] The final coordinate is one for a point. A direction can be represented using a final coordinate of zero, which prevents translation from affecting it. The composition of transformations follows matrix multiplication: \[ ^{A}T_C=^{A}T_B\,^{B}T_C. \] This equation is the foundation of serial-chain forward kinematics. The inverse transformation is \[ T^{-1}=\begin{bmatrix}R^T&-R^Tp\\0&1\end{bmatrix}. \] A frequent source of error is reading a matrix from right to left without checking the frame labels. The superscript and subscript notation should be treated as part of the equation, not as optional decoration. A Simple Composition ExampleSuppose a tool frame is translated by \(0.4\) m along the base-frame x-axis and then rotated about the base z-axis by \(90^\circ\). Its pose is \[ T=\begin{bmatrix} 0&-1&0&0.4\\ 1&0&0&0\\ 0&0&1&0\\ 0&0&0&1 \end{bmatrix}. \] A tool point located at \([0.2,0,0,1]^T\) in the tool frame is therefore located at \([0.4,0.2,0,1]^T\) in the base frame. The rotation changes the direction of the local x-axis, while the translation locates the tool origin. Denavit–Hartenberg Modelling of Serial ManipulatorsThe Denavit–Hartenberg convention provides a systematic method for assigning coordinate frames to serial robot links. It reduces the geometric description of each joint-to-joint relationship to four parameters: - \(a_i\): link length, measured along \(x_i\);
- \(\alpha_i\): link twist, measured about \(x_i\);
- \(d_i\): link offset, measured along \(z_{i-1}\);
- \(\theta_i\): joint angle, measured about \(z_{i-1}\).
For the standard convention, the elementary transformation is often written as \[ ^{i-1}T_i=R_z(\theta_i)T_z(d_i)T_x(a_i)R_x(\alpha_i). \] Its expanded form is \[ ^{i-1}T_i=\begin{bmatrix} \cos\theta_i&-\sin\theta_i\cos\alpha_i&\sin\theta_i\sin\alpha_i&a_i\cos\theta_i\\ \sin\theta_i&\cos\theta_i\cos\alpha_i&-\cos\theta_i\sin\alpha_i&a_i\sin\theta_i\\ 0&\sin\alpha_i&\cos\alpha_i&d_i\\ 0&0&0&1 \end{bmatrix}. \] The complete forward-kinematic model is \[ ^{0}T_n=^{0}T_1\,^{1}T_2\cdots^{n-1}T_n. \] For a revolute joint, \(\theta_i\) is variable and the other parameters are generally constant. For a prismatic joint, \(d_i\) is variable. Frame assignment follows geometric rules. The z-axis is aligned with the joint axis. The x-axis is chosen along the common normal between consecutive z-axes, or according to a suitable perpendicular direction when the axes intersect. The origin is placed at the intersection or at the relevant common-normal location. The y-axis is selected to complete a right-handed frame. Different texts use standard and modified D–H conventions. Both are valid, but their transformation equations and frame locations differ. A model must never mix parameters from one convention with equations from the other. Applied Scenario: Modelling a Two-Link Planar RobotConsider a two-link planar manipulator with revolute joints and link lengths \(l_1\) and \(l_2\). Both joint axes are parallel to the base z-axis. Let joint variables be \(q_1\) and \(q_2\). For a planar model, the relevant transformations are \[ T_1=R_z(q_1)T_x(l_1),\qquad T_2=R_z(q_2)T_x(l_2). \] The end-effector transformation is \(T_0^2=T_1T_2\). Its position is \[ x=l_1\cos q_1+l_2\cos(q_1+q_2), \] \[ y=l_1\sin q_1+l_2\sin(q_1+q_2). \] The end-effector orientation in the plane is \(q_1+q_2\). These equations demonstrate several important principles. Joint rotations accumulate, link translations are affected by preceding rotations, and the final pose is obtained through ordered composition rather than by adding link coordinates independently. Illustrative Industrial Case: Camera-to-Tool RegistrationThe following is an illustrative case based on a common industrial automation problem. A robot-mounted camera inspects components on a conveyor. The camera detects a component pose in the camera frame, but the robot controller requires the target pose in the base frame. Background. The robot has calibrated link geometry, a tool frame, and a camera rigidly attached to the tool. The camera provides \(^{C}T_O\), the object pose relative to the camera. The robot controller provides \(^{B}T_T\), the tool pose relative to the base, and calibration provides \(^{T}T_C\), the camera pose relative to the tool. Problem. The robot must calculate the object pose in the base frame and move the tool to a grasp pose without confusing the camera and tool coordinate systems. Analysis. The required pose is \[ ^{B}T_O=^{B}T_T\,^{T}T_C\,^{C}T_O. \] If the desired grasp frame \(\{G\}\) is related to the object by \(^{O}T_G\), then \[ ^{B}T_G=^{B}T_O\,^{O}T_G. \] The operation depends on accurate calibration, consistent units, correct timestamping, and a known transformation convention. A camera measurement taken while the robot is moving may not correspond to the current tool pose. Approach. Engineers first validate every fixed transformation using a calibration artifact. They then test the chain with a known object at several locations. Rotation matrices are checked for orthogonality, and residual position and orientation errors are evaluated. Motion planning includes an approach pose, a low-speed final descent, and collision constraints. Outcome. A correctly labelled transformation chain allows the robot to convert perception data into a grasp target. If the camera frame is accidentally inverted or a transformation is applied in the wrong order, the resulting error may be large even when each individual matrix appears numerically plausible. Learning points. Frame labels, calibration quality, temporal synchronization, and independent verification are as important as the algebra. In industrial systems, a mathematically correct model can still fail if the physical frame definitions are wrong. Jacobians and Local Motion RepresentationAlthough homogeneous transformations describe finite poses, differential motion is commonly represented by a twist or a Jacobian. A spatial velocity may be written as \[ V=\begin{bmatrix}v\\\omega\end{bmatrix}, \] where \(v\) is linear velocity and \(\omega\) is angular velocity. For a manipulator with joint velocity vector \(\dot q\), \[ V=J(q)\dot q. \] The Jacobian depends on the selected frame and on whether spatial or body velocity is used. Its rank indicates the instantaneous mobility of the end effector. A rank-deficient Jacobian corresponds to a kinematic singularity, at which certain Cartesian motions cannot be generated independently and joint velocities may become very large for modest task-space velocities. This connection illustrates why spatial representation is foundational: frame conventions influence not only pose calculations but also velocity control, force transformation, singularity analysis, and optimization. Common Errors, Limitations, and Professional PracticeSeveral errors recur in robotic modelling. Degrees may be entered where radians are expected. A row-vector convention may be mixed with a column-vector convention. Transformations may be multiplied in the wrong order. A passive change of coordinates may be confused with an active physical rotation. Standard and modified D–H conventions may be mixed. Finally, approximate numerical rotations may lose orthogonality after repeated computation. Good practice includes the following: - assign explicit names to frames and write frame labels on every transformation;
- state the axis order and angle convention;
- use unit tests for known poses and zero configurations;
- verify \(R^TR\approx I\) and \(\det R\approx1\);
- maintain consistent units and coordinate handedness;
- compare symbolic and numerical results where possible;
- visualize frames and tool axes in simulation;
- validate the model against physical measurements;
- re-normalize quaternions after numerical integration;
- document whether a transformation maps coordinates or physically moves a body.
A representation is not trustworthy merely because it produces a plausible drawing. It must satisfy geometric constraints and agree with measured robot behaviour. Digital Tools and Emerging DevelopmentsModern robotics software represents poses using libraries for matrices, quaternions, rigid-body transformations, and Lie groups. Libraries based on \(SE(3)\) and its Lie algebra \(se(3)\) support systematic interpolation, uncertainty propagation, optimization, and estimation. These methods are increasingly important in simultaneous localization and mapping, autonomous manipulation, and multi-sensor calibration. Robot operating systems and simulation platforms typically exchange pose messages containing position and quaternion orientation. Digital twins use transformation trees to maintain relationships among bases, links, sensors, workpieces, and environments. Machine-learning systems also depend on correct spatial representation: training data, camera observations, grasp poses, and force measurements must be expressed in compatible frames. Emerging research combines geometric methods with data-driven models. Neural networks may estimate poses or corrections, but physical consistency still requires valid rotations, rigid transformations, and calibrated frames. A learned model cannot compensate reliably for an undocumented frame convention or unsafe coordinate definition. Ethical, Safety, and Governance ConsiderationsSpatial models influence physical motion, so errors can create safety hazards, damage equipment, or cause a robot to interact incorrectly with a person or product. Frame definitions, calibration records, software versions, and validation results should be traceable. Safety functions must not rely solely on an unverified perception transformation or an opaque learned correction. Professional practice requires conservative testing: simulation and low-speed trials should precede full-speed operation, and singular configurations or uncertain measurements should trigger an appropriate supervisory response. In regulated applications, the transformation model and its validation evidence form part of the technical documentation supporting safe operation. Chapter SummaryMathematical modelling converts robotic geometry into computational form. Coordinate frames establish reference systems; vectors represent positions, directions, and physical quantities; rotation matrices describe orientation while preserving orthogonality. Euler angles are intuitive but can suffer from sequence dependence and gimbal lock. Quaternions provide a compact, nonsingular orientation representation, subject to a unit-norm constraint and sign ambiguity. Homogeneous transformations combine rotation and translation and enable systematic composition of rigid-body poses. The Denavit–Hartenberg convention reduces serial-manipulator geometry to four parameters per joint, but its convention must be applied consistently. These representations support forward kinematics, camera calibration, motion control, Jacobian analysis, simulation, and industrial automation. Reliable implementation depends on explicit frame labels, validation, calibration, numerical checks, and attention to safety. Key TermsCoordinate frame: An origin and oriented set of axes used to express geometric quantities. Position vector: A vector locating a point relative to a specified origin. Rotation matrix: An orthogonal 3-by-3 matrix with determinant +1 representing orientation. Special orthogonal group SO(3): The set of all valid three-dimensional rotation matrices. Euler angles: Three sequential angles used to parameterize orientation. Gimbal lock: A parameterization singularity in which two Euler rotation axes become aligned. Quaternion: A four-parameter unit-norm representation of three-dimensional orientation. Homogeneous coordinate: An augmented coordinate used to combine rotation and translation in matrix form. Homogeneous transformation: A 4-by-4 matrix representing a rigid-body pose. Rigid-body pose: The position and orientation of an object or coordinate frame. Denavit–Hartenberg convention: A systematic frame and parameter convention for serial manipulators. Link length: The D–H distance measured along a common-normal x-axis. Link twist: The D–H angle between consecutive joint axes measured about the x-axis. Joint offset: The D–H displacement measured along a joint axis. Jacobian: A matrix relating joint rates to task-space linear and angular velocity. Kinematic singularity: A configuration in which the Jacobian loses rank. Extrinsic rotation: Rotation about fixed, external axes. Intrinsic rotation: Rotation about axes attached to the moving body or frame. Frame calibration: Estimation of the geometric relationship between physical coordinate frames. Review QuestionsShort Answer Questions1. Why is a point representation different from a direction representation in homogeneous coordinates? 2. State the two defining properties of a valid three-dimensional rotation matrix. 3. What is the principal limitation of Euler-angle representations? 4. What four parameters are used in the standard Denavit–Hartenberg convention? 5. Why is transformation multiplication order important? Long Answer Questions1. Explain how coordinate frames and homogeneous transformations are used to describe a robot tool pose. 2. Compare rotation matrices, Euler angles, and quaternions with respect to interpretation, computation, and singularities. 3. Derive the forward-kinematic position equations of a two-link planar revolute manipulator. 4. Describe the frame-assignment procedure used in the standard Denavit–Hartenberg convention. 5. Explain how calibration and transformation chains are used in camera-to-tool registration. Analytical / Application Questions1. A camera pose is measured as \(^{C}T_O\), the camera-to-tool calibration is \(^{T}T_C\), and the robot pose is \(^{B}T_T\). Derive the expression for the object pose in the base frame and explain why reversing any two factors is generally invalid. 2. A controller interpolates Euler angles for a robot passing near a pitch angle of 90 degrees. Analyse the likely problem and recommend a more suitable orientation representation. 3. A computed rotation matrix has determinant 0.97 and \(R^TR\neq I\). Explain what this indicates and propose two corrective or diagnostic actions. 22. Multiple Choice Questions with AnswersQuestion 1Which condition must a 3-by-3 matrix satisfy to represent a proper three-dimensional rotation? A. R^TR=0 and det(R)=1 B. R^TR=I and det(R)=+1 C. R^TR=I and det(R)=0 D. R^TR=R and det(R)=-1 Correct Answer: B. R^TR=I and det(R)=+1 Question 2For a homogeneous transformation T=[R p; 0 1], what does p represent? A. The angular velocity of the body B. The orientation of the z-axis C. The position of the transformed frame origin D. The inverse rotation matrix Correct Answer: C. The position of the transformed frame origin Question 3Why can Euler angles become unsuitable for numerical orientation interpolation? A. They cannot represent translation B. They always require four parameters C. They may encounter coordinate singularities such as gimbal lock D. They cannot describe rotations about principal axes Correct Answer: C. They may encounter coordinate singularities such as gimbal lock Question 4A direction is represented in homogeneous coordinates with a final component of zero primarily because A. it causes rotation to be ignored B. translation should not affect the direction C. the direction has zero magnitude D. it converts the direction into a point Correct Answer: B. translation should not affect the direction Question 5For a revolute joint in the standard D–H convention, which parameter normally varies with joint motion? A. Link length a_i B. Link twist alpha_i C. Joint angle theta_i D. Link offset d_i only Correct Answer: C. Joint angle theta_i Question 6Given transformations between frames, the pose of object O in base frame B is correctly computed as A. ^CT_O ^TT_C ^BT_T B. ^BT_T ^TT_C ^CT_O C. ^BT_T ^CT_O ^TT_C D. ^TT_C ^BT_T ^CT_O Correct Answer: B. ^BT_T ^TT_C ^CT_O Question 7What is a major advantage of unit quaternions over Euler angles? A. They require no normalization B. They eliminate all orientation calculations C. They avoid the Euler-angle coordinate singularity D. They directly contain translation coordinates Correct Answer: C. They avoid the Euler-angle coordinate singularity Question 8If a rotation matrix is used to transform a vector from frame B to frame A, the correct relation is A. ^Av=^BR_A ^Bv B. ^Av=^AR_B ^Bv C. ^Av=^AR_B ^Av D. ^Bv=^AR_B ^Bv Correct Answer: B. ^Av=^AR_B ^Bv Question 9A Jacobian loses rank at a robot configuration. What is the most direct interpretation? A. The robot has infinite independent task-space motions B. The robot is at a kinematic singularity C. All joint axes are necessarily parallel D. The homogeneous transformation is invalid Correct Answer: B. The robot is at a kinematic singularity Question 10Why must standard and modified D–H conventions not be mixed in one model? A. They use different physical units B. They describe different robot materials C. Their frame locations and transformation equations differ D. Only modified D–H can represent revolute joints Correct Answer: C. Their frame locations and transformation equations differ
|