Skip to content

Lesson 2: Planar Transformations and Mathematical Foundations

Master planar transformation mathematics through SCARA robot programming, covering complex number analysis, homogeneous coordinates, and transformation matrix composition as foundation for 3D spatial mechanics.

🎯 Learning Objectives

By the end of this lesson, you will be able to:

  1. Apply complex number analysis for planar rotations and translations
  2. Implement homogeneous coordinates for unified transformation representation
  3. Compose multiple planar transformations using matrix multiplication
  4. Program precise 2D trajectories for SCARA robot motion control

🔧 Real-World System Problem: SCARA Robot Programming

SCARA (Selective Compliance Assembly Robot Arm) robots dominate electronics manufacturing and precision assembly. These 2D planar robots require precise mathematical control of position and orientation to place components with micrometer accuracy while maintaining high-speed operation.

System Description

SCARA Robot Architecture:

  • Shoulder Joint (revolute, vertical axis rotation)
  • Elbow Joint (revolute, vertical axis rotation)
  • Vertical Actuator (prismatic, Z-axis motion)
  • Wrist Rotation (revolute, tool orientation)
  • End-Effector (gripper or specialized tool)
  • Vision System (part recognition and alignment)

The Planar Motion Challenge

SCARA programming requires precise control of:

Engineering Question: How do we mathematically represent and program complex 2D trajectories that combine rotations, translations, and tool orientations in a systematic, precise manner?

Why Planar Mathematics Matters

Consequences of Poor Mathematical Foundation:

  • Programming errors leading to collision or missed placements
  • Inefficient trajectories with unnecessary motion and longer cycle times
  • Orientation errors causing assembly failures
  • Workspace limitations from inadequate mathematical modeling
  • Calibration difficulties without systematic transformation framework

Benefits of Systematic Planar Analysis:

  • Precise motion programming using mathematical transformation tools
  • Optimal trajectory planning through systematic matrix composition
  • Consistent coordinate frame management across different work areas
  • Scalable programming methods applicable to complex 3D systems

📚 Fundamental Theory: Planar Transformation Mathematics

Complex Number Representation of Planar Motion

Complex numbers provide an elegant mathematical framework for representing 2D rotations and translations. Every point in the plane can be represented as a complex number z = x + iy, and transformations become simple algebraic operations.

🔢 Complex Number Planar Point

Where:

  • = Complex number representing 2D point
  • = Cartesian coordinates (real and imaginary parts)
  • = Distance from origin (magnitude)
  • = Angle from positive real axis (phase)

Physical Meaning: Every 2D point corresponds to a unique complex number, enabling algebraic manipulation of geometric transformations.

🔄 Complex Rotation Operator

Rotation by angle :

Matrix form:

Physical Meaning: Multiplying by rotates any point counterclockwise by angle about the origin.

Homogeneous Coordinates for Unified Representation

Homogeneous coordinates solve the fundamental problem that translation cannot be represented as matrix multiplication in Cartesian coordinates. By adding a third coordinate, both rotation and translation become matrix multiplications.

🎯 Homogeneous Coordinate Representation

2D point in homogeneous coordinates:

General transformation matrix:

Where:

  • = Rotation matrix elements
  • = Translation vector components

Physical Meaning: Homogeneous coordinates enable all 2D transformations to be represented as 3×3 matrix multiplications.

Pure Translation:

Pure Rotation:

Identity Transformation:

Composite Homogeneous Transformations for Robotics

Real robot control requires precise composition of multiple rotations and translations. Understanding the systematic rules for matrix multiplication order is essential for accurate end-effector positioning and complex trajectory programming.

🔧 Transformation Composition Rules

Matrix multiplication is non-commutative - order matters!

For robot positioning with multiple transformations:

  1. Initial state: Fixed and mobile frames are coincident → Identity matrix
  2. Fixed frame operations: Rotate/translate about fixed axes (X,Y,Z) → Pre-multiply current matrix
  3. Mobile frame operations: Rotate/translate about mobile axes (A,B,C) → Post-multiply current matrix

General composition:

Where transformations are applied in sequence: H_1 first, H_n last.

Example 1: Simple rotation and translation sequence
  1. Problem: 40° rotation about OX-axis, then 7 units translation along mobile B-axis

    Setup: H = H(x,40°) · I · H(B,7)

  2. Matrix composition:

  3. Final result:

Advanced Multi-Body Transformations

Complex robotic systems require systematic handling of multiple coordinate frames, object manipulations, and dynamic transformations. Mastering these principles enables precise control of sophisticated manufacturing and assembly operations.

Advanced Example: Triangular prism manipulation
  1. Problem setup: Triangular prism with vertices A(1,3,0), B(-1,3,0), C(-1,3,2), D(1,3,2), E(1,5,2), F(-1,5,2)

    Required transformations:

    • +60° rotation about X-axis
    • -60° rotation about Z-axis
    • +5 units translation in Y-direction
  2. Transformation matrix composition:

  3. Matrix multiplication sequence:

  4. Final transformation matrix:

  5. New vertex coordinates: Apply H to each vertex

    Example for vertex A:

Key Principles for Robot Programming

🎯 Essential Transformation Guidelines

Critical Success Factors:

  1. Frame Convention Consistency: Always clearly define fixed vs. mobile frame operations
  2. Matrix Order Verification: Pre-multiply for fixed frame, post-multiply for mobile frame
  3. Inverse Relationship Understanding: Use H⁻¹ for reverse transformations
  4. Numerical Precision: Account for floating-point errors in complex sequences
  5. Physical Validation: Verify results against expected geometric relationships

Common Programming Errors:

  • ❌ Incorrect matrix multiplication order
  • ❌ Mixing fixed and mobile frame conventions
  • ❌ Forgetting to account for intermediate coordinate frames
  • ❌ Using wrong inverse transformation relationships

🌐 Extending to 3D: Rotations About XYZ Axes

While SCARA robots operate primarily in 2D, understanding 3D rotations is essential for complete spatial mechanics mastery. 3D rotations about individual coordinate axes form the foundation for complex orientation control in 6-DOF industrial robots.

Fundamental 3D Rotation Matrices

Following the established axis convention where counterclockwise rotation is positive, we can derive rotation matrices for each coordinate axis. Each rotation transforms a mobile frame (A, B, C) relative to a fixed frame (X, Y, Z).

Axes Convention

Rotation about X-axis by angle α:

Rotation about X Axis

Geometric Analysis:

After rotating axis B:

After rotating axis C:

Transformation Summary:

BeforeAfter
A(1,0,0)A(1,0,0)
B(0,1,0)B(0, cos α, sin α)
C(0,0,1)C(0, -sin α, cos α)

🔄 X-Axis Rotation Matrix

Physical Meaning: Rotates vectors around the X-axis, leaving X-coordinates unchanged while rotating Y and Z components in the YZ-plane.

3D Rotation Applications and Examples

Click to reveal 3D rotation examples and calculations
  1. Point rotation about X-axis:

    Problem: Point q = (3, 7, 5) rotated 60° about X-axis

    Solution:

  2. Point rotation about Y-axis:

    Problem: Point p = (4, 4, 2√3) in mobile frame rotated 60° about Y-axis

    Solution:

  3. Point rotation about Z-axis:

    Problem: Point p = (7, 6, 5) rotated 30° about Z-axis

    Solution:

  4. Inverse transformations (world to body coordinates):

    For Y-axis rotation: Mobile frame rotated 60° about Y-axis

    Problem: Points p_xyz = (2, 3, 6) and q_xyz = (4, 2, 5) in fixed frame

    Solution:

    Since rotation matrices are orthogonal:

Advanced 3D Applications

Problem: Given rotation matrix, determine axis and angle

Example matrix:

Analysis steps:

  1. Compare with standard rotation matrices
  2. Identify unchanged axis (Y-axis: middle row/column)
  3. Calculate angle:
  4. Result: 30° rotation about Y-axis

Rotation About an Arbitrary Axis Through the Origin

Rotation about an Arbitrary Axes

To perform rotation about an arbitrary axis through the origin, we extend the individual axis rotation concepts to handle any vector direction. This fundamental capability enables complete 3D orientation control for advanced robotics applications.

Problem Setup: Given a fixed frame OXYZ and an arbitrary rotation axis V = (x,y,z) with components V_x, V_y, V_z, we need to construct the rotation matrix R(V,θ) for rotation angle θ.

🔄 Arbitrary Axis Rotation Strategy

Five-step decomposition process:

  1. Rotation by angle α about X-axis
  2. Rotation by angle about Y-axis
  3. Rotation by angle θ about Z-axis
  4. Rotation by angle β about Y-axis
  5. Rotation by angle about X-axis

Matrix composition: R(V,θ) = R(x,-α) R(y,β) R(z,θ) R(y,-β) R(x,α)

The complete rotation matrix:

Geometric relationships: For unit vector |V| = 1:

⚡ Simplified Arbitrary Axis Formula

Final rotation matrix in compact form:

Where: C = cos θ, S = sin θ, T = (1 - cos θ)

Unit vector components:

Example: 90° rotation about V = (2, 2, 2)
  1. Calculate unit vector components:

  2. Calculate trigonometric values:

  3. Compute matrix elements:

  4. Final rotation matrix:

Applications in Spatial Mechanics

Arbitrary axis rotation capabilities are essential for advanced 6-DOF robot programming, tool orientation control, and complex trajectory planning where rotations cannot be decomposed into simple XYZ sequences.

Key applications:

  • Tool orientation programming for complex manufacturing operations
  • Camera gimbal control for smooth tracking and stabilization
  • Spacecraft attitude control using reaction wheels and thrusters
  • Robotic welding with precise torch angle control
  • 3D printing with multi-axis extruder orientation

🔧 Application: SCARA Robot Trajectory Programming

Let’s program a complete pick-and-place operation for electronics assembly.


System Parameters:

  • SCARA robot: Link 1 = = 400 mm, Link 2 = = 300 mm
  • Joint ranges: , , mm,
  • Positioning accuracy: ±0.01 mm and ±0.1°
  • Workpiece: Electronic component 5×3 mm with 0.2 mm placement tolerance
  • Pick location: (200, 100) mm, Place location: (450, 250) mm
  • Required tool rotation: 45° for proper component orientation

Step 1: Forward Kinematics Using Complex Numbers

Click to reveal forward kinematics calculations
  1. Joint coordinate representation:

    Using complex number approach:

  2. End-effector position:

    In Cartesian form:

  3. Matrix representation:

  4. Tool orientation:

    Tool angle = (wrist rotation)

Step 2: Transformation Matrix Development

Click to reveal transformation matrix calculations
  1. Base to Link 1 transformation:

  2. Link 1 to Link 2 transformation:

  3. Combined base to end-effector:

  4. Tool frame transformation:

    Including tool offset and rotation:

Step 3: Trajectory Planning and Interpolation

Click to reveal trajectory planning calculations
  1. Waypoint definition:

    • Home position: (350, 0) mm, ,
    • Pick approach: (200, 120) mm (20 mm above component)
    • Pick position: (200, 100) mm
    • Place approach: (450, 270) mm (20 mm above target)
    • Place position: (450, 250) mm
  2. Linear interpolation in Cartesian space:

    For path from point A to point B: , where

    Position:

    Orientation:

  3. Transformation matrix interpolation:

    For smooth rotation interpolation:

    Translation interpolation:

  4. Velocity profile generation:

    Trapezoidal velocity profile:

    • Acceleration phase:
    • Constant velocity:
    • Deceleration phase:

Step 4: Inverse Kinematics Solutions

Click to reveal inverse kinematics calculations
  1. Geometric approach for 2-DoF SCARA:

    Given end-effector position (x, y):

  2. Two solutions for elbow configuration:

    Elbow up:

    Elbow down:

  3. Shoulder angle calculation:

  4. Solution selection criteria:

    • Choose configuration avoiding joint limits
    • Minimize joint motion from current position
    • Avoid singularities ( or )
    • Consider obstacle avoidance

📊 SCARA Programming Analysis Summary

Forward Kinematics

Complex method: Elegant rotation representation
Matrix method: Systematic composition
Accuracy: Sub-millimeter precision
Status: Multiple approaches available

Trajectory Planning

Interpolation: Linear and circular paths
Velocity: Trapezoidal profiles
Smoothness: C¹ continuous motion
Status: Optimized for cycle time

Inverse Solutions

Multiple configs: Elbow up/down options
Selection: Optimization criteria
Singularity: Systematic avoidance
Status: Robust solution methods

🎯 Advanced Analysis: Concatenation and Composition

Transformation Sequence Analysis

Understanding transformation composition is critical for complex motion programming. The order of operations fundamentally affects the final result, making systematic matrix composition essential for reliable robot programming.

Rotation then Translation vs Translation then Rotation:

Case 1: Rotate 45° then translate (2, 0)

Case 2: Translate (2, 0) then rotate 45°

Result: Different final positions despite same operations!

🛠️ Design Guidelines for Planar Motion Programming

Programming Best Practices

Performance Optimization

Matrix pre-computation:

  • Calculate transformation matrices offline when possible
  • Use lookup tables for common angles
  • Optimize trigonometric function calls

Numerical stability:

  • Use robust inverse kinematics algorithms
  • Implement numerical conditioning checks
  • Handle near-singular configurations gracefully

📋 Summary and Next Steps

In this lesson, you learned to:

  1. Apply complex number mathematics for elegant planar transformation representation
  2. Implement homogeneous coordinates for unified rotation and translation operations
  3. Compose transformation matrices systematically for complex motion sequences
  4. Program SCARA robots with precise trajectory control and multiple solution handling

Key Mathematical Insights:

  • Complex numbers elegantly represent 2D rotations
  • Homogeneous coordinates unify all 2D transformations
  • Matrix composition order critically affects results

Critical Foundation: Homogeneous transformation matrices:

Coming Next: In Lesson 3, we’ll extend these 2D concepts to full 3D spatial transformations, covering rotation matrices, Euler angles, and complex 3D orientation control for 6-DOF industrial robot arms.

Comments

© 2021-2025 SiliconWit. All rights reserved.